/* ===== 单证管理系统 v3 — Premium Redesign ===== */

:root {
  /* Brand */
  --primary: #4F46E5;
  --primary-light: #EEF2FF;
  --primary-dark: #3730A3;
  --primary-soft: rgba(79,70,229,0.08);

  /* Semantic */
  --success: #059669;
  --success-light: #ECFDF5;
  --success-soft: rgba(5,150,105,0.08);
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --danger-soft: rgba(220,38,38,0.08);
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --warning-soft: rgba(217,119,6,0.08);

  /* Neutrals */
  --bg: #F8FAFC;
  --bg-alt: #F1F5F9;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* Text */
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  /* Radii */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ================================================================
   TOPBAR — 顶部导航
   ================================================================ */
.topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.topbar-brand-text {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-stats { display: flex; align-items: center; }
.topbar-refund {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--success-light);
  border: 1px solid rgba(5,150,105,0.2);
  border-radius: var(--radius-full);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  white-space: nowrap;
}
.topbar-refund.empty {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-weight: 400;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-badge {
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 2px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ================================================================
   LOGIN — 登录页
   ================================================================ */
/* ===== 登录页：账号密码 / 微信扫码 切换 ===== */
.login-tabs {
  display: flex;
  gap: 6px;
  margin-top: 18px;
  padding: 4px;
  background: var(--bg, #f4f5f9);
  border-radius: 10px;
}
.login-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.login-tab.active {
  background: #fff;
  color: var(--primary, #2b6cf6);
  box-shadow: 0 1px 4px rgba(24,32,56,.08);
}
.qr-img-box {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border, #dfe3ea);
  border-radius: 12px;
  background: #fff;
  color: var(--text-muted, #9aa0aa);
  font-size: 13px;
  overflow: hidden;
}
.qr-img-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.6;
}

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 40px 20px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}
.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-light), #E0E7FF);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--primary);
}
.login-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ================================================================
   MAIN — 主区域
   ================================================================ */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}

/* ================================================================
   TOOLBAR — 工具栏
   ================================================================ */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.toolbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.toolbar-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 34px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.search-box {
  position: relative;
  max-width: 300px;
  width: 100%;
}
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.filter-btns {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.view-btn:not(:last-child) { border-right: 1px solid var(--border); }
.view-btn:hover { color: var(--text); background: var(--bg-alt); }
.view-btn.active { background: var(--primary); color: #fff; }

/* ================================================================
   BUTTONS — 按钮
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(79,70,229,0.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  border-color: #CBD5E1;
  color: var(--text);
  background: var(--bg-alt);
}
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 1px 2px rgba(220,38,38,0.3); }
.btn-danger:hover { background: #B91C1C; box-shadow: 0 2px 8px rgba(220,38,38,0.35); transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0); }
.btn svg { pointer-events: none; flex-shrink: 0; }
.tax-status-item svg { pointer-events: none; }

/* ================================================================
   STATS OVERVIEW — 统计概览卡片
   ================================================================ */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: var(--radius);
  padding: 22px 20px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.stat-card .stat-num.stat-num-amount {
  /* 金额数字含 ¥ 和千分位，位数长，缩到 24px 防止溢出 6 列卡片 */
  font-size: 24px;
}
.stat-card .stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}
/* 颜色语义 */
.stat-card.total { border-top-color: var(--primary); }
.stat-card.total::before { background: linear-gradient(180deg, rgba(79,70,229,0.06) 0%, transparent 60%); }
.stat-card.total .stat-num { color: var(--primary); }
.stat-card.complete { border-top-color: var(--success); }
.stat-card.complete::before { background: linear-gradient(180deg, rgba(5,150,105,0.06) 0%, transparent 60%); }
.stat-card.complete .stat-num { color: var(--success); }
.stat-card.incomplete { border-top-color: var(--danger); }
.stat-card.incomplete::before { background: linear-gradient(180deg, rgba(220,38,38,0.06) 0%, transparent 60%); }
.stat-card.incomplete .stat-num { color: var(--danger); }
.stat-card.tax-success { border-top-color: var(--success); }
.stat-card.tax-success::before { background: linear-gradient(180deg, rgba(5,150,105,0.06) 0%, transparent 60%); }
.stat-card.tax-success .stat-num { color: var(--success); }
/* 第二行 — 通过 --card-color 驱动 */
.stat-card[style*="--card-color"] { border-top-color: var(--card-color); }
.stat-card[style*="--card-color"]::before { background: linear-gradient(180deg, color-mix(in srgb, var(--card-color) 8%, transparent) 0%, transparent 60%); }
.stat-card[style*="--card-color"] .stat-num { color: var(--card-color); }
/* 第二行容器 — 响应式覆盖 */
.stats-overview[style*="repeat(5"] {}

/* ================================================================
   SHIPMENT CARDS — 发货批次卡片
   ================================================================ */
.shipment-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shipment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.shipment-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-top .card-booking {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}
.booking-report-type {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  letter-spacing: 0.02em;
}
.booking-report-type.combined {
  background: var(--warning-light);
  color: var(--warning);
}
.card-top .card-booking .booking-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.card-top .card-booking .booking-badge.complete { background: var(--success-light); color: var(--success); }
.card-top .card-booking .booking-badge.incomplete { background: var(--danger-light); color: var(--danger); }
.card-top .card-booking .booking-badge.tax {
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.card-top .card-booking .booking-badge.tax:hover { transform: translateY(-1px); }
.card-top .card-booking .booking-badge.tax.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.card-top .card-booking .booking-badge.tax.inactive { background: var(--bg-alt); color: var(--text-secondary); border-color: var(--border); }
.card-top .card-booking .booking-badge.tax.success { background: var(--success-light); color: var(--success); border-color: var(--success); }
.card-top .card-booking .booking-badge.tax.disabled { cursor: not-allowed; opacity: 0.4; pointer-events: none; }
.card-top .card-booking .booking-badge.tax.disabled:hover { transform: none; }
.card-top .card-booking .booking-badge.tax-ok { background: var(--success-light); color: var(--success); }
.card-top .card-booking .booking-badge.tax-pending { background: var(--warning-light); color: var(--warning); }
.card-top .card-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }

/* Doc dots */
.doc-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.doc-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
  position: relative;
  transition: transform var(--transition);
}
.doc-dot:hover { transform: scale(1.18); z-index: 5; }
.doc-dot.uploaded {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(5,150,105,0.25);
}
.doc-dot.missing {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.25);
}
.doc-dot[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--text);
  color: var(--text-inverse);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  z-index: 20;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

