/* ============================================================
   财务系统 · 设计系统 v2
   ------------------------------------------------------------
   原则：
   1. 先定色板与间距刻度，所有组件只从刻度里取值，保证节奏统一
   2. 文字分四级（标题/正文/次说明/弱提示），不靠字号堆叠靠颜色分层
   3. 表格是主战场：表头吸顶、行悬浮、数字右对齐等宽
   4. 卡片只做「一层」阴影，不做花哨渐变，靠留白和分隔线建立层级
   5. 左栏按「板块」分组（总览 / TikTok），以后接新平台再加一组
   ============================================================ */

:root {
  /* —— 背景与分隔 —— */
  --bg:             #f4f5f7;
  --surface:        #ffffff;
  --surface-2:      #f8f9fb;
  --surface-3:      #eef1f5;
  --surface-hover:  #fafbfd;
  --border:         #e7eaef;
  --border-strong:  #d0d5dd;

  /* —— 文字四级 —— */
  --text:    #0f172a;   /* 标题、关键数字 */
  --text-2:  #475467;   /* 正文 */
  --text-3:  #98a2b3;   /* 次说明 */

  /* —— 主色与状态色 —— */
  --brand:      #4f46e5;
  --brand-600:  #4338ca;
  --brand-700:  #3730a3;
  --brand-soft: #eef2ff;
  --brand-ring: rgba(79,70,229,.14);

  --ok:          #059669;
  --ok-soft:     #ecfdf5;
  --ok-border:   #a7f3d0;
  --warn:        #b45309;
  --warn-soft:   #fffbeb;
  --warn-border: #fde68a;
  --danger:        #e11d48;
  --danger-soft:   #fff1f2;
  --danger-border: #fecdd3;
  --info-soft:     #f2f4f7;

  /* —— 侧边栏（深色）—— */
  --sb-bg:     #0b1220;
  --sb-bg-2:   #111a2e;
  --sb-text:   #94a3b8;
  --sb-text-2: #e2e8f0;
  --sb-line:   rgba(255,255,255,.07);

  /* —— 圆角 / 阴影 / 动效 —— */
  --radius:    13px;
  --radius-sm: 9px;
  --radius-xs: 6px;

  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.03);
  --shadow-md: 0 4px 14px -2px rgba(16,24,40,.08), 0 2px 6px -2px rgba(16,24,40,.04);
  --shadow-lg: 0 16px 40px -12px rgba(16,24,40,.18), 0 4px 12px -4px rgba(16,24,40,.06);

  --sidebar-w: 232px;
  --header-h:  60px;
  --content-max: 2400px;
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13.5px; line-height: 1.6; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.num, table td, table th, .kpi-value { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
code, .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: #3f4a5f; }
::selection { background: var(--brand-ring); }
.muted { color: var(--text-3); }
b, strong { font-weight: 640; }
a { color: var(--brand); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd3de; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b3c2; background-clip: content-box; border: 3px solid transparent; }

/* ============================ 布局 ============================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--sb-bg), var(--sb-bg-2));
  color: var(--sb-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 16px; height: var(--header-h); flex: 0 0 var(--header-h);
  border-bottom: 1px solid var(--sb-line);
}
.sb-logo {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 14px -2px rgba(99,102,241,.55);
}
.sb-brand h1 { font-size: 13.5px; font-weight: 620; color: #fff; letter-spacing: .2px; line-height: 1.3; }
.sb-brand p { font-size: 10.5px; color: #64748b; letter-spacing: .4px; }

/* min-height:0 必须有：否则 flex 子项不会收缩，店铺列表一长就把底部的「退出登录」挤出屏幕 */
.sb-nav { padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sb-nav::-webkit-scrollbar { width: 9px; }
.sb-nav::-webkit-scrollbar-thumb { background: #26314a; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
.sb-nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 11px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--sb-text); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; transition: background .14s var(--ease), color .14s var(--ease);
}
.sb-nav button svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.sb-nav button:hover { background: rgba(255,255,255,.06); color: var(--sb-text-2); }
.sb-nav button.active {
  background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.14));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(129,140,248,.28);
}
.sb-nav button.active svg { opacity: 1; color: #a5b4fc; }

/* ---- 左栏「板块」分组：总览 ｜ TikTok ---- */
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-group + .sb-group { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--sb-line); }
.sb-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 11px 6px !important; background: transparent !important;
  font-size: 10.5px !important; font-weight: 700 !important; letter-spacing: 1.1px;
  color: #64748b !important; text-transform: uppercase; cursor: pointer;
}
.sb-group-head:hover { color: var(--sb-text-2) !important; background: transparent !important; }
.sb-chev { width: 13px !important; height: 13px !important; opacity: .55 !important; transition: transform .18s var(--ease); }
.sb-group.collapsed .sb-chev { transform: rotate(-90deg); }
.sb-group.collapsed .sb-items { display: none; }
.sb-group.collapsed .sb-group-stores { display: none; }
.sb-group.collapsed .sb-upload, .sb-group.collapsed .sb-upload-sum { display: none; }

