/* miaey电商运营看板 —— 现代 SaaS 高对比风格 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --side1: #1e1b4b;
  --side2: #312e81;
  --bg: #f4f6fb;
  --ink: #1f2937;
  --muted: #6b7280;
  --primary: #6366f1;
  --line: #e5e7eb;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(30, 27, 75, .08);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px; flex: 0 0 232px;
  background: linear-gradient(180deg, var(--side1), var(--side2));
  color: #e0e7ff;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding: 0 6px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text b { display: block; font-size: 17px; color: #fff; }
.brand-text span { font-size: 11px; letter-spacing: 2px; color: #a5b4fc; }
.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  color: #c7d2fe; font-size: 15px; cursor: pointer;
  transition: all .18s; text-decoration: none;
}
.nav-item .ico { font-size: 17px; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .45); font-weight: 600; }
.side-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #a5b4fc;
  padding: 10px 8px; border-top: 1px solid rgba(255, 255, 255, .12); }
.src-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }

/* ---------- 主区域 ---------- */
.main { flex: 1; padding: 26px 30px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar h1 { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.topbar p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.date-chip { background: #fff; border: 1px solid var(--line); padding: 9px 14px;
  border-radius: 10px; font-size: 13px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn { border: none; cursor: pointer; border-radius: 10px; font-size: 14px;
  padding: 10px 18px; font-weight: 600; transition: all .18s; }
.btn.primary { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: #eef2ff; color: #4338ca; }
.btn.ghost:hover { background: #e0e7ff; }

/* ---------- 概览卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.card { display: flex; gap: 14px; align-items: center;
  background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  border: 1px solid #f0f1f6; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%; opacity: .12; }
.card-ico { width: 52px; height: 52px; border-radius: 14px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-label { font-size: 13px; color: var(--muted); }
.card-num { font-size: 23px; font-weight: 800; white-space: nowrap; }
.card-sub { font-size: 12px; color: var(--muted); }
.c-red .card-ico { background: linear-gradient(135deg, #ef4444, #dc2626); }
.c-red::after { background: #ef4444; }
.c-red .card-num { color: #dc2626; }
.c-blue .card-ico { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.c-blue::after { background: #3b82f6; }
.c-blue .card-num { color: #2563eb; }
.c-purple .card-ico { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.c-purple::after { background: #8b5cf6; }
.c-purple .card-num { color: #7c3aed; }
.c-green .card-ico { background: linear-gradient(135deg, #10b981, #059669); }
.c-green::after { background: #10b981; }
.c-green .card-num { color: #059669; }

/* ---------- 面板/图表 ---------- */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid #f0f1f6; padding: 20px 22px; margin-bottom: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.panel-head h2 { font-size: 17px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.grid-2 .panel { margin-bottom: 0; }
.chart { width: 100%; height: 320px; }

/* 分段控件 */
.seg { display: inline-flex; background: #f1f3f9; border-radius: 10px; padding: 4px; gap: 2px; }
.seg-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600; transition: all .15s; }
.seg-btn.active { background: #fff; color: #4f46e5; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }

/* 定时任务 */
.jobs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.job-row { display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; background: #f8f9fd; border-radius: 10px; font-size: 13px; }
.job-row b { font-weight: 700; }
.job-row span { color: var(--muted); font-size: 12px; }
.manual { display: flex; flex-direction: column; gap: 9px; }
.manual .btn { width: 100%; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data-table th { text-align: left; padding: 11px 12px; color: var(--muted);
  background: #f8f9fd; font-weight: 700; border-bottom: 1px solid var(--line); }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #f1f2f6; }
.data-table tbody tr:hover { background: #fafbff; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.tag.blue { background: #dbeafe; color: #1d4ed8; }
.tag.purple { background: #ede9fe; color: #6d28d9; }
.tag.green { background: #d1fae5; color: #047857; }
.tag.red { background: #fee2e2; color: #b91c1c; }
.tag.gray { background: #f1f3f9; color: #6b7280; }

/* ---------- 页面切换 ---------- */
.page { display: none; }
.page.active { display: block; }

/* ---------- 作战驾驶舱 ---------- */
/* 子标签导航 */
.cb-tabs { display: flex; gap: 8px; background: #fff; border: 1px solid #f0f1f6;
  border-radius: 14px; padding: 7px; box-shadow: var(--shadow); margin-bottom: 22px;
  position: sticky; top: 12px; z-index: 50; overflow-x: auto; }
.cb-tab { flex: 1 1 auto; border: none; background: transparent; cursor: pointer;
  padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 700;
  color: var(--muted); white-space: nowrap; transition: all .18s;
  display: flex; align-items: center; justify-content: center; gap: 7px; }
.cb-tab .cbt-ico { font-size: 15px; }
.cb-tab:hover { background: #f3f4fb; color: #4338ca; }
.cb-tab.active { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }

/* 子视图 */
.cb-tabview { display: none; }
.cb-tabview.active { display: block; animation: cbFade .22s ease; }
@keyframes cbFade { from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; } }

.cb-kpi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 22px; }
.cb-kpi-card { position: relative; overflow: hidden; background: #fff; border: 1px solid #f0f1f6;
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; transition: transform .2s, box-shadow .2s; }
.cb-kpi-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(30,27,75,.14); }
.cb-kpi-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 19px; color: #fff; font-weight: 800; }
.cb-kpi-label { font-size: 12.5px; color: var(--muted); }
.cb-kpi-val { font-size: 22px; font-weight: 800; line-height: 1.1; }
.cb-kpi-val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.cb-kpi-sub { font-size: 11.5px; color: var(--muted); }
.cb-kpi-card::after { content: ""; position: absolute; right: -26px; bottom: -26px;
  width: 80px; height: 80px; border-radius: 50%; opacity: .1; }

.cb-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid #f0f1f6; padding: 20px 22px; margin-bottom: 22px; }
.cb-panel-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.cb-panel-head h2 { font-size: 16px; font-weight: 700; }
.cb-hint { font-size: 12px; color: var(--muted); }

/* 时间轴 */
.cb-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cb-day { border: 1px solid #f0f1f6; border-radius: 16px; padding: 16px;
  background: linear-gradient(180deg, #fff, #f8faff); cursor: pointer;
  transition: all .2s; display: flex; flex-direction: column; gap: 8px; }
.cb-day:hover { transform: translateY(-4px); border-color: #c7d2fe;
  box-shadow: 0 14px 30px rgba(99,102,241,.18); }
.cb-day-top { display: flex; justify-content: space-between; align-items: center; }
.cb-date { font-size: 15px; font-weight: 800; }
.cb-day-tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 700; }
.cb-day-tag.live { background: #d1fae5; color: #047857; }
.cb-day-tag.nolive { background: #dbeafe; color: #1d4ed8; }
.cb-day-tag.empty { background: #fee2e2; color: #b91c1c; }
.cb-day-gmv b { font-size: 26px; font-weight: 800; color: #4f46e5; }
.cb-day-gmv small { color: var(--muted); margin-left: 2px; }
.cb-day-meta, .cb-day-stats { display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); }
.cb-day-btn { margin-top: 2px; text-align: center; font-size: 12.5px; font-weight: 700;
  color: #4f46e5; background: #eef2ff; border-radius: 9px; padding: 8px; transition: all .18s; }
.cb-day:hover .cb-day-btn { background: #6366f1; color: #fff; }

/* 图表网格 */
.cb-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.cb-chart { width: 100%; height: 300px; }

/* 重点关注 */
.cb-focus { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cb-focus-card { border: 1px solid #f0f1f6; border-radius: 14px; overflow: hidden; background: #fff;
  transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.cb-focus-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(30,27,75,.12); }
.cb-focus-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; color: #fff; }
.cb-focus-head b { font-size: 14.5px; }
.cb-focus-ico { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; font-size: 15px; }
.cb-focus-problem { padding: 12px 16px 4px; font-size: 12.5px; color: #b91c1c;
  line-height: 1.7; flex: 1; }
.cb-focus-fix { padding: 8px 16px 14px; font-size: 12.5px; color: #047857; line-height: 1.7; }
.cb-focus-fix b { font-weight: 700; }

/* 次日计划 */
.cb-plan { background: linear-gradient(135deg, #312e81, #4338ca 55%, #6d28d9);
  border-radius: 18px; padding: 22px 26px; box-shadow: 0 14px 34px rgba(67,56,202,.35);
  margin-bottom: 22px; }
.cb-plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cb-plan-ico { color: #fbbf24; font-size: 20px; font-weight: 800; }
.cb-plan-head h2 { color: #fff; font-size: 17px; }
.cb-plan p { color: #e0e7ff; font-size: 13.5px; line-height: 1.9; }

/* 色系 */
.tone-red .cb-kpi-ico { background: linear-gradient(135deg,#f87171,#dc2626); }
.tone-red::after { background: #ef4444; } .tone-red .cb-kpi-val { color: #dc2626; }
.tone-blue .cb-kpi-ico { background: linear-gradient(135deg,#60a5fa,#2563eb); }
.tone-blue::after { background: #3b82f6; } .tone-blue .cb-kpi-val { color: #2563eb; }
.tone-orange .cb-kpi-ico { background: linear-gradient(135deg,#fbbf24,#d97706); }
.tone-orange::after { background: #f59e0b; } .tone-orange .cb-kpi-val { color: #d97706; }
.tone-purple .cb-kpi-ico { background: linear-gradient(135deg,#a78bfa,#7c3aed); }
.tone-purple::after { background: #8b5cf6; } .tone-purple .cb-kpi-val { color: #7c3aed; }
.tone-cyan .cb-kpi-ico { background: linear-gradient(135deg,#22d3ee,#0891b2); }
.tone-cyan::after { background: #06b6d4; } .tone-cyan .cb-kpi-val { color: #0891b2; }
.tone-green .cb-kpi-ico { background: linear-gradient(135deg,#34d399,#059669); }
.tone-green::after { background: #10b981; } .tone-green .cb-kpi-val { color: #059669; }
.tone-pink .cb-focus-head { background: linear-gradient(135deg,#f472b6,#db2777); }
.tone-purple .cb-focus-head { background: linear-gradient(135deg,#a78bfa,#7c3aed); }
.tone-orange .cb-focus-head { background: linear-gradient(135deg,#fbbf24,#d97706); }
.tone-blue .cb-focus-head { background: linear-gradient(135deg,#60a5fa,#2563eb); }
.tone-cyan .cb-focus-head { background: linear-gradient(135deg,#22d3ee,#0891b2); }
.tone-green .cb-focus-head { background: linear-gradient(135deg,#34d399,#059669); }
.dm-area { display: inline-block; background: #4338ca; color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 7px; font-weight: 600; margin-bottom: 8px; }

/* 弹窗 */
.cb-modal { position: fixed; inset: 0; z-index: 1000; display: none; }
.cb-modal.show { display: block; }
.cb-modal-mask { position: absolute; inset: 0; background: rgba(17,17,30,.55); backdrop-filter: blur(3px); }
.cb-modal-box { position: relative; max-width: 880px; margin: 44px auto;
  max-height: calc(100vh - 88px); background: #fff; border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0,0,0,.3); overflow: hidden; animation: cbPop .25s ease; }
@keyframes cbPop { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.cb-modal-close { position: absolute; right: 16px; top: 16px; z-index: 2; width: 34px; height: 34px;
  border-radius: 10px; border: none; background: #f1f3f9; cursor: pointer; font-size: 15px; color: #6b7280; }
.cb-modal-close:hover { background: #e5e7eb; }
.cb-modal-body { padding: 26px 28px; max-height: calc(100vh - 88px); overflow-y: auto; }
.cb-modal-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cb-modal-title h3 { font-size: 21px; font-weight: 800; }
.cb-modal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.cb-modal-cell { background: #f8f9fd; border: 1px solid #f0f1f6; border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.cb-modal-cell span { font-size: 12px; color: var(--muted); }
.cb-modal-cell b { font-size: 16px; font-weight: 800; }
.cb-modal-block { margin-bottom: 18px; }
.cb-modal-block h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 8px;
  padding-left: 10px; border-left: 4px solid #6366f1; }
.cb-modal-block p { font-size: 13px; line-height: 1.8; color: #374151; }
.cb-modal-imp { border: 1px solid #f0f1f6; border-radius: 12px; padding: 14px 16px;
  background: #f8f9fd; margin-bottom: 10px; }
.cb-mp { font-size: 12.5px; color: #b91c1c; line-height: 1.7; margin-bottom: 6px; }
.cb-mf { font-size: 12.5px; color: #047857; line-height: 1.7; }

/* ---------- 月度汇总与费用台账 ---------- */
.fin-panel { background: #fff; border: 1px solid #f0f1f6; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 22px; }
.fin-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.fin-head h2 { font-size: 16px; font-weight: 700; }

.fin-sum-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.fin-sum-card { border-radius: 16px; padding: 18px 20px; color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 7px; }
.fin-sum-card::after { content: ""; position: absolute; right: -24px; bottom: -24px;
  width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.16); }
.fsc-label { font-size: 13px; opacity: .9; }
.fin-sum-card b { font-size: 27px; font-weight: 800; line-height: 1.1; }
.fsc-sub { font-size: 12px; opacity: .85; }
.fsc-red { background: linear-gradient(135deg,#f87171,#dc2626); }
.fsc-orange { background: linear-gradient(135deg,#fbbf24,#d97706); }
.fsc-green { background: linear-gradient(135deg,#34d399,#059669); }

.fin-composition { display: flex; flex-direction: column; gap: 11px;
  padding: 16px; background: #f8f9fd; border-radius: 14px; margin-bottom: 18px; }
.fin-comp-row { display: grid; grid-template-columns: 130px 1fr 110px 56px; align-items: center; gap: 12px; }
.fin-comp-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.fin-comp-name i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fin-comp-bar { height: 9px; background: #e8ebf3; border-radius: 6px; overflow: hidden; }
.fin-comp-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.fin-comp-val { font-size: 13.5px; font-weight: 800; text-align: right; }
.fin-comp-pct { font-size: 12px; color: var(--muted); text-align: right; }

.fin-table tfoot td { background: #f8f9fd; border-top: 2px solid var(--line); font-size: 13px; }
.fin-note { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }

.fin-modal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.fin-modal-cell { background: #f8f9fd; border: 1px solid #f0f1f6; border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.fin-modal-cell i { width: 26px; height: 6px; border-radius: 4px; }
.fin-modal-cell span { font-size: 12px; color: var(--muted); }
.fin-modal-cell b { font-size: 15px; font-weight: 800; }

/* ---------- 豆包渠道页 ---------- */
.db-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.db-head h2 { font-size: 21px; color: var(--ink); }
.db-head p { font-size: 13px; color: var(--muted); margin-top: 5px; }

.db-kpi { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 22px; }
.db-kpi-card { position: relative; overflow: hidden; background: #fff; border: 1px solid #f0f1f6;
  border-radius: var(--radius); padding: 16px; display: flex; gap: 13px; align-items: center;
  box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; }
.db-kpi-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(30,27,75,.14); }
.db-kpi-ico { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff; }
.db-kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.db-kpi-label { font-size: 12.5px; color: var(--muted); }
.db-kpi-val { font-size: 21px; font-weight: 800; line-height: 1.1; }
.db-kpi-val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.db-kpi-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-kpi-card::after { content: ""; position: absolute; right: -26px; bottom: -26px;
  width: 74px; height: 74px; border-radius: 50%; opacity: .12; }

.tone-red .db-kpi-ico { background: linear-gradient(135deg,#f87171,#dc2626); }
.tone-red::after { background: #ef4444; } .tone-red .db-kpi-val { color: #dc2626; }
.tone-blue .db-kpi-ico { background: linear-gradient(135deg,#60a5fa,#2563eb); }
.tone-blue::after { background: #3b82f6; } .tone-blue .db-kpi-val { color: #2563eb; }
.tone-orange .db-kpi-ico { background: linear-gradient(135deg,#fbbf24,#d97706); }
.tone-orange::after { background: #f59e0b; } .tone-orange .db-kpi-val { color: #d97706; }
.tone-purple .db-kpi-ico { background: linear-gradient(135deg,#a78bfa,#7c3aed); }
.tone-purple::after { background: #8b5cf6; } .tone-purple .db-kpi-val { color: #7c3aed; }
.tone-cyan .db-kpi-ico { background: linear-gradient(135deg,#22d3ee,#0891b2); }
.tone-cyan::after { background: #06b6d4; } .tone-cyan .db-kpi-val { color: #0891b2; }

/* 响应式 */
@media (max-width: 1280px) {
  .cb-kpi { grid-template-columns: repeat(3, 1fr); }
  .db-kpi { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .cb-kpi { grid-template-columns: repeat(2, 1fr); }
  .db-kpi { grid-template-columns: repeat(2, 1fr); }
  .cb-timeline { grid-template-columns: repeat(2, 1fr); }
  .cb-chart-grid { grid-template-columns: 1fr; }
  .cb-focus { grid-template-columns: 1fr; }
  .fin-sum-cards { grid-template-columns: 1fr; }
  .fin-modal-grid { grid-template-columns: repeat(3, 1fr); }
  .fin-comp-row { grid-template-columns: 110px 1fr 96px; }
  .fin-comp-pct { display: none; }
}
@media (max-width: 640px) {
  .cb-kpi { grid-template-columns: 1fr; }
  .db-kpi { grid-template-columns: 1fr; }
  .cb-timeline { grid-template-columns: 1fr; }
  .cb-modal-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-modal-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-comp-row { grid-template-columns: 1fr; gap: 6px; }
  .fin-comp-bar { order: 3; }
}

/* ============ 月度利润报表 ============ */
.profit-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.profit-ctrl { display: flex; align-items: center; gap: 8px; }
.profit-ctrl input[type="month"] { padding: 6px 10px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; font-size: 13px; color: var(--text, #1f2937); background: #fff; }
.btn-mini { padding: 6px 14px; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg,#6366f1,#4f46e5); color: #fff; font-size: 13px; }

.pf-flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.pf-step { flex: 1; min-width: 120px; border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; color: #fff; position: relative; overflow: hidden; }
.pf-label { font-size: 12.5px; opacity: .92; }
.pf-val { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.pf-arrow { display: flex; align-items: center; font-size: 20px; font-weight: 700; color: var(--muted, #9ca3af); }
.pf-step.tone-blue { background: linear-gradient(135deg,#60a5fa,#2563eb); }
.pf-step.tone-orange { background: linear-gradient(135deg,#fbbf24,#d97706); }
.pf-step.tone-green { background: linear-gradient(135deg,#34d399,#059669); }
.pf-step.tone-purple { background: linear-gradient(135deg,#a78bfa,#7c3aed); }
.pf-step.tone-gold { background: linear-gradient(135deg,#fcd34d,#f59e0b); }

.pf-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.pf-card { border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 18px;
  background: #fff; position: relative; overflow: hidden; }
.pf-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.pf-card.tone-blue::before { background: #3b82f6; }
.pf-card.tone-orange::before { background: #f59e0b; }
.pf-card.tone-green::before { background: #10b981; }
.pf-card-label { font-size: 13px; color: var(--muted, #6b7280); margin-bottom: 8px; }
.pf-card-val { font-size: 24px; font-weight: 800; }
.pf-card.tone-blue .pf-card-val { color: #2563eb; }
.pf-card.tone-orange .pf-card-val { color: #d97706; }
.pf-card.tone-green .pf-card-val { color: #059669; }
.pf-card-sub { font-size: 12px; color: var(--muted, #9ca3af); margin-top: 6px; }

.pf-section-title { font-size: 14px; font-weight: 700; color: var(--text, #1f2937);
  margin: 6px 0 12px; padding-left: 10px; border-left: 3px solid #6366f1; }
.pf-fees { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.pf-fee { border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 14px 16px; background: #fff; }
.pf-fee-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pf-fee-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fc); flex: none; }
.pf-fee-label { font-size: 13px; color: var(--muted, #6b7280); flex: 1; }
.pf-fee-val { font-size: 16px; font-weight: 800; color: var(--text, #111827); }
.pf-fee-bar { height: 6px; border-radius: 6px; background: #f3f4f6; overflow: hidden; }
.pf-fee-bar i { display: block; height: 100%; border-radius: 6px; background: var(--fc); transition: width .4s; }

.pf-result { border-radius: 16px; padding: 24px 26px;
  background: linear-gradient(135deg,#ecfdf5,#d1fae5); border: 1px solid #a7f3d0; }
.pf-result.neg { background: linear-gradient(135deg,#fef2f2,#fee2e2); border-color: #fecaca; }
.pf-result-label { font-size: 14px; color: #047857; font-weight: 700; margin-bottom: 8px; }
.pf-result.neg .pf-result-label { color: #b91c1c; }
.pf-result-val { font-size: 34px; font-weight: 800; color: #059669; letter-spacing: .5px; }
.pf-result.neg .pf-result-val { color: #dc2626; }
.pf-result-sub { font-size: 12.5px; color: #047857; margin-top: 8px; opacity: .85; }
.pf-result.neg .pf-result-sub { color: #b91c1c; }

@media (max-width: 1100px) {
  .pf-kpi { grid-template-columns: 1fr; }
  .pf-fees { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pf-flow { flex-direction: column; }
  .pf-arrow { transform: rotate(90deg); align-self: center; }
  .pf-result-val { font-size: 27px; }
}

/* ============ 总公司清单核对 ============ */
.rc-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rc-upload input[type="file"] { flex: 1; min-width: 200px; font-size: 13px; }
.btn-rc { background: linear-gradient(135deg,#10b981,#059669); }
.rc-msg { font-size: 12.5px; color: var(--muted, #6b7280); }

.rc-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rc-chip { padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.rc-chip-match { background: #d1fae5; color: #047857; }
.rc-chip-mismatch { background: #fee2e2; color: #b91c1c; }
.rc-chip-extra { background: #ffedd5; color: #c2410c; }
.rc-chip-missing { background: #fef9c3; color: #a16207; }
.rc-chip-return { background: #e0e7ff; color: #4338ca; }
.rc-chip-total { background: #f3f4f6; color: #374151; }

.rc-table .rc-tag { padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.rc-match { background: #f0fdf4; }
.rc-match .rc-tag { background: #10b981; color: #fff; }
.rc-mismatch { background: #fef2f2; }
.rc-mismatch .rc-tag { background: #dc2626; color: #fff; }
.rc-extra { background: #fff7ed; }
.rc-extra .rc-tag { background: #ea580c; color: #fff; }
.rc-missing { background: #fefce8; }
.rc-missing .rc-tag { background: #ca8a04; color: #fff; }
.rc-return { background: #eef2ff; }
.rc-return .rc-tag { background: #6366f1; color: #fff; }
tr.rc-color-warn td:nth-child(4), tr.rc-color-warn td:nth-child(5) {
  color: #dc2626; font-weight: 700; }

.rc-accessory { margin-top: 12px; font-size: 12.5px; color: #92400e;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 14px; }