/* Missing list */
.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}
.missing-list .missing-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}
.missing-list .missing-item {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
  white-space: nowrap;
  font-weight: 500;
}
.missing-list .all-ok {
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Card bottom */
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.card-bottom .progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}
.card-bottom .progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.card-bottom .card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Progress bars */
.progress-bar-outer {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
  max-width: 300px;
}
.progress-bar-inner {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar-inner.complete { background: var(--success); }
.progress-bar-inner.warning { background: var(--warning); }
.progress-bar-inner.danger { background: var(--danger); }

/* ================================================================
   MATRIX TABLE — 进度矩阵表
   ================================================================ */
.matrix-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.matrix-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-alt);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  min-width: 76px;
}
.matrix-table thead th.sticky-col {
  left: 0;
  z-index: 20;
  min-width: 180px;
  text-align: left;
  background: var(--bg-alt);
}
.matrix-table tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}
.matrix-table tbody tr:hover { background: var(--primary-light); }
.matrix-table tbody tr:nth-child(even) { background: rgba(241,245,249,0.5); }
.matrix-table tbody tr:nth-child(even):hover { background: var(--primary-light); }
.matrix-table tbody td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.matrix-table tbody td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 15;
  background: var(--surface);
  text-align: left;
  border-right: 1px solid var(--border);
}
.matrix-table tbody tr:hover td.sticky-col { background: var(--primary-light); }
.matrix-table tbody tr:nth-child(even) td.sticky-col { background: rgba(241,245,249,0.5); }
.matrix-table tbody tr:nth-child(even):hover td.sticky-col { background: var(--primary-light); }
.matrix-booking {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  font-size: 14px;
}
.matrix-remark {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matrix-cell {
  font-size: 16px;
  font-weight: 700;
  width: 76px;
  min-width: 76px;
}
.matrix-cell.ok { color: var(--success); }
.matrix-cell.missing { color: var(--danger); }
.matrix-cell.na { color: var(--text-muted); font-weight: 400; font-size: 14px; }
.matrix-report-type {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}
.matrix-report-type.combined { background: var(--warning-light); color: var(--warning); }
.matrix-progress { min-width: 110px; }
.matrix-progress-bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.matrix-progress-inner {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.matrix-progress-inner.complete { background: var(--success); }
.matrix-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ================================================================
   DETAIL — 详情页
   ================================================================ */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.detail-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.detail-title { flex: 1; min-width: 0; }
.detail-title h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  letter-spacing: -0.02em;
}
.detail-title p { font-size: 13px; color: var(--text-muted); }
.badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.badge-ok { background: var(--success-light); color: var(--success); }
.badge-warn { background: var(--danger-light); color: var(--danger); }

/* Detail progress */
.detail-progress-row {
  display: flex;
  gap: 40px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.detail-progress-stat {
  display: flex;
  flex-direction: column;
}
.detail-progress-stat .num { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.detail-progress-stat .num.complete { color: var(--success); }
.detail-progress-stat .num.missing { color: var(--danger); }
.detail-progress-stat .label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* Alert boxes */
.alert-box {
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.alert-box.danger {
  background: var(--danger-light);
  border: 1px solid rgba(220,38,38,0.15);
}
.alert-box.success {
  background: var(--success-light);
  border: 1px solid rgba(5,150,105,0.15);
}
.alert-box .alert-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.alert-box.danger .alert-title { color: var(--danger); }
.alert-box.success .alert-title { color: var(--success); }
.alert-box .alert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alert-tag {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
  font-weight: 500;
}

.btn-download-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}
.btn-download-all:hover {
  box-shadow: 0 4px 16px rgba(5,150,105,0.4);
  transform: translateY(-2px);
}
.btn-download-all:active { transform: translateY(0); }

/* ================================================================
   TAX STATUS — 退税状态
   ================================================================ */
.tax-status-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-xs);
}
.tax-status-section .section-title {
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.tax-status-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.tax-status-item {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.tax-status-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.tax-status-item.inactive {
  border-color: var(--border);
  opacity: 0.75;
}
.tax-status-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.tax-status-item.success {
  border-color: var(--success);
  background: var(--success-light);
}
.tax-status-item.pending {
  border-color: var(--warning);
  background: var(--warning-light);
}
.tax-status-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--bg);
}
.tax-status-item.disabled:hover {
  border-color: var(--border);
  box-shadow: none;
}
.tax-status-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tax-status-item.inactive .tax-status-icon { background: var(--bg-alt); color: var(--text-muted); }
.tax-status-item.active .tax-status-icon { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.tax-status-item.success .tax-status-icon { background: linear-gradient(135deg, #059669, #047857); color: #fff; }
.tax-status-item.pending .tax-status-icon { background: linear-gradient(135deg, #D97706, #B45309); color: #fff; }
.tax-status-item.disabled .tax-status-icon { background: var(--bg-alt); color: var(--text-muted); }
.tax-status-info { flex: 1; min-width: 0; }
.tax-status-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}
.tax-status-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.tax-status-item.active .tax-status-value { color: var(--primary); }
.tax-status-item.success .tax-status-value { color: var(--success); }
.tax-status-item.pending .tax-status-value { color: var(--warning); }
.tax-status-item.disabled .tax-status-value { color: var(--text-muted); }
.tax-status-action {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  border: 1px solid var(--border);
}
.tax-status-item.active .tax-status-action,
.tax-status-item.success .tax-status-action,
.tax-status-item.pending .tax-status-action {
  background: transparent;
  border-color: transparent;
}

/* ================================================================
   DOC GRID — 材料卡片网格
   ================================================================ */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.doc-card.uploaded {
  border-color: rgba(5,150,105,0.2);
  border-left: 3px solid var(--success);
}
.doc-card.missing {
  border-left: 3px solid var(--danger);
}
.doc-card:hover { box-shadow: var(--shadow-md); }

/* "+" 新增自定义单证卡片（虚线边框、居中 + 号） */
.doc-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  min-height: 158px;
  padding: 18px 20px;
  transition: all var(--transition);
}
.doc-card-add:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
}
.doc-card-add-inner {
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.doc-card-add:hover .doc-card-add-inner { color: var(--primary); }
.doc-card-add-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px dashed currentColor;
  color: var(--primary);
  font-size: 32px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition);
}
.doc-card-add:hover .doc-card-add-icon {
  background: var(--primary);
  color: #fff;
  border-style: solid;
}
.doc-card-add-text { font-size: 14px; font-weight: 600; }
.doc-card-add-hint { font-size: 11px; opacity: 0.8; }

/* 自定义单证标签（在卡片名称后） */
.custom-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}
.doc-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.doc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon.uploaded { background: var(--success-light); color: var(--success); }
.doc-icon.missing { background: var(--danger-light); color: var(--danger); }
.doc-name { font-size: 15px; font-weight: 600; color: var(--text); }
.doc-status { font-size: 12px; margin-top: 2px; font-weight: 500; }
.doc-status.uploaded { color: var(--success); }
.doc-status.missing { color: var(--danger); }
.doc-file-info {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  line-height: 1.6;
}
.customs-no-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 13px;
}
.customs-no-display.pending {
  background: var(--bg-alt);
  border-color: var(--border);
}
.customs-no-label {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
}
.customs-no-value {
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.5px;
  background: rgba(79,70,229,0.08);
  padding: 3px 10px;
  border-radius: 4px;
}
.customs-no-pending {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}
.doc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 采购合同检查结果框 */
.contract-box {
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.contract-box.danger {
  background: var(--danger-light);
  border: 1px solid rgba(220,53,69,0.25);
  color: var(--danger);
}
.contract-box.ok {
  background: var(--success-light);
  border: 1px solid rgba(5,150,105,0.25);
  color: var(--success);
}
.contract-box.pending {
  background: var(--bg);
  border: 1px dashed var(--border);
  color: var(--text-muted);
}
.contract-box-title {
  font-weight: 600;
  margin-bottom: 3px;
}
.contract-box-item {
  margin-left: 4px;
}
.contract-box-item.dim {
  color: var(--text-muted);
  opacity: 0.85;
}

/* ================================================================
   MODALS — 模态框
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 460px;
  max-width: 94vw;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group select option {
  background: var(--surface);
  color: var(--text);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone .upload-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}
.file-selected {
  background: var(--success-light);
  border: 1px solid rgba(5,150,105,0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

/* ================================================================
   TOAST — 消息提示
   ================================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.toast.success { border-left-color: var(--success); color: var(--text); }
.toast.error { border-left-color: var(--danger); color: var(--text); }
.toast.warning { border-left-color: var(--warning); color: var(--text); }
.toast.info { border-left-color: var(--primary); color: var(--text); }

/* ================================================================
   EMPTY STATE — 空状态
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 20px; opacity: 0.25; }
.empty-state h3 { font-size: 17px; margin-bottom: 8px; color: var(--text-secondary); font-weight: 600; }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ================================================================
   SKELETON — 骨架屏
   ================================================================ */
.skeleton-list { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.skeleton-line {
  height: 14px; background: var(--bg); border-radius: 7px;
  margin-bottom: 10px; animation: skeletonPulse 1.5s ease-in-out infinite;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-30 { width: 30%; }
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ================================================================
   SORT DROPDOWN — 排序下拉
   ================================================================ */
.sort-dropdown { position: relative; }
.sort-dropdown select {
  appearance: none; -webkit-appearance: none;
  padding: 10px 36px 10px 14px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); color: var(--text);
  cursor: pointer; transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sort-dropdown select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-bg); }

/* ================================================================
   PAGINATOR — 分页器
   ================================================================ */
.paginator {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 24px; padding: 16px 0;
}
.paginator-info {
  font-size: 13px; color: var(--text-muted); margin: 0 12px;
  min-width: 100px; text-align: center; white-space: nowrap;
}
.paginator-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); color: var(--text); cursor: pointer;
  font-size: 13px; font-family: inherit; transition: all 0.2s;
}
.paginator-btn:hover:not(:disabled) {
  background: var(--primary-bg); border-color: var(--primary); color: var(--primary);
}
.paginator-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 500;
}
.paginator-btn:disabled { opacity: 0.35; cursor: default; }
.paginator-ellipsis { padding: 0 4px; color: var(--text-muted); font-size: 13px; }