/* 上传状态：一个开关 + 月份下拉。打开后每家店后面标「已传／未传／缺什么」 */
.sb-upload { display: flex; align-items: center; gap: 6px; padding: 3px 11px 1px; }
.sb-upload-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  padding: 5px 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: #7d8ca3; font: inherit; font-size: 11.5px; font-weight: 550;
  cursor: pointer; transition: .14s var(--ease); white-space: nowrap;
}
.sb-upload-btn svg { width: 13px; height: 13px; flex: none; }
.sb-upload-btn:hover { background: rgba(255,255,255,.05); color: var(--sb-text-2); }
.sb-upload-btn[aria-pressed="true"] {
  background: rgba(99,102,241,.2); color: #c7d2fe; border-color: rgba(129,140,248,.28);
}
.sb-upload-month {
  flex: none; width: 86px; height: 24px; padding: 0 4px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 6px;
  background: rgba(255,255,255,.06); color: #cbd5e1; font: inherit; font-size: 11px;
  cursor: pointer; outline: none;
}
.sb-upload-month option { background: #1b2233; color: #e2e8f0; }
.sb-upload-sum {
  display: none; padding: 0 12px 4px 25px; font-size: 10.5px; color: #7d8ca3; letter-spacing: .1px;
}
.sb-upload-sum.on { display: block; }

.sb-items { display: flex; flex-direction: column; gap: 2px; }
.sb-items button { padding-left: 12px; }
.sb-items button svg { width: 15px; height: 15px; }

/* 平台分组里内嵌的店铺列表（TikTok 一批、SHEIN 一批，各归各的） */
.sb-group-stores { display: flex; flex-direction: column; gap: 2px; margin: 3px 0 2px; }
.sb-group-stores:empty { display: none; }
.sb-group-stores.collapsed { display: none; }
.sb-group-stores .sb-store { padding-left: 20px; font-size: 12.5px; }
/* 「36 家店铺」折叠开关：店多的平台不要直接把侧边栏撑满 */
.sb-stores-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 5px 12px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: #7d8ca3; font: inherit; font-size: 11.5px; font-weight: 550;
  cursor: pointer; text-align: left; transition: .14s var(--ease);
}
.sb-stores-toggle:hover { background: rgba(255,255,255,.05); color: var(--sb-text-2); }
.sb-stores-toggle .sb-chev { width: 11px !important; height: 11px !important; transform: rotate(-90deg); }
.sb-stores-toggle[aria-expanded="true"] .sb-chev { transform: none; }
.sb-head-right { display: flex; align-items: center; gap: 6px; }
.sb-count {
  font-size: 10px; font-weight: 600; letter-spacing: 0;
  padding: 0 6px; border-radius: 20px; line-height: 15px;
  background: rgba(255,255,255,.07); color: #93a2b8;
}

