/* ===== 全局变量 ===== */
:root {
  --primary: #0d4ea2;
  --primary-light: #1673d6;
  --primary-dark: #08306b;
  --bg-main: #f0f4f8;
  --bg-card: #ffffff;
  --bg-sidebar: #0a2a5e;
  --bg-sidebar-hover: #0d3a7a;
  --text-main: #1a2744;
  --text-secondary: #5a6a80;
  --text-light: #ffffff;
  --border: #e0e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow: 0 2px 12px rgba(13, 78, 162, 0.08);
  --shadow-lg: 0 8px 32px rgba(13, 78, 162, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
}

* { 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-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== 登录页 ===== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a2a5e 0%, #0d4ea2 50%, #1673d6 100%);
}

.login-container {
  width: 900px;
  max-width: 95%;
  min-height: 520px;
  display: flex;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, #0a2a5e, #0d4ea2);
  color: #fff;
  padding: 50px 40px;
  display: flex;
  align-items: center;
}

.login-brand .brand-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.login-brand h1 { font-size: 28px; margin-bottom: 8px; }
.login-brand p { opacity: 0.8; margin-bottom: 40px; }

.login-features .feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  opacity: 0.9;
}

.login-features .dot {
  width: 6px; height: 6px;
  background: #4fc3f7;
  border-radius: 50%;
}

.login-right {
  flex: 1;
  padding: 50px 40px;
  display: flex;
  align-items: center;
}

.login-form-wrapper { width: 100%; }
.login-form-wrapper h2 { font-size: 24px; margin-bottom: 8px; color: var(--text-main); }
.login-subtitle { color: var(--text-secondary); margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(22, 115, 214, 0.1);
}

.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 10px; }

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-login:hover { background: var(--primary-light); }