/* ================================================================
   DASHBOARD — 仪表盘
   ================================================================ */
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  color: white;
}
.dashboard-hero h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.dashboard-hero p { font-size: 14px; opacity: 0.85; }
.dashboard-hero-right .btn { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); }
.dashboard-hero-right .btn:hover { background: rgba(255,255,255,0.3); }

.dashboard-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.section-heading {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 月度趋势图 */
.monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-height: 220px;
  padding: 10px 0;
}
.monthly-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.monthly-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 165px;
}
.monthly-bar {
  width: 24px;
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 0.4s ease;
}
.monthly-bar.created { background: linear-gradient(180deg, var(--primary) 0%, rgba(79,70,229,0.6) 100%); }
.monthly-bar.tax { background: linear-gradient(180deg, var(--success) 0%, rgba(5,150,105,0.6) 100%); }
.monthly-bar-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.monthly-label { font-size: 11px; color: var(--text-muted); text-align: center; }
.monthly-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.monthly-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-dot.created { background: var(--primary); }
.legend-dot.tax { background: var(--success); }

/* 材料类型统计条 */
.doc-type-bars { display: flex; flex-direction: column; gap: 12px; }
.doc-type-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.doc-type-bar-label {
  width: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  text-align: right;
}
.doc-type-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.doc-type-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #7C3AED 100%);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.doc-type-bar-num {
  width: 90px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.stat-card[style*="--card-color"] .stat-num { color: var(--card-color); }