/* （原「店铺」整段列表的样式已废弃：店铺列表现在挂在各平台分组里，见 .sb-group-stores） */
.sb-store {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--sb-text); transition: .14s var(--ease);
  border: 0; background: none; font-family: inherit; text-align: left; width: 100%;
}
.sb-store:hover { background: rgba(255,255,255,.06); color: var(--sb-text-2); }
.sb-store.active { background: rgba(99,102,241,.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(129,140,248,.22); }
.sb-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: #475569; }
.sb-dot.on { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.14); }
.sb-dot.off { background: #fb7185; box-shadow: 0 0 0 3px rgba(251,113,133,.14); }
.sb-store-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sb-tag { flex: none; font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: rgba(251,113,133,.16); color: #fda4af; white-space: nowrap; font-weight: 550; }
.sb-tag.ok { background: rgba(52,211,153,.16); color: #6ee7b7; }
.sb-tag.mid { background: rgba(251,191,36,.16); color: #fcd34d; }

.sb-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--sb-line); font-size: 11px; color: #4b5a72; line-height: 1.65; }
.sb-foot .tag { margin-bottom: 4px; }
.sb-foot .k { display: flex; justify-content: space-between; padding: 2px 0; }
.sb-foot .k b { color: var(--sb-text); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h); flex: none;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.tb-title h2 { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.tb-title p { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.tb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.content { padding: 20px 24px 72px; max-width: var(--content-max); width: 100%; }
.panel { display: none; animation: fade .22s var(--ease); }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.grid-split { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; align-items: start; }
/* 右栏需要放得下多列表格时用这个（现金对账摘要等） */
.grid-split.wide-right { grid-template-columns: minmax(0, 1fr) 640px; }
@media (max-width: 1600px) { .grid-split.wide-right { grid-template-columns: minmax(0, 1fr) 520px; } }
@media (max-width: 1280px) { .grid-split, .grid-split.wide-right { grid-template-columns: 1fr; } }
/* 卡片高度各自独立：不加 height:fit-content 时，矮卡片会被高卡片撑出一大片空白 */
.grid-split > .card { margin-bottom: 0; align-self: start; height: fit-content; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.card-head h3 {
  font-size: 14.5px; font-weight: 650; letter-spacing: -.15px;
  display: flex; align-items: center; gap: 9px; color: var(--text);
}
.card-head h3::before { content: ''; width: 3px; height: 15px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), #818cf8); flex: none; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 0; }
.hr { height: 1px; background: var(--border); margin: 18px 0; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: .14s var(--ease); box-shadow: var(--shadow-xs);
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { background: var(--surface-2); border-color: #b9c0cd; color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn.primary {
  background: linear-gradient(180deg, #5b53ea, var(--brand)); border-color: var(--brand-600);
  color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.25), 0 4px 12px -4px rgba(79,70,229,.4);
}
.btn.primary:hover { background: linear-gradient(180deg, #4f46e5, var(--brand-600)); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm {
  height: 26px; padding: 0 10px; font-size: 12px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-family: inherit; font-weight: 550; cursor: pointer; transition: .14s var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm:hover { background: var(--surface-2); color: var(--text); border-color: #b9c0cd; }
a.btn-sm { text-decoration: none; }
.ghost { background: transparent; border-color: transparent; box-shadow: none; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field { display: flex; align-items: center; gap: 7px; }
.field label, .field > span { font-size: 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
input[type=month], input[type=text], input[type=number], input[type=password], select {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  transition: .14s var(--ease); box-shadow: var(--shadow-xs);
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
select { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; }

/* ============================ 标签 / 徽标 ============================ */
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 550;
  padding: 2px 8px; border-radius: 20px; background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.tag.off { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 550;
  padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--text-3); }

/* 数据齐备度指示点 */
.pip { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px;
  background: var(--border-strong); vertical-align: middle; }
.pip.on { background: #34d399; }
.pip.off { background: #fda4af; }
.pips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================ KPI ============================ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 20px 18px; box-shadow: var(--shadow-sm);
  overflow: hidden; transition: .18s var(--ease);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), #818cf8); }
.kpi.ok::before { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi.warn::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kpi.err::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.kpi.mute::before { background: var(--border-strong); }
.kpi-label { font-size: 12px; color: var(--text-3); font-weight: 550; letter-spacing: .1px; }
.kpi-value { font-size: clamp(21px, 1.55vw, 29px); font-weight: 700; letter-spacing: -.9px; margin-top: 9px; line-height: 1.1; color: var(--text); }
.kpi-value.ok { color: var(--ok); }
.kpi-value.warn { color: var(--warn); }
.kpi-value.err { color: var(--danger); }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 11.5px; color: var(--text-3); margin-top: 7px; line-height: 1.5; }
.kpi-foot b { color: var(--text-2); font-weight: 600; }

.kpi-row { display: flex; flex-wrap: wrap; gap: 14px; }
/* 190px 起跳：1440 宽的屏也能把 5 张 KPI 卡排成一行，不会掉一张到第二行 */
.kpi-row > .kpi { flex: 1 1 190px; min-width: 168px; margin: 0; }

/* ============================ 店铺卡片 ============================ */
/* 平台分区标题：TikTok 一批、SHEIN 一批，不混在一起 */
.plat-band {
  display: flex; align-items: center; gap: 9px; margin: 4px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.plat-band + .store-grid { margin-bottom: 22px; }
.plat-name { font-size: 12px; font-weight: 700; letter-spacing: .6px; color: var(--text-2); text-transform: uppercase; }
.plat-n {
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-3);
}
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.store-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; transition: .18s var(--ease); box-shadow: var(--shadow-xs);
}
.store-card:hover { border-color: #c7cede; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.store-card h4 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.store-card .srow { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-top: 6px; flex-wrap: wrap; }
.store-card .srow b { color: var(--text); font-weight: 620; }
.store-card .muted { font-size: 12px; }

/* ============================ 上传卡 ============================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (min-width: 1500px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.up-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px;
  transition: .18s var(--ease); box-shadow: var(--shadow-xs);
}
.up-card.drag { border-color: var(--brand); background: var(--brand-soft); }
.up-card h4 { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.up-card .desc { font-size: 12px; color: var(--text-3); line-height: 1.7; flex: 1; }
.up-card .desc code { font-size: 11.5px; }
.up-card .stat {
  font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 11px;
  font-weight: 550; word-break: break-word;
}
.up-card .stat.empty { color: var(--text-3); font-weight: 400; background: transparent; border-style: dashed; }
/* 每张上传卡的「下载示例文件」：小号、可点、不抢按钮的注意力 */
.up-card .sample-link {
  font-size: 11.5px; color: var(--brand); text-decoration: none;
  display: inline-flex; align-items: center; gap: 3px; line-height: 1.5;
}
.up-card .sample-link:hover { text-decoration: underline; }
.up-card .req { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px;
  background: var(--danger-soft); color: var(--danger); }
.up-card .opt { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--text-3); }
.up-card .btn { width: 100%; margin-top: 2px; }

/* ============================ 表格 ============================ */
.table-wrap { overflow: auto; max-height: 640px; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table th {
  position: sticky; top: 0; z-index: 2; text-align: left; font-weight: 600; font-size: 11.5px;
  color: var(--text-3); background: var(--surface-2); padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border); letter-spacing: .2px;
}
table td { padding: 10px 14px; border-bottom: 1px solid #f1f3f7; text-align: left; color: var(--text-2);
  vertical-align: middle; white-space: nowrap; }
table td:last-child, table th:last-child { padding-right: 18px; }
table tbody tr:last-child td { border-bottom: 0; }
table tbody tr:hover td { background: var(--surface-hover); }
table tr.total td { background: var(--brand-soft); font-weight: 650; color: var(--text);
  border-top: 1px solid #dcdffb; border-bottom: 0; }
table tr.total:hover td { background: var(--brand-soft); }
/* 数字列统一右对齐；表头由 app.js 的 autoAlignTables() 跟着走 */
table .num, table th.num { text-align: right; }
table .lft, table th.lft { text-align: left; }
/* 首列再往左推一点，避免贴着卡片边 */
table th:first-child { padding-left: 18px; }
table td:first-child { padding-left: 18px; }
table .neg, td .neg { color: var(--danger); }
table .pos, td .pos { color: var(--ok); }
table .dim, td.dim { color: var(--text-3); }
table .mono, td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--text-2); }
table td b { color: var(--text); font-weight: 640; }

/* 键值表（店铺信息、口径说明）*/
table.kv { font-size: 13px; }
table.kv th {
  position: static; text-align: left; width: 190px; background: var(--surface-2); color: var(--text-2);
  font-weight: 600; padding: 11px 16px; white-space: normal; box-shadow: none;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
table.kv td { text-align: left; white-space: normal; padding: 11px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-2); line-height: 1.7; }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }
table.kv tr:hover td, table.kv tr:hover th { background: inherit; }

.ellip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; }

/* ============================ 提示条 ============================ */
.alert { display: flex; gap: 11px; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 12.5px;
  line-height: 1.7; margin-bottom: 14px; border: 1px solid; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.alert > div { min-width: 0; flex: 1; }
.alert.info { background: var(--brand-soft); border-color: #dcdffb; color: #3730a3; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.alert.err, .alert.danger { background: var(--danger-soft); border-color: var(--danger-border); color: #9f1239; }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-border); color: #065f46; }
.alert.danger b, .alert.err b { color: #881337; }

/* 缺成本商品清单 */
.miss-wrap { margin-top: 11px; max-height: 320px; overflow: auto; border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm); background: var(--surface); }
table.miss-table { width: 100%; font-size: 12px; }
table.miss-table th { position: sticky; top: 0; background: #fff5f6; color: #9f1239; font-weight: 600;
  padding: 8px 11px; border-bottom: 1px solid var(--danger-border); }
table.miss-table td { padding: 7px 11px; border-bottom: 1px solid #fdf0f2; color: var(--text-2); vertical-align: top; }
table.miss-table tbody tr:last-child td { border-bottom: none; }
table.miss-table td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }

/* ============================ 数据健康 ============================ */
.health-list { display: flex; flex-direction: column; gap: 9px; max-height: 420px; overflow-y: auto; }
.health-item { display: flex; align-items: flex-start; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.health-item .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--text-3); }
.health-item.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.health-item.warn .dot { background: #f59e0b; box-shadow: 0 0 0 3px var(--warn-soft); }
.health-item.err .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.health-item .txt { flex: 1; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.health-item .txt b { font-weight: 620; color: var(--text); }
.health-item .txt .muted { display: block; margin-top: 2px; font-size: 11.5px; }

/* ============================ 阶梯拆解 ============================ */
.tier-list { display: flex; flex-direction: column; gap: 11px; }
.tier-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 16px; background: var(--surface-2); }
.tier-item .th { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tier-item .th b { font-size: 13.5px; font-weight: 650; }
.tier-item .res { font-size: 13px; font-weight: 650; color: var(--ok); }
.tier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--text-2); padding: 3px 0; }
.tier-row b { font-weight: 600; color: var(--text); }

/* ============================ 图表 ============================ */
.chart-box { padding: 4px 2px 0; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .lbl { font-size: 11px; fill: var(--text-3); font-family: inherit; }
svg.chart .bar { transition: opacity .15s var(--ease); }
svg.chart .bar:hover { opacity: .82; }
svg.chart .thr { stroke: #f59e0b; stroke-width: 1.4; stroke-dasharray: 6 4; }
svg.chart .thr-txt { font-size: 11px; fill: #b45309; font-weight: 600; }
.chart-legend { display: flex; gap: 22px; padding: 14px 6px 2px; flex-wrap: wrap; }
.chart-legend span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; flex: none; }

/* ============================ 空 / 加载 ============================ */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px;
  padding: 52px 20px; color: var(--text-3); font-size: 13px; text-align: center; }
.empty svg { width: 34px; height: 34px; opacity: .4; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border-strong);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, #f7f8fa 50%, var(--surface-3) 75%);
  background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ============================ 提示浮层 ============================ */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: 480px;
  padding: 13px 17px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6;
  background: #111827; color: #f9fafb; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: #064e3b; }
.toast.err { background: #881337; }

.robanner { background: var(--warn-soft); border-bottom: 1px solid var(--warn-border); color: var(--warn);
  padding: 9px 24px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
body.readonly .up-card button, body.readonly #btnNewStore, body.readonly #btnEditStore,
body.readonly #btnDelStore, body.readonly #btnAddStaff, body.readonly #btnBindStaff, body.readonly #btnSnapshot,
body.readonly #btnLockMonths, body.readonly #btnSaveOptions, body.readonly #btnResetOptions,
body.readonly #btnBackupNow, body.readonly #btnSetPassword { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ============================ 现金对账 · 店铺小卡 ============================ */
.store-chip {
  display: inline-flex; flex-direction: column; gap: 4px; padding: 12px 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; margin: 0 10px 10px 0; min-width: 224px; box-shadow: var(--shadow-xs);
}
.store-chip b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.store-chip span { color: var(--text-2); }
.store-chip.ok { border-left: 3px solid var(--ok); }
.store-chip.warn { border-left: 3px solid #f59e0b; background: var(--warn-soft); }
.store-chip.bad { border-left: 3px solid var(--danger); background: var(--danger-soft); }

/* ============================ 参数设置表单 ============================
   三个区块共用同一套节奏：固定列宽 + 标签左对齐 + 输入框紧跟标签。 */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, 292px);
  gap: 11px 30px; justify-content: start; }
.opt-item { display: flex; align-items: center; gap: 12px; font-size: 12.5px;
  color: var(--text-2); min-width: 0; }
.opt-item > span:first-child { flex: 1; min-width: 0; line-height: 1.45; text-align: left; }
.opt-item input[type=number] { flex: none; width: 100px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: 7px; font-family: inherit; font-size: 12.5px;
  text-align: right; font-variant-numeric: tabular-nums; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs); }
.opt-item input[type=number]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.opt-item input[type=checkbox] { flex: none; width: 15px; height: 15px; accent-color: var(--brand); margin-top: 1px; }
.opt-item.bool { align-items: flex-start; gap: 9px; }
.opt-item.bool > span:first-child { flex: 1; }
.opt-item:hover > span:first-child { color: var(--text); }

.tier-edit { display: grid; grid-template-columns: repeat(auto-fill, 420px); gap: 11px 30px; justify-content: start; }
.tier-edit-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.tier-edit-row input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 7px; font-family: inherit; font-size: 12.5px; text-align: right;
  font-variant-numeric: tabular-nums; background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.tier-edit-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.tier-edit-row span { flex: none; }

.opt-group-title { margin: 20px 0 9px; font-size: 12.5px; font-weight: 650; color: var(--text);
  display: flex; align-items: center; gap: 8px; }
.opt-group-title:first-child { margin-top: 2px; }
.opt-group-title::before { content: ''; width: 3px; height: 13px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), #818cf8); }

/* ============================ 操作流程 / 步骤 ============================ */
.steps { padding-left: 20px; font-size: 12.5px; color: var(--text-2); line-height: 2; }
.steps li { padding-left: 4px; }
.steps li::marker { color: var(--brand); font-weight: 600; }

/* ============================ 遗留 / 兼容 ============================ */
.grid { display: grid; gap: 14px; }
.prog { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--brand); }
.skeleton, .axis, .skeleton-chart { color: inherit; }

/* ============================ 数据总览 · 筛选条 ============================ */
.filter-card { overflow: visible; position: sticky; top: var(--header-h); z-index: 15;
  border-radius: 0 0 var(--radius) var(--radius); }
.filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 13px 20px;
}
.fb-left, .fb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.filter-note { padding: 9px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; color: var(--text-2); border-radius: 0 0 var(--radius) var(--radius); }
.filter-note .muted { font-size: 11.5px; }

/* ---- 店铺多选下拉 ---- */
.ms { position: relative; }
.ms-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; font-size: 13px; font-weight: 550; color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-xs); transition: .14s var(--ease); min-width: 190px;
}
.ms-btn:hover { border-color: #b9c0cd; background: var(--surface-2); }
.ms-btn svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.ms-btn #msText { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-chev { transition: transform .18s var(--ease); }
.ms-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 300px; max-height: 400px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg, 0 12px 32px -8px rgba(16,24,40,.22)); overflow: hidden;
  display: flex; flex-direction: column;
}
.ms-pop[hidden] { display: none; }
.ms-acts { display: flex; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ms-act {
  flex: 1; height: 27px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface);
  font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer;
}
.ms-act:hover { background: var(--brand-soft); border-color: #c7d2fe; color: var(--brand-700); }
.ms-list { overflow-y: auto; padding: 5px; }
.ms-group {
  padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .8px;
  color: var(--text-3); text-transform: uppercase;
}
.ms-group:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; }
.ms-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.ms-item:hover { background: var(--surface-2); }
.ms-item input { width: 15px; height: 15px; accent-color: var(--brand); flex: none; cursor: pointer; }
.ms-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ms-meta { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ============================ 数据总览 · 商品排行 ============================ */
.prod-head { padding: 13px 20px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.prod-head .pos { color: var(--ok); }
.prod-head .neg { color: var(--danger); }
.tag.danger { background: var(--danger-soft); color: #9f1239; border-color: var(--danger-border); }

/* ============================ 数据总览 · 毛利对账桥 ============================ */
table.kv.bridge th { width: 150px; }
table.kv.bridge td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 550; color: var(--text); }
table.kv.bridge td.muted { font-size: 11.5px; color: var(--text-3); }
table.kv.bridge tr.bridge-total td, table.kv.bridge tr.bridge-total th {
  background: var(--brand-soft); font-weight: 650; color: var(--brand-700); }
table.kv.bridge tr.bridge-total td.num { font-size: 14px; }

/* ============================ 现金对账 · 差额标注 ============================ */
.recon-note { display: flex; align-items: center; gap: 6px; max-width: 440px; }
.recon-note .rn-txt {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--text-2); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recon-note .btn-sm { flex: none; }
.btn-sm.danger { color: var(--danger); border-color: var(--danger-border); }
.btn-sm.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.store-chip .btn-sm { align-self: flex-start; margin-top: 5px; }

/* ============================ 店铺档案 · 「本店没有这一项」声明 ============================ */
.declare-row {
  display: flex; flex-direction: column; gap: 6px; margin-top: 11px; padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.chk { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.chk input { width: 14px; height: 14px; accent-color: var(--brand); flex: none; cursor: pointer; }
.chk:hover { color: var(--text); }
.chk input:checked + span { color: var(--brand-700); font-weight: 600; }

/* ============================ 产品成本明细（手工录入） ============================ */
#costList input {
  height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: 12.5px; background: var(--surface); color: var(--text);
  font-variant-numeric: tabular-nums; transition: .14s var(--ease);
}
#costList .ci-cost, #costList .ci-leg { width: 92px; text-align: right; }
#costList .ci-cur { width: 64px; text-align: center; }
#costList .ci-total { font-variant-numeric: tabular-nums; }
#costList input:hover { border-color: var(--border-strong); }
#costList input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
#costList .ci-name { width: 100%; min-width: 180px; }
#costList tr.draft td { background: var(--brand-soft); }
#costList td.nowrap { white-space: nowrap; }

/* 表格里的操作按钮：用 flex 排一行。光靠 td 的 white-space:nowrap 不保险 —— 
   实测过：两个 inline-flex 按钮会被挤成上下两行，把行高撑到 51px。 */
.act-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

/* ============================ SKU 映射明细 ============================ */
#mapList input, #mapList select {
  height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: 12.5px; background: var(--surface); color: var(--text); transition: .14s var(--ease);
}
#mapList .mi-name { width: 100%; min-width: 200px; }
#mapList .mi-sku { width: 100%; min-width: 200px; font-family: ui-monospace, Consolas, monospace; }
#mapList .mi-plat, #mapList .mi-store { width: 100%; }
#mapList input:hover, #mapList select:hover { border-color: var(--border-strong); }
#mapList input:focus, #mapList select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
#mapList tr.draft td { background: var(--brand-soft); }

/* ============================ 产品档案（映射 + 成本 合并） ============================ */
#catList input, #catList select {
  height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: 12.5px; background: var(--surface); color: var(--text); transition: .14s var(--ease);
}
#catList input:hover, #catList select:hover { border-color: var(--border-strong); }
#catList input:focus, #catList select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
#catList .ci-name, #catList .mi-name, #catList .mi-sku { width: 100%; min-width: 180px; }
#catList .mi-sku { font-family: ui-monospace, Consolas, monospace; }
#catList .ci-cost, #catList .ci-leg { width: 90px; text-align: right; }
#catList .ci-cur { width: 60px; text-align: center; }
#catList .mi-plat, #catList .mi-store { width: 100%; }
#catList .ci-total { font-variant-numeric: tabular-nums; }
#catList tr.draft td { background: var(--brand-soft); }

/* 分段切换：按产品 / 按 SKU */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; height: 34px; }
.seg button {
  border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px;
  font-weight: 550; padding: 0 13px; cursor: pointer; transition: .14s var(--ease); white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface-2); color: var(--text); }
.seg button.active { background: var(--brand); color: #fff; }

/* ============================ 产品档案 · 公司产品名下拉 ============================ */
.pick { display: flex; flex-direction: column; gap: 4px; min-width: 260px; }
.pick .mi-pick { width: 100%; }
.pick .mi-name { width: 100%; }
/* 可搜索下拉（2026-11-02 新增）：165 个产品靠原生 select 选不动，改成打字筛选 */
.pick .mi-q { width: 100%; }
.mi-drop { z-index: 60; max-height: 300px; overflow: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18); }
.mi-group { padding: 6px 9px 3px; font-size: 10.5px; color: var(--text-3); letter-spacing: .2px; }
.mi-item { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-item:hover, .mi-item.on { background: var(--brand-soft); color: var(--brand); }
.mi-item.mi-new { border-top: 1px solid var(--border); margin-top: 3px; padding-top: 7px; color: var(--brand); font-weight: 600; }
.mi-empty { padding: 10px; font-size: 12px; color: var(--text-3); }
.mi-more { padding: 6px 10px; font-size: 11px; color: var(--text-3); }
.cost-hint { font-size: 10.5px; color: var(--text-3); font-weight: 400; margin-top: 3px; line-height: 1.4; white-space: normal; }
#catList .ci-cost[readonly] { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; border-style: dashed; }
#catList .ci-leg[readonly] { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; border-style: dashed; }

/* 侧栏底部「同事访问」地址：点一下复制 */
.lan-link { color: var(--brand); text-decoration: none; font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: 11.5px; }
.lan-link:hover { text-decoration: underline; }

/* ============================ 弹窗（员工添加 / 绑定） ============================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 300; padding: 20px;
  background: rgba(15, 23, 42, .42);
  display: flex; align-items: center; justify-content: center;
}
.modal-mask[hidden] { display: none; }
.modal {
  width: 100%; max-width: 452px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 14.5px; font-weight: 650; color: var(--text); }
.modal-x {
  border: 0; background: none; cursor: pointer; line-height: 1;
  font-size: 19px; color: var(--text-3); padding: 2px 4px; border-radius: 5px;
}
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.field.col { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.field.col > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field.col input, .field.col select {
  height: 36px; padding: 0 10px; font: inherit; font-size: 13px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
}
.field.col input:focus, .field.col select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
.modal-hint { font-size: 12px; color: var(--text-3); line-height: 1.65; }
.modal-hint b { color: var(--text-2); font-weight: 600; }

/* ── 员工工资单（tab=salary）：屏幕上是卡片预览，真正的纸在 /salary 打印页 ── */
.slip-sum { display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 10px;
  font-size: 13px; color: var(--text-2); }
.slip-sum b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.slip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 12px; align-items: start; }
.slip-person { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.slip-ph { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); }
.slip-ph b { font-size: 14px; color: var(--text); }
.slip-ph .muted { font-size: 11.5px; }
.slip-amt { margin-left: auto; font-size: 16px; font-weight: 750; color: var(--brand);
  font-variant-numeric: tabular-nums; }
.slip-person .slip-ph .btn { padding: 4px 10px; font-size: 12px; }
.slip-tb { width: 100%; border-collapse: collapse; font-size: 12px; }
.slip-tb th, .slip-tb td { padding: 6px 14px; border-bottom: 1px solid var(--border); }
.slip-tb thead th { background: var(--surface-hover); font-size: 11px; color: var(--text-3);
  font-weight: 650; text-align: left; }
.slip-tb .n, .slip-tb th.n { text-align: right; font-variant-numeric: tabular-nums; }
.slip-tb tbody tr:last-child td { border-bottom: 0; }
.slip-cn { padding: 8px 14px; font-size: 11.5px; color: var(--text-3); background: var(--surface-hover); }

/* ── 账号与权限（系统设置）── */
.user-add { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.user-add input, .user-add select { height: 34px; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; background: #fff; }
.user-add input { width: 132px; }
.user-add select[multiple] { height: auto; min-width: 158px; padding: 4px 6px; }
.user-add select[multiple] option { padding: 2px 4px; }
.user-add .btn { height: 34px; }

/* 可上传店铺：复选框平铺（20 家店也能一眼扫完，点一下就切换，不用按 Ctrl） */
.store-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 2px 4px; max-height: 140px; overflow: auto; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 9px; background: #fff; flex: 1 1 280px; min-width: 240px; }
.store-pick label { display: flex; align-items: center; gap: 5px; font-size: 12.5px;
  cursor: pointer; padding: 2px 3px; border-radius: 5px; white-space: nowrap; overflow: hidden; }
.store-pick label:hover { background: var(--surface-2); }
.store-pick input { margin: 0; width: 14px; height: 14px; flex: none; accent-color: var(--brand); }
.store-pick span { overflow: hidden; text-overflow: ellipsis; }
.sp-wrap { flex: 1 1 300px; min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.sp-title { font-size: 11px; color: var(--text-3); letter-spacing: .3px; }
.sp-title span { color: var(--text-3); font-weight: 400; }
.sp-wrap .store-pick { flex: none; width: 100%; }

/* ── 上传员模式：侧边栏只留「上传数据」，其余板块整块不显示 ── */
body.role-uploader .sb-group,
body.role-uploader .sb-upload,
body.role-uploader .sb-upload-sum,
body.role-uploader .sb-group-stores { display: none !important; }
.sb-role-nav { padding: 8px 10px 4px; }
.sb-role-nav button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 0; border-radius: 9px; background: rgba(79,70,229,.18); color: #e2e8f0;
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.sb-role-nav button svg { width: 17px; height: 17px; flex: none; }
.sb-role-nav button.active { background: #4f46e5; color: #fff; }

/* 可上传店铺：按平台分组（TikTok / SHEIN …），组内再平铺复选框 */
.store-pick { display: block; max-height: 230px; overflow: auto; }
.sp-group + .sp-group { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); }
.sp-gt { display: flex; align-items: baseline; gap: 6px; font-size: 11px; font-weight: 800;
  color: var(--text-2); letter-spacing: .5px; margin-bottom: 5px; position: sticky; top: 0;
  background: #fff; padding: 1px 0 2px; }
.sp-gt span { font-weight: 400; color: var(--text-3); font-size: 10.5px; letter-spacing: 0; }
.sp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 2px 4px; }

/* 分组标题可点击折叠（SHEIN 36 家，全摊开太高） */
.sp-gt { cursor: pointer; border: 0; background: #fff; width: 100%; text-align: left;
  padding: 2px 0; font-family: inherit; }
.sp-gt:hover { color: var(--brand); }
.sp-caret { display: inline-block; width: 13px; font-style: normal; color: var(--text-3);
  transition: transform .15s; }
.sp-group.collapsed .sp-caret { transform: rotate(-90deg); }
.sp-group.collapsed .sp-items { display: none; }
.store-pick { max-height: 300px; }

/* ── 上传指引 ── */
.guide-link { font-size: 11px; font-weight: 400; color: var(--brand); text-decoration: none;
  margin-left: 6px; border-bottom: 1px dashed currentColor; }
.guide-link:hover { color: var(--brand-strong, #4338ca); }
.guide-modal { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; }
.guide-modal[hidden] { display: none; }
.gm-mask { position: absolute; inset: 0; background: rgba(15,23,42,.62); }
.gm-box { position: relative; width: min(1180px, 94vw); max-height: 92vh; background: #fff;
  border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); }
.gm-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: #fbfcfe; }
.gm-hd b { font-size: 14.5px; }
.gm-x { margin-left: auto; border: 0; background: transparent; font-size: 16px; color: var(--text-3);
  cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.gm-x:hover { background: var(--surface-2); color: var(--text); }
.gm-body { overflow: auto; padding: 14px 16px 18px; }
.gm-item + .gm-item { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.gm-item h4 { margin: 0 0 6px; font-size: 14px; }
.gm-item ol { margin: 0 0 8px; padding-left: 18px; font-size: 12.5px; line-height: 1.85; color: var(--text-2); }
.gm-item ol b { color: var(--brand); }
.gm-item img { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; display: block; }
.gm-tip { margin-top: 6px; font-size: 11.5px; background: var(--warn-soft, #fffbeb); color: var(--warn, #92400e);
  border-left: 3px solid var(--warn-line, #f59e0b); padding: 6px 10px; border-radius: 0 6px 6px 0; line-height: 1.7; }

/* 指引图：点一下放到原始尺寸，看清红框标注 */
.gm-item img { cursor: zoom-in; }
.gm-item img.zoom { width: auto; max-width: none; cursor: zoom-out; }
.gm-zoom { font-size: 11px; color: var(--text-3); margin-top: 5px; text-align: center; }

/* 全屏看图：默认「整张适应屏幕」，点一下切原始像素（可拖动滚动） */
.img-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(8,12,20,.95);
  display: flex; align-items: center; justify-content: center; overflow: auto; padding: 18px; }
.img-viewer[hidden] { display: none; }
.img-viewer img { max-width: 100%; max-height: calc(100vh - 60px); width: auto; height: auto;
  object-fit: contain; border-radius: 6px; cursor: zoom-in; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.img-viewer img.full { max-width: none; max-height: none; cursor: zoom-out; }
.iv-tip { position: fixed; bottom: 12px; left: 0; right: 0; text-align: center;
  font-size: 11.5px; color: rgba(255,255,255,.62); pointer-events: none; }

/* 封账标签：账已结，别再传了 */
.sb-tag.lock { background: #fff7ed; color: #c2410c; border-color: #fed7aa; font-weight: 700; }

/* 退出登录：放在 logo 行右侧，店铺列表再长也不会被挤出屏幕 */
.sb-exit { text-decoration: none; margin-left: auto; flex: 0 0 auto; width: auto; height: 26px; padding: 0 7px; gap: 4px; font-size: 11px; border: 0; border-radius: 7px;
  background: transparent; color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sb-exit:hover { background: rgba(255,255,255,.09); color: #f8fafc; }
.sb-exit svg { width: 13px; height: 13px; }
.sb-exit span { line-height: 1; }

/* 上传卡里的「选择文件上传」用 label 包 input：原生触发，避免 JS click 被浏览器吞掉 */
.up-card .up-pick { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.up-card .up-pick input[type=file] { display: none; }

/* 平台切换：两个按钮，选中的高亮。TikTok 和 SHEIN 各自独立一套菜单 */
.sb-plat { display: flex; gap: 6px; padding: 10px 12px 4px; }
.sb-plat button {
  flex: 1; padding: 6px 0; border: 1px solid rgba(255,255,255,.13); border-radius: 8px;
  background: transparent; color: #94a3b8; font-size: 12px; font-weight: 600;
  letter-spacing: .3px; cursor: pointer; transition: .15s var(--ease);
}
.sb-plat button:hover { border-color: rgba(255,255,255,.28); color: #e2e8f0; }
.sb-plat button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* hidden 属性会被上面的 display:flex 覆盖（同优先级、后者赢），必须显式压掉 */
.sb-group[hidden], .sb-plat[hidden] { display: none !important; }

/* 权限裁剪用 hidden 控制显隐：自定义 CSS 里的 display 会覆盖它，统一压掉 */
[hidden] { display: none !important; }