.login-hint {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== 主布局 ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h2 { font-size: 18px; color: #fff; }
.sidebar-header p { font-size: 12px; opacity: 0.6; margin-top: 4px; }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active { background: var(--bg-sidebar-hover); color: #fff; border-left-color: #4fc3f7; }
.nav-item .icon { width: 20px; text-align: center; font-size: 16px; }
.nav-item .badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  color: #fff;
}
.user-name { font-size: 13px; }
.user-role { font-size: 11px; opacity: 0.6; }
.btn-logout {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 24px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 600; }
.page-actions { display: flex; gap: 10px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.stat-icon.blue { background: #e3f0fd; color: #1673d6; }
.stat-icon.green { background: #d4f5e9; color: #10b981; }
.stat-icon.orange { background: #fef0d4; color: #f59e0b; }
.stat-icon.purple { background: #ede0fe; color: #8b5cf6; }
.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-unit { font-size: 13px; color: var(--text-secondary); margin-left: 4px; }

/* ===== 表格 ===== */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: #f7f9fc;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
tr:hover { background: #f7f9fc; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-pending { background: #fef0d4; color: #b45309; }
.tag-approved { background: #d4f5e9; color: #065f46; }
.tag-rejected { background: #fee; color: #991b1b; }
.tag-borrow { background: #e3f0fd; color: #1673d6; }
.tag-return { background: #d4f5e9; color: #065f46; }
.tag-repair_transfer { background: #f0e6ff; color: #6b21a8; }
.tag-scrap { background: #fce4ec; color: #c62828; }
.tag-purchase_inbound { background: #e8f5e9; color: #2e7d32; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.filter-bar select, .filter-bar input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fff;
}

/* ===== 大屏专用 ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.balance-card {
  background: linear-gradient(135deg, #0d4ea2, #1673d6);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.balance-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.balance-card.green { background: linear-gradient(135deg, #047857, #10b981); }
.balance-card.orange { background: linear-gradient(135deg, #b45309, #f59e0b); }
.balance-card.purple { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.balance-card .bc-name { font-size: 14px; opacity: 0.9; margin-bottom: 8px; }
.balance-card .bc-value { font-size: 32px; font-weight: 700; }
.balance-card .bc-trend { font-size: 12px; opacity: 0.8; margin-top: 6px; display: flex; gap: 12px; }

.chart-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.chart-container { width: 100%; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 17px; }
.modal-close { cursor: pointer; font-size: 22px; color: var(--text-secondary); background: none; border: none; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 移动端菜单按钮 ===== */
.mobile-menu-btn {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 4px 8px;
  line-height: 1;
}

/* 侧边栏内部关闭按钮（仅移动端可见） */
.mobile-sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* ===== 侧边栏遮罩 ===== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99;
}

/* ===== 响应式 ===== */

/* 平板竖屏 & 手机共用规则 */
@media (max-width: 1024px) {
  /* 侧边栏：覆盖式抽屉 */
  .sidebar {
    transform: translateX(-100%);
    z-index: 150;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* 侧边栏遮罩 */
  .sidebar-backdrop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* 主内容区全宽 */
  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  /* 汉堡菜单按钮 */
  .mobile-menu-btn {
    display: block;
  }

  /* 侧边栏内关闭按钮 */
  .mobile-sidebar-close {
    display: flex;
  }

  /* 页面标题缩小 */
  .page-title {
    font-size: 18px;
  }

  /* 看板网格：2列 */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 统计卡片：2列 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 筛选栏：垂直堆叠 */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }

  /* 页面头部允许换行 */
  .page-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .page-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 触屏优化 */
  .btn, .nav-item, .pagination button, .modal-close,
  .mobile-menu-btn, .mobile-sidebar-close, select, input[type="date"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* 模态框：接近全屏 */
  .modal {
    width: 95%;
    max-width: 95%;
    max-height: 95vh;
    border-radius: 12px 12px 0 0;
    align-self: flex-end;
    margin: 0 auto;
  }
  .modal-overlay {
    align-items: flex-end;
  }
  .modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-header h3 {
    font-size: 16px;
  }
  .modal-close {
    font-size: 28px;
    padding: 4px 8px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  /* 表格：横向滚动 */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 按钮触屏优化 */
  .btn {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 14px;
  }
  .btn-sm {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 13px;
  }

  /* 表单触屏优化 */
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 42px;
    font-size: 16px; /* 防iOS缩放 */
  }
  .form-group label {
    font-size: 14px;
  }

  /* 分页：小尺寸 */
  .pagination {
    flex-wrap: wrap;
    gap: 6px;
  }
  .pagination button {
    padding: 8px 12px;
    font-size: 14px;
    min-width: 36px;
    min-height: 36px;
  }

  /* Toast：居中 */
  .toast {
    left: 16px;
    right: 16px;
    max-width: none;
    top: 16px;
    text-align: center;
    animation: toastSlideDown 0.3s ease;
  }
  @keyframes toastSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  /* 侧边栏导航项：更大的触控区域 */
  .nav-item {
    min-height: 48px;
    padding: 14px 24px;
    font-size: 15px;
  }

  /* 退出按钮更大 */
  .btn-logout {
    min-height: 40px;
    font-size: 14px;
  }

  /* 托盘库库存横条：2列 */
  .warehouse-bar-items {
    grid-template-columns: repeat(2, 1fr);
  }
  .warehouse-overview-bar {
    padding: 16px 14px;
  }
  .warehouse-bar-item-value {
    font-size: 24px;
  }

  /* 结余卡片：2列 */
  .balance-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 托盘库卡片：2列 */
  .warehouse-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 导入导出区：单列 */
  .io-section {
    grid-template-columns: 1fr;
  }

  /* 图表容器：小屏时降低高度 */
  .chart-container {
    min-height: 280px;
  }

  /* 双列图表：单列 */
  .chart-two-col {
    grid-template-columns: 1fr !important;
  }
}

/* ===== 手机专用 (≤640px) ===== */
@media (max-width: 640px) {
  .main-content {
    padding: 12px;
  }

  /* 看板网格：单列 */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* 统计卡片：可2列可1列，缩小尺寸 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card {
    padding: 14px 12px;
    gap: 10px;
  }
  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
    border-radius: 10px;
  }
  .stat-value {
    font-size: 22px;
  }
  .stat-label {
    font-size: 11px;
  }

  /* 卡片缩小 */
  .card {
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 8px;
  }

  /* 页面标题 */
  .page-title {
    font-size: 16px;
  }

  /* 表格：更小字体 */
  table {
    font-size: 12px;
  }
  th, td {
    padding: 8px 10px;
  }

  /* 结余卡片：单列 */
  .balance-cards-grid {
    grid-template-columns: 1fr;
  }
  .balance-card {
    padding: 14px;
  }

  /* 托盘库卡片：单列 */
  .warehouse-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .wh-card {
    padding: 16px;
  }
  .wh-card-value {
    font-size: 24px;
  }

  /* 托盘库库存横条：单列 */
  .warehouse-bar-items {
    grid-template-columns: 1fr;
  }

  /* 大屏结余卡：缩小 */
  .balance-card .bc-value {
    font-size: 24px;
  }
  .balance-card .bc-name {
    font-size: 13px;
  }

  /* 图表容器缩小 */
  .chart-container {
    min-height: 240px;
  }

  /* 标签略小 */
  .tag {
    font-size: 11px;
    padding: 2px 8px;
  }

  /* 空状态 */
  .empty-state {
    padding: 30px 16px;
  }
  .empty-state .icon {
    font-size: 36px;
  }

  /* 明细折叠块防溢出 */
  details summary {
    word-break: break-all;
    font-size: 13px;
  }
}

/* ===== 极小屏 (≤400px) ===== */
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-value {
    font-size: 20px;
  }
  .chart-container {
    min-height: 200px;
  }
  .modal {
    width: 100%;
    border-radius: 12px 12px 0 0;
  }
  .modal-body {
    max-height: 55vh;
  }
  .page-header {
    gap: 8px;
  }
}

/* ===== 登录页响应式 ===== */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    min-height: auto;
    width: 100%;
    max-width: 400px;
    margin: 0 16px;
    border-radius: 12px;
  }
  .login-left {
    display: none;
  }
  .login-right {
    padding: 32px 24px;
  }
  .login-form-wrapper h2 {
    font-size: 20px;
  }
  .btn-login {
    min-height: 46px;
    font-size: 16px;
  }
  .form-group input {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  .login-container {
    margin: 0 12px;
  }
  .login-right {
    padding: 24px 16px;
  }
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }

/* ===== 导入导出区 ===== */
.io-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.io-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}
.io-card .io-icon { font-size: 36px; margin-bottom: 12px; }
.io-card h4 { font-size: 16px; margin-bottom: 8px; }
.io-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.io-card .btn { width: 100%; justify-content: center; }

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.file-upload-area:hover { border-color: var(--primary-light); }
.file-upload-area.dragover { border-color: var(--primary); background: #f0f7ff; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  z-index: 300;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== 结余总量卡片 ===== */
.balance-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.balance-card {
  background: linear-gradient(135deg, #f8faff 0%, #eef3fb 100%);
  border: 1px solid #d8e4f4;
  border-radius: 10px;
  padding: 16px 18px;
  transition: all 0.2s;
}
.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(13,78,162,0.12);
}

.balance-card-name {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.balance-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.balance-card-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

.balance-card-bar {
  height: 5px;
  background: #e0e8f0;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.balance-card-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.balance-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.balance-card-total {
  background: linear-gradient(135deg, #0a2a5e 0%, #0d4ea2 100%);
  border-color: var(--primary-dark);
}
.balance-card-total .balance-card-name {
  color: rgba(255,255,255,0.75);
}
.balance-card-total .balance-card-value {
  color: #fff;
}
.balance-card-total .balance-card-unit {
  color: rgba(255,255,255,0.6);
}

@media (max-width: 1200px) {
  .balance-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .balance-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .balance-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 托盘库卡片 ===== */
.warehouse-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.wh-card {
  background: #fff;
  border-radius: 12px;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(10,42,94,0.07);
  border: 1.5px solid #e8ecf3;
  transition: transform 0.18s, box-shadow 0.18s;
}
.wh-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10,42,94,0.12);
}
.wh-card-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}
.wh-card-body {
  flex: 1;
}
.wh-card-label {
  font-size: 13px;
  color: #6b7a90;
  margin-bottom: 4px;
}
.wh-card-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.wh-card-unit {
  font-size: 12px;
  color: #6b7a90;
  margin-top: 2px;
}

/* 闲置 - 绿色 */
.wh-idle .wh-card-icon { background: #e8f5e9; }
.wh-idle .wh-card-value { color: #2e7d32; }

/* 破损 - 红色 */
.wh-damaged .wh-card-icon { background: #fce4ec; }
.wh-damaged .wh-card-value { color: #c62828; }

/* 其他 - 橙色 */
.wh-other .wh-card-icon { background: #fff3e0; }
.wh-other .wh-card-value { color: #e65100; }

/* 合计 - 深蓝 */
.wh-total {
  background: linear-gradient(135deg, #0a2a5e 0%, #0d4ea2 100%);
  border-color: #0a2a5e;
}
.wh-total .wh-card-icon { background: rgba(255,255,255,0.15); }
.wh-total .wh-card-label { color: rgba(255,255,255,0.7); }
.wh-total .wh-card-value { color: #fff; }
.wh-total .wh-card-unit { color: rgba(255,255,255,0.5); }

@media (max-width: 1200px) {
  .warehouse-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .warehouse-summary { grid-template-columns: 1fr; }
}

/* ===== 托盘库库存概览横条（数据看板） ===== */
.warehouse-overview-bar {
  background: linear-gradient(135deg, #0a2a5e 0%, #0d4ea2 100%);
  border-radius: 14px;
  padding: 20px 28px;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px rgba(10,42,94,0.18);
}
.warehouse-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
.warehouse-bar-icon {
  font-size: 20px;
}
.warehouse-bar-date {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-left: 8px;
}
.warehouse-bar-items {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.warehouse-bar-item {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.18s;
}
.warehouse-bar-item:hover {
  background: rgba(255,255,255,0.18);
}
.warehouse-bar-item-label {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 6px;
}
.warehouse-bar-item-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.warehouse-bar-item-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
}

/* 闲置 - 绿色高亮 */
.warehouse-bar-item-idle {
  background: rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.3);
}
.warehouse-bar-item-idle .warehouse-bar-item-label { color: rgba(255,255,255,0.8); }
.warehouse-bar-item-idle .warehouse-bar-item-value { color: #10b981; }
.warehouse-bar-item-idle .warehouse-bar-item-desc { color: rgba(16,185,129,0.6); }

/* 破损 - 红色高亮 */
.warehouse-bar-item-damaged {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.25);
}
.warehouse-bar-item-damaged .warehouse-bar-item-label { color: rgba(255,255,255,0.8); }
.warehouse-bar-item-damaged .warehouse-bar-item-value { color: #ef4444; }
.warehouse-bar-item-damaged .warehouse-bar-item-desc { color: rgba(239,68,68,0.6); }

/* 其他 - 橙色高亮 */
.warehouse-bar-item-other {
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.25);
}
.warehouse-bar-item-other .warehouse-bar-item-label { color: rgba(255,255,255,0.8); }
.warehouse-bar-item-other .warehouse-bar-item-value { color: #f59e0b; }
.warehouse-bar-item-other .warehouse-bar-item-desc { color: rgba(245,158,11,0.6); }

/* 仓库结存 - 白色高亮 */
.warehouse-bar-item-closing {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
}
.warehouse-bar-item-closing .warehouse-bar-item-value { color: #7dd3fc; }

@media (max-width: 1200px) {
  .warehouse-bar-items { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .warehouse-bar-items { grid-template-columns: repeat(2, 1fr); }
  .warehouse-overview-bar { padding: 16px; }
}
@media (max-width: 480px) {
  .warehouse-bar-items { grid-template-columns: 1fr; }
}