/* ================================================================
   DATE FILTER & BATCH TOOLBAR
   ================================================================ */
.date-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-filter input[type="date"] {
  font-family: inherit;
}

/* 批量操作工具栏 */
.batch-toolbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  animation: batchSlideUp 0.3s ease;
}
.batch-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 4px;
  white-space: nowrap;
}
.batch-count strong { color: var(--primary); }
@keyframes batchSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 卡片勾选框 */
.card-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-right: 4px;
  cursor: pointer;
  position: relative;
}
.card-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: var(--surface);
}
.card-checkbox input:checked + .checkbox-mark {
  background: var(--primary);
  border-color: var(--primary);
}
.card-checkbox input:checked + .checkbox-mark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}
/* 拖拽上传高亮 */
.doc-card.drag-over {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
  transform: scale(1.03);
}
/* 回收站 */
.trash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.trash-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--danger); }
.trash-count { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.trash-list { display: flex; flex-direction: column; gap: 8px; }
.trash-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.2s; }
.trash-item:hover { border-color: var(--danger); background: rgba(239,68,68,0.03); }
.trash-item-left { display: flex; flex-direction: column; gap: 4px; }
.trash-booking { font-size: 15px; font-weight: 600; }
.trash-meta { font-size: 12px; color: var(--text-muted); }
.trash-item-right { display: flex; gap: 8px; }
/* 导入步骤 */
.import-steps { margin: 12px 0; }
.import-step { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; color: var(--text-secondary); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.shipment-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,70,229,0.15);
}

