/* ============================================
   跨境订单管理系统 v5.0 · Waybill × 柔术
   设计理念：主界面是「工作文件」——运单调度面板
   像被翻阅、标注过的物流单证，腰带色为组织线索
   ============================================ */

/* ═══════════════════════════════════════════════
   1. 设计令牌
   ═══════════════════════════════════════════════ */
:root {
  /* 核心色板 — 与登录页一致 */
  --fog:        #F3F4F6;
  --doc:        #FFFFFF;
  --ink:        #111827;
  --priority:   #DC2626;
  --gold:       #C8960C;
  --mat-yellow: #E6B422;
  --stamp-bg:   #FEF2F2;
  --field:      #F9FAFB;
  --rule:       #E5E7EB;
  --rule-dark:  #D1D5DB;
  --muted:      #9CA3AF;
  --muted-ink:  #6B7280;

  /* 腰带色阶 */
  --belt-white:  #F5F5F0;
  --belt-blue:   #1E3A5F;
  --belt-purple: #5B2C6E;
  --belt-brown:  #6B3A2A;
  --belt-black:  #1A1A1A;

  /* 功能色 — 主操作色 = 蓝腰带 (非紫色) */
  --primary:       var(--belt-blue);
  --primary-hover: #15294A;
  --danger:        var(--priority);
  --danger-hover:  #B91C1C;
  --success:       #065F46;
  --bg:            var(--fog);
  --card-bg:       var(--doc);
  --text:          var(--ink);
  --text-secondary:var(--muted-ink);
  --border:        var(--rule);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow:    0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.10),0 12px 40px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════
   2. Reset + Body
   ═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--fog);
  color: var(--text); line-height: 1.6; min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   3. Header — 文档头风格
   ═══════════════════════════════════════════════ */
