/* WMS 紧凑清新风格 */
:root {
    --primary: #36a3f7;
    --primary-soft: #e8f4fd;
    --primary-hover: #1890ff;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff7875;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #2c3e50;
    --text-sub: #64748b;
    --text-muted: #94a3b8;
    --border: #e8eef4;
    --radius: 6px;
    --gap: 10px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.layuimini-container,
.wms-container {
    padding: 12px 14px;
    min-height: calc(100vh - 48px);
}

.wms-flex-between,
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 页头 — 单行紧凑 */
.wms-page-header {
    background: var(--card);
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: var(--gap);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.wms-page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.wms-page-title .layui-icon {
    font-size: 16px;
    color: var(--primary);
}

.wms-page-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* 搜索区 */
.wms-search-panel {
    background: var(--card);
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: var(--gap);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.wms-search-legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.wms-search-legend::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px;
}

.wms-search-panel .layui-form-label {
    padding: 6px 10px;
    width: auto;
    font-size: 12px;
}

.wms-search-panel .layui-input,
.wms-search-panel .layui-select,
.wms-search-panel .layui-textarea {
    height: 32px;
    line-height: 32px;
    font-size: 12px;
}

.wms-search-panel .layui-form-item {
    margin-bottom: 8px;
}

/* 表格区 */
.wms-table-panel {
    background: var(--card);
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* 统计卡片 */
.wms-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.wms-stat-card {
    background: var(--card);
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}

.wms-stat-card:hover {
    border-color: #b3d8f7;
}

.wms-stat-card::after { display: none; }

.wms-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.wms-stat-label {
    font-size: 12px;
    color: var(--text-sub);
}

.wms-stat-badge {
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-blue   { background: #e8f4fd; color: #1890ff; }
.badge-green  { background: #f0faf0; color: #52c41a; }
.badge-orange { background: #fff8e6; color: #d48806; }
.badge-red    { background: #fff1f0; color: #ff4d4f; }
.badge-cyan   { background: #e6fffb; color: #13c2c2; }

.wms-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0;
}

.wms-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-icon-blue   { background: #e8f4fd; color: #1890ff; }
.stat-icon-green  { background: #f0faf0; color: #52c41a; }
.stat-icon-orange { background: #fff8e6; color: #fa8c16; }
.stat-icon-red    { background: #fff1f0; color: #ff4d4f; }
.stat-icon-cyan   { background: #e6fffb; color: #13c2c2; }

/* 图表 */
.wms-chart-container {
    background: var(--card);
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: var(--gap);
}

.wms-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 按钮 */
.wms-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.layui-btn {
    height: 30px !important;
    line-height: 30px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

.layui-btn-sm {
    height: 26px !important;
    line-height: 26px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
}

.layui-btn:hover {
    transform: none;
    opacity: 0.92;
}

.layui-btn-xs {
    height: 22px !important;
    line-height: 22px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
}

/* 表格 */
.layui-table-view {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    margin: 0 !important;
}

.layui-table thead tr {
    background: #f8fafc !important;
}

.layui-table th {
    font-weight: 600 !important;
    color: var(--text-sub) !important;
    font-size: 12px !important;
    padding: 8px 10px !important;
}

.layui-table td {
    font-size: 12px !important;
    padding: 7px 10px !important;
}

.layui-table tbody tr:hover {
    background-color: #f0f7ff !important;
}

.row-warning { background-color: #fffbe6 !important; }
.row-danger  { background-color: #fff1f0 !important; }

/* 弹窗 */
.layui-layer {
    border-radius: 8px !important;
}

.layui-layer-title {
    background: #fff !important;
    color: var(--text) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    height: 42px !important;
    line-height: 42px !important;
    border-bottom: 1px solid var(--border) !important;
}

/* 工作台专用 */
.wms-home { padding: 12px 14px; }

.wms-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.wms-home .wms-stat-card {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.wms-home .wms-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.wms-home .wms-stat-value { font-size: 22px; }
.wms-home .wms-stat-label { font-size: 11px; color: var(--text-muted); }
.wms-home .wms-stat-badge { font-size: 10px; padding: 0 5px; margin-top: 2px; }

.wms-home .c-blue .wms-stat-icon   { background: #69b1ff; }
.wms-home .c-green .wms-stat-icon  { background: #73d13d; }
.wms-home .c-orange .wms-stat-icon { background: #ffc069; }
.wms-home .c-red .wms-stat-icon    { background: #ff9c8e; }
.wms-home .c-blue .wms-stat-value   { color: #1890ff; }
.wms-home .c-green .wms-stat-value  { color: #52c41a; }
.wms-home .c-orange .wms-stat-value { color: #fa8c16; }
.wms-home .c-red .wms-stat-value    { color: #ff4d4f; }

.wms-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wms-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px;
}

.wms-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: var(--gap);
}

.wms-quick-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    box-shadow: var(--shadow);
}

.wms-quick-card:hover {
    border-color: #91caff;
    background: #fafcff;
}

.wms-quick-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin: 0 auto 6px;
    color: #fff;
}

.wms-quick-icon.blue   { background: #69b1ff; }
.wms-quick-icon.green  { background: #73d13d; }
.wms-quick-icon.orange { background: #ffc069; }
.wms-quick-icon.red    { background: #ff9c8e; }
.wms-quick-icon.cyan   { background: #5cdbd3; }
.wms-quick-icon.purple { background: #b37feb; }

.wms-quick-card h4 { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.wms-quick-card p  { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

.wms-todo-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.wms-todo-body { padding: 10px 12px; }

.wms-todo-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.wms-todo-tab {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.15s;
}

.wms-todo-tab:hover { border-color: #91caff; color: var(--primary); }
.wms-todo-tab.cur { background: var(--primary-soft); color: var(--primary-hover); border-color: #91caff; font-weight: 500; }

@media (max-width: 1200px) {
    .wms-stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .wms-stat-row { grid-template-columns: 1fr; }
    .wms-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fadeInUp { animation: fadeInUp 0.3s ease-out; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-primary  { color: var(--primary-hover); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-danger   { color: var(--danger); }
.text-muted    { color: var(--text-muted); }

.mt-10 { margin-top: 8px; }
.mt-20 { margin-top: 12px; }
.mb-10 { margin-bottom: 8px; }
.mb-20 { margin-bottom: 12px; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