/* ================================================================
   ACCESSIBILITY — 可访问性
   ================================================================ */

/* 键盘焦点指示 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
/* 消除鼠标点击时的默认焦点环（保留键盘焦点环） */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* 尊重用户运动偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton-line { animation: none; opacity: 0.6; }
}

/* ================================================================
   RESPONSIVE — 响应式
   ================================================================ */

/* 预览模态框 */
.modal-preview { max-width: 90vw; width: auto; min-width: 400px; }
.modal-header-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 16px; font-weight: 600; }
.preview-body { display: flex; align-items: center; justify-content: center; min-height: 200px; max-height: 70vh; overflow: auto; background: #f1f5f9; border-radius: var(--radius); }
.preview-body img { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.preview-body .preview-unsupported { padding: 40px; text-align: center; color: var(--text-muted); }
.preview-error { padding: 40px; text-align: center; color: var(--danger); }

/* 自定义确认弹窗 */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 10000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.confirm-dialog { background: var(--surface); border-radius: 16px; padding: 28px 32px; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); animation: modalSlideUp 0.3s ease; }
.confirm-dialog h3 { font-size: 17px; margin: 0 0 10px; }
.confirm-dialog p { font-size: 14px; color: var(--text-secondary); margin: 0 0 24px; line-height: 1.6; }
.confirm-dialog.danger h3 { color: var(--danger); }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .topbar-brand { font-size: 15px; }
  .main { padding: 16px 16px 40px; }
  .stats-overview { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  /* 第二行 5 列强制 2 列 */
  .stats-overview[style*="repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card { padding: 16px 14px; min-height: 90px; }
  .stat-card .stat-num { font-size: 26px; }
  .stat-card .stat-label { font-size: 12px; }
  .doc-dots { gap: 5px; }
  .doc-dot { width: 28px; height: 28px; font-size: 10px; border-radius: 6px; }
  .toolbar-main { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-wrap: wrap; }
  .toolbar-right { margin-left: 0; width: 100%; justify-content: flex-end; }
  .search-box { max-width: none; }
  /* 仪表盘 Hero */
  .dashboard-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 20px; }
  .dashboard-hero h1 { font-size: 22px; }
  .dashboard-hero-right { width: 100%; }
  .dashboard-hero-right .btn { width: 100%; justify-content: center; }
  .dashboard-section { padding: 18px 16px; }
  .monthly-chart { gap: 12px; min-height: 160px; }
  .monthly-bar { width: 16px; }
  .doc-type-bar-label { width: 70px; font-size: 11px; }
  .batch-toolbar {
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: none;
    width: auto;
    padding: 12px 16px;
    animation: batchSlideUp 0.3s ease;
  }
  .batch-toolbar .btn-sm { padding: 8px 12px; font-size: 12px; }
  .card-bottom { flex-direction: column; align-items: stretch; }
  .view-toggle { display: none; }
  .matrix-hint { font-size: 12px; }
  .matrix-table { font-size: 12px; min-width: 900px; }
  .matrix-table thead th { padding: 10px 6px; font-size: 11px; }
  .matrix-table tbody td { padding: 8px 6px; }
  .matrix-table tbody td.sticky-col { min-width: 140px; }
  .matrix-booking { font-size: 13px; }
  .doc-grid { grid-template-columns: 1fr; }
  .paginator-btn { width: 32px; height: 32px; font-size: 12px; }
  .paginator-info { font-size: 12px; min-width: auto; margin: 0 6px; }
  .sort-dropdown select { padding: 8px 30px 8px 10px; font-size: 12px; }
  .skeleton-card { padding: 16px; }
}
/* 平板竖屏 — 4 列 → 3 列过渡 */
@media (min-width: 769px) and (max-width: 1024px) {
  .stats-overview { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stats-overview[style*="repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }
  .main { padding: 24px 24px 48px; }
  .doc-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ===== 已退税明细弹窗（仪表盘卡片点击进入） ===== */
.stat-card.clickable { cursor: pointer; }
.stat-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
  transition: color 0.18s ease;
}
.stat-card.clickable:hover .stat-hint { color: var(--primary); }
.stat-card.tax-success.clickable:hover .stat-hint { color: var(--success); }

.modal.modal-tax { width: 760px; max-width: 94vw; }
.tax-modal-loading,
.tax-modal-empty {
  padding: 48px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.tax-modal-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.tax-modal-summary b { color: var(--text); font-weight: 700; }
.tax-modal-summary .tax-amount { color: var(--success); }
.tax-modal-table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tax-modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tax-modal-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-alt);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.tax-modal-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.tax-modal-table tbody tr:last-child td { border-bottom: none; }
.tax-modal-table tbody tr:hover { background: var(--surface-hover); }
.tax-modal-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.tax-modal-table th.num,
.tax-modal-table td.num { text-align: right; white-space: nowrap; }
.tax-modal-table th.op,
.tax-modal-table td.op { text-align: right; white-space: nowrap; }
.tax-modal-table .tax-amount { color: var(--success); font-weight: 700; }
.tax-muted { color: var(--text-muted); }
.tax-modal-tip { margin-top: 10px; font-size: 12px; color: var(--text-muted); }

/* ===== 未退税金额明细：对账条 + 状态标签 ===== */
.modal.modal-recon { width: 820px; }
.tax-recon {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}
.tax-recon-item {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.tax-recon-item.highlight {
  background: var(--danger-light);
  border-color: rgba(220, 38, 38, 0.25);
}
.tax-recon-item .k {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tax-recon-item .v {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.tax-recon-item .v.ok { color: var(--success); }
.tax-recon-item .v.danger { color: var(--danger); }
.tax-recon-item .s {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tax-recon-op {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 700;
  flex: 0 0 auto;
}
.tax-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tax-chip.ok { background: var(--success-light); color: var(--success); }
.tax-chip.wait { background: var(--warning-light); color: var(--warning); }
.tax-chip.none { background: var(--bg-alt); color: var(--text-muted); }
.tax-modal-table .file-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ===== 未退税明细：状态筛选行 ===== */
.recon-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.recon-filter-row .filter-btn { padding: 5px 12px; font-size: 12px; }
.recon-filter-sum {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.recon-filter-sum b { color: var(--text); font-weight: 700; }
.recon-empty {
  text-align: center;
  padding: 32px 12px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== 未退税明细：暂无进项票批次 ===== */
.recon-sub {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.recon-sub-title {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.recon-sub-title b { color: var(--text); font-weight: 700; }
.tax-chip.noinv {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.25);
  margin-right: 4px;
}
.recon-sub-wrap { max-height: 190px; }
.tax-modal-table .recon-mat {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* ===== 未退税明细：整体高度受控，内容区滚动（小屏也能看到底部按钮） ===== */
.modal.modal-recon {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.modal.modal-recon #unrefundedBody {
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.modal.modal-recon .tax-modal-table-wrap,
.modal.modal-recon .recon-sub-wrap {
  max-height: none;
}

/* ===== 进项票②：选填标记 / 发票信息 / 批次合计条 ===== */
.optional-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}
.invoice-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.invoice-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}
.invoice-box-row > span { color: var(--text-muted); flex: 0 0 auto; }
.invoice-box-row > b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.invoice-box-row > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invoice-box-row .tax-amount { color: var(--success); }
.invoice-sum-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 4px 0 14px;
  padding: 10px 14px;
  background: var(--success-soft);
  border: 1px solid rgba(5, 150, 105, 0.18);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.invoice-sum-strip b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.invoice-sum-strip .tax-amount { color: var(--success); }
.invoice-sum-strip .inv-sum-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}
.invoice-sum-strip svg { width: 15px; height: 15px; }
.modal.modal-recon { width: 880px; }

/* ===== 多店铺：顶栏切换器 / 店铺管理弹窗 ===== */
.topbar-store { display: flex; align-items: center; gap: 6px; margin-left: 14px; }
.store-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: var(--radius-full);
  color: var(--primary-dark);
}
.store-switch svg { opacity: 0.8; flex: 0 0 auto; }
.store-switch select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  outline: none;
  max-width: 200px;
}
.modal.modal-store { width: 640px; max-height: 86vh; overflow-y: auto; }
.store-create { display: flex; gap: 8px; margin: 4px 0 16px; }
.store-create input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
.store-list { display: flex; flex-direction: column; gap: 10px; }
.store-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}
.store-row.disabled { opacity: 0.65; background: var(--bg-alt); }
.store-row-head { display: flex; align-items: center; gap: 8px; }
.store-name-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
}
.store-current-tag, .store-disabled-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.store-current-tag { background: var(--success-light); color: var(--success); }
.store-disabled-tag { background: var(--bg-alt); color: var(--text-muted); }
.store-members {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.store-members-label { color: var(--text-muted); font-weight: 600; }
.store-member { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.store-row-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }

/* ===== 未退税口径：超退提示色 ===== */
.tax-recon-item .v.warn { color: var(--warning); }