.header {
  background: var(--doc);
  color: var(--ink);
  padding: 14px 32px;
  display: flex; justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.header-left { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.logo { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 8px; }
/* FKZ 徽标块 — 蓝腰带底 + 白字，呼应主操作色 */
.logo-mark {
  background: var(--belt-blue); color: #fff;
  padding: 3px 9px; border-radius: 5px;
  font-weight: 800; font-size: 1.02rem; letter-spacing: 1.5px;
  box-shadow: 0 1px 2px rgba(30,58,95,0.30);
}
/* ERP 后缀 — 拉开字距的收尾，配金色分隔点 */
.logo-suffix {
  color: var(--muted-ink); font-weight: 700;
  font-size: 0.95rem; letter-spacing: 4px; padding-left: 2px;
}
.subtitle {
  font-size: 0.75rem; color: var(--muted); letter-spacing: 1px;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.user-badge {
  font-size: 0.82rem; border: 1px solid var(--rule-dark);
  background: var(--doc); color: var(--muted-ink);
  padding: 4px 14px; border-radius: 20px; font-weight: 500;
}
.user-badge small { opacity: 0.6; font-size: 0.72rem; }
.btn-white {
  background: var(--doc); color: var(--ink); border: 1px solid var(--rule-dark);
  padding: 5px 14px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.btn-white:hover { background: var(--field); border-color: var(--primary); color: var(--primary); }

/* ═══════════════════════════════════════════════
   4. Sidebar — 腰带蓝黑渐变侧边栏
   ═══════════════════════════════════════════════ */
.app-layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 210px; min-width: 210px;
  background: linear-gradient(180deg, #1A1A1A 0%, #1E3A5F 100%);
  color: #fff; display: flex; flex-direction: column;
  padding: 0; overflow-y: auto; flex-shrink: 0;
}
.sidebar-nav { padding: 0; }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(200,150,12,0.12); /* 金标缝线 */
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.10); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.sidebar-username {
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-section-label {
  font-size: 0.6rem; font-weight: 700;
  color: rgba(200,150,12,0.45); /* 金标分类 */
  text-transform: uppercase; letter-spacing: 2px;
  padding: 18px 18px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none; cursor: pointer; transition: all 0.15s;
  border-left: 3px solid transparent; margin: 1px 0;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
.nav-item.nav-active {
  background: rgba(255,255,255,0.08); color: #fff;
  border-left-color: var(--gold); font-weight: 600; /* 金标激活 */
}
.nav-item-sm { font-size: 0.76rem; opacity: 0.4; padding: 8px 18px; }
.nav-item-sm:hover { opacity: 1; }
.nav-icon { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.nav-text { flex: 1; }
.nav-count, .nav-badge {
  font-size: 0.66rem; background: rgba(200,150,12,0.15);
  color: var(--gold); padding: 1px 7px; border-radius: 10px;
  min-width: 22px; text-align: center; font-weight: 600;
}
.nav-badge { background: var(--gold); color: #111827; font-weight: 700; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 10px 14px; }

/* ═══════════════════════════════════════════════
   5. 主内容区
   ═══════════════════════════════════════════════ */
.main-content { flex: 1; overflow-y: auto; background: var(--fog); }
.content-section { display: none; overflow-anchor: none; }
.content-section.section-active { display: block; }

/* ═══════════════════════════════════════════════
   5a. 多标签页栏
   ═══════════════════════════════════════════════ */
.tab-bar {
  display: flex; align-items: flex-end; gap: 0;
  height: 36px; padding: 4px 12px 0;
  background: #E8ECF1; border-bottom: 1px solid var(--rule);
  overflow-x: auto; overflow-y: hidden; flex-shrink: 0;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 8px 0 10px;
  background: #D1D6DC; color: #6B7280;
  border-radius: 6px 6px 0 0;
  font-size: 0.73rem; white-space: nowrap; cursor: pointer;
  user-select: none; flex-shrink: 0; transition: all 0.12s;
  margin-right: 2px; border: 1px solid transparent; border-bottom: none;
}
.tab-item:hover { background: #C8CED5; color: #374151; }
.tab-item.tab-active {
  background: #fff; color: var(--text); font-weight: 600;
  border-color: var(--rule);
}
.tab-item .tab-icon { font-size: 0.85rem; line-height: 1; }
.tab-item .tab-close {
  font-size: 0.85rem; line-height: 1; cursor: pointer;
  padding: 0 2px; margin-left: 2px; border-radius: 3px;
  color: #9CA3AF; transition: all 0.12s;
}
.tab-item .tab-close:hover { color: #EF4444; background: #FEE2E2; }
.tab-item.tab-fixed .tab-close { display: none; }

#section-orders.section-active {
  display: flex; flex-direction: column; height: calc(100vh - 56px - 36px);
  overflow: hidden;
}
.section-title-bar {
  padding: 16px 40px 0;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.section-title-bar h2 {
  font-size: 1rem; font-weight: 700; color: var(--text);
  border-bottom: 2px solid var(--belt-blue); padding-bottom: 10px; flex: 1;
}
.section-header { display: none; }

/* ═══════════════════════════════════════════════
   6. 销售面板
   ═══════════════════════════════════════════════ */
#salesPanel { display: block !important; }
.sales-panel {
  background: var(--card-bg); margin: 0 40px 20px; padding: 20px 24px;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.sales-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.sales-header h3 { font-size: 1rem; color: var(--primary); }
.sales-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sales-filters .btn-period {
  padding: 5px 12px; font-size: 0.76rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.sales-filters .btn-period.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.sales-filters .input-sm {
  padding: 5px 10px; font-size: 0.76rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-family: inherit;
}
.date-sep { font-size: 0.78rem; color: var(--text-secondary); }
.sales-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-top: 14px;
}
.sales-card { background: var(--field); border-radius: var(--radius); padding: 16px; text-align: center; }
.sales-card-wide { grid-column: span 2; text-align: left; }
.sales-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.sales-label { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }
.cs-stat { font-size: 0.82rem; padding: 3px 0; border-bottom: 1px solid var(--border); }
.cs-stat:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════
   7. 销售订单总览 — 运营指挥中心
   ═══════════════════════════════════════════════ */
#section-overview { overflow: auto; background: #F3F5F7; }
.overview-dashboard {
  --ops-ink: #172033;
  --ops-muted: #667085;
  --ops-blue: #2563EB;
  --ops-teal: #0F766E;
  --ops-amber: #B45309;
  --ops-red: #B91C1C;
  width: min(1500px, 100%); margin: 0 auto; padding: 26px 40px 44px;
  color: var(--ops-ink); font-variant-numeric: tabular-nums;
}

/* ============================================
   经营分析工作台
   ============================================ */
.analytics-page {
  --analytics-bg: #f3f5f7;
  --analytics-ink: #172033;
  --analytics-muted: #687386;
  --analytics-faint: #8d97a6;
  --analytics-rule: #d7dde5;
  --analytics-rule-soft: #e9edf1;
  --analytics-blue: #2156a5;
  --analytics-teal: #147d72;
  --analytics-gold: #b67b13;
  --analytics-red: #b9404a;
  --analytics-expense: #765c91;
  width: min(100%, 1490px);
  margin: 0 auto;
  color: var(--analytics-ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

#section-overview > .analytics-page,
#section-sales > .analytics-page { padding: 26px 30px 44px; }

.analytics-page *,
.analytics-modal * { box-sizing: border-box; letter-spacing: 0; }

.analytics-page button,
.analytics-modal button,
.analytics-page input,
.analytics-page select,
.analytics-modal input,
.analytics-modal select,
.analytics-modal textarea { font: inherit; }

.analytics-page button:focus-visible,
.analytics-modal button:focus-visible,
.analytics-page input:focus-visible,
.analytics-page select:focus-visible,
.analytics-modal input:focus-visible,
.analytics-modal select:focus-visible,
.analytics-modal textarea:focus-visible { outline: 2px solid var(--analytics-blue, #2156a5); outline-offset: 2px; }

.analytics-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}

.analytics-page-head h2 { margin: 0; color: #172033; font-size: 24px; line-height: 1.25; font-weight: 700; }
.analytics-page-head p { margin: 5px 0 0; color: #687386; font-size: 12px; line-height: 1.55; }

.analytics-health {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 180px;
  padding: 9px 12px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
}
.analytics-health i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #147d72; }
.analytics-health.attention i { background: #b9404a; }
.analytics-health strong { display: block; color: #172033; font-size: 11px; line-height: 1.35; }
.analytics-health span { display: block; margin-top: 2px; color: #8d97a6; font-size: 9px; }

.analytics-data-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 12px;
  padding: 8px 11px;
  border: 1px solid #d7dde5;
  border-left: 3px solid #b67b13;
  background: #fff;
  color: #687386;
  font-size: 10px;
}
.analytics-data-notice.error { border-left-color: #b9404a; color: #8f2f38; }
.analytics-data-notice button { min-height: 28px; border: 0; color: #2156a5; background: transparent; font-weight: 700; cursor: pointer; }
.analytics-scope-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-left: 3px solid #147d72;
  background: #f3f8f7;
  color: #455064;
  font-size: 12px;
  line-height: 1.5;
}
.analytics-scope-note.company { border-left-color: #b67b13; background: #fff9ec; }
.analytics-scope-note strong { flex: 0 0 auto; color: #172033; font-size: 12px; }

.analytics-target-band {
  display: grid;
  grid-template-columns: minmax(275px, 1.25fr) repeat(4, minmax(125px, .55fr));
  overflow: hidden;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
}
.analytics-target-main { padding: 18px 20px; border-right: 1px solid #e9edf1; }
.analytics-target-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.analytics-target-title > span { color: #687386; font-size: 10px; font-weight: 700; }
.analytics-target-title button { min-height: 28px; padding: 0 4px; border: 0; color: #2156a5; background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.analytics-target-main > strong { display: block; margin: 6px 0 10px; font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 26px; line-height: 1; }
.analytics-target-main > strong small { color: #8d97a6; font-family: "Microsoft YaHei UI", sans-serif; font-size: 11px; font-weight: 500; }
.analytics-target-main > em { display: block; margin-top: 7px; color: #8d97a6; font-size: 9px; font-style: normal; }
.analytics-progress { height: 5px; overflow: hidden; border-radius: 2px; background: #edf0f3; }
.analytics-progress b { display: block; height: 100%; background: #b67b13; }
.analytics-progress-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; margin-top: 7px; color: #687386; font-size: 9px; }
.analytics-progress-meta .positive { color: #147d72; font-weight: 700; }
.analytics-progress-meta .negative { color: #b9404a; font-weight: 700; }

.analytics-kpi {
  min-width: 0;
  padding: 18px 15px;
  border: 0;
  border-right: 1px solid #e9edf1;
  background: #fff;
  color: #172033;
  text-align: left;
}
button.analytics-kpi { cursor: pointer; }
button.analytics-kpi:hover { background: #f7f9fb; }
.analytics-kpi:last-child { border-right: 0; }
.analytics-kpi > span { display: block; color: #687386; font-size: 9px; }
.analytics-kpi > strong { display: block; overflow: hidden; margin: 7px 0 5px; font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 22px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.analytics-kpi > small { display: block; color: #8d97a6; font-size: 8px; line-height: 1.45; }
.analytics-kpi.profit > strong { color: #147d72; }
.analytics-kpi.operating > strong { color: #2156a5; }

.analytics-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0; border-top: 1px solid #d7dde5; border-bottom: 1px solid #d7dde5; }
.analytics-insight { display: grid; grid-template-columns: 5px minmax(0, 1fr); gap: 10px; min-width: 0; padding: 12px 16px; border-right: 1px solid #d7dde5; }
.analytics-insight:last-child { border-right: 0; }
.analytics-insight > i { width: 5px; height: 34px; border-radius: 2px; background: #2156a5; }
.analytics-insight:nth-child(2) > i { background: #147d72; }
.analytics-insight:nth-child(3) > i { background: #b9404a; }
.analytics-insight strong { display: block; overflow: hidden; font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.analytics-insight span { display: block; margin-top: 2px; color: #687386; font-size: 9px; line-height: 1.5; }

.analytics-panel { min-width: 0; border: 1px solid #d7dde5; border-radius: 6px; background: #fff; }
.analytics-panel-pad { padding: 16px 18px; }
.analytics-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.analytics-panel-head span { display: block; margin-bottom: 2px; color: #687386; font-size: 9px; font-weight: 700; }
.analytics-panel-head h3 { margin: 0; color: #172033; font-size: 14px; line-height: 1.35; }
.analytics-panel-head > small { flex: 0 0 auto; padding-top: 3px; color: #8d97a6; font-size: 8px; text-align: right; }
.analytics-overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 12px; }
.analytics-chart { width: 100%; height: 300px; }
.analytics-chart-lg { height: 330px; }
.analytics-chart-tall { height: 345px; }

.analytics-action-list { display: flex; flex-direction: column; }
.analytics-action-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 10px 0; border: 0; border-bottom: 1px solid #e9edf1; background: transparent; color: #172033; text-align: left; cursor: pointer; }
.analytics-action-row:last-child { border-bottom: 0; }
.analytics-action-row:hover strong { color: #2156a5; }
.analytics-action-row > i { width: 7px; height: 26px; border-radius: 2px; background: #2156a5; }
.analytics-action-row > i.warning { background: #b67b13; }
.analytics-action-row > i.critical { background: #b9404a; }
.analytics-action-row > span { min-width: 0; }
.analytics-action-row strong { display: block; overflow: hidden; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.analytics-action-row small { display: block; margin-top: 2px; color: #8d97a6; font-size: 8px; line-height: 1.35; }
.analytics-action-row > b { color: #b9404a; font-family: Bahnschrift, sans-serif; font-size: 11px; text-align: right; }
.analytics-action-row > b small { font-family: "Microsoft YaHei UI", sans-serif; font-weight: 500; }

.analytics-funnel-panel { margin-top: 12px; }
.analytics-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-funnel button { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 9px; min-width: 0; min-height: 78px; padding: 8px 15px; border: 0; border-right: 1px solid #e9edf1; background: transparent; color: #172033; text-align: left; cursor: pointer; }
.analytics-funnel button:last-child { border-right: 0; }
.analytics-funnel button:hover { background: #f7f9fb; }
.analytics-funnel button > span { grid-row: 1 / span 2; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #c8d5e7; border-radius: 50%; color: #2156a5; font-family: Bahnschrift, sans-serif; font-size: 9px; }
.analytics-funnel button > strong { align-self: end; font-family: Bahnschrift, sans-serif; font-size: 18px; }
.analytics-funnel button > small { grid-column: 2; align-self: start; color: #687386; font-size: 9px; }
.analytics-funnel button > i { grid-column: 2; display: block; height: 4px; overflow: hidden; border-radius: 2px; background: #edf0f3; }
.analytics-funnel button > i b { display: block; height: 100%; background: #2156a5; }
.analytics-funnel button > em { grid-column: 3; grid-row: 1 / span 3; color: #687386; font-size: 9px; font-style: normal; }

.analytics-legacy { margin-top: 12px; border-top: 1px solid #bec7d1; }
.analytics-section-label { display: flex; align-items: baseline; gap: 9px; padding: 11px 2px 8px; }
.analytics-section-label strong { font-size: 11px; }
.analytics-section-label span { color: #8d97a6; font-size: 9px; }
.analytics-legacy-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; border: 1px solid #d7dde5; border-radius: 6px; background: #fff; }
.analytics-legacy-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.analytics-legacy-grid.eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-legacy-grid.eight > :nth-child(-n+4) { border-bottom: 1px solid #e9edf1; }
.analytics-legacy-grid.eight > :nth-child(4n) { border-right: 0; }
.analytics-legacy-grid.eight small { overflow: visible; text-overflow: clip; white-space: normal; }
.analytics-legacy-grid > div,
.analytics-legacy-grid > button { min-width: 0; padding: 13px 15px; border: 0; border-right: 1px solid #e9edf1; background: #fff; color: #172033; text-align: left; }
.analytics-legacy-grid > div:last-child,
.analytics-legacy-grid > button:last-child { border-right: 0; }
.analytics-legacy-grid > button { cursor: pointer; }
.analytics-legacy-grid > button:hover { background: #f7f9fb; }
.analytics-legacy-grid span { display: block; color: #687386; font-size: 9px; }
.analytics-legacy-grid strong { display: block; overflow: hidden; margin: 4px 0 2px; font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-legacy-grid small { display: block; overflow: hidden; color: #8d97a6; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.analytics-period-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.analytics-site-filter { display: flex; align-items: center; gap: 8px; color: #455064; font-size: 12px; font-weight: 700; }
.analytics-site-filter select { min-width: 185px; height: 34px; padding: 0 30px 0 10px; border: 1px solid #aeb8c5; border-radius: 5px; background: #fff; color: #172033; font-size: 12px; font-weight: 600; }
.analytics-period-buttons { display: flex; overflow: hidden; border: 1px solid #c9d1dc; border-radius: 5px; background: #fff; }
.analytics-period-buttons .btn-period { min-width: 54px; height: 34px; padding: 0 10px; border: 0; border-right: 1px solid #e0e5eb; background: #fff; color: #687386; font-size: 10px; font-weight: 700; cursor: pointer; }
.analytics-period-buttons .btn-period:last-child { border-right: 0; }
.analytics-period-buttons .btn-period.active { background: #2156a5; color: #fff; }
.analytics-head-actions { display: flex; align-items: flex-start; gap: 10px; }
.analytics-overview-filters { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.analytics-overview-period { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.analytics-overview-modes button { min-width: 58px; height: 34px; padding: 0 10px; border: 0; border-right: 1px solid #e0e5eb; background: #fff; color: #687386; font-size: 11px; font-weight: 700; cursor: pointer; }
.analytics-overview-modes button:last-child { border-right: 0; }
.analytics-overview-modes button.active { background: #2156a5; color: #fff; }
.analytics-period-selection { display: flex; align-items: center; gap: 5px; }
.analytics-period-selection select { width: 156px; height: 32px; padding: 0 28px 0 9px; border: 1px solid #c9d1dc; border-radius: 5px; background: #fff; color: #344054; font-size: 11px; }
.analytics-period-step { width: 32px; height: 32px; padding: 0; border: 1px solid #c9d1dc; border-radius: 5px; background: #fff; color: #2156a5; font-size: 20px; line-height: 1; cursor: pointer; }
.analytics-period-step:hover { border-color: #2156a5; background: #f4f7fb; }
.analytics-custom-dates { display: flex; align-items: center; gap: 7px; color: #8d97a6; font-size: 9px; }
.analytics-custom-dates .input { width: 132px; height: 31px; min-height: 31px; padding: 4px 7px; font-size: 9px; }

.analytics-tabs { display: flex; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid #bec7d1; scrollbar-width: thin; }
.analytics-tabs button { flex: 0 0 auto; height: 39px; padding: 0 17px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #687386; font-size: 11px; font-weight: 700; cursor: pointer; }
.analytics-tabs button.active { border-bottom-color: #2156a5; color: #2156a5; }

.analytics-period-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 47px; margin-bottom: 12px; padding: 9px 13px; border-left: 3px solid #2156a5; background: #fff; }
.analytics-period-bar > div:first-child strong { display: block; font-size: 11px; }
.analytics-period-bar > div:first-child span { display: block; margin-top: 2px; color: #8d97a6; font-size: 8px; }
.analytics-compare { display: flex; align-items: center; gap: 10px; color: #687386; font-size: 9px; }
.analytics-compare b { padding: 4px 7px; border-radius: 3px; background: #f1f3f6; color: #687386; }
.analytics-compare b.positive { color: #147d72; }
.analytics-compare b.negative { color: #b9404a; }

.analytics-summary-band,
.analytics-mini-band,
.analytics-expense-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; margin-bottom: 12px; border: 1px solid #d7dde5; border-radius: 6px; background: #fff; }
.analytics-summary-band > div,
.analytics-mini-band > div,
.analytics-expense-summary > div { min-width: 0; padding: 16px 18px; border-right: 1px solid #e9edf1; }
.analytics-summary-band > div:last-child,
.analytics-mini-band > div:last-child,
.analytics-expense-summary > div:last-child { border-right: 0; }
.analytics-summary-band span,
.analytics-mini-band span,
.analytics-expense-summary span { display: block; color: #687386; font-size: 9px; }
.analytics-summary-band strong,
.analytics-mini-band strong,
.analytics-expense-summary strong { display: block; overflow: hidden; margin: 5px 0 3px; font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 21px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.analytics-mini-band strong { font-size: 18px; }
.analytics-summary-band small,
.analytics-mini-band small,
.analytics-expense-summary small { display: block; overflow: hidden; color: #8d97a6; font-size: 8px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.analytics-summary-band .sales strong { color: #2156a5; }
.analytics-summary-band .profit strong { color: #147d72; }
.analytics-summary-band .operating strong { color: #2156a5; }
.analytics-expense-summary .expense { color: #765c91; }
.analytics-expense-summary .positive { color: #147d72; }
.analytics-expense-summary .negative { color: #b9404a; }

.analytics-two-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.analytics-customer-grid,
.analytics-profit-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr); gap: 12px; margin-bottom: 12px; }
.analytics-sales-original { margin-top: 0; }

.analytics-size-matrix { display: grid; grid-template-columns: repeat(12, minmax(58px, 1fr)); gap: 4px; overflow-x: auto; padding-bottom: 3px; }
.analytics-size-matrix > div:not(.analytics-empty),
.analytics-size-matrix > button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 62px; border: 0; border-radius: 3px; color: #fff; font: inherit; cursor: copy; }
.analytics-size-matrix > button:hover { filter: brightness(.95); }
.analytics-size-matrix > button:active { transform: translateY(1px); }
.analytics-size-matrix span { font-size: 9px; }
.analytics-size-matrix strong { margin-top: 3px; font-family: Bahnschrift, sans-serif; font-size: 16px; }
.analytics-tooltip-card { min-width: 190px; max-width: 320px; }
.analytics-tooltip-title { margin-bottom: 8px; color: #fff; font-weight: 700; line-height: 1.45; white-space: normal; word-break: break-word; }
.analytics-tooltip-row { display: flex; justify-content: space-between; gap: 18px; margin-top: 4px; color: rgba(255,255,255,.86); }
.analytics-tooltip-row strong { color: #fff; font-weight: 700; }
.analytics-tooltip-copy { width: 100%; height: 28px; margin-top: 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; color: #fff; background: rgba(255,255,255,.12); font-size: 12px; font-weight: 700; cursor: pointer; }
.analytics-tooltip-copy:hover { background: rgba(255,255,255,.2); }

.analytics-table-wrap { max-width: 100%; overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; color: #455064; font-size: 9px; }
.analytics-table th { height: 34px; padding: 7px 9px; border-bottom: 1px solid #d7dde5; background: #f7f8fa; color: #687386; font-weight: 700; text-align: left; white-space: nowrap; }
.analytics-table td { height: 39px; padding: 7px 9px; border-bottom: 1px solid #e9edf1; line-height: 1.45; }
.analytics-table tbody tr:last-child td { border-bottom: 0; }
.analytics-table tbody tr[onclick] { cursor: pointer; }
.analytics-table tbody tr[onclick]:hover td { background: #f7f9fb; }
.analytics-table .numeric { font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; text-align: right; white-space: nowrap; }
.analytics-table .positive { color: #147d72; }
.analytics-table .negative { color: #b9404a; }
.analytics-table .expense { color: #765c91; font-weight: 700; }
.analytics-freight-page { display: grid; gap: 12px; }
.analytics-freight-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.analytics-freight-intro h2 { margin: 0; color: #182536; font-size: 20px; line-height: 1.25; }
.analytics-freight-intro p { margin: 6px 0 0; color: #667589; font-size: 12px; line-height: 1.5; }
.analytics-panel-kicker { display: block; margin-bottom: 5px; color: #2c6a9a; font-size: 11px; font-weight: 800; }
.analytics-freight-summary { margin-bottom: 0; }
.analytics-freight-ledger { overflow: hidden; }
.analytics-freight-ledger > .analytics-table-toolbar { padding: 15px 20px; border-bottom: 1px solid #e3e7ed; }
.analytics-freight-ledger > .analytics-table-toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.analytics-freight-ledger > .analytics-table-toolbar strong { color: #263445; font-size: 14px; }
.analytics-freight-ledger > .analytics-table-toolbar span { color: #718096; font-size: 12px; }
.analytics-freight-search { width: min(360px, 100%); height: 36px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 4px; color: #263445; font-size: 13px; box-sizing: border-box; }
.analytics-freight-table { min-width: 1080px; }
.analytics-actual-freight-table { min-width: 1360px; }
.analytics-freight-table td strong,
.analytics-freight-table td small { display: block; }
.analytics-freight-table td small { margin-top: 2px; color: #718096; font-size: 11px; }
.analytics-freight-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e3e7ed; color: #667589; font-size: 12px; }
.analytics-freight-pagination button { width: 34px; height: 32px; border: 1px solid #cbd3dd; border-radius: 4px; background: #fff; color: #344054; font-size: 18px; cursor: pointer; }
.analytics-freight-pagination button:disabled { color: #98a2b3; background: #f2f4f7; cursor: default; }

.analytics-ledger > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 35px; border-bottom: 1px solid #e9edf1; color: #455064; font-size: 10px; }
.analytics-ledger > div strong { font-family: Bahnschrift, sans-serif; font-size: 11px; }
.analytics-ledger > div.positive strong { color: #147d72; }
.analytics-ledger > div.negative strong { color: #b9404a; }
.analytics-ledger > div.expense strong { color: #765c91; }
.analytics-ledger > div.total { min-height: 44px; border-top: 1px solid #bec7d1; border-bottom: 0; color: #172033; font-weight: 700; }
.analytics-ledger > div.total strong { color: #2156a5; font-size: 15px; }
.analytics-ledger > div.confirmation { min-height: 46px; padding: 0 9px; border: 1px solid #d7dde5; border-left-width: 3px; background: #f7f8fa; }
.analytics-ledger > div.confirmation.confirmed { border-left-color: #147d72; background: #f2f8f7; }
.analytics-ledger > div.confirmation.pending { border-left-color: #b67b13; background: #fff9ed; }
.analytics-ledger > div.confirmation.confirmed strong { color: #147d72; }
.analytics-ledger > div.confirmation.pending strong { color: #8a5b08; font-family: "Microsoft YaHei UI", sans-serif; font-size: 11px; }
.analytics-quality { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.analytics-quality > div { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; }
.analytics-quality span { color: #687386; font-size: 9px; }
.analytics-quality strong { color: #172033; font-family: Bahnschrift, sans-serif; font-size: 10px; }
.analytics-quality i { grid-column: 1 / -1; display: block; height: 4px; overflow: hidden; background: #edf0f3; }
.analytics-quality i b { display: block; height: 100%; background: #147d72; }

.analytics-risk-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.analytics-risk-list > div,
.analytics-risk-list > button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; min-height: 66px; padding: 10px 13px; border: 0; border-right: 1px solid #e9edf1; background: transparent; color: #172033; text-align: left; }
.analytics-risk-list > :last-child { border-right: 0; }
.analytics-risk-list > button { cursor: pointer; }
.analytics-risk-list > button:hover { background: #f7f9fb; }
.analytics-risk-list span { min-width: 0; }
.analytics-risk-list strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-risk-list small { display: block; margin-top: 3px; color: #8d97a6; font-size: 8px; line-height: 1.35; }
.analytics-risk-list b { flex: 0 0 auto; color: #b9404a; font-family: Bahnschrift, sans-serif; font-size: 12px; }

.analytics-expense-trend-panel { margin-bottom: 12px; }
.analytics-expense-trend-panel .analytics-chart { height: 235px; }
.analytics-expense-ledger { min-height: 560px; overflow: hidden; }
.analytics-table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 9px 14px; border-bottom: 1px solid #d7dde5; }
.analytics-table-toolbar > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.analytics-table-toolbar strong { font-size: 11px; }
.analytics-table-toolbar span { color: #8d97a6; font-size: 9px; }
.analytics-table-toolbar small { color: #667085; font-size: 11px; }
.analytics-table-filters { display: flex; align-items: center; gap: 7px; }
.analytics-table-filters select,
.analytics-table-filters input { width: 120px; height: 32px; padding: 0 8px; border: 1px solid #c9d1dc; border-radius: 4px; background: #fff; color: #455064; font-size: 9px; }
.analytics-table-filters input { width: 238px; }
.analytics-table-filters .btn { min-height: 32px; padding: 0 10px; font-size: 9px; }
.analytics-expense-table-wrap { min-height: 430px; }
.analytics-expense-table { min-width: 760px; table-layout: fixed; }
.analytics-expense-table .expense-col-date { width: 172px; }
.analytics-expense-table .expense-col-description { width: 34%; }
.analytics-expense-table .expense-col-amount { width: 155px; }
.analytics-expense-table .expense-col-notes { width: auto; }
.analytics-expense-table td { height: auto; min-height: 52px; padding-top: 11px; padding-bottom: 11px; vertical-align: top; }
.analytics-expense-row { cursor: pointer; }
.analytics-expense-row:hover td,
.analytics-expense-row:focus td { background: #f4f7fb; }
.analytics-expense-row:focus { outline: 2px solid #2156a5; outline-offset: -2px; }
.analytics-expense-description strong,
.analytics-expense-notes { overflow-wrap: anywhere; white-space: pre-wrap; }
.analytics-expense-date,
.analytics-expense-amount { white-space: nowrap; }
.analytics-expense-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 10px 14px; border-top: 1px solid #d7dde5; background: #fafbfc; color: #455064; font-size: 11px; }
.analytics-expense-page-controls { display: flex; align-items: center; gap: 6px; }
.analytics-expense-page-controls label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.analytics-expense-page-controls select { height: 32px; padding: 0 7px; border: 1px solid #c9d1dc; border-radius: 4px; color: #344054; background: #fff; font: inherit; }
.analytics-expense-page-controls button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #c9d1dc; border-radius: 4px; color: #2156a5; background: #fff; font-family: Arial, sans-serif; font-size: 18px; cursor: pointer; }
.analytics-expense-page-controls button:hover:not(:disabled) { border-color: #2156a5; background: #eef4fc; }
.analytics-expense-page-controls button:disabled { color: #98a2b3; background: #f2f4f7; cursor: not-allowed; }
.analytics-expense-page-controls > span { min-width: 76px; text-align: center; white-space: nowrap; }
.analytics-tag { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 6px; border-radius: 3px; background: #f0edf4; color: #654e7c; font-size: 8px; white-space: nowrap; }
.analytics-row-actions { white-space: nowrap; }
.analytics-row-actions button { min-height: 26px; padding: 0 5px; border: 0; background: transparent; color: #2156a5; font-size: 8px; font-weight: 700; cursor: pointer; }
.analytics-row-actions button.danger { color: #b9404a; }

.analytics-cash-summary .positive,
.analytics-cash-table .positive,
.analytics-cash-live b { color: #147d72; }
.analytics-cash-insights { margin-bottom: 12px; }
.analytics-cash-insights p { margin: 7px 0; color: #455064; font-size: 12px; line-height: 1.55; }
.analytics-cash-form-panel { margin-bottom: 12px; padding: 16px 18px; }
.analytics-cash-readonly-notice { border-left: 3px solid #d2a33a; background: #fffaf0; }
.analytics-cash-form { display: flex; flex-direction: column; gap: 14px; }
.analytics-cash-form-top { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 14px; align-items: end; }
.analytics-cash-live { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid #d7dde5; border-radius: 5px; background: #f7f9fb; }
.analytics-cash-live span { min-width: 0; padding: 10px 12px; border-right: 1px solid #e9edf1; color: #455064; font-size: 11px; }
.analytics-cash-live span:last-child { border-right: 0; }
.analytics-cash-live b { display: block; margin-top: 3px; font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 17px; }
.analytics-cash-group { padding-top: 13px; border-top: 1px solid #e9edf1; }
.analytics-cash-group > strong { display: block; margin-bottom: 10px; color: #172033; font-size: 12px; }
.analytics-cash-input { font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 13px !important; font-weight: 700; }
.analytics-cash-error { min-height: 18px; color: #b9404a; font-size: 11px; }
.analytics-cash-table-wrap { min-height: 250px; }
.analytics-cash-table { min-width: 980px; }
.analytics-cash-table td { height: auto; min-height: 48px; padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.analytics-cash-table td strong { color: #172033; }

.analytics-empty { display: grid; place-items: center; min-height: 90px; padding: 16px; color: #8d97a6; font-size: 10px; text-align: center; }
.analytics-empty.compact { min-height: 120px; }

.analytics-modal-overlay { z-index: 2600; }
.analytics-modal { width: min(520px, calc(100vw - 28px)); max-width: 520px; border-radius: 6px; }
.analytics-expense-modal { width: min(640px, calc(100vw - 28px)); max-width: 640px; }
.analytics-modal .modal-header { align-items: flex-start; }
.analytics-modal .modal-header h2 { margin: 0; font-size: 15px; }
.analytics-modal .modal-header p { margin: 3px 0 0; color: #8d97a6; font-size: 9px; }
.analytics-form { padding: 18px 19px 20px; }
.analytics-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; }
.analytics-field { display: flex; flex-direction: column; gap: 5px; }
.analytics-field-full { grid-column: 1 / -1; }
.analytics-field > span { color: #455064; font-size: 10px; font-weight: 700; }
.analytics-field .input { width: 100%; min-height: 36px; font-size: 10px; }
.analytics-field textarea.input { min-height: 72px; padding-top: 8px; resize: vertical; }
.analytics-field > small { min-height: 14px; color: #b9404a; font-size: 8px; }
.analytics-form-note { margin: 7px 0 0; color: #687386; font-size: 9px; line-height: 1.5; }
.analytics-duplicate-warning { display: none; margin-top: 10px; padding: 8px 10px; border-left: 3px solid #b67b13; background: #fff8e7; color: #7f5710; font-size: 9px; line-height: 1.5; }
.analytics-duplicate-warning.visible { display: block; }
.analytics-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.analytics-modal-actions .btn { min-height: 34px; }
.analytics-modal-actions .analytics-expense-delete { margin-right: auto; border-color: #d9a5aa; color: #b9404a; }
.analytics-modal-actions .analytics-expense-delete:hover { border-color: #b9404a; background: #fff4f5; }

@media (max-width: 1120px) {
  .analytics-target-band { grid-template-columns: 1.2fr 1fr 1fr; }
  .analytics-target-main { grid-row: span 2; }
  .analytics-kpi:nth-child(4) { border-top: 1px solid #e9edf1; }
  .analytics-kpi:nth-child(5) { border-top: 1px solid #e9edf1; }
  .analytics-customer-grid,
  .analytics-profit-grid { grid-template-columns: 1fr; }
  .analytics-legacy-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-legacy-grid.six > :nth-child(-n+3) { border-bottom: 1px solid #e9edf1; }
  .analytics-legacy-grid.six > :nth-child(3) { border-right: 0; }
}

@media (max-width: 760px) {
  #section-overview > .analytics-page,
  #section-sales > .analytics-page { padding: 14px 11px 30px; }
  .analytics-page-head { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 13px; }
  .analytics-page-head h2 { font-size: 20px; }
  .analytics-page-head p { font-size: 10px; }
  .analytics-head-actions { width: 100%; flex-direction: column; }
  .analytics-overview-filters { align-items: stretch; width: 100%; }
  .analytics-site-filter { justify-content: space-between; width: 100%; }
  .analytics-site-filter select { flex: 1; min-width: 0; min-height: 40px; font-size: 16px; }
  .analytics-scope-note { align-items: flex-start; flex-direction: column; gap: 2px; }
  .analytics-overview-period { width: 100%; align-items: stretch; }
  .analytics-overview-modes button { flex: 1; min-height: 38px; }
  .analytics-period-selection { width: 100%; }
  .analytics-period-selection select { flex: 1; width: auto; min-width: 0; min-height: 38px; }
  .analytics-period-step { width: 38px; height: 38px; flex: 0 0 38px; }
  .analytics-health { width: 100%; min-width: 0; }
  .analytics-period-controls { align-items: stretch; width: 100%; }
  .analytics-period-buttons { overflow-x: auto; }
  .analytics-period-buttons .btn-period { flex: 0 0 58px; min-height: 38px; }
  .analytics-custom-dates { justify-content: flex-end; }
  .analytics-custom-dates .input { flex: 1; width: auto; max-width: 148px; min-height: 36px; }
  .analytics-tabs { margin-right: -11px; margin-left: -11px; padding-left: 4px; scroll-behavior: smooth; }
  .analytics-tabs button { min-height: 42px; padding: 0 13px; }
  .analytics-target-band { grid-template-columns: 1fr 1fr; }
  .analytics-target-main { grid-column: 1 / -1; grid-row: auto; border-right: 0; border-bottom: 1px solid #e9edf1; }
  .analytics-kpi { min-height: 106px; border-top: 0 !important; border-bottom: 1px solid #e9edf1; }
  .analytics-kpi:nth-child(odd) { border-right: 0; }
  .analytics-kpi:last-child { border-bottom: 0; }
  .analytics-target-main > strong { font-size: 22px; }
  .analytics-kpi > strong { font-size: 19px; }
  .analytics-insights { grid-template-columns: 1fr; }
  .analytics-insight { border-right: 0; border-bottom: 1px solid #d7dde5; }
  .analytics-insight:last-child { border-bottom: 0; }
  .analytics-insight strong { white-space: normal; }
  .analytics-overview-grid,
  .analytics-two-grid,
  .analytics-customer-grid,
  .analytics-profit-grid { grid-template-columns: 1fr; }
  .analytics-panel-pad { padding: 14px 12px; }
  .analytics-chart,
  .analytics-chart-lg,
  .analytics-chart-tall { height: 285px; }
  .analytics-funnel { grid-template-columns: 1fr 1fr; }
  .analytics-funnel button:nth-child(2) { border-right: 0; }
  .analytics-funnel button:nth-child(-n+2) { border-bottom: 1px solid #e9edf1; }
  .analytics-legacy-grid,
  .analytics-legacy-grid.six,
  .analytics-legacy-grid.eight { grid-template-columns: 1fr 1fr; }
  .analytics-legacy-grid > :nth-child(even),
  .analytics-legacy-grid.six > :nth-child(even),
  .analytics-legacy-grid.eight > :nth-child(even) { border-right: 0; }
  .analytics-legacy-grid > :not(:nth-last-child(-n+2)),
  .analytics-legacy-grid.six > :not(:nth-last-child(-n+2)),
  .analytics-legacy-grid.eight > :not(:nth-last-child(-n+2)) { border-bottom: 1px solid #e9edf1; }
  .analytics-period-bar { align-items: flex-start; flex-direction: column; }
  .analytics-compare { flex-wrap: wrap; }
  .analytics-summary-band,
  .analytics-mini-band,
  .analytics-expense-summary { grid-template-columns: 1fr 1fr; }
  .analytics-summary-band > div:nth-child(2),
  .analytics-mini-band > div:nth-child(2),
  .analytics-expense-summary > div:nth-child(2) { border-right: 0; }
  .analytics-summary-band > div:nth-child(-n+2),
  .analytics-mini-band > div:nth-child(-n+2),
  .analytics-expense-summary > div:nth-child(-n+2) { border-bottom: 1px solid #e9edf1; }
  .analytics-summary-band strong,
  .analytics-expense-summary strong { font-size: 18px; }
  .analytics-mini-band strong { font-size: 15px; }
  .analytics-risk-list { grid-template-columns: 1fr; }
  .analytics-risk-list > div,
  .analytics-risk-list > button { border-right: 0; border-bottom: 1px solid #e9edf1; }
  .analytics-risk-list > :last-child { border-bottom: 0; }
  .analytics-quality { grid-template-columns: 1fr; }
  .analytics-table-toolbar { align-items: stretch; flex-direction: column; }
  .analytics-table-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .analytics-table-filters select,
  .analytics-table-filters input { width: 100%; min-height: 38px; }
  .analytics-table-filters .btn { min-height: 40px; }
  .analytics-table-filters input { grid-column: 1 / -1; }
  .analytics-expense-trend-panel .analytics-chart { height: 220px; }
  .analytics-expense-ledger { min-height: 0; }
  .analytics-expense-table-wrap { min-height: 0; }
  .analytics-expense-pagination { align-items: flex-start; flex-direction: column; }
  .analytics-expense-page-controls { flex-wrap: wrap; width: 100%; }
  .analytics-expense-page-controls > span { flex: 1; }
  .analytics-cash-form-top,
  .analytics-cash-live { grid-template-columns: 1fr; }
  .analytics-cash-live span { border-right: 0; border-bottom: 1px solid #e9edf1; }
  .analytics-cash-live span:last-child { border-bottom: 0; }
  .analytics-modal-actions { flex-wrap: wrap; }
  .analytics-modal-actions .analytics-expense-delete { flex-basis: 100%; margin-right: 0; }
  .analytics-form-grid { grid-template-columns: 1fr; }
  .analytics-field-full { grid-column: auto; }
  .analytics-modal { max-height: calc(100vh - 24px); overflow-y: auto; }
  .sales-site-form-field,
  .order-number-form-field { flex: 0 0 auto; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-page *, .analytics-modal * { scroll-behavior: auto !important; transition: none !important; }
}

/* 经营分析可读性增强：放大正文并提高次级文字对比度 */
.analytics-page {
  --analytics-muted: #455064;
  --analytics-faint: #667085;
  font-size: 13px;
}
.analytics-page-head h2 { font-size: 26px; }
.analytics-page-head p { color: #455064; font-size: 14px; }
.analytics-health { min-width: 205px; }
.analytics-health strong { font-size: 13px; }
.analytics-health span { color: #667085; font-size: 11px; }
.analytics-data-notice { color: #455064; font-size: 12px; }
.analytics-target-title > span { color: #455064; font-size: 12px; }
.analytics-target-title button { font-size: 11px; }
.analytics-target-main > strong { font-size: 28px; }
.analytics-target-main > strong small { color: #667085; font-size: 13px; }
.analytics-target-main > em { color: #667085; font-size: 11px; }
.analytics-progress-meta { color: #455064; font-size: 11px; }
.analytics-kpi > span { color: #455064; font-size: 12px; font-weight: 600; }
.analytics-kpi > strong { font-size: 24px; }
.analytics-kpi > small { color: #667085; font-size: 11px; line-height: 1.55; }
.analytics-insight strong { font-size: 13px; }
.analytics-insight span { color: #455064; font-size: 11px; }
.analytics-panel-head span { color: #455064; font-size: 11px; }
.analytics-panel-head h3 { font-size: 16px; }
.analytics-panel-head > small { color: #667085; font-size: 11px; line-height: 1.45; }
.analytics-action-row { min-height: 58px; }
.analytics-action-row strong { font-size: 12px; }
.analytics-action-row small { color: #667085; font-size: 11px; }
.analytics-action-row > b { font-size: 13px; }
.analytics-funnel button { min-height: 84px; }
.analytics-funnel button > span { font-size: 10px; }
.analytics-funnel button > strong { font-size: 20px; }
.analytics-funnel button > small,
.analytics-funnel button > em { color: #455064; font-size: 11px; }
.analytics-section-label strong { font-size: 13px; }
.analytics-section-label span { color: #667085; font-size: 11px; }
.analytics-legacy-grid span { color: #455064; font-size: 11px; }
.analytics-legacy-grid strong { font-size: 19px; }
.analytics-legacy-grid small { color: #667085; font-size: 11px; }
.analytics-period-buttons .btn-period { min-width: 60px; color: #455064; font-size: 12px; }
.analytics-custom-dates { color: #667085; font-size: 11px; }
.analytics-custom-dates .input { font-size: 11px; }
.analytics-tabs button { color: #455064; font-size: 13px; }
.analytics-period-bar > div:first-child strong { font-size: 13px; }
.analytics-period-bar > div:first-child span { color: #667085; font-size: 11px; }
.analytics-compare { color: #455064; font-size: 11px; }
.analytics-compare b { color: #455064; }
.analytics-summary-band span,
.analytics-mini-band span,
.analytics-expense-summary span { color: #455064; font-size: 11px; }
.analytics-summary-band strong,
.analytics-expense-summary strong { font-size: 23px; }
.analytics-mini-band strong { font-size: 20px; }
.analytics-summary-band small,
.analytics-mini-band small,
.analytics-expense-summary small { color: #667085; font-size: 11px; line-height: 1.55; }
.analytics-summary-band small { overflow: visible; min-height: 2.9em; text-overflow: clip; white-space: normal; }
.analytics-size-matrix span { font-size: 11px; }
.analytics-size-matrix strong { font-size: 17px; }
.analytics-table { color: #344054; font-size: 12px; }
.analytics-table th { height: 39px; color: #455064; font-size: 12px; }
.analytics-table td { height: 44px; }
.analytics-ledger > div { min-height: 40px; color: #455064; font-size: 12px; }
.analytics-ledger > div strong { font-size: 13px; }
.analytics-ledger > div.total strong { font-size: 16px; }
.analytics-quality span { color: #455064; font-size: 11px; }
.analytics-quality strong { font-size: 12px; }
.analytics-risk-list > div,
.analytics-risk-list > button { min-height: 72px; }
.analytics-risk-list strong { font-size: 12px; }
.analytics-risk-list small { color: #667085; font-size: 11px; }
.analytics-risk-list b { font-size: 14px; }
.analytics-table-toolbar strong { font-size: 13px; }
.analytics-table-toolbar span { color: #667085; font-size: 11px; }
.analytics-table-filters select,
.analytics-table-filters input,
.analytics-table-filters .btn { font-size: 11px; }
.analytics-tag { font-size: 11px; }
.analytics-row-actions button { font-size: 11px; }
.analytics-empty { color: #667085; font-size: 12px; }
.analytics-modal .modal-header h2 { font-size: 17px; }
.analytics-modal .modal-header p { color: #667085; font-size: 11px; }
.analytics-field > span { color: #344054; font-size: 12px; }
.analytics-field .input { font-size: 12px; }
.analytics-field > small { font-size: 11px; }
.analytics-form-note { color: #455064; font-size: 11px; }
.analytics-duplicate-warning { font-size: 11px; }

@media (max-width: 760px) {
  .analytics-page-head h2 { font-size: 23px; }
  .analytics-page-head p { font-size: 13px; }
  .analytics-target-main > strong { font-size: 24px; }
  .analytics-kpi { min-height: 116px; }
  .analytics-kpi > strong { font-size: 21px; }
  .analytics-summary-band strong,
  .analytics-expense-summary strong { font-size: 20px; }
  .analytics-mini-band strong { font-size: 18px; }
  .analytics-profit-grid .analytics-chart-tall { height: 305px; }
  .analytics-custom-dates .input,
  .analytics-table-filters select,
  .analytics-table-filters input,
  .analytics-field .input { font-size: 16px; }
}

/* 员工工资 */
.payroll-summary > div:first-child strong { font-size: 18px; }
.payroll-sheet { margin-bottom: 16px; }
.payroll-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.payroll-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.payroll-toolbar label { color: #455064; font-size: 12px; font-weight: 700; }
.payroll-toolbar .input { width: 155px; min-height: 36px; }
.payroll-actions { justify-content: flex-end; }
.payroll-actions .btn { min-height: 36px; }
.payroll-timeoff-rule { flex: 1 1 330px; justify-content: flex-start; padding: 7px 10px; border-left: 3px solid #2c8b7d; background: #f4faf8; }
.payroll-timeoff-rule label { display: flex; align-items: center; gap: 7px; color: #176b62; white-space: nowrap; }
.payroll-timeoff-rule .payroll-cell-input { width: 74px; min-width: 74px; height: 30px; }
.payroll-timeoff-rule small { color: #5d6d7e; font-size: 11px; line-height: 1.35; }
.payroll-import-status { flex-basis: 100%; padding: 7px 10px; border: 1px solid #cfe3df; border-radius: 4px; background: #f1faf8; color: #176b62; font-size: 12px; line-height: 1.45; }
.payroll-import-status.error { border-color: #efc8cc; background: #fff5f5; color: #a43c46; }
.payroll-status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border: 1px solid #d7dde5; border-radius: 4px; color: #455064; font-size: 11px; font-weight: 700; white-space: nowrap; }
.payroll-status.archived { border-color: #9acbc4; background: #eef9f7; color: #0f6c63; }
.payroll-status.draft { border-color: #e4c688; background: #fff8e7; color: #7f5710; }
.payroll-form-error { min-height: 18px; color: #b9404a; font-size: 12px; }
.payroll-table-wrap { max-height: 560px; border: 1px solid #e1e6eb; }
.payroll-table { min-width: 1880px; }
.payroll-table th { position: sticky; top: 0; z-index: 3; background: #f7f9fb; white-space: nowrap; }
.payroll-table th:first-child,
.payroll-table td:first-child { position: sticky; left: 0; z-index: 2; min-width: 116px; background: #fff; }
.payroll-table th:first-child { z-index: 4; background: #f7f9fb; }
.payroll-table td { min-width: 105px; padding: 6px; vertical-align: middle; }
.payroll-table td:nth-child(4) { min-width: 208px; }
.payroll-table td:nth-child(9) { min-width: 150px; }
.payroll-table td:nth-child(14) { min-width: 180px; }
.payroll-name { display: table-cell; white-space: nowrap; }
.payroll-name button { width: 24px; height: 24px; margin-left: 6px; border: 0; background: transparent; color: #a43c46; font-size: 18px; cursor: pointer; }
.payroll-cell-input,
.payroll-label-input,
.payroll-note-input { box-sizing: border-box; width: 100%; min-width: 92px; height: 32px; border: 1px solid #cfd6df; border-radius: 4px; background: #fff; color: #172033; font: inherit; }
.payroll-cell-input { padding: 0 7px; text-align: right; }
.payroll-attendance-inputs { display: flex; min-width: 170px; flex-direction: column; gap: 4px; }
.payroll-attendance-inputs label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #667085; font-size: 10px; font-weight: 700; white-space: nowrap; }
.payroll-attendance-inputs .payroll-cell-input { width: 76px; min-width: 76px; }
.payroll-timeoff-inputs { display: grid; min-width: 196px; grid-template-columns: 1fr 1fr; gap: 5px 8px; }
.payroll-timeoff-inputs label { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #667085; font-size: 10px; font-weight: 700; white-space: nowrap; }
.payroll-timeoff-inputs .payroll-cell-input { width: 58px; min-width: 58px; height: 27px; }
.payroll-timeoff-inputs strong { color: #176b62; font-size: 11px; }
.payroll-timeoff-summary { display: grid; gap: 3px; color: #667085; font-size: 11px; }
.payroll-timeoff-summary strong { color: #176b62; }
.payroll-derived-input { background: #f3f5f7; color: #667085; }
.payroll-label-input { height: 24px; margin-bottom: 4px; padding: 0 6px; color: #455064; font-size: 10px; }
.payroll-piecework { display: grid; gap: 3px; min-width: 132px; color: #526174; font-size: 11px; line-height: 1.25; white-space: nowrap; }
.payroll-piecework span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.payroll-piecework strong { color: #176b62; font-size: 13px; }
.payroll-slip-action .btn { min-width: 58px; min-height: 30px; padding: 0 8px; color: #2156a5; font-size: 11px; }
.payroll-slip-overlay { z-index: 2800; padding: 20px; }
.payroll-slip-modal { width: min(600px, calc(100vw - 32px)); max-width: 600px; border-top-color: #2156a5; }
.payroll-slip-modal .modal-body { padding: 18px; background: #f3f5f7; }
.payroll-slip-card { overflow: hidden; border: 1px solid #d7dde5; border-top: 6px solid #2156a5; background: #fff; color: #172033; }
.payroll-slip-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 17px; border-bottom: 1px solid #d7dde5; }
.payroll-slip-card header span { display: block; color: #667085; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.payroll-slip-card h3 { margin: 5px 0 0; font-size: 20px; line-height: 1.25; }
.payroll-slip-card header > strong { padding-top: 5px; font-size: 22px; white-space: nowrap; }
.payroll-slip-meta { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 7px 12px; padding: 15px 22px; border-bottom: 1px solid #e9edf1; color: #667085; font-size: 11px; }
.payroll-slip-meta strong { overflow: hidden; color: #344054; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.payroll-slip-card section { padding: 16px 22px 0; }
.payroll-slip-card h4 { margin: 0; padding-bottom: 8px; border-bottom: 1px solid #d7dde5; color: #344054; font-size: 13px; }
.payroll-slip-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 38px; padding: 9px 0; border-bottom: 1px solid #edf0f3; }
.payroll-slip-row span { color: #344054; font-size: 13px; }
.payroll-slip-row small { display: block; margin-top: 3px; color: #8d97a6; font-size: 11px; }
.payroll-slip-row strong { flex: 0 0 auto; padding-top: 1px; font-size: 13px; white-space: nowrap; }
.payroll-slip-row .income { color: #147d72; }
.payroll-slip-row .deduction { color: #b9404a; }
.payroll-slip-empty { padding: 12px 0 3px; color: #8d97a6; font-size: 12px; }
.payroll-slip-notes { margin: 16px 22px 0; color: #667085; font-size: 12px; line-height: 1.55; }
.payroll-slip-card footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 22px 22px; padding: 15px 17px; background: #173b6c; color: #fff; }
.payroll-slip-card footer span { font-size: 13px; font-weight: 700; }
.payroll-slip-card footer strong { font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: 25px; line-height: 1; white-space: nowrap; }
.payroll-note-input { min-width: 165px; padding: 0 7px; }
.payroll-cell-input:focus,
.payroll-label-input:focus,
.payroll-note-input:focus { border-color: #2156a5; outline: 2px solid rgba(33,86,165,.12); }
.payroll-final { color: #147d72; font-weight: 800; white-space: nowrap; }
.payroll-inline-money { display: block; margin-top: 4px; white-space: nowrap; }
.payroll-month-notes { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 12px; color: #455064; font-size: 12px; font-weight: 700; }
.payroll-month-notes .input { width: 100%; }
.payroll-lower-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; }
.payroll-history-table tbody tr { cursor: pointer; }
.payroll-history-table tbody tr:hover { background: #f5f8fc; }
.payroll-employee-form { margin-bottom: 16px; }
.payroll-employee-fields { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; }
.payroll-employee-fields label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #344054; font-size: 12px; font-weight: 700; }
.payroll-employee-fields .input { width: 100%; }
.payroll-field-wide { grid-column: span 2; }
.payroll-employee-table { min-width: 730px; }

@media (max-width: 1120px) {
  .payroll-lower-grid { grid-template-columns: 1fr; }
  .payroll-employee-fields { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 760px) {
  .payroll-toolbar { align-items: stretch; flex-direction: column; }
  .payroll-toolbar > div:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .payroll-timeoff-rule { width: 100%; }
  .payroll-toolbar .input { width: 100%; min-width: 0; font-size: 16px; }
  .payroll-actions { display: grid !important; grid-template-columns: 1fr 1fr; }
  .payroll-actions .btn { width: 100%; }
  .payroll-table-wrap { max-height: 66vh; }
  .payroll-cell-input,
  .payroll-label-input,
  .payroll-note-input { font-size: 16px; }
  .payroll-employee-fields { grid-template-columns: 1fr 1fr; }
  .payroll-field-wide { grid-column: 1 / -1; }
  .payroll-month-notes { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .payroll-employee-fields { grid-template-columns: 1fr; }
  .payroll-field-wide { grid-column: auto; }
}
.overview-dashboard button { font: inherit; color: inherit; }
.overview-heading {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 0 0 20px; border-bottom: 1px solid #CCD2DA;
}
.overview-eyebrow { color: var(--ops-blue); font-size: 0.68rem; font-weight: 800; letter-spacing: 0; }
.overview-heading h2 { margin: 4px 0 3px; font-size: 1.65rem; line-height: 1.2; letter-spacing: 0; }
.overview-heading p { margin: 0; color: var(--ops-muted); font-size: 0.82rem; }
.overview-health {
  min-width: 238px; display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 6px;
}
.overview-health-dot { width: 9px; height: 28px; flex: 0 0 auto; border-radius: 2px; background: var(--ops-teal); }
.overview-health.needs-attention .overview-health-dot { background: var(--ops-red); }
.overview-health strong, .overview-health small { display: block; }
.overview-health strong { font-size: 0.82rem; }
.overview-health small { margin-top: 2px; color: var(--ops-muted); font-size: 0.69rem; }

.overview-kpi-band {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #FFFFFF; border-bottom: 1px solid #D9DEE5; margin-bottom: 22px;
}
.overview-kpi {
  min-width: 0; min-height: 124px; padding: 20px 22px; text-align: left;
  background: transparent; border: 0; border-right: 1px solid #E4E7EC;
}
button.overview-kpi { cursor: pointer; }
.overview-kpi:last-child { border-right: 0; }
.overview-kpi:hover { background: #F8FAFC; }
.overview-kpi-label { display: block; color: var(--ops-muted); font-size: 0.75rem; font-weight: 700; }
.overview-kpi-label em {
  display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 3px;
  color: #7C2D12; background: #FFEDD5; font-size: 0.62rem; font-style: normal;
}
.overview-kpi strong {
  display: block; margin: 8px 0 5px; font-size: 1.85rem; line-height: 1;
  color: var(--ops-ink); overflow-wrap: anywhere;
}
.overview-kpi.profit strong { color: var(--ops-teal); }
.overview-kpi.profit.negative strong { color: var(--ops-red); }
.overview-kpi small { display: block; min-height: 28px; color: var(--ops-muted); font-size: 0.68rem; line-height: 1.45; }

.overview-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.overview-flow, .overview-alerts, .overview-snapshot { background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 6px; }
.overview-block-heading {
  min-height: 62px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid #E4E7EC;
}
.overview-block-heading span { display: block; color: var(--ops-blue); font-size: 0.64rem; font-weight: 800; }
.overview-block-heading h3 { margin: 2px 0 0; font-size: 0.94rem; letter-spacing: 0; }
.overview-block-heading > small { color: var(--ops-muted); font-size: 0.68rem; text-align: right; }
.overview-flow-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px 0; }
.overview-flow-step {
  position: relative; min-width: 0; min-height: 190px; padding: 22px 18px 18px; text-align: left;
  background: transparent; border: 0; border-right: 1px solid #E4E7EC; cursor: pointer;
}
.overview-flow-step:last-child { border-right: 0; }
.overview-flow-step:hover { background: #F8FAFC; }
.overview-step-index { display: block; color: #98A2B3; font: 700 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.overview-flow-step > strong { display: block; margin-top: 18px; font-size: 1.75rem; line-height: 1; }
.overview-flow-step > span:not(.overview-step-index) { display: block; margin-top: 7px; font-size: 0.76rem; font-weight: 700; }
.overview-flow-step > small { display: block; min-height: 32px; margin-top: 4px; color: var(--ops-muted); font-size: 0.66rem; line-height: 1.4; }
.overview-flow-step i { display: block; height: 5px; margin-top: 18px; overflow: hidden; background: #E7EAF0; border-radius: 2px; }
.overview-flow-step i b { display: block; height: 100%; background: var(--ops-blue); border-radius: inherit; }
.overview-flow-step:nth-child(3) i b { background: var(--ops-amber); }
.overview-flow-step:nth-child(4) i b { background: var(--ops-teal); }

.overview-alert-list { padding: 6px 10px 10px; }
.overview-alert-row {
  width: 100%; min-height: 56px; display: grid; grid-template-columns: 5px minmax(0, 1fr) auto 12px;
  align-items: center; gap: 10px; padding: 8px 7px; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid #EEF0F3; cursor: pointer;
}
.overview-alert-row:last-child { border-bottom: 0; }
.overview-alert-row:hover { background: #F8FAFC; }
.overview-alert-mark { width: 5px; height: 31px; border-radius: 2px; background: #CBD5E1; }
.overview-alert-row.warning.has-value .overview-alert-mark { background: var(--ops-amber); }
.overview-alert-row.critical.has-value .overview-alert-mark { background: var(--ops-red); }
.overview-alert-copy { min-width: 0; }
.overview-alert-copy strong, .overview-alert-copy small { display: block; }
.overview-alert-copy strong { font-size: 0.76rem; }
.overview-alert-copy small { margin-top: 2px; color: var(--ops-muted); font-size: 0.64rem; overflow-wrap: anywhere; }
.overview-alert-row > b { min-width: 25px; text-align: right; font-size: 1rem; }
.overview-alert-row.critical.has-value > b { color: var(--ops-red); }
.overview-alert-row.warning.has-value > b { color: var(--ops-amber); }
.overview-alert-arrow { color: #98A2B3; font-size: 1.1rem; }

.overview-snapshot { margin-top: 20px; }
.overview-snapshot-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.overview-snapshot-grid > button, .overview-snapshot-grid > div {
  min-width: 0; min-height: 106px; padding: 16px; text-align: left; background: transparent;
  border: 0; border-right: 1px solid #E4E7EC;
}
.overview-snapshot-grid > :last-child { border-right: 0; }
.overview-snapshot-grid > button { cursor: pointer; }
.overview-snapshot-grid > button:hover { background: #F8FAFC; }
.overview-snapshot-grid span, .overview-snapshot-grid strong, .overview-snapshot-grid small { display: block; }
.overview-snapshot-grid span { color: var(--ops-muted); font-size: 0.7rem; font-weight: 700; }
.overview-snapshot-grid strong { margin-top: 9px; font-size: 1.35rem; }
.overview-snapshot-grid small { margin-top: 4px; color: var(--ops-muted); font-size: 0.64rem; overflow-wrap: anywhere; }
.overview-dashboard button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.28); outline-offset: -3px; }

@media (max-width: 1180px) {
  .overview-workspace { grid-template-columns: 1fr; }
  .overview-alert-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .overview-alert-row:nth-last-child(2) { border-bottom: 0; }
  .overview-snapshot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-snapshot-grid > :nth-child(3) { border-right: 0; }
  .overview-snapshot-grid > :nth-child(-n+3) { border-bottom: 1px solid #E4E7EC; }
}

@media (max-width: 900px) {
  .overview-dashboard { padding: 22px 24px 36px; }
  .overview-kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-kpi:nth-child(2) { border-right: 0; }
  .overview-kpi:nth-child(-n+2) { border-bottom: 1px solid #E4E7EC; }
  .overview-flow-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-flow-step:nth-child(2) { border-right: 0; }
  .overview-flow-step:nth-child(-n+2) { border-bottom: 1px solid #E4E7EC; }
}

@media (max-width: 640px) {
  .overview-dashboard { padding: 16px 12px 28px; }
  .overview-heading { align-items: stretch; flex-direction: column; gap: 13px; }
  .overview-heading h2 { font-size: 1.35rem; }
  .overview-health { min-width: 0; }
  .overview-kpi-band { grid-template-columns: 1fr; }
  .overview-kpi { min-height: 108px; border-right: 0; border-bottom: 1px solid #E4E7EC; padding: 16px; }
  .overview-kpi:nth-child(2) { border-right: 0; }
  .overview-kpi:nth-child(3) { border-right: 0; }
  .overview-kpi:last-child { border-bottom: 0; }
  .overview-kpi strong { font-size: 1.55rem; }
  .overview-block-heading { align-items: flex-start; }
  .overview-block-heading > small { max-width: 42%; }
  .overview-flow-track { grid-template-columns: 1fr; }
  .overview-flow-step { min-height: 136px; border-right: 0; border-bottom: 1px solid #E4E7EC; padding: 16px; }
  .overview-flow-step:nth-child(2) { border-right: 0; }
  .overview-flow-step:last-child { border-bottom: 0; }
  .overview-flow-step > strong { margin-top: 10px; }
  .overview-flow-step > small { min-height: 0; }
  .overview-flow-step i { margin-top: 12px; }
  .overview-alert-list { display: block; }
  .overview-alert-row:nth-last-child(2) { border-bottom: 1px solid #EEF0F3; }
  .overview-snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-snapshot-grid > :nth-child(3) { border-right: 1px solid #E4E7EC; }
  .overview-snapshot-grid > :nth-child(2n) { border-right: 0; }
  .overview-snapshot-grid > :nth-child(-n+4) { border-bottom: 1px solid #E4E7EC; }
}

/* ═══════════════════════════════════════════════
   8. VIP 面板 — 紫色主题 (VIP = 紫带)
   ═══════════════════════════════════════════════ */
.vip-regular-panel { padding: 0 40px 12px; }
.vip-regular-header {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  padding: 10px 0 6px;
}
.vip-table-wrap { overflow-x: auto; }
.vip-table {
  width: 100%; border-collapse: collapse; background: var(--card-bg);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.vip-table thead { background: #F8F5FC; }
.vip-table th {
  text-align: left; padding: 8px 10px; font-size: 0.72rem; font-weight: 700;
  color: var(--belt-purple); text-transform: uppercase; letter-spacing: 0.3px;
  border-bottom: 2px solid var(--belt-purple); white-space: nowrap;
}
.vip-table td {
  padding: 8px 10px; font-size: 0.84rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.vip-table tbody tr:hover { background: #FAF7FD; }
.vip-table tbody tr.row-vip { background: #FDFAFF; }
.vip-table tbody tr.row-vip:hover { background: #F8F3FC; }
.td-vip-name {
  font-weight: 600; cursor: pointer; color: var(--primary);
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.td-vip-name:hover { color: var(--primary-hover); }
.source-tag {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 0.7rem; background: var(--field); color: var(--text-secondary);
  margin-right: 3px; white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   9. 工具栏 — 货运调度控制条
   ═══════════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 40px 10px;
  max-width: 100%; flex-wrap: wrap; overflow-x: visible;
  background: var(--doc); border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.filter-group { display: flex; gap: 5px; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; overflow: hidden; }
.filter-group .input { max-width: 110px; padding: 6px 8px; font-size: 0.78rem; flex-shrink: 0; }
.filter-group .site-order-filter { max-width: 132px; font-weight: 700; color: #17365d; }

/* ═══════════════════════════════════════════════
   10. 输入框 — 底边线 focus 风格
   ═══════════════════════════════════════════════ */
.input {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.86rem; font-family: inherit; background: var(--card-bg); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none; border-bottom-color: var(--primary);
  box-shadow: 0 2px 0 0 var(--primary); border-color: var(--primary);
}
.input:disabled { background: var(--field); color: var(--muted-ink); cursor: not-allowed; opacity: 1; }
select.input {
  cursor: pointer; appearance: none; -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  position: relative; z-index: 1;
}
textarea.input { resize: vertical; }

/* ═══════════════════════════════════════════════
   11. 按钮系统
   ═══════════════════════════════════════════════ */
.btn {
  padding: 8px 18px; border: none; border-radius: var(--radius-sm);
  font-size: 0.86rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-warn {
  background: var(--mat-yellow); color: #111827; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  padding: 4px 12px; font-size: 0.76rem; font-weight: 600;
}
.btn-warn:hover { background: #D4A30E; }
.btn-outline { background: var(--card-bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--gold); color: #fff; border: none; }
.btn-accent:hover { background: #B0830A; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 4px 10px; font-size: 0.76rem; }
.btn-copy {
  background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0;
}
.btn-copy:hover { background: #D1FAE5; border-color: #34D399; }
.btn-clone {
  background: #F5F0FA; color: #6D28D9; border: 1px solid #C4B5FD;
}
.btn-clone:hover { background: #EDE9FE; border-color: #8B5CF6; }
.btn-back {
  background: #fff; color: var(--primary); border: 2px solid var(--primary);
  font-weight: 700;
}
.btn-back:hover { background: #EEF2F8; }

.btn-micro {
  padding: 3px 10px; font-size: 0.7rem; border-radius: var(--radius-sm);
  font-weight: 600; white-space: nowrap; flex-shrink: 0; cursor: pointer;
  line-height: 1.3; font-family: inherit; transition: all 0.15s;
  border: 1.5px solid var(--rule-dark); background: #fff; color: var(--primary);
}
.btn-micro:hover { background: #EEF2F8; border-color: var(--primary); }

/* ═══════════════════════════════════════════════
   12. 发货包裹行
   ═══════════════════════════════════════════════ */
.tracking-bundle-row {
  background: var(--field); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
}
.tracking-bundle-row.tracking-bundle-accident { background: #FFF7F7; border-color: #DC2626; box-shadow: inset 3px 0 0 #DC2626; }
.bundle-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; font-size: 0.76rem; font-weight: 600; color: var(--text-secondary);
}
.bundle-header-actions { display: flex; align-items: center; gap: 6px; }
.bundle-accident-status { width: 82px; min-height: 30px; padding: 4px 24px 4px 8px; font-size: 0.74rem; font-weight: 700; }
.tracking-bundle-accident .bundle-accident-status { color: #B91C1C; border-color: #DC2626; background: #fff; }
.bundle-accident-fields { align-items: flex-end; gap: 12px; padding-top: 8px; margin-top: 8px; border-top: 1px solid #FECACA; }
.bundle-accident-fields .form-group { width: 180px; margin: 0; }
.bundle-accident-fields label { font-size: 0.7rem; }
.bundle-accident-hint { padding-bottom: 8px; font-size: 0.72rem; color: #991B1B; }
.package-derived-status:disabled { opacity: 1; color: #B91C1C; background: #FFF1F2; border-color: #DC2626; font-size: 0.75rem; font-weight: 700; cursor: default; }
.btn-remove-bundle {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 0.9rem; padding: 2px 6px; border-radius: var(--radius-sm);
}
.btn-remove-bundle:hover { background: var(--stamp-bg); }
.bundle-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-end; }
.bundle-row .form-group { margin-bottom: 0; }
.bundle-row .form-group label { font-size: 0.7rem; }
.bundle-row .form-group input { width: 100%; box-sizing: border-box; min-width: 0; }
.bundle-row .form-group .bundle-tracking-wrap { display: flex; gap: 4px; align-items: flex-end; }
.btn-track-lookup {
  width: 30px; height: 30px; flex-shrink: 0;
  background: #EEF2F8; border: 1px solid var(--rule-dark); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center;
  padding: 0; color: var(--primary); transition: all 0.15s;
}
.btn-track-lookup:hover:not(:disabled) { background: #DDE4F0; border-color: var(--primary); }
.btn-track-lookup:disabled { opacity: 0.35; cursor: not-allowed; }
.bundle-products { display: flex; align-items: flex-start; gap: 10px; margin-top: 2px; }

.multi-select-wrap { position: relative; flex-shrink: 0; }
.bundle-select-btn { font-size: 0.73rem; padding: 4px 10px; }
.multi-select-drop {
  position: absolute; top: 100%; left: 0; z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12); min-width: 160px; max-height: 200px;
  overflow-y: auto; padding: 4px 0;
}
.multi-select-opt {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px;
  font-size: 0.78rem; cursor: pointer; white-space: nowrap;
}
.multi-select-opt:hover { background: #EEF2F8; }
.multi-select-opt input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }

.bundle-thumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bundle-thumb-wrap {
  position: relative; display: flex; flex-direction: column; align-items: center;
}
.bundle-thumb-img {
  width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover;
  border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s;
}
.bundle-thumb-label {
  font-size: 0.58rem; color: var(--text-secondary); max-width: 40px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}

/* ═══════════════════════════════════════════════
   13. 物流追踪按钮
   ═══════════════════════════════════════════════ */
.track-btn {
  display: inline-block; padding: 2px 8px; font-size: 0.73rem; font-weight: 600;
  background: #EEF2F8; color: var(--primary);
  border: 1px solid var(--rule-dark); border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  text-decoration: none; white-space: nowrap; vertical-align: middle;
  transition: all 0.15s; cursor: pointer; margin-left: 2px;
}
.track-btn:hover { background: #DDE4F0; border-color: var(--primary); }
.track-btn-17 {
  display: inline-block; padding: 2px 6px; font-size: 0.68rem; font-weight: 600;
  background: #FEF9E7; color: #92400E; border: 1px solid #FCD34D; border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-decoration: none; white-space: nowrap;
  vertical-align: middle; transition: all 0.15s; cursor: pointer;
}
.track-btn-17:hover { background: #FDE68A; border-color: #F59E0B; color: #78350F; }
.btn-resend {
  display: inline-block; padding: 1px 7px; font-size: 0.7rem; font-weight: 600;
  background: #FFF7ED; color: #C2410C; border: 1px solid #FDBA74; border-radius: var(--radius-sm);
  text-decoration: none; white-space: nowrap; vertical-align: middle;
  transition: all 0.15s; cursor: pointer; margin-left: 3px;
}
.btn-resend:hover { background: #FFEDD5; border-color: #F97316; color: #9A3412; }
.td-track { white-space: normal; word-break: break-all; }

/* ═══════════════════════════════════════════════
   14. 客户链接
   ═══════════════════════════════════════════════ */
.customer-link {
  cursor: pointer; color: var(--primary); transition: color 0.12s;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px; text-decoration-color: var(--rule-dark);
}
.customer-link:hover { color: var(--primary-hover); text-decoration-color: var(--primary); }

/* ═══════════════════════════════════════════════
   15. 刷新提示条
   ═══════════════════════════════════════════════ */
.refresh-banner {
  background: #FFFDF5; border: 1px solid var(--mat-yellow); border-radius: var(--radius);
  padding: 8px 16px; margin: 0 40px 8px; font-size: 0.80rem;
  color: #92400E; cursor: pointer; text-align: center;
  transition: opacity 0.3s;
}
.refresh-banner:hover { background: #FEF9E7; }

/* ═══════════════════════════════════════════════
   16. 分页 — 吸顶条 + 控件
   ═══════════════════════════════════════════════ */
.pag-sticky {
  position: sticky; top: 0; z-index: 14;
  background: var(--fog); padding: 0 40px;
}
.pag-sticky:empty { display: none; }
.pagination {
  display: flex; justify-content: flex-start; align-items: center;
  padding: 4px 0 6px; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.pag-info { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }
.pag-btns { display: flex; gap: 3px; }
.pag-btn {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  font-size: 0.72rem; font-family: inherit; color: var(--text);
  transition: all 0.12s;
}
.pag-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pag-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pag-num.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pag-jump { font-size: 0.7rem; color: var(--text-secondary); white-space: nowrap; }
.pag-home-btn { margin-left: 12px; }
.pag-input {
  width: 40px; padding: 2px 4px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.7rem; font-family: inherit; text-align: center;
}
.pag-input:focus { outline: none; border-color: var(--primary); }

/* ═══════════════════════════════════════════════
   17. 包裹徽章
   ═══════════════════════════════════════════════ */
.package-badge {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  font-size: 0.68rem; font-weight: 700; cursor: pointer;
  background: #F5F0FA; color: var(--belt-purple); margin-top: 2px;
  transition: transform 0.12s;
}
.package-badge:hover { transform: scale(1.1); box-shadow: 0 1px 4px rgba(91,44,110,0.3); }
.btn-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); padding: 4px 8px; border-radius: var(--radius-sm); }
.btn-close:hover { background: var(--field); color: var(--text); }

/* ═══════════════════════════════════════════════
   18. 订单表格 — 核心复杂组件
   ═══════════════════════════════════════════════ */
.table-container {
  flex: 1; min-height: 0; overflow-x: auto; overflow-y: auto;
  padding: 0 40px 0; max-width: 100%; max-height: none;
}
.order-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card-bg); min-width: 1200px; table-layout: fixed;
  overflow-anchor: none;
}
.order-table thead th {
  position: sticky; top: 0; z-index: 13;
  background: var(--field);
  text-align: left; padding: 7px 6px; font-size: 0.68rem; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px;
  border-bottom: 2px solid var(--belt-blue); /* 蓝腰带头 */
  white-space: nowrap;
  box-shadow: 0 2px 4px -2px rgba(0,0,0,0.08);
}
.order-table td {
  padding: 6px 6px; font-size: 0.76rem; border-bottom: 1px solid var(--border);
  vertical-align: middle; background: #fff;
}
.order-table tbody tr:hover td { background: #F9F7F4; } /* 暖纸感 hover */

/* ---- 行高亮状态 ---- */
.row-void    { background: #FEE2E2 !important; }
.row-void td  { background: #FEE2E2 !important; }
.row-void:hover { background: #FECACA !important; }
.row-void:hover td { background: #FECACA !important; }
.row-accident { background: #FFF1F2 !important; }
.row-accident td { background: #FFF1F2 !important; }
.row-accident:hover { background: #FFE4E6 !important; }
.row-accident:hover td { background: #FFE4E6 !important; }
n.row-partial-void    { background: #FFF7ED !important; }
.row-partial-void td  { background: #FFF7ED !important; }
.row-partial-void:hover { background: #FFEDD5 !important; }
.row-partial-void:hover td { background: #FFEDD5 !important; }
.row-unpaid  { background: #FEF9C3 !important; }
.row-unpaid td { background: #FEF9C3 !important; }
.row-unpaid:hover { background: #FEF08A !important; }
.row-unpaid:hover td { background: #FEF08A !important; }
.row-blacklist { background: #FEF2F2 !important; }
.row-blacklist td { background: #FEF2F2 !important; }
.row-blacklist:hover { background: #FECACA !important; }
.row-blacklist:hover td { background: #FECACA !important; }

/* ═══════════════════════════════════════════════
   19. Sticky 列 — 冻结列所有状态
   ═══════════════════════════════════════════════ */
.order-table th.sticky-col,
.order-table td.sticky-col {
  position: sticky;
  box-shadow: 4px 0 8px -4px rgba(0,0,0,0.12);
  z-index: 1;
}
.order-table thead th.sticky-col { background: var(--field); z-index: 12; }
.order-table tbody td.sticky-col { background: #fff; }
.order-table tbody tr:hover td.sticky-col { background: #F9F7F4; }
.order-table tbody tr.row-blacklist td.sticky-col { background: #FEF2F2; }
.order-table tbody tr.row-blacklist:hover td.sticky-col { background: #FECACA; }
.order-table tbody tr.row-void td.sticky-col { background: #FEE2E2; }
.order-table tbody tr.row-void:hover td.sticky-col { background: #FECACA; }
.order-table tbody tr.row-accident td.sticky-col { background: #FFF1F2; }
.order-table tbody tr.row-accident:hover td.sticky-col { background: #FFE4E6; }
.order-table tbody tr.row-unpaid td.sticky-col { background: #FEF9C3; }
.order-table tbody tr.row-unpaid:hover td.sticky-col { background: #FEF08A; }
.order-table tbody tr.row-partial-void td.sticky-col { background: #FFF7ED; }
.order-table tbody tr.row-partial-void:hover td.sticky-col { background: #FFEDD5; }
.order-table tbody tr.row-cb-override td.sticky-col { background: #FEF2F2; }
.order-table tbody tr.row-cb-override:hover td.sticky-col { background: #FECACA; }

/* ═══════════════════════════════════════════════
   20. 表格单元格细节
   ═══════════════════════════════════════════════ */
.actions { display: flex; gap: 4px; white-space: nowrap; }

.thumb {
  width: 36px; height: 36px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; border: 1.5px solid var(--border); transition: transform 0.15s;
  flex-shrink: 0;
}
.thumb:hover { transform: scale(2.5); z-index: 10; position: relative; box-shadow: var(--shadow-lg); }
.no-img { color: var(--muted); font-size: 0.73rem; }

.td-addr {
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.74rem; cursor: pointer; transition: background 0.15s; position: relative;
}
.td-addr:hover { background: #EEF2F8; border-radius: var(--radius-sm); }
.td-price { font-weight: 700; color: var(--ink); white-space: nowrap; }
.td-notes { min-width: 160px; max-width: 240px; font-size: 0.74rem; line-height: 1.3; word-break: break-word; white-space: normal; }

.notes-textarea {
  width: 100%; min-width: 140px; padding: 3px 5px; font-size: 0.74rem; line-height: 1.35;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  resize: none; overflow-y: auto; font-family: inherit; color: var(--text);
  min-height: 24px; max-height: 56px;
  transition: border-color 0.15s, background 0.15s;
}
.notes-textarea:focus { border-color: var(--primary); background: #fff; outline: none; max-height: 160px; }
.notes-textarea:hover:not(:focus) { border-color: var(--border); background: #FAFAFA; }
.notes-textarea::-webkit-scrollbar { width: 4px; }
.notes-textarea::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 2px; }

.td-date { white-space: nowrap; font-size: 0.74rem; color: var(--text-secondary); }
.td-customer { white-space: normal; word-break: break-all; font-weight: 600; }
.td-address, th[data-col="address"] { min-width: 220px; }
.td-address { font-size: 0.8rem; line-height: 1.35; word-break: break-word; white-space: normal; }
.addr-text { overflow-wrap: break-word; word-break: break-word; }
.td-orderno { min-width: 110px; white-space: normal; word-break: break-all; font-size: 0.76rem; }
.td-orderno:hover { color: var(--primary-hover) !important; }
.orderno-text {
  cursor: pointer; color: var(--primary); text-decoration: underline;
  text-underline-offset: 3px; font-weight: 700;
}
.orderno-text:hover { color: var(--primary-hover); }

/* 合并单元格 */
.merged-cell { line-height: 1.3; }
.merged-main { font-weight: 600; display: block; word-break: break-word; white-space: normal; font-size: 0.76rem; max-height: 2.4em; overflow: hidden; }
.merged-sub { font-size: 10px; color: var(--muted-ink); display: block; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merged-sub2 { font-size: 0.74rem; display: block; margin-top: 1px; }

.bundle-cell-stack { display: flex; flex-direction: column; gap: 4px; }
.bundle-cell-row { min-height: 32px; display: flex; flex-direction: column; justify-content: center; }
.bundle-cell-row + .bundle-cell-row { border-top: 1px dashed var(--rule); padding-top: 3px; }
.bundle-cell-sub { font-size: 10px; color: var(--muted-ink); display: block; margin-top: 2px; }
.bundle-track-init { font-size: 0.72rem; font-family: var(--font-mono, monospace); }
.bundle-track-tn { font-size: 0.72rem; font-family: var(--font-mono, monospace); display: block; margin-top: 1px; }

.orderno-link { cursor: pointer; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; font-family: monospace; font-size: 0.78rem; }
.orderno-link:hover { color: var(--primary-hover); }
.cust-name-link { cursor: pointer; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.cust-name-link:hover { color: var(--primary-hover); }

.notes-brief { font-size: 0.78rem; color: var(--text-secondary); cursor: default; }
.text-muted { color: var(--muted); font-size: 0.74rem; }

/* 订单详情展开面板 */
.order-detail-row { background: var(--field); }
.order-detail-row td { padding: 0 !important; }
.order-detail-panel { padding: 16px 20px; }
.detail-images { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-images img { max-width: 200px; max-height: 150px; border-radius: var(--radius); border: 1px solid var(--rule); }
.detail-note { font-size: 0.82rem; color: var(--muted-ink); margin-bottom: 10px; padding: 6px 10px; background: var(--field); border-radius: var(--radius-sm); border-left: 3px solid var(--belt-blue); }
.detail-actions { margin-top: 0; display: flex; gap: 8px; }
.bundle-accident-summary { display: block; margin-bottom: 4px; color: #B91C1C; font-size: 0.68rem; font-weight: 700; }
.bundle-resend-linked { display: inline-block; color: #166534; font-size: 0.66rem; font-weight: 700; }

.detail-bundle-list { margin-bottom: 10px; border: 1px solid var(--rule); border-radius: var(--radius-sm); overflow: hidden; }
.detail-bundle-head { padding: 8px 12px; background: var(--field); border-bottom: 1px solid var(--rule); color: var(--muted-ink); font-size: 0.8rem; font-weight: 700; }
.detail-bundle-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; background: #fff; border-bottom: 1px solid var(--rule); }
.detail-bundle-row:last-child { border-bottom: none; }
.detail-bundle-accident { background: #FFF1F2; box-shadow: inset 3px 0 0 #DC2626; }
.detail-bundle-index { color: var(--text-secondary); font-size: 0.74rem; font-weight: 700; }
.detail-bundle-main { min-width: 0; }
.detail-bundle-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted-ink); font-size: 0.74rem; overflow-wrap: anywhere; }
.detail-bundle-products { margin-top: 4px; color: var(--text-secondary); font-size: 0.72rem; line-height: 1.45; }
.detail-bundle-comp { color: #B91C1C; font-size: 0.7rem; font-weight: 700; }
.detail-bundle-action { justify-self: end; }

/* 多产品逐产品状态清单（订单详情面板 · Phase 1 纯展示） */
.prod-status-list { margin-bottom: 10px; border: 1px solid var(--rule); border-radius: var(--radius-sm); overflow: hidden; }
.prod-status-head { font-size: 0.8rem; font-weight: 700; color: var(--muted-ink); padding: 8px 12px; background: var(--field); border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prod-status-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--rule); background: #fff; }
.prod-status-row:last-child { border-bottom: none; }
.prod-status-void { opacity: 0.55; background: #fafafa; }
.prod-status-void .prod-status-name { text-decoration: line-through; }
.prod-status-idx { flex-shrink: 0; width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--belt-blue); border-radius: 50%; }
.prod-status-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prod-status-title { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.prod-status-meta { font-size: 0.7rem; font-weight: 400; color: var(--text-secondary); }
.prod-status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.73rem; }
.prod-status-prep { color: var(--muted-ink); }
.prod-status-fallback { font-size: 0.66rem; color: var(--text-secondary); }
.prod-status-track { color: var(--text-secondary); font-family: monospace; font-size: 0.72rem; }
.btn-filter-orderno { background: none; border: none; cursor: pointer; font-size: 0.73rem; padding: 0 2px; opacity: 0.5; }
.btn-filter-orderno:hover { opacity: 1; }

.td-product { position: relative; min-width: 140px; padding-right: 24px !important; }
.prod-name { font-weight: 500; line-height: 1.25; font-size: 0.75rem; }
.prod-code { font-size: 0.68rem; color: var(--text-secondary); line-height: 1.25; }
.prod-color { font-size: 0.68rem; color: var(--text-secondary); line-height: 1.25; }
.btn-edit-product { position: absolute; right: 4px; top: 6px; background: var(--field); border: 1px solid var(--border); cursor: pointer; font-size: 0.65rem; padding: 1px 4px; border-radius: var(--radius-sm); opacity: 0; transition: opacity 0.15s; }
.td-product:hover .btn-edit-product { opacity: 1; }
.btn-edit-product:hover { background: var(--rule); }

/* ═══════════════════════════════════════════════
   21. 销售统计增强
   ═══════════════════════════════════════════════ */
.sales-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.sales-compare { font-size: 0.82rem; color: var(--text-secondary); padding: 4px 12px; background: var(--field); border-radius: var(--radius); }
.chart-row { padding: 0 16px; margin: 12px 0; }
.chart-row-2 { display: flex; gap: 16px; }
.chart-box { background: var(--card-bg); border-radius: var(--radius); padding: 12px 8px; box-shadow: var(--shadow); }
.chart-box h4 { font-size: 0.78rem; color: var(--text-secondary); margin: 0 0 8px 4px; }
.chart-wrap { width: 100%; }
.chart-box-half { flex: 1; min-width: 0; }

.cs-board { margin: 16px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cs-board-header { padding: 12px 20px; font-size: 0.85rem; font-weight: 700; cursor: pointer; user-select: none; background: var(--field); border-bottom: 1px solid var(--border); }
.cs-board-body { padding: 0; }
.cs-table { width: 100%; border-collapse: collapse; }
.cs-table th { text-align: left; padding: 8px 12px; font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--border); background: #FAFAFA; }
.cs-table td { padding: 8px 12px; font-size: 0.82rem; border-bottom: 1px solid var(--field); }

/* ═══════════════════════════════════════════════
   22. 单号复制按钮
   ═══════════════════════════════════════════════ */
.td-track, .td-initial-track { position: relative; white-space: nowrap; }
.inline-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-left: 2px;
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--field); color: var(--muted-ink); cursor: pointer;
  font-size: 0.7rem; vertical-align: middle;
  transition: all 0.15s;
}
.inline-copy-btn:hover { background: #EEF2F8; color: var(--primary); border-color: var(--rule-dark); }
.inline-copy-btn:active { transform: scale(0.92); }
.inline-copy-btn.copied { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }

/* ═══════════════════════════════════════════════
   23. Badge 系统 — 25+ 状态标签
   ═══════════════════════════════════════════════ */
.country-badge, .status-badge {
  display: inline-block; padding: 1px 6px; border-radius: 14px;
  font-size: 0.68rem; font-weight: 600; white-space: nowrap; line-height: 1.35;
}
.country-badge { background: #EEF2F8; color: var(--primary); }

/* 订单来源 */
.badge-card      { background: #EEF2F8; color: var(--primary); }
.badge-whatsapp  { background: #D1FAE5; color: #065F46; }
.badge-wechat    { background: #DCFCE7; color: #166534; }
.badge-instagram { background: #FCE7F3; color: #9D174D; }
.badge-email     { background: #EEF2F8; color: var(--primary); }
.badge-backend   { background: var(--field); color: #374151; }

/* 发货状态 */
.badge-pending { background: #F5F5F0; color: var(--muted-ink); }       /* 白带=待处理 */
.badge-packed  { background: #DBEAFE; color: #1E40AF; }                /* 蓝带=已打包 */
.badge-qc      { background: #FCE7F3; color: #831843; }                /* 品检 */
.badge-shipped { background: #DBEAFE; color: var(--primary); }          /* 蓝带=已发货 */
.badge-problem { background: #FEF2F2; color: var(--priority); border: 1px solid var(--priority); } /* 红标=问题 */
.badge-void    { background: #E5E7EB; color: #6B7280; }                 /* 灰带=作废 */
.badge-ps-pending   { background: #EFF6FF; color: #2563EB; border: 1px solid #93C5FD; } /* 待处理-中性蓝 */
.badge-ps-contacted { background: #FFFBEB; color: #D97706; border: 1px solid #D97706; } /* 已联系-黄 */
.badge-ps-followup  { background: #FFF7ED; color: #EA580C; border: 1px solid #EA580C; } /* 待跟进-橙 */
.badge-ps-resolved  { background: #F0FDF4; color: #16A34A; border: 1px solid #16A34A; } /* 已解决-绿 */
.badge-prep    { background: #E0F2FE; color: #0369A1; }                /* 备货 */

/* 物流状态 */
.badge-log-pending   { background: var(--field); color: var(--muted-ink); }
.badge-log-transit   { background: #DBEAFE; color: #1E40AF; }
.badge-log-customs   { background: #FEF3C7; color: #92400E; }
.badge-log-seized    { background: #FEE2E2; color: #991B1B; }
.badge-log-delivered { background: #E5E7EB; color: var(--belt-black); } /* 黑带=已送达 */

/* 客户分类 */
.badge-vip       { background: #F5F0FA; color: var(--belt-purple); }    /* 紫带=VIP */
.badge-regular   { background: #DBEAFE; color: #1E40AF; }               /* 蓝带=常客 */
.badge-blacklist { background: #FECACA; color: var(--priority); font-weight: 700; }
.badge-influencer { background: #FEF3C7; color: #B45309; font-weight: 700; }  /* 金带=达人 */
.badge-chargeback { background: var(--priority); color: #fff; font-weight: 700; }
.order-table tbody .badge-chargeback { background: var(--priority); color: #fff; }

/* 付款状态 */
.badge-paid       { background: #D1FAE5; color: #065F46; }
.badge-unpaid     { background: #7C2D12; color: #FEF3C7; font-weight: 700; }
.badge-paymethod  { background: var(--field); color: #374151; }

/* 其他 */
.badge-quality  { background: #EEF2F8; color: #1E40AF; }
.badge-va       { background: #FCE7F3; color: #9D174D; margin: 0 2px; white-space: nowrap; display: inline-block; }
.badge-danger   { background: var(--stamp-bg); color: var(--priority); font-weight: 600; }
.badge-exchange { background: #FEF3C7; color: #92400E; }
.badge-multi    { color: var(--priority); font-size: 0.6rem; font-weight: 700; white-space: nowrap; }
.badge-dup      { color: #111827; background: var(--mat-yellow); font-size: 0.6rem; font-weight: 700; padding: 1px 5px; border-radius: 8px; white-space: nowrap; }
.badge-cb-override { color: #fff; background: var(--priority); font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.badge-carrier  { background: #EEF2F8; color: var(--primary); }

.dup-order-link { color: var(--primary); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 0.76rem; }
.dup-order-link:hover { color: var(--belt-purple); }

/* ═══════════════════════════════════════════════
   24. 批量操作栏 — 黑底白字指令条
   ═══════════════════════════════════════════════ */
.batch-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--belt-black); color: #fff; border-radius: var(--radius);
  font-size: 0.80rem;
  flex: 1 0 100%; order: 100; flex-wrap: wrap;
}
.batch-bar .btn-sm { font-size: 0.73rem; padding: 3px 10px; }
.batch-bar .btn-outline { border-color: rgba(255,255,255,0.3); color: #fff; background: transparent; }
.batch-bar .btn-outline:hover { background: rgba(255,255,255,0.15); border-color: #fff; }
.batch-bar .btn-danger { background: var(--danger); }
.batch-label { display: flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.batch-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--gold); }
.master-cb { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); margin: 0; }
td[data-col="_select"] { width: 30px; min-width: 30px; text-align: center; padding: 0 3px; }
td[data-col="_select"] .batch-cb { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); margin: 0; }
.shopyy-push-filter { text-align: left; cursor: pointer; }
.shopyy-push-filter.active { border-color: #DC2626; background: #FEF2F2; color: #B42318; font-weight: 700; }
.mobile-page-select {
  display: none; align-items: center; gap: 8px; color: var(--text-secondary);
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.mobile-page-select input { width: 20px; height: 20px; cursor: pointer; accent-color: var(--primary); }

/* ═══════════════════════════════════════════════
   25. 库存表格
   ═══════════════════════════════════════════════ */
.inv-table-wrap { padding: 12px 40px 0; overflow-x: auto; }
.inv-table {
  width: 100%; border-collapse: collapse; background: var(--card-bg);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.inv-table thead { background: var(--field); }
.inv-table th {
  text-align: left; padding: 10px 12px; font-size: 0.72rem; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px;
  border-bottom: 2px solid var(--belt-blue);
}
.inv-table td { padding: 10px 12px; font-size: 0.84rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.inv-table tbody tr:hover { background: #F9F7F4; }
.inv-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.inv-no-img { color: var(--muted); font-size: 0.73rem; }

/* ═══════════════════════════════════════════════
   26. 异常/重复/编辑/拒付 行高亮（扩展）
   ═══════════════════════════════════════════════ */
.row-anomaly    { background: #F5F3FF !important; }        /* 紫带=异常 */
.row-anomaly td { background: #F5F3FF !important; }
.row-anomaly:hover { background: #EDE9FE !important; }
.row-anomaly:hover td { background: #EDE9FE !important; }
.row-anomaly td.sticky-col { background: #F5F3FF; }
.row-anomaly:hover td.sticky-col { background: #EDE9FE; }

.row-dup        { background: #FFF7ED !important; }        /* 棕带=重复 */
.row-dup td     { background: #FFF7ED !important; }
.row-dup:hover  { background: #FFEDD5 !important; }
.row-dup:hover td { background: #FFEDD5 !important; }
.row-dup td.sticky-col { background: #FFF7ED; }
.row-dup:hover td.sticky-col { background: #FFEDD5; }

/* 已调货超3天 = 橙色醒目行 */
.row-transfer-overdue        { background: #FFF7ED !important; }
.row-transfer-overdue td     { background: #FFF7ED !important; }
.row-transfer-overdue:hover  { background: #FFEDD5 !important; }
.row-transfer-overdue:hover td { background: #FFEDD5 !important; }
.row-transfer-overdue td.sticky-col { background: #FFF7ED; }
.row-transfer-overdue:hover td.sticky-col { background: #FFEDD5; }
.row-transfer-overdue td[data-col="index"] {
  border-left: 3px solid #EA580C;
}
/* 已调货超3天徽章样式 */
.badge-transfer-overdue { background: #FFF7ED; color: #EA580C; border: 1px solid #EA580C; font-weight: 700; }

.row-cb-override        { background: #FEF2F2 !important; }  /* 红带=拒付覆盖 */
.row-cb-override td     { background: #FEF2F2 !important; }
.row-cb-override:hover  { background: #FECACA !important; }
.row-cb-override:hover td { background: #FECACA !important; }

tr.row-editing { background: #FFFDF5 !important; outline: 2px solid var(--gold); outline-offset: -2px; } /* 金标=编辑中 */
tr.row-editing td { background: #FFFDF5 !important; box-shadow: none !important; }
tr.row-editing td.sticky-col { background: #FFFDF5 !important; }

/* ═══════════════════════════════════════════════
   27. 异常徽章
   ═══════════════════════════════════════════════ */
.anomaly-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.76rem; color: var(--belt-purple); background: #F5F1FF;
  padding: 5px 12px; border-radius: 20px; border: 1px solid #DDD6FE;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
  margin-left: 6px;
}
.anomaly-badge:hover { background: #EDE9FE; border-color: var(--belt-purple); }

/* ═══════════════════════════════════════════════
   28. 问题单筛选按钮
   ═══════════════════════════════════════════════ */
.problem-filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 14px; font-size: 0.78rem; font-weight: 600;
  color: var(--priority); background: var(--stamp-bg);
  border: 1.5px solid var(--priority); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
  margin-left: 4px;
}
.problem-filter-btn:hover { background: #FEE2E2; border-color: var(--danger-hover); }
.problem-filter-btn .problem-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-size: 0.68rem; font-weight: 700;
  color: #fff; background: var(--priority);
  border-radius: 10px;
}
.problem-filter-btn.active { color: #fff; background: var(--priority); border-color: #B91C1C; }
.problem-filter-btn.active .problem-count { color: var(--priority); background: #fff; }
.problem-filter-btn.active:hover { background: #B91C1C; border-color: #991B1B; }

/* 待通知转单号筛选按钮（蓝腰带色，区别于问题单的红） */
.notify-filter-btn { color: var(--belt-blue); background: #EFF6FF; border-color: var(--belt-blue); }
.notify-filter-btn:hover { background: #DBEAFE; border-color: var(--primary-hover); }
.notify-filter-btn .problem-count { background: var(--belt-blue); }
.notify-filter-btn.active { color: #fff; background: var(--belt-blue); border-color: var(--primary-hover); }
.notify-filter-btn.active .problem-count { color: var(--belt-blue); background: #fff; }
.notify-filter-btn.active:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* 物流追踪单元格内 — 待通知标记 */
.notify-pending { margin-top: 3px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.notify-new-tag { font-size: 0.6rem; font-weight: 700; color: var(--belt-blue); background: #DBEAFE; padding: 0 4px; border-radius: 3px; white-space: nowrap; }
.notify-done-btn { font-size: 0.62rem; font-weight: 700; color: #065F46; background: #D1FAE5; padding: 1px 6px; border-radius: 3px; text-decoration: none; white-space: nowrap; }
.notify-done-btn:hover { background: #065F46; color: #fff; }
.notify-done { margin-top: 3px; display: flex; align-items: center; gap: 3px; }
.notify-done-tag { font-size: 0.6rem; color: var(--muted); white-space: nowrap; }
.notify-undo-btn { font-size: 0.6rem; color: var(--muted); text-decoration: none; }
.notify-undo-btn:hover { color: var(--belt-blue); }
/* 本单全部已通知 — 一键按钮 */
.notify-all-row { margin-top: 4px; }
.notify-all-btn { font-size: 0.62rem; font-weight: 700; color: #fff; background: var(--belt-blue); padding: 2px 8px; border-radius: 3px; text-decoration: none; white-space: nowrap; }
.notify-all-btn:hover { background: var(--primary-hover); }

/* 调货超期筛选按钮（橙色醒目） */
.transfer-overdue-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 14px; font-size: 0.78rem; font-weight: 600;
  color: #EA580C; background: #FFF7ED;
  border: 1.5px solid #EA580C; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
  margin-left: 0;
}
.transfer-overdue-btn:hover { background: #FFEDD5; border-color: #C2410C; }
.transfer-overdue-btn .transfer-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-size: 0.68rem; font-weight: 700;
  color: #fff; background: #EA580C;
  border-radius: 10px;
}
.transfer-overdue-btn.active { color: #fff; background: #EA580C; border-color: #C2410C; }
.transfer-overdue-btn.active .transfer-count { color: #EA580C; background: #fff; }
.transfer-overdue-btn.active:hover { background: #C2410C; border-color: #9A3412; }
.cb-resolve-anomaly { width: 15px; height: 15px; cursor: pointer; accent-color: var(--belt-purple); }

/* ═══════════════════════════════════════════════
   29. 行内编辑控件
   ═══════════════════════════════════════════════ */
.edit-input { width: 100%; padding: 4px 8px; border: 1px solid var(--rule-dark); border-radius: var(--radius-sm); font-size: 0.82rem; font-family: inherit; background: #fff; }
.edit-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.edit-num { max-width: 90px; text-align: right; }
.edit-num2 { max-width: 70px; text-align: right; font-size: 0.76rem; }
.edit-select { width: 100%; padding: 4px 6px; border: 1px solid var(--rule-dark); border-radius: var(--radius-sm); font-size: 0.8rem; background: #fff; max-width: 130px; }
.edit-textarea { width: 100%; padding: 4px 8px; border: 1px solid var(--rule-dark); border-radius: var(--radius-sm); font-size: 0.8rem; resize: vertical; min-height: 36px; font-family: inherit; }

.btn-save-row { background: var(--success); color: #fff; border: none; font-size: 0.76rem; padding: 4px 10px; }
.btn-save-row:hover { background: #047857; }
.btn-cancel-row { background: var(--danger); color: #fff; border: none; font-size: 0.76rem; padding: 4px 10px; }
.btn-cancel-row:hover { background: var(--danger-hover); }

/* 行内 select badge */
.inline-select {
  appearance: none; -webkit-appearance: none; border: none;
  font-family: inherit; font-weight: 600; cursor: pointer;
  padding: 1px 20px 1px 6px; border-radius: 14px; font-size: 0.68rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center;
  background-color: inherit; color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
  max-width: 130px; text-overflow: ellipsis;
}
.inline-select:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.inline-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.inline-qty {
  width: 48px; padding: 3px 4px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.84rem; font-family: inherit;
  text-align: center; transition: border-color 0.15s;
}
.inline-qty:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); }
.inline-qty:hover { border-color: var(--primary); }

.inline-text-wide {
  width: 140px; max-width: none; padding: 3px 6px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.8rem; font-family: inherit;
  transition: border-color 0.15s;
}
.inline-text-wide:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); width: 260px; }
.inline-text-wide:hover { border-color: var(--primary); }

.inline-text {
  width: 90px; padding: 3px 6px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.8rem; font-family: inherit;
  transition: border-color 0.15s;
}
.inline-text:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); }
.inline-text:hover { border-color: var(--primary); }

.inline-textarea {
  width: 220px; min-height: 32px; max-height: 120px; padding: 4px 6px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.78rem; font-family: inherit; resize: vertical;
  line-height: 1.4; word-break: break-word; overflow-y: auto;
  transition: border-color 0.15s, width 0.15s;
}
.inline-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); width: 300px; }
.inline-textarea:hover { border-color: var(--primary); }

.track-val { font-family: monospace; font-size: 0.76rem; }

/* ═══════════════════════════════════════════════
   30. 表格列溢出修复
   ═══════════════════════════════════════════════ */
td[data-col="shoeSize"] { word-break: break-all; white-space: normal !important; overflow-wrap: break-word; }
td[data-col="price_cost"] { overflow: hidden; }
td[data-col="prepStatus"] { font-size: 0.74rem; line-height: 1.25; color: var(--text); word-break: break-word; white-space: normal; }
td[data-col="shipping"] { overflow: hidden; white-space: nowrap; }
td[data-col="customerShipping"] { white-space: normal; }
.customer-shipping-type {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: .72rem;
  line-height: 1.35;
  word-break: break-word;
}

.edit-prep-status {
  width: 100% !important; font-size: 0.72rem; padding: 4px 6px;
  border: 1px solid var(--rule-dark); border-radius: var(--radius-sm);
  resize: none; overflow-y: auto; box-sizing: border-box;
  min-height: 30px; max-height: 44px;
}
.edit-prep-status.prep-floating {
  position: fixed; z-index: 9999; width: auto;
  min-height: 60px; max-height: 160px; font-size: 0.82rem;
  padding: 8px 10px; border: 2px solid var(--primary);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  background: #fff; resize: vertical;
}
.prep-placeholder { font-size: 0.72rem; padding: 4px 6px; color: transparent; user-select: none; pointer-events: none; }

td[data-col="product_order"] .merged-cell { min-width: fit-content; }
td[data-col="product_order"] .package-badge { white-space: nowrap; display: inline-block; }

th[data-col="carrier"],
td[data-col="carrier"] { width: 75px !important; max-width: 75px !important; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
td[data-col="carrier"] .status-badge { display: inline-block; max-width: 100%; }

td[data-col="valueAdded"] { overflow: hidden; }
td[data-col="notes"] { overflow: hidden; }

/* ═══════════════════════════════════════════════
   31. 可点击徽章
   ═══════════════════════════════════════════════ */
.status-badge[onclick], .status-badge[style*="cursor:pointer"] {
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
}
.status-badge[onclick]:hover, .status-badge[style*="cursor:pointer"]:hover {
  transform: scale(1.08); box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ═══════════════════════════════════════════════
   32. 详情弹窗
   ═══════════════════════════════════════════════ */
.detail-header { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-section { margin-bottom: 14px; }
.detail-section h4 { font-size: 0.88rem; color: var(--primary); margin-bottom: 8px; }
.detail-row { padding: 6px 0; font-size: 0.85rem; display: flex; gap: 8px; border-bottom: 1px solid var(--field); }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-secondary); min-width: 80px; }
.vip-section { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--radius); padding: 12px; }
.regular-section { background: #EEF2F8; border: 1px solid var(--rule-dark); border-radius: var(--radius); padding: 12px; }
.danger-section { background: var(--stamp-bg); border: 1px solid #FECACA; border-radius: var(--radius); padding: 12px; }

/* 物流时间线 */
#trackingDetail .btn { margin-top: 4px; }
.tracking-timeline { padding-left: 16px; border-left: 2px solid #EEF2F8; margin-left: 8px; }
.tracking-step { position: relative; margin-bottom: 12px; padding-left: 16px; }
.tracking-step:last-child { margin-bottom: 0; }
.tracking-dot {
  position: absolute; left: -25px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2px solid #EEF2F8;
}
.tracking-step:first-child .tracking-dot { background: var(--success); border-color: #D1FAE5; }
.tracking-status { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.tracking-location { font-size: 0.78rem; color: var(--text-secondary); }
.tracking-time { font-size: 0.75rem; color: var(--muted); }

/* ═══════════════════════════════════════════════
   33. 列设置面板
   ═══════════════════════════════════════════════ */
.column-settings-wrapper { position: relative; display: inline-block; }
.courier-label-actions { position: relative; align-items: stretch; flex: 0 0 auto; }
.courier-label-main { border-radius: 6px 0 0 6px; }
.courier-label-more {
  width: 36px;
  min-width: 36px;
  padding: 0;
  border-left: 1px solid rgba(255,255,255,.35);
  border-radius: 0 6px 6px 0;
  font-size: 15px;
}
.courier-label-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  width: 170px;
  padding: 5px;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(15,23,42,.14);
}
.courier-label-menu.open { display: block; }
.courier-label-menu button {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #243247;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.courier-label-menu button:hover { background: #f2f5f9; }
.column-settings-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 100; min-width: 220px; padding: 10px 0;
}
.col-settings-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 14px 8px; border-bottom: 1px solid var(--border);
  font-size: 0.80rem; font-weight: 600; color: var(--text);
}
.btn-reset-cols { background: none; border: none; color: var(--primary); font-size: 0.73rem; cursor: pointer; font-family: inherit; }
.btn-reset-cols:hover { text-decoration: underline; }
.col-settings-list { max-height: 320px; overflow-y: auto; padding: 6px 0; }
.col-settings-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px;
  font-size: 0.80rem; cursor: pointer; transition: background 0.1s;
}
.col-settings-item:hover { background: var(--field); }
.col-settings-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }
.col-settings-item input[type="checkbox"]:disabled { opacity: 0.4; cursor: not-allowed; }
.col-sticky-tag { font-size: 0.68rem; margin-left: auto; color: var(--muted); }

/* ═══════════════════════════════════════════════
   34. 弹窗系统
   ═══════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg); border-radius: var(--radius); width: 90%;
  max-width: 720px; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--belt-blue); /* 蓝腰带顶边 */
}
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 960px; }
.modal-sm { max-width: 420px; }
.image-modal { max-width: 600px; }

.modal-body { overflow: visible; }
.modal { overflow-y: auto; overflow-x: hidden; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; background: #fff;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.modal-header-buttons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.modal-header-sep { display: inline-block; width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.btn-modal-ctrl {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  color: var(--text-secondary); padding: 4px 8px; border-radius: var(--radius-sm); line-height: 1;
}
.btn-modal-ctrl:hover { background: var(--field); color: var(--text); }

.modal-overlay.fullscreen { padding: 0; }
.modal-overlay.fullscreen .modal {
  max-width: 100vw !important; width: 100vw !important; max-height: 100vh !important;
  height: 100vh !important; border-radius: 0; margin: 0; border-top: none;
}

.modal-minibar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--primary); color: #fff; padding: 6px 20px;
  font-size: 0.85rem; cursor: pointer; text-align: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  align-items: center; justify-content: center; gap: 8px;
}
.modal-minibar.active { display: flex; }
.modal-minibar:hover { background: var(--primary-hover); }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
.modal-footer-left { flex: 1; }

/* 弹窗双栏 */
.modal-two-col { display: flex; gap: 20px; }
.modal-left { flex: 0 0 65%; min-width: 0; }
.modal-right { flex: 0 0 35%; min-width: 0; }

/* ═══════════════════════════════════════════════
   35. 表单
   ═══════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.83rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.form-group .input { width: 100%; }
.required { color: var(--danger); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.sales-site-form-field { flex: 0 0 138px; }
.order-number-form-field { flex: 0 0 255px; }
.order-number-input-row { display: flex; gap: 4px; }
.order-number-input-row .input { min-width: 0; flex: 1; font-family: Consolas, "Microsoft YaHei UI", monospace; }
.order-number-input-row .btn { flex: 0 0 auto; }

.form-prod-name { flex: 0 0 240px; min-width: 200px; }
.form-prod-code { flex: 0 0 200px; min-width: 160px; }
.prod-input { width: 100% !important; }
.form-prod-name textarea.prod-input { resize: vertical; min-height: 60px; white-space: normal; word-break: break-word; }
.form-prod-code input.prod-input { white-space: nowrap; }

/* ═══════════════════════════════════════════════
   36. 多产品行
   ═══════════════════════════════════════════════ */
.product-row {
  background: var(--field); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 12px; position: relative;
}
.product-row-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 0.80rem; font-weight: 600; color: var(--text-secondary);
}
.product-row-header .btn-remove-product {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 1rem; padding: 2px 6px; border-radius: var(--radius-sm); line-height: 1;
}
.product-row-header .btn-remove-product:hover { background: var(--stamp-bg); }

.product-row-body {
  display: grid; grid-template-columns: 2fr 2fr 1fr;
  gap: 14px; align-items: start;
}
.product-row-body .form-group { margin-bottom: 8px; }
.product-row-body .form-group label { font-size: 0.74rem; white-space: nowrap; }

.prod-col-left textarea.prod-input { resize: vertical; min-height: 44px; white-space: normal; word-break: break-word; width: 100% !important; }
.prod-col-mid { border-left: 1px solid var(--rule); padding-left: 14px; }
.prod-col-mid input.prod-input { width: 100% !important; }
.prod-col-right {
  border-left: 1px solid var(--rule); padding-left: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.prod-col-right .form-group { margin-bottom: 4px; }
.prod-col-right .form-group input,
.prod-col-right .form-group select { width: 100% !important; }

/* 产品预览 */
.product-preview-box {
  width: 100%; position: relative; margin-top: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; min-height: 80px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-preview-box img { width: 100%; max-height: 200px; object-fit: contain; cursor: pointer; display: none; }
.product-preview-box .btn-remove-preview {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; background: var(--danger); color: #fff;
  border: none; border-radius: 50%; font-size: 12px; line-height: 1;
  cursor: pointer; display: none; z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.product-preview-box .btn-remove-preview:hover { background: var(--danger-hover); }
.product-preview-box .img-placeholder { color: var(--muted); font-size: 2rem; padding: 20px; }

.product-img-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.product-img-row .btn-img-sm {
  background: var(--field); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.7rem; padding: 4px 8px; white-space: nowrap;
}
.product-img-row .btn-img-sm:hover { background: var(--rule); }

.add-product-btn {
  display: block; width: 100%; padding: 8px; border: 2px dashed var(--border);
  border-radius: var(--radius); background: transparent; color: var(--text-secondary);
  font-size: 0.85rem; cursor: pointer; margin-bottom: 12px; transition: all 0.15s;
}
.add-product-btn:hover { border-color: var(--primary); color: var(--primary); background: #EEF2F8; }

.section-title-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px; }
.section-title-row .section-title { margin: 0; padding: 0; border: none; }

.product-row:only-of-type .btn-remove-product { display: none; }
#productRows .product-row:first-child .btn-remove-product { display: inline-block; }
#productRows .product-row:first-child:only-of-type .btn-remove-product { display: none; }

.flex-1 { flex: 1; }
.section-title { font-size: 0.88rem; font-weight: 700; color: var(--primary); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #EEF2F8; }

.assignee-badge {
  display: inline-block; font-size: 0.74rem; font-weight: 500;
  background: #EEF2F8; color: var(--primary);
  padding: 2px 10px; border-radius: 20px;
  margin-left: 10px; vertical-align: middle;
}
.assignee-select {
  display: inline-block; width: auto; min-width: 100px;
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 28px 3px 10px; margin-left: 10px;
  vertical-align: middle; border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════
   37. 智能解析 + 图片上传 + 拒付 + 成本卡
   ═══════════════════════════════════════════════ */
.parser-box {
  background: #EEF2F8; border: 2px dashed var(--rule-dark);
  border-radius: var(--radius); padding: 12px; margin-bottom: 16px; position: relative;
}
.parser-textarea {
  background: #fff; font-size: 0.82rem; width: 100%; resize: vertical;
  padding-right: 44px; box-sizing: border-box;
}
.btn-parse-icon {
  position: absolute; right: 16px; bottom: 16px;
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm);
  cursor: pointer; width: 34px; height: 34px; display: flex;
  align-items: center; justify-content: center;
  font-size: 1rem; padding: 0; transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(30,58,95,0.25);
}
.btn-parse-icon:hover { background: var(--primary-hover); transform: scale(1.08); }

.image-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.image-hint { font-size: 0.76rem; color: var(--text-secondary); }
.image-preview { display: none; position: relative; margin-top: 6px; }
.image-preview img { max-width: 200px; max-height: 150px; border-radius: var(--radius); border: 2px solid var(--border); }
.btn-remove-img {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff; border: none;
  width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.image-card {
  background: var(--field); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 12px;
}
.image-card > label { font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; display: block; }
.image-card .image-upload { flex-direction: column; align-items: flex-start; }
.image-card .image-preview img { max-width: 100%; max-height: 120px; }

.chargeback-fields {
  background: var(--stamp-bg); border: 1px solid #FECACA;
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px;
}

.cost-card {
  background: #FEF9E7; border: 1px solid #FDE68A;
  border-radius: var(--radius); margin-top: 4px; overflow: hidden;
}
.cost-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; cursor: pointer; user-select: none;
  font-size: 0.82rem; font-weight: 600; color: #92400E;
}
.cost-card-header:hover { background: #FEF3C7; }
.cost-card-arrow { font-size: 0.7rem; transition: transform 0.2s; }
.cost-card.open .cost-card-arrow { transform: rotate(90deg); }
.cost-card-body { padding: 0 12px 12px; display: none; }
.cost-card.open .cost-card-body { display: block; }

.cost-item-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cost-item-row label { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; min-width: 70px; }
.cost-item-row .cost-item-input { flex: 1; padding: 4px 8px; font-size: 0.82rem; }

.product-img-upload { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.product-img-upload .btn-img-sm { background: var(--field); border: 1px dashed var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.7rem; padding: 4px 8px; white-space: nowrap; }
.product-img-upload .btn-img-sm:hover { background: var(--rule); }
.product-img-upload .img-label { font-size: 0.7rem; color: var(--text-secondary); white-space: nowrap; }
.product-img-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); display: none; }

.modal-left .form-row { gap: 10px; }
.modal-left .form-group { margin-bottom: 10px; }
.modal-left .section-title { margin: 12px 0 8px; }
.modal-left .form-prod-name { flex: 0 0 200px; min-width: 160px; }
.modal-left .form-prod-code { flex: 0 0 160px; min-width: 130px; }

/* ═══════════════════════════════════════════════
   38. 空状态 + 灯箱
   ═══════════════════════════════════════════════ */
.empty-state { display: none; text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state.visible { display: block; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }

.image-lightbox {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.88); z-index: 9999;
  align-items: center; justify-content: center; cursor: pointer;
}
.image-lightbox.active { display: flex; }
.image-lightbox img {
  max-width: 92vw; max-height: 92vh; object-fit: contain;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: default;
}
.image-lightbox .lightbox-close {
  position: absolute; top: 20px; right: 30px;
  color: #fff; font-size: 2rem; background: none; border: none;
  cursor: pointer; opacity: 0.8;
}
.image-lightbox .lightbox-close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════
   39. 滚动条定制
   ═══════════════════════════════════════════════ */
.table-container { scrollbar-width: auto; scrollbar-color: rgba(0,0,0,0.2) rgba(0,0,0,0.02); }
.table-container::-webkit-scrollbar { width: 10px; height: 10px; }
.table-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); }
.table-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 5px; }
.table-container::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.35); }
.table-container::-webkit-scrollbar-thumb:active { background: rgba(0,0,0,0.45); }
.table-container::-webkit-scrollbar-corner { background: transparent; }

/* ═══════════════════════════════════════════════
   40. 运费账单模块
   ═══════════════════════════════════════════════ */
#section-freight.section-active,
#section-inv-cn.section-active,
#section-inv-us.section-active,
#section-product-cost.section-active {
  display: flex; flex-direction: column;
  height: calc(100vh - 56px - 36px); overflow: hidden;
}
.freight-sticky-head { flex-shrink: 0; background: #fff; z-index: 10; border-bottom: 1px solid var(--rule); padding: 10px 16px 8px; }
.freight-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 28px; }
.freight-head-group { display: inline-flex !important; align-items: center; gap: 0; flex-shrink: 0; flex-wrap: nowrap; white-space: nowrap; max-width: none; }
.freight-head-group > * { flex-shrink: 0; white-space: nowrap; }
.freight-title { display: inline !important; margin: 0; font-size: 0.95rem; font-weight: 700; line-height: 28px; white-space: nowrap; width: auto; flex-shrink: 0; color: var(--text); }
.freight-search { display: inline-flex !important; align-items: center; gap: 0; flex-shrink: 0; margin-left: 20px; white-space: nowrap; }
.freight-search-input { width: 190px; height: 28px; font-size: 0.73rem; padding: 0 10px; border: 1px solid var(--rule-dark); border-radius: var(--radius-sm) 0 0 var(--radius-sm); box-sizing: border-box; line-height: 26px; border-right: none; flex-shrink: 0; }
.freight-search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,58,95,0.15); }
.freight-search-btn { height: 28px; font-size: 0.73rem; padding: 0 10px; border: 1px solid var(--rule-dark); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #fff; cursor: pointer; color: #374151; line-height: 26px; box-sizing: border-box; transition: all 0.12s; flex-shrink: 0; }
.freight-search-btn:hover { background: var(--field); border-color: var(--muted); }
.freight-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; margin-left: auto; }
.freight-action-btn { height: 28px; font-size: 0.73rem; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; line-height: 26px; box-sizing: border-box; transition: all 0.12s; font-weight: 500; font-family: inherit; border: none; }
.freight-btn-accent { background: var(--gold); color: #fff; border: 1px solid var(--gold); }
.freight-btn-accent:hover { background: #B0830A; border-color: #B0830A; }
.freight-btn-primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.freight-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.freight-btn-outline { background: #fff; color: #374151; border: 1px solid var(--rule-dark); }
.freight-btn-outline:hover { background: var(--field); border-color: var(--muted); }
.freight-pager-row { display: flex; align-items: center; margin-top: 4px; }
.freight-pager-top { display: flex; align-items: center; gap: 0; font-size: 0.73rem; color: var(--muted-ink); flex-wrap: wrap; row-gap: 4px; line-height: 28px; }
.freight-pager-top .pager-stat { color: var(--muted-ink); font-weight: normal; white-space: nowrap; font-size: 0.73rem; line-height: 28px; }
.freight-pager-top .pager-goto { display: inline-flex; align-items: center; gap: 3px; color: var(--muted-ink); font-weight: normal; white-space: nowrap; font-size: 0.73rem; line-height: 28px; }
.freight-pager-top .pager-goto span { color: var(--muted-ink); font-weight: normal; font-size: 0.73rem; line-height: 28px; }
.freight-pager-top .pager-pages { display: inline-flex; align-items: center; gap: 0; }
.freight-pager-top button { font-size: 0.73rem; height: 28px; min-width: 28px; padding: 0 7px; margin: 0 2px; border: 1px solid var(--rule-dark); background: #fff; border-radius: var(--radius-sm); cursor: pointer; color: #374151; transition: all 0.12s; line-height: 26px; text-align: center; box-sizing: border-box; font-family: inherit; }
.freight-pager-top button:hover:not(:disabled) { background: #EEF2F8; border-color: var(--primary); color: var(--primary); }
.freight-pager-top button:disabled { opacity: 0.3; cursor: default; background: var(--field); }
.freight-pager-top .pager-page { font-weight: 500; font-variant-numeric: tabular-nums; min-width: 28px; padding: 0 6px; }
.freight-pager-top .pager-active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; cursor: default; }
.freight-pager-top .pager-active:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.freight-pager-top .pager-ellipsis { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0 2px; color: var(--muted-ink); font-size: 0.73rem; letter-spacing: 1px; user-select: none; line-height: 28px; }
.freight-pager-jump { width: 46px; height: 28px; text-align: center; font-size: 0.73rem; border: 1px solid var(--rule-dark); border-radius: var(--radius-sm); padding: 0 4px; box-sizing: border-box; line-height: 26px; color: #374151; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; }
.freight-pager-jump:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,58,95,0.18); }
.freight-pager-jump::-webkit-inner-spin-button, .freight-pager-jump::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.freight-pager-jump[type=number] { -moz-appearance: textfield; }
.btn-xs { font-size: 0.72rem !important; padding: 4px 10px !important; height: 28px; line-height: 1.2; border-radius: var(--radius-sm); }
.input-xs { font-size: 0.72rem !important; padding: 4px 10px !important; height: 28px; border-radius: var(--radius-sm); }
.freight-body-scroll { flex: 1; overflow-y: auto; overflow-x: auto; background: #fff; position: relative; }
.freight-body-scroll table { width: 100%; }
.freight-body-scroll thead { position: sticky; top: 0; z-index: 8; }
.freight-body-scroll thead th { padding-top: 7px !important; padding-bottom: 7px !important; font-size: 0.72rem; background: var(--field); box-shadow: 0 1px 0 var(--rule); color: var(--text-secondary); font-weight: 700; text-transform: uppercase; border-bottom: 2px solid var(--belt-blue); }
.freight-body-scroll tbody td { padding-top: 7px !important; padding-bottom: 7px !important; font-size: 0.76rem; border-bottom: 1px solid var(--border); }
.col-track { width: 155px; }
.col-track, .col-track * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 155px; }
.freight-body-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.freight-body-scroll::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }
.freight-body-scroll::-webkit-scrollbar-track { background: transparent; }

/* 运费统计看板 */
.freight-stats-bar { padding: 6px 16px !important; }
.freight-stat-card { transition: all 0.15s; user-select: none; }
.freight-stat-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.freight-stat-card strong { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.freight-stat-card input[type="date"] { font-family: inherit; }

/* ═══════════════════════════════════════════════
   41. ShopYY 多商品选择
   ═══════════════════════════════════════════════ */
.shopyy-items-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.shopyy-item-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 2px solid var(--rule); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s; background: #fff;
}
.shopyy-item-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.1); }
.shopyy-item-card .shopyy-item-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rule); flex-shrink: 0; background: var(--field); }
.shopyy-item-card .shopyy-item-info { flex: 1; min-width: 0; }
.shopyy-item-card .shopyy-item-name { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; color: var(--ink); }
.shopyy-item-card .shopyy-item-meta { font-size: 0.78rem; color: var(--muted-ink); line-height: 1.5; }
.shopyy-item-card .shopyy-item-price { font-weight: 700; color: var(--primary); font-size: 0.92rem; white-space: nowrap; }
.shopyy-item-card .btn-select-item { flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   42. 响应式 — 汉堡菜单 + 侧边栏
   ═══════════════════════════════════════════════ */
.hamburger {
  display: none;
  background: var(--doc); color: var(--ink); border: 1px solid var(--rule-dark);
  font-size: 1.4rem; padding: 4px 12px; border-radius: var(--radius-sm);
  cursor: pointer; line-height: 1; font-family: inherit; transition: all 0.15s;
}
.hamburger:hover { background: var(--field); border-color: var(--primary); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 98; }
.sidebar-backdrop.active { display: block; }

/* ═══════════════════════════════════════════════
   43. 响应式 — 移动端 @media 768px
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hamburger { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }

  .header {
    flex-direction: row; padding: 10px 14px; gap: 8px;
    position: sticky; top: 0; z-index: 100;
  }
  .header-left { flex: 1; flex-direction: column; gap: 2px; align-items: flex-start; }
  .logo { font-size: 1.05rem; }
  .subtitle { display: none; }
  .header-right { gap: 6px; }
  .header-right .btn-sm { font-size: 0.72rem; padding: 6px 10px; min-height: 36px; }
  .user-badge { font-size: 0.72rem; padding: 4px 10px; }
  .header-right { flex: 0 1 auto; min-width: 0; margin-left: auto; }
  .header-right .anomaly-badge,
  .header-right #btnUsers { display: none !important; }

  .app-layout { position: relative; }
  .sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0; z-index: 99;
    width: 260px; min-width: 260px;
    transition: left 0.25s ease; box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }
  .main-content { width: 100%; }

  .nav-item { padding: 14px 18px; font-size: 0.9rem; }
  .nav-icon { font-size: 1.15rem; }
  .nav-section-label { padding: 20px 18px 8px; font-size: 0.68rem; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-value { font-size: 1.2rem; }
  .stat-icon { font-size: 1.4rem; }
  .stat-label { font-size: 0.72rem; }

  .toolbar { flex-direction: column; padding: 10px; gap: 8px; align-items: stretch; }
  .toolbar .btn { min-height: 44px; font-size: 0.9rem; padding: 10px 16px; }
  .toolbar .courier-label-actions { width: 100%; }
  .toolbar .courier-label-main { flex: 1 1 auto; min-width: 0; }
  .toolbar .courier-label-more { flex: 0 0 44px; width: 44px; min-width: 44px; padding: 0; }
  .filter-group { flex-direction: column; gap: 6px; }
  .filter-group .input { max-width: none !important; min-height: 44px; font-size: 16px; }
  .filter-group select.input { padding-right: 36px; }
  .filter-group .shopyy-push-filter { text-align: left; padding-right: 12px; }

  .batch-bar { flex-wrap: wrap; gap: 6px; padding: 10px; font-size: 0.8rem; }
  .batch-bar .btn-sm { min-height: 36px; font-size: 0.78rem; padding: 6px 12px; }

  .pag-sticky { padding: 0 10px; }
  .pagination { gap: 6px; padding: 10px 0; }
  .pag-btn { min-width: 38px; height: 38px; font-size: 0.82rem; }
  .pag-input { width: 48px; height: 32px; font-size: 0.82rem; }

  /* 表格 → 卡片布局 */
  #section-orders.section-active { display: block; height: auto; overflow: visible; }
  .table-container { flex: none; min-height: auto; padding: 0 8px 20px; overflow-x: visible; max-height: none; scrollbar-width: none; }
  .table-container::-webkit-scrollbar { width: 0; height: 0; }
  .order-table, .order-table thead, .order-table tbody,
  .order-table th, .order-table td, .order-table tr {
    display: block; width: 100%;
  }
  .order-table { min-width: auto; border-spacing: 0; }
  .order-table thead { display: none; }
  .order-table tbody tr {
    background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 10px; padding: 12px; border: 1px solid var(--rule);
  }
  .order-table tbody tr.row-void { background: #FEE2E2 !important; }
  .order-table tbody tr.row-unpaid { background: #FEF9C3 !important; }
  .order-table tbody tr.row-anomaly { background: #F5F3FF !important; }
  .order-table tbody tr.row-dup { background: #FFF7ED !important; }
  .order-table tbody tr.row-blacklist { background: #FEF2F2 !important; }
  .order-table tbody tr.row-cb-override { background: #FEF2F2 !important; }
  .anomaly-badge { font-size: 0.72rem; padding: 4px 10px; }
  .order-table td {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 6px 0; border-bottom: 1px solid var(--field); font-size: 0.82rem;
    background: transparent !important; box-shadow: none;
  }
  .order-table td:last-child { border-bottom: none; }
  .order-table td::before {
    content: attr(data-label);
    font-weight: 700; font-size: 0.72rem; color: var(--muted-ink);
    min-width: 70px; flex-shrink: 0; text-transform: uppercase;
    letter-spacing: 0.3px; padding-top: 2px;
  }
  .order-table td[data-col="actions"]::before { content: none; }
  .order-table td[data-col="_select"] { padding: 4px 0; }
  .order-table td[data-col="_select"]::before { content: none; }
  .order-table td[data-col="_select"] {
    display: flex !important; width: 100% !important; min-width: 0; min-height: 34px;
    justify-content: flex-start;
  }
  .order-table td[data-col="_select"] .batch-cb {
    display: block !important; width: 22px !important; height: 22px !important;
    flex: 0 0 22px; margin: 0;
  }
  .mobile-page-select { display: inline-flex; }
  .td-orderno { flex-wrap: wrap; }
  .td-addr { max-width: none !important; white-space: normal !important; }
  .td-notes { max-width: none !important; }
  .td-date { white-space: normal !important; }
  .inline-select { max-width: none !important; font-size: 0.8rem !important; padding: 4px 24px 4px 8px !important; }
  .inline-text, .inline-text-wide { width: 100% !important; }
  .inline-text-wide:focus { width: 100% !important; }
  .inline-textarea { width: 100% !important; }
  .inline-textarea:focus { width: 100% !important; }
  .inline-qty { width: 60px !important; height: 36px; font-size: 0.9rem !important; }
  .actions { gap: 6px; flex-wrap: wrap; }
  .actions .btn { min-height: 36px; padding: 6px 12px; font-size: 0.78rem; }
  .notes-textarea { min-width: auto; width: 100%; font-size: 16px; min-height: 36px; }

  .order-detail-panel { padding: 10px; }
  .detail-actions { flex-wrap: wrap; gap: 6px; }
  .detail-actions .btn { min-height: 40px; padding: 8px 14px; font-size: 0.84rem; }
  .detail-bundle-row { grid-template-columns: 28px minmax(0, 1fr); padding: 10px; }
  .detail-bundle-action { grid-column: 2; justify-self: start; }
  .detail-bundle-action .btn { min-height: 38px; }
  .bundle-header { align-items: flex-start; }
  .bundle-header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .bundle-accident-fields { flex-direction: column; align-items: stretch; }
  .bundle-accident-fields .form-group { width: 100%; }
  .bundle-accident-hint { padding-bottom: 0; }

  .sales-panel { margin: 8px; padding: 14px; }
  .sales-toolbar { flex-direction: column; align-items: stretch; }
  .sales-filters { gap: 4px; }
  .sales-filters .btn-period { min-height: 36px; padding: 6px 12px; font-size: 0.8rem; }
  .sales-filters .input-sm { min-height: 36px; font-size: 16px; }
  .sales-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sales-card-wide { grid-column: span 2; }
  .sales-value { font-size: 1.2rem; }
  .chart-row-2 { flex-direction: column; gap: 10px; }
  #chartTrend { height: 200px !important; }
  #chartPayment { height: 200px !important; }
  .cs-table th, .cs-table td { padding: 6px 8px; font-size: 0.75rem; }

  .modal-overlay { padding: 10px; align-items: flex-start; }
  .modal { max-width: 100% !important; width: 100% !important; border-radius: 12px; max-height: 96vh; border-top: 2px solid var(--belt-blue); }
  .modal-header { padding: 14px 16px; }
  .modal-header h2 { font-size: 0.95rem; }
  .modal-body { padding: 16px; }
  .modal-header-buttons { gap: 6px; }
  .modal-header-buttons .btn { min-height: 38px; padding: 8px 14px; font-size: 0.82rem; }
  .modal-header-sep { margin: 0 2px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 6px; }
  .modal-footer .btn { min-height: 44px; padding: 10px 20px; font-size: 0.9rem; flex: 1; min-width: 100px; }
  .btn-close { min-width: 44px; min-height: 44px; font-size: 1.3rem; }

  .modal-two-col { flex-direction: column; gap: 12px; }
  .modal-left, .modal-right { flex: 1 1 auto; }
  .modal-xl { max-width: 100% !important; }

  .form-group { margin-bottom: 12px; }
  .form-group label { font-size: 0.85rem; margin-bottom: 6px; }
  .form-group .input { min-height: 44px; font-size: 16px; padding: 10px 12px; }
  textarea.input { min-height: 80px; }
  select.input { padding-right: 36px; }
  .form-row { flex-direction: column; gap: 0; }
  .sales-site-form-field,
  .order-number-form-field { flex: 0 0 auto; width: 100%; }
  .form-prod-name, .form-prod-code { flex: 1 1 auto; min-width: auto; }
  .flex-1 { flex: auto; }

  .parser-box { padding: 10px; }
  .parser-box textarea { min-height: 80px; font-size: 16px; }

  .image-upload { flex-direction: column; align-items: flex-start; }
  .image-preview img { max-width: 140px; max-height: 110px; }

  .inv-table-wrap { padding: 8px; overflow-x: auto; }
  .inv-table { min-width: 600px; }
  .inv-table th, .inv-table td { font-size: 0.78rem; padding: 8px; }
  .inv-thumb { width: 36px; height: 36px; }

  .vip-table-wrap { overflow-x: auto; }
  .vip-table { min-width: 500px; }
  .vip-table th, .vip-table td { padding: 6px 8px; font-size: 0.76rem; }
  .vip-regular-panel { padding: 0 8px 12px; }

  .section-title-bar { padding: 12px 12px 0; }
  .section-title-bar h2 { font-size: 0.9rem; }
  .refresh-banner { margin: 0 8px 8px; font-size: 0.78rem; padding: 10px; min-height: 44px; display: flex; align-items: center; }

  .column-settings-dropdown { position: fixed; left: 10px; right: 10px; top: 50%; transform: translateY(-50%); max-height: 70vh; }
  .col-settings-item { padding: 10px 16px; font-size: 0.9rem; min-height: 44px; }
  .col-settings-item input[type="checkbox"] { width: 20px; height: 20px; }

  .empty-state { padding: 40px 16px; }
  .empty-state .empty-icon { font-size: 2.5rem; }

  .chargeback-fields { padding: 10px; }
  .chargeback-fields .form-row { gap: 0; }
}

/* ═══════════════════════════════════════════════
   44. 无障碍：减弱动画
   ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .stat-card:hover, .stat-card-clickable:hover { transform: none; }
}

/* ═══════════════════════════════════════════════
   42. AI 聊天助手
   ═══════════════════════════════════════════════ */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 9998;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45); }
.chat-fab-icon { font-size: 24px; line-height: 1; }

.chat-window {
  position: fixed; bottom: 96px; right: 24px; z-index: 9999;
  width: 520px; max-height: min(720px, calc(100vh - 128px));
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  display: none; flex-direction: column;
  overflow: hidden;
}
.chat-window.active { display: flex; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff; font-weight: 600; font-size: 0.9rem;
  flex-shrink: 0;
}
.chat-header-title { font-size: 0.88rem; }
.chat-header-actions { display: flex; gap: 8px; }
.chat-btn-clear, .chat-btn-close {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font-size: 14px; line-height: 28px; text-align: center;
}
.chat-btn-clear:hover, .chat-btn-close:hover { background: rgba(255,255,255,0.35); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  min-height: 240px; max-height: 540px; display: flex; flex-direction: column; gap: 12px;
  background: #f9fafb;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 0.85rem; line-height: 1.5; word-break: break-word;
}
.chat-msg-user .chat-bubble {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant .chat-bubble {
  background: #fff; color: #1f2937;
  border: 1px solid #e5e7eb; border-bottom-left-radius: 4px;
}
.chat-welcome strong { display: inline-block; margin-bottom: 5px; color: #17365d; font-size: .92rem; }
.chat-welcome span { color: #64748b; }
.chat-msg-loading .chat-bubble {
  background: #fff; color: #9ca3af; font-style: italic;
  border: 1px solid #e5e7eb;
}

.chat-msg-support { width: 100%; }
.chat-support-card {
  width: 100%; overflow: hidden; border-radius: 10px;
  background: #fff; border: 1px solid #dbe3ec; border-left: 4px solid #244a78;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}
.chat-support-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; background: #f4f7fb; border-bottom: 1px solid #e5eaf0;
  color: #172033; font-size: .86rem;
}
.chat-support-heading span {
  max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 7px; border-radius: 4px; color: #315e91; background: #e7eef7;
  font-size: .7rem; font-weight: 700;
}
.chat-support-section { padding: 11px 13px; border-bottom: 1px solid #eef1f4; }
.chat-support-section:last-child { border-bottom: 0; }
.chat-support-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; color: #526174; font-size: .7rem; font-weight: 800;
  letter-spacing: .04em;
}
.chat-support-copy {
  color: #263548; font-size: .82rem; line-height: 1.62; white-space: pre-wrap; word-break: break-word;
}
.chat-support-analysis { background: #fbfcfe; }
.chat-support-steps { background: #fbfcfe; }
.chat-support-evidence .chat-support-copy { color: #6b7788; font-size: .76rem; }
.chat-support-reply { background: #fffdf7; }
.chat-reply-editor {
  display: block; width: 100%; min-height: 118px; max-height: 260px; resize: vertical;
  box-sizing: border-box; padding: 10px 11px; border: 1px solid #d9cfae; border-radius: 7px;
  background: #fff; color: #172033; font: inherit; font-size: .84rem; line-height: 1.65;
  outline: none;
}
.chat-reply-editor:focus { border-color: #315e91; box-shadow: 0 0 0 2px rgba(49,94,145,.11); }
.chat-copy-btn {
  padding: 4px 9px; border: 1px solid #315e91; border-radius: 5px;
  background: #fff; color: #244a78; cursor: pointer; font-size: .7rem; font-weight: 700;
}
.chat-copy-btn:hover, .chat-copy-btn.copied { background: #244a78; color: #fff; }

.chat-footer-wrap { border-top: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.chat-footer {
  display: flex; gap: 8px; padding: 10px 12px;
  background: #fff;
}
.chat-input {
  flex: 1; padding: 8px 12px; border: 1px solid #d9d9d9;
  border-radius: 8px; font-size: 0.85rem; outline: none;
  font-family: inherit;
}
.chat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.chat-btn-send {
  padding: 8px 16px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
  font-weight: 500;
}
.chat-btn-send:hover { background: #2563eb; }
.chat-btn-send:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-safety-note { padding: 0 12px 9px; color: #8792a2; font-size: .68rem; text-align: center; }

@media (max-width: 480px) {
  .chat-window { width: calc(100vw - 24px); right: 12px; bottom: 76px; max-height: calc(100vh - 96px); }
  .chat-body { padding: 12px; max-height: none; }
  .chat-support-section, .chat-support-heading { padding-left: 11px; padding-right: 11px; }
  .chat-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }
}

/* ═══════════ 发货录入 / 物流回填 ═══════════ */
.shipping-section { padding: 16px 20px; }
.ship-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.ship-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #111827; }
.ship-tabs { display: inline-flex; gap: 4px; background: #f1f5f9; padding: 3px; border-radius: 8px; }
.ship-tab { border: none; background: transparent; padding: 6px 16px; font-size: .82rem; border-radius: 6px; cursor: pointer; color: #475569; font-weight: 600; }
.ship-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ship-tab-badge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; font-size: .68rem; line-height: 18px; text-align: center; background: #ef4444; color: #fff; border-radius: 9px; }

.ship-entry-bar { display: flex; gap: 8px; margin-bottom: 14px; max-width: 620px; }
.ship-input { flex: 1; height: 40px; font-size: .95rem; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; }
.ship-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ship-btn { height: 40px; padding: 0 18px; font-size: .85rem; font-weight: 600; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: #374151; cursor: pointer; }
.ship-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.ship-btn-primary:hover { background: #1d4ed8; }
.ship-btn:disabled { opacity: .6; cursor: default; }
.ship-btn-sm { height: 30px; padding: 0 12px; font-size: .78rem; }

.ship-entry-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; max-width: 620px; background: #fff; }
.ship-empty { color: #94a3b8; font-size: .85rem; padding: 8px 2px; }
.ship-empty.ship-err, .ship-err { color: #b91c1c; }
.ship-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ship-card-on { font-size: 1rem; font-weight: 700; color: #0f172a; }
.ship-card-country { margin-left: 10px; font-size: .8rem; color: #2563eb; background: #eff6ff; padding: 2px 10px; border-radius: 12px; }
.ship-card-warn { font-size: .74rem; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; padding: 2px 8px; border-radius: 6px; }
.ship-customer-shipping { margin: -4px 0 12px; padding: 7px 10px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; color: #1e3a8a; font-size: .8rem; line-height: 1.45; word-break: break-word; }
.ship-customer-shipping span { display: inline-block; margin-right: 8px; color: #64748b; font-size: .72rem; font-weight: 700; }
.ship-prod-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ship-prod-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid #f1f5f9; border-radius: 8px; cursor: pointer; }
.ship-prod-row:hover { background: #f8fafc; }
.ship-prod-row.exchange { border-color: #b9ddd4; background: #f2faf7; }
.ship-prod-list.single .ship-prod-row { cursor: default; }
.ship-prod-ck { width: 16px; height: 16px; flex-shrink: 0; }
.ship-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid #e5e7eb; flex-shrink: 0; }
.ship-thumb-empty { display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; color: #9ca3af; background: #f3f4f6; }
.ship-prod-meta { font-size: .82rem; color: #334155; }
.ship-exchange-tag { display: inline-block; margin-left: 7px; padding: 1px 5px; border-radius: 3px; background: #d9f2e9; color: #0f766e; font-size: .68rem; }
.ship-card-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px dashed #e2e8f0; padding-top: 12px; }
.ship-date-lbl { font-size: .8rem; color: #475569; }
.ship-date { height: 34px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .82rem; margin-left: 4px; }
.ship-hint { font-size: .74rem; color: #94a3b8; }
.ship-card-foot .ship-btn-primary { margin-left: auto; }

.ship-backfill-hint { font-size: .8rem; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.ship-table-wrap { overflow-x: auto; }
.ship-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.ship-table th { text-align: left; padding: 8px 10px; background: #f8fafc; color: #475569; font-weight: 600; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.ship-table td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.ship-bf-prod { color: #64748b; font-size: .76rem; }
.ship-bf-customer-shipping { color: #1e3a8a; font-size: .76rem; line-height: 1.35; word-break: break-word; }
.ship-bf-in { width: 100%; height: 30px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .78rem; box-sizing: border-box; }
.ship-bf-in:focus { outline: none; border-color: #2563eb; }
.ship-status { margin-top: 12px; font-size: .82rem; font-weight: 600; min-height: 20px; }

@media (max-width: 640px) {
  .ship-head { gap: 10px; }
  .ship-entry-bar, .ship-entry-card { max-width: 100%; }
  .ship-card-foot .ship-btn-primary { margin-left: 0; }
}

/* ═══════════ 销售统计 · 经营分析中心 ═══════════ */
#section-sales { overflow: auto; background: #F3F5F7; }
#section-sales .sales-panel {
  --sales-ink: #172033;
  --sales-muted: #667085;
  --sales-blue: #2563EB;
  --sales-teal: #0F766E;
  --sales-amber: #B45309;
  --sales-red: #BE123C;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 26px 40px 44px;
  color: var(--sales-ink);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.sales-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #CCD2DA;
}
.sales-eyebrow { color: var(--sales-blue); font-size: .68rem; font-weight: 800; letter-spacing: 0; }
.sales-heading h2 { margin: 4px 0 3px; font-size: 1.65rem; line-height: 1.2; letter-spacing: 0; }
.sales-heading p { margin: 0; color: var(--sales-muted); font-size: .82rem; line-height: 1.5; }
.sales-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sales-filters { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #E4E8ED; border-radius: 6px; }
.sales-filters .btn-period {
  min-width: 56px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  color: #475467;
  background: transparent;
  font-family: inherit;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
}
.sales-filters .btn-period:hover { color: var(--sales-ink); background: rgba(255,255,255,.65); }
.sales-filters .btn-period.active { color: #FFFFFF; background: var(--sales-ink); }
.sales-filters .btn-period:focus-visible,
.sales-custom-dates input:focus-visible { outline: 2px solid var(--sales-blue); outline-offset: 2px; }
.sales-custom-dates { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.sales-custom-dates .input-sm {
  width: 132px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #D0D5DD;
  border-radius: 4px;
  color: var(--sales-ink);
  background: #FFFFFF;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1;
}
.sales-custom-dates .input-sm:disabled { color: #98A2B3; background: #EAECF0; }
.sales-custom-dates .date-sep { color: var(--sales-muted); font-size: .72rem; }
.sales-period-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 58px;
  padding: 11px 0;
}
.sales-period-bar > div:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.sales-period-bar strong { font-size: .82rem; }
.sales-period-bar small { color: var(--sales-muted); font-size: .7rem; }
.sales-compare { display: flex; align-items: center; gap: 10px; padding: 0; color: var(--sales-muted); background: transparent; font-size: .72rem; white-space: nowrap; }
.sales-compare b { padding-left: 10px; border-left: 1px solid #D0D5DD; font-size: .72rem; }
.sales-compare b.up { color: var(--sales-teal); }
.sales-compare b.down { color: var(--sales-red); }
.sales-compare b.neutral { color: var(--sales-muted); }

.sales-outcome-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #D9DEE5;
  border-radius: 6px;
}
.sales-outcome-item { position: relative; min-width: 0; padding: 20px 22px 19px; border-right: 1px solid #EAECF0; }
.sales-outcome-item:last-child { border-right: 0; }
.sales-outcome-item::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: #475467; }
.sales-outcome-item.tone-blue::before { background: var(--sales-blue); }
.sales-outcome-item.tone-teal::before { background: var(--sales-teal); }
.sales-outcome-item.tone-amber::before { background: var(--sales-amber); }
.sales-outcome-item.tone-red::before { background: var(--sales-red); }
.sales-outcome-item > span { display: flex; align-items: center; gap: 7px; color: var(--sales-muted); font-size: .72rem; font-weight: 700; }
.sales-outcome-item em,
.sales-ledger-total em { padding: 2px 5px; border-radius: 3px; color: #854D0E; background: #FEF3C7; font-size: .58rem; font-style: normal; font-weight: 800; }
.sales-outcome-item > strong { display: block; margin-top: 9px; color: var(--sales-ink); font-size: 1.75rem; line-height: 1.05; letter-spacing: 0; overflow-wrap: anywhere; }
.sales-outcome-item.tone-blue > strong { color: var(--sales-blue); }
.sales-outcome-item.tone-teal > strong { color: var(--sales-teal); }
.sales-outcome-item.tone-amber > strong { color: var(--sales-amber); }
.sales-outcome-item.tone-red > strong { color: var(--sales-red); }
.sales-outcome-item small { display: block; min-height: 2.8em; margin-top: 8px; color: #7C8594; font-size: .65rem; line-height: 1.4; }

.sales-driver-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid #CCD2DA;
  border-bottom: 1px solid #CCD2DA;
}
.sales-driver-band > div { min-width: 0; padding: 13px 18px; border-right: 1px solid #D9DEE5; }
.sales-driver-band > div:last-child { border-right: 0; }
.sales-driver-band span,
.sales-driver-band small { display: block; color: var(--sales-muted); font-size: .66rem; }
.sales-driver-band strong { display: block; margin: 4px 0 3px; color: var(--sales-ink); font-size: 1.05rem; }

.sales-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(330px, .8fr); gap: 14px; margin-top: 18px; }
.sales-chart-panel,
.sales-ledger-panel,
.sales-breakdown-panel,
.cs-board { min-width: 0; background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 6px; box-shadow: none; }
.sales-chart-panel,
.sales-ledger-panel,
.sales-breakdown-panel { padding: 16px 18px; }
.sales-block-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.sales-block-heading span { color: var(--sales-blue); font-size: .62rem; font-weight: 800; }
.sales-block-heading h3 { margin: 2px 0 0; color: var(--sales-ink); font-size: .86rem; line-height: 1.35; letter-spacing: 0; }
.sales-block-heading small { padding-top: 3px; color: var(--sales-muted); font-size: .65rem; text-align: right; }
#chartTrend { width: 100%; height: 330px; }

.sales-ledger { border-top: 1px solid #EAECF0; }
.sales-ledger-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EAECF0; font-size: .73rem; }
.sales-ledger-row span { color: var(--sales-muted); }
.sales-ledger-row i { display: inline-flex; justify-content: center; width: 18px; color: var(--sales-red); font-style: normal; font-weight: 800; }
.sales-ledger-row.positive i,
.sales-ledger-row.compensation i { color: var(--sales-teal); }
.sales-ledger-row strong { color: var(--sales-ink); font-size: .8rem; white-space: nowrap; }
.sales-ledger-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding: 12px; color: #FFFFFF; background: var(--sales-teal); border-radius: 4px; }
.sales-ledger-total.negative { background: var(--sales-red); }
.sales-ledger-total span { display: flex; align-items: center; gap: 6px; font-size: .73rem; font-weight: 700; }
.sales-ledger-total strong { font-size: 1.05rem; }
.sales-data-quality { margin-top: 15px; padding-top: 13px; border-top: 1px solid #D9DEE5; }
.sales-quality-heading,
.sales-quality-item > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sales-quality-heading { margin-bottom: 10px; }
.sales-quality-heading strong { font-size: .72rem; }
.sales-quality-heading span { color: var(--sales-muted); font-size: .62rem; }
.sales-quality-item { margin-top: 9px; }
.sales-quality-item span,
.sales-quality-item small { color: var(--sales-muted); font-size: .65rem; }
.sales-quality-item strong { font-size: .7rem; }
.sales-quality-item > i,
.sales-rank-main > i,
.sales-product-main > i { display: block; height: 5px; overflow: hidden; margin: 5px 0 3px; background: #EAECF0; border-radius: 2px; }
.sales-quality-item > i b,
.sales-rank-main > i b,
.sales-product-main > i b { display: block; height: 100%; background: var(--sales-teal); border-radius: 2px; }
.sales-quality-item.freight > i b { background: var(--sales-amber); }

.sales-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.sales-breakdown-panel { min-height: 310px; }
#chartPayment { width: 100%; height: 250px; }
.sales-rank-list,
.sales-product-list { display: flex; flex-direction: column; }
.sales-rank-row,
.sales-product-row { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 0; border-bottom: 1px solid #EAECF0; }
.sales-rank-row:last-child,
.sales-product-row:last-child { border-bottom: 0; }
.sales-rank-index { flex: 0 0 22px; color: #98A2B3; font-size: .66rem; font-weight: 800; }
.sales-rank-main,
.sales-product-main { flex: 1; min-width: 0; }
.sales-rank-main > div,
.sales-product-main > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.sales-rank-main strong,
.sales-product-main strong { overflow: hidden; color: var(--sales-ink); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.sales-rank-main span,
.sales-product-main span { flex: 0 0 auto; color: var(--sales-muted); font-size: .64rem; }
.sales-rank-main > i b { background: var(--sales-blue); }
.sales-product-main > i b { background: var(--sales-amber); }
.sales-rank-value { flex: 0 0 68px; color: #344054; font-size: .72rem; text-align: right; }
.sales-empty { display: flex; align-items: center; justify-content: center; min-height: 170px; padding: 20px; color: #98A2B3; font-size: .73rem; text-align: center; }

.sales-loss-panel {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #E6C8CF;
  border-radius: 6px;
}
.sales-loss-heading,
.sales-loss-item { padding: 16px 18px; }
.sales-loss-heading { display: flex; flex-direction: column; justify-content: center; background: #FFF5F6; }
.sales-loss-heading span { color: var(--sales-red); font-size: .62rem; font-weight: 800; }
.sales-loss-heading strong { margin-top: 4px; color: #7A2334; font-size: .78rem; line-height: 1.4; }
.sales-loss-item { border-left: 1px solid #F0D8DD; }
.sales-loss-item span,
.sales-loss-item small { display: block; color: var(--sales-muted); font-size: .65rem; }
.sales-loss-item strong { display: block; margin: 5px 0 3px; color: var(--sales-red); font-size: 1rem; }

#section-sales .cs-board { margin: 14px 0 0; overflow: hidden; }
#section-sales .cs-board > .sales-block-heading { margin: 0; padding: 15px 18px; border-bottom: 1px solid #D9DEE5; }
.cs-table-wrap { overflow-x: auto; }
#section-sales .cs-table { min-width: 760px; }
#section-sales .cs-table th { padding: 9px 14px; color: var(--sales-muted); background: #F8F9FB; font-size: .66rem; white-space: nowrap; }
#section-sales .cs-table td { padding: 10px 14px; color: #344054; border-bottom: 1px solid #EAECF0; font-size: .73rem; white-space: nowrap; }
#section-sales .cs-table tbody tr:last-child td { border-bottom: 0; }
#section-sales .cs-table td.positive { color: var(--sales-teal); font-weight: 700; }
#section-sales .cs-table td.negative { color: var(--sales-red); font-weight: 700; }

@media (max-width: 1180px) {
  .sales-heading { align-items: flex-start; flex-direction: column; }
  .sales-controls { align-items: flex-start; width: 100%; }
  .sales-analysis-grid { grid-template-columns: 1fr; }
  .sales-ledger-panel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 0 22px; }
  .sales-ledger-panel > .sales-block-heading { grid-column: 1 / -1; }
  .sales-data-quality { margin-top: 0; padding-top: 0; padding-left: 22px; border-top: 0; border-left: 1px solid #D9DEE5; }
}

@media (max-width: 900px) {
  #section-sales .sales-panel { padding: 22px 24px 36px; }
  .sales-outcome-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-outcome-item:nth-child(2) { border-right: 0; }
  .sales-outcome-item:nth-child(-n+2) { border-bottom: 1px solid #EAECF0; }
  .sales-driver-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-driver-band > div:nth-child(2) { border-right: 0; }
  .sales-driver-band > div:nth-child(-n+2) { border-bottom: 1px solid #D9DEE5; }
  .sales-loss-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sales-loss-heading { grid-column: 1 / -1; }
  .sales-loss-item:first-of-type { border-left: 0; }
}

@media (max-width: 640px) {
  #section-sales .sales-panel { margin: 0; padding: 16px 12px 30px; }
  .sales-heading { gap: 16px; padding-bottom: 16px; }
  .sales-heading h2 { font-size: 1.35rem; }
  .sales-controls { gap: 9px; }
  .sales-filters { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .sales-filters .btn-period { width: 100%; min-width: 0; height: 36px; padding: 0 6px; font-size: .72rem; }
  .sales-custom-dates { display: grid; grid-template-columns: 1fr auto 1fr; width: 100%; }
  .sales-custom-dates .input-sm { width: 100%; min-width: 0; height: 36px; font-size: 16px; }
  .sales-period-bar { align-items: flex-start; flex-direction: column; gap: 6px; padding: 12px 2px; }
  .sales-period-bar > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .sales-compare { flex-wrap: wrap; gap: 5px 8px; white-space: normal; }
  .sales-compare b { padding-left: 8px; }
  .sales-outcome-item { padding: 16px 13px; }
  .sales-outcome-item > strong { font-size: 1.35rem; }
  .sales-outcome-item small { min-height: 4.2em; font-size: .62rem; }
  .sales-driver-band > div { padding: 12px 11px; }
  .sales-analysis-grid,
  .sales-breakdown-grid { grid-template-columns: 1fr; gap: 10px; }
  .sales-chart-panel,
  .sales-ledger-panel,
  .sales-breakdown-panel { padding: 14px 12px; }
  .sales-ledger-panel { display: block; }
  .sales-data-quality { margin-top: 14px; padding: 13px 0 0; border-top: 1px solid #D9DEE5; border-left: 0; }
  #chartTrend { height: 260px !important; }
  #chartPayment { height: 240px !important; }
  .sales-breakdown-panel { min-height: 0; }
  .sales-loss-panel { grid-template-columns: 1fr; }
  .sales-loss-heading { grid-column: auto; }
  .sales-loss-item { border-top: 1px solid #F0D8DD; border-left: 0; }
  .sales-block-heading small { max-width: 105px; }
  .sales-rank-value { flex-basis: 62px; }
  #section-sales .cs-board > .sales-block-heading { padding: 14px 12px; }
}

/* 实际拿货与供应商货款 */
.procurement-page { display: grid; gap: 16px; }
.procurement-operations-sync { overflow: hidden; border: 1px solid #cfd8e3; border-left: 3px solid #2156a5; border-radius: 7px; background: #fff; }
.procurement-sync-rail { display: grid; grid-template-columns: minmax(230px, 1fr) auto auto; align-items: center; gap: 14px; min-height: 58px; padding: 8px 10px 8px 14px; }
.procurement-sync-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.procurement-sync-dot { width: 9px; height: 9px; flex: 0 0 9px; border: 2px solid #d7e2ef; border-radius: 50%; background: #2366a5; box-shadow: 0 0 0 3px #f2f6fa; }
.procurement-operations-sync[data-sync-state="success"] .procurement-sync-dot { border-color: #d6eee7; background: #16806d; box-shadow: 0 0 0 3px #eef8f5; }
.procurement-operations-sync[data-sync-state="syncing"] .procurement-sync-dot { border-color: #f4dfb6; background: #c78313; box-shadow: 0 0 0 3px #fff8ea; animation: procurement-sync-pulse 1.3s ease-in-out infinite; }
.procurement-operations-sync[data-sync-state="error"] .procurement-sync-dot { border-color: #f2d5da; background: #b83a4b; box-shadow: 0 0 0 3px #fff3f5; }
@keyframes procurement-sync-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .procurement-operations-sync[data-sync-state="syncing"] .procurement-sync-dot { animation: none; }
}
.procurement-sync-identity > div { min-width: 0; }
.procurement-sync-identity strong { display: block; color: #203044; font-size: 13px; line-height: 1.3; }
.procurement-sync-identity span { display: block; overflow: hidden; margin-top: 2px; color: #687789; font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.procurement-sync-options { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px; }
.procurement-sync-options label { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 9px; border: 1px solid #d7dfe8; border-radius: 15px; background: #f8fafc; color: #526174; font-size: 11px; font-weight: 700; cursor: pointer; user-select: none; }
.procurement-sync-options label:has(input:checked) { border-color: #b8cee2; background: #eef5fb; color: #1f5f94; }
.procurement-sync-options input { width: 14px; height: 14px; margin: 0; accent-color: #2366a5; flex: 0 0 auto; }
.procurement-sync-actions { display: flex; align-items: center; gap: 6px; }
.procurement-sync-actions .btn { min-height: 34px; padding: 0 12px; white-space: nowrap; }
.procurement-sync-actions .btn-primary { min-width: 112px; }
.procurement-advanced-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 72px; flex-shrink: 0; }
.procurement-advanced-toggle b { color: #718095; font-size: 13px; font-weight: 700; line-height: 1; }
.procurement-operations-advanced { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: end; gap: 10px 12px; padding: 12px 14px 14px; border-top: 1px solid #e5eaf0; background: #f8fafc; }
.procurement-operations-advanced[hidden] { display: none; }
.procurement-operations-advanced label,
.procurement-operations-advanced small { display: block; }
.procurement-operations-advanced label { margin-bottom: 5px; color: #354458; font-size: 12px; font-weight: 700; }
.procurement-operations-advanced input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 4px; color: #243244; background: #fff; font-size: 13px; box-sizing: border-box; }
.procurement-operations-advanced small { margin-top: 5px; color: #748195; font-size: 11px; line-height: 1.4; }
.procurement-save-config { min-height: 36px; }
.procurement-fallback-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-bottom: 1px; }
.procurement-fallback-actions > span { margin-right: 2px; color: #748195; font-size: 11px; font-weight: 700; white-space: nowrap; }
.procurement-fallback-actions .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.procurement-summary { margin: 0; }
.procurement-summary strong { font-size: 22px; }
.procurement-supplier-panel,
.procurement-ledger { min-width: 0; overflow: hidden; }
.procurement-supplier-panel > .analytics-panel-head { padding: 18px 20px 12px; }
.procurement-supplier-wrap { max-height: 430px; border-top: 1px solid #e3e7ed; }
.procurement-supplier-table { min-width: 860px; }
.procurement-supplier-table th,
.procurement-supplier-table td { padding-right: 16px; padding-left: 16px; }
.procurement-supplier-table .procurement-net { color: #a53342; background: #fff8f8; }
.analytics-monthly-freight { overflow: hidden; }
.analytics-monthly-freight > .analytics-panel-head { padding: 16px 20px 12px; }
.analytics-monthly-freight-table { min-width: 620px; }
.analytics-monthly-freight-table .analytics-freight-net { color: #a53342; background: #fff8f8; }
.procurement-toolbar { padding: 17px 20px; border-bottom: 1px solid #e3e7ed; }
.procurement-actions { display: flex; align-items: center; gap: 8px; }
.procurement-view-switch { display: inline-flex; height: 36px; padding: 2px; border: 1px solid #cbd3dd; border-radius: 5px; background: #f4f6f8; }
.procurement-view-switch button { min-width: 92px; padding: 0 11px; border: 0; border-radius: 3px; color: #475467; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.procurement-view-switch button.active { color: #173f78; background: #fff; box-shadow: 0 1px 2px rgba(20, 35, 55, .12); }
.procurement-filters { display: grid; grid-template-columns: 180px 150px minmax(260px, 1fr); gap: 9px; padding: 12px 20px; background: #f8f9fb; border-bottom: 1px solid #e3e7ed; }
.procurement-filters select,
.procurement-filters input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cbd3dd; border-radius: 4px; color: #263445; background: #fff; font-size: 13px; }
.procurement-table-wrap { min-height: 178px; }
.procurement-entry-table { min-width: 1240px; }
.procurement-settlement-table { min-width: 760px; }
.procurement-table td { vertical-align: middle; }
.procurement-table td strong,
.procurement-table td small { display: block; }
.procurement-table td small { margin-top: 3px; color: #667085; font-size: 11px; }
.procurement-row { cursor: pointer; }
.procurement-row:hover td { background: #f6f8fa; }
.procurement-row.locked { cursor: default; }
.procurement-type { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 4px; color: #344054; background: #eef1f4; font-size: 11px; font-weight: 800; white-space: nowrap; }
.procurement-type.purchase { color: #175c54; background: #dff3ef; }
.procurement-type.return,
.procurement-type.refund { color: #80590e; background: #fff0cc; }
.procurement-type.payment { color: #8b2e3c; background: #fce7ea; }
.procurement-type.opening { color: #365681; background: #e7eef8; }
.procurement-pagination { padding: 12px 20px; border-top: 1px solid #e3e7ed; }
.procurement-pagination > div { display: flex; align-items: center; gap: 7px; }
.procurement-pagination label { color: #475467; font-size: 12px; }
.procurement-pagination select { height: 32px; margin-left: 4px; border: 1px solid #cbd3dd; border-radius: 4px; color: #263445; background: #fff; }
.procurement-pagination button { width: 34px; height: 32px; border: 1px solid #cbd3dd; border-radius: 4px; color: #344054; background: #fff; font-size: 18px; cursor: pointer; }
.procurement-pagination button:disabled { color: #98a2b3; background: #f2f4f7; cursor: default; }
.procurement-modal { width: min(860px, calc(100vw - 28px)); max-width: 860px; }
.procurement-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.procurement-form-grid .analytics-field > span { color: #344054; font-size: 13px; }
.procurement-form-grid .input { color: #202c3c; font-size: 14px; }
.procurement-total-preview { display: flex; align-items: baseline; gap: 12px; min-height: 54px; margin-top: 12px; padding: 13px 15px; border-left: 4px solid #168076; color: #344054; background: #f2f8f7; }
.procurement-total-preview span { font-size: 13px; font-weight: 700; }
.procurement-total-preview strong { color: #116b63; font-size: 22px; }
.procurement-total-preview small { color: #667085; font-size: 12px; }
.procurement-monthly-modal { width: min(720px, calc(100vw - 28px)); }
.procurement-monthly-preview { max-height: 380px; margin-top: 14px; overflow: auto; border: 1px solid #d8dee7; border-radius: 6px; background: #fff; }
.procurement-monthly-total { display: flex; align-items: baseline; gap: 12px; padding: 15px 17px; border-bottom: 1px solid #d8dee7; background: #f2f8f7; }
.procurement-monthly-total span { color: #344054; font-size: 13px; font-weight: 700; }
.procurement-monthly-total strong { color: #116b63; font-size: 24px; }
.procurement-monthly-total small { color: #667085; font-size: 12px; }
.procurement-monthly-table { min-width: 420px; }
.procurement-monthly-done { display: flex; flex-direction: column; gap: 5px; padding: 22px; color: #116b63; background: #f2f8f7; }
.procurement-monthly-done span { color: #667085; font-size: 13px; }
.procurement-delete { margin-right: auto; color: #a53342; border-color: #d9aeb5; }
.analytics-cash-position { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid #cfd6df; border-radius: 6px; background: #fff; }
.analytics-cash-position > div { min-width: 0; padding: 17px 20px; border-right: 1px solid #e1e5ea; }
.analytics-cash-position > div:last-child { border-right: 0; background: #edf7f5; }
.analytics-cash-position span,
.analytics-cash-position small,
.analytics-liability-grid span,
.analytics-liability-grid small { display: block; color: #5f6b7a; font-size: 12px; }
.analytics-cash-position strong,
.analytics-liability-grid strong { display: block; margin: 5px 0 3px; color: #273548; font-size: 21px; }
.analytics-cash-position .net strong { color: #116b63; }
.analytics-current-liabilities { overflow: hidden; }
.analytics-current-liabilities > .analytics-panel-head { padding: 17px 20px 12px; border-bottom: 1px solid #e1e5ea; }
.analytics-liability-total { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 10px; text-align: right; }
.analytics-liability-total span { color: #667085; font-size: 12px; }
.analytics-liability-total strong { color: #a53342; font-size: 22px; letter-spacing: -.02em; }
.analytics-liability-total small { grid-column: 1 / -1; color: #7b8491; font-size: 11px; }
.analytics-liability-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-liability-grid > div { min-width: 0; padding: 17px 20px 19px; border-right: 1px solid #e1e5ea; background: #fff; }
.analytics-liability-grid > div:last-child { border-right: 0; }
.analytics-liability-grid strong { color: #a53342; }
.analytics-liability-anomaly { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; width: 100%; padding: 13px 20px; color: #7d2633; text-align: left; border: 0; border-top: 1px solid #edc8ce; background: #fff4f5; cursor: pointer; }
.analytics-liability-anomaly:hover { background: #fdebed; }
.analytics-liability-anomaly:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(165, 51, 66, .25); outline-offset: -3px; }
.analytics-liability-anomaly:disabled { color: #7b8491; background: #f7f8fa; cursor: default; }
.analytics-liability-anomaly-mark { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; font-weight: 800; border-radius: 50%; background: #b33b4b; }
.analytics-liability-anomaly:disabled .analytics-liability-anomaly-mark { background: #98a1ad; }
.analytics-liability-anomaly-copy strong { display: block; color: inherit; font-size: 14px; }
.analytics-liability-anomaly-copy small { display: block; margin-top: 2px; color: #786269; font-size: 12px; }
.analytics-liability-anomaly b { min-width: 48px; font-size: 18px; text-align: right; }
.analytics-liability-anomaly-action { color: #9f3040; font-size: 12px; font-weight: 700; }
.analytics-liability-anomaly:disabled .analytics-liability-anomaly-action { visibility: hidden; }
.analytics-cash-flow-panel { overflow: hidden; }
.analytics-cash-flow-panel > .analytics-panel-head { padding: 17px 20px 12px; }
.analytics-cash-flow-table { min-width: 700px; }

#analyticsOperationsEntry { margin-bottom: 10px; }

@media (min-width: 1280px) {
  #section-sales .analytics-page-head { align-items: center; gap: 18px; margin-bottom: 11px; }
  #section-sales .analytics-page-head > div:first-child { min-width: 205px; }
  #section-sales .analytics-period-controls { display: grid; grid-template-columns: auto auto; align-items: center; gap: 6px 8px; }
  #section-sales .analytics-site-filter { grid-column: 1; grid-row: 1; }
  #section-sales .analytics-period-buttons { grid-column: 2; grid-row: 1; }
  #section-sales .analytics-period-selection { grid-column: 2; grid-row: 2; justify-self: end; }
  #section-sales .analytics-custom-dates { grid-column: 1 / 3; grid-row: 2; justify-self: end; }
}

@media (max-width: 900px) {
  .analytics-freight-intro { padding: 15px 13px; }
  .analytics-freight-intro h2 { font-size: 18px; }
  .analytics-freight-ledger > .analytics-table-toolbar { padding: 13px; }
  .analytics-freight-ledger > .analytics-table-toolbar > div { align-items: flex-start; flex-direction: column; gap: 3px; }
  .analytics-freight-search { width: 100%; min-height: 40px; margin-top: 5px; font-size: 16px; }
  .analytics-freight-pagination { justify-content: space-between; padding: 11px 13px; }
  #analyticsOperationsEntry { margin-bottom: 12px; }
  .procurement-sync-rail { grid-template-columns: minmax(190px, 1fr) auto; gap: 7px 12px; }
  .procurement-sync-identity { grid-column: 1; grid-row: 1; }
  .procurement-sync-options { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .procurement-sync-actions { grid-column: 2; grid-row: 1 / 3; }
}

@media (max-width: 900px) {
  .procurement-toolbar { align-items: stretch; flex-direction: column; }
  .procurement-actions { justify-content: space-between; flex-wrap: wrap; width: 100%; }
  .procurement-filters { grid-template-columns: 1fr 1fr; }
  .procurement-filters input { grid-column: 1 / -1; }
  .analytics-liability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-liability-grid > div:nth-child(2n) { border-right: 0; }
  .analytics-liability-grid > div:nth-child(-n+2) { border-bottom: 1px solid #e1e5ea; }
  .analytics-current-liabilities > .analytics-panel-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .analytics-liability-total { width: 100%; grid-template-columns: auto 1fr; text-align: left; }
  .analytics-liability-total strong { text-align: right; }
  .analytics-liability-total small { text-align: left; }
  .analytics-liability-anomaly { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .analytics-liability-anomaly-action { display: none; }
}

@media (max-width: 640px) {
  .procurement-page { gap: 12px; }
  .procurement-sync-rail { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px; }
  .procurement-sync-identity { grid-column: 1; grid-row: 1; }
  .procurement-sync-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-column: 1; grid-row: 2; }
  .procurement-sync-actions .btn { min-height: 40px; }
  .procurement-sync-options { grid-column: 1; grid-row: 3; justify-content: flex-start; gap: 5px; }
  .procurement-sync-options label { min-height: 32px; padding: 0 8px; }
  .procurement-operations-advanced { grid-template-columns: 1fr; padding: 13px; }
  .procurement-operations-advanced .btn { min-height: 38px; }
  .procurement-fallback-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .procurement-fallback-actions > span { grid-column: 1 / -1; }
  .procurement-fallback-actions .btn { min-height: 38px; }
  .procurement-summary strong { font-size: 19px; }
  .procurement-supplier-panel > .analytics-panel-head,
  .procurement-toolbar { padding-right: 13px; padding-left: 13px; }
  .procurement-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .procurement-view-switch { grid-column: 1 / -1; width: 100%; }
  .procurement-view-switch button { flex: 1; min-height: 36px; }
  .procurement-actions .btn { min-width: 0; min-height: 40px; padding: 0 8px; font-size: 12px; }
  .procurement-filters { padding: 10px 13px; }
  .procurement-filters select,
  .procurement-filters input { min-height: 42px; font-size: 16px; }
  .procurement-pagination { align-items: flex-start; flex-direction: column; gap: 9px; padding: 12px 13px; }
  .procurement-pagination > div { justify-content: space-between; width: 100%; }
  .procurement-form-grid { grid-template-columns: 1fr; }
  .procurement-form-grid .analytics-field-full { grid-column: auto; }
  .procurement-total-preview { align-items: flex-start; flex-direction: column; gap: 3px; }
  .procurement-monthly-total { align-items: flex-start; flex-direction: column; gap: 3px; }
  .analytics-cash-position,
  .analytics-liability-grid { grid-template-columns: 1fr; }
  .analytics-cash-position > div,
  .analytics-liability-grid > div { border-right: 0; border-bottom: 1px solid #e1e5ea; }
  .analytics-cash-position > div:last-child,
  .analytics-liability-grid > div:last-child { border-bottom: 0; }
  .analytics-liability-anomaly { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px; padding: 13px; }
  .analytics-liability-anomaly b { font-size: 16px; }
}
