:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #e8ecf2;
  --line-strong: #dbe2ec;
  --text: #14181f;
  --text-2: #5a6474;
  --text-3: #98a2b3;
  --primary: #1856d8;
  --primary-weak: #eaf1ff;
  --primary-deep: #0f3fa6;
  --ok: #0f9d6b;
  --ok-weak: #e6f7f0;
  --warn: #d97706;
  --warn-weak: #fef3e2;
  --danger: #d92d20;
  --danger-weak: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
  --sidebar: 220px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d7dde6; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff;
}
.login-brand {
  position: relative; overflow: hidden; padding: 56px; color: #fff;
  background: radial-gradient(120% 90% at 15% 8%, #3b7bf0 0%, #1856d8 42%, #0b2f7a 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand .rings { position: absolute; right: -160px; top: -120px; width: 620px; height: 620px; opacity: .18; }
.login-brand h1 { font-size: 34px; line-height: 1.3; margin: 0 0 14px; letter-spacing: .5px; font-weight: 700; }
.login-brand p { margin: 0; color: rgba(255,255,255,.75); font-size: 15px; max-width: 420px; }
.login-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 1px; font-size: 15px; }
.login-logo .mark {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; backdrop-filter: blur(4px);
}
.login-feats { display: flex; gap: 28px; flex-wrap: wrap; position: relative; }
.login-feats div { font-size: 13px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 8px; }
.login-feats b { display: block; font-size: 22px; color: #fff; letter-spacing: .5px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 360px; }
.login-box h2 { font-size: 24px; margin: 0 0 6px; }
.login-box .sub { color: var(--text-2); margin: 0 0 28px; font-size: 13px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: #fff; outline: none; transition: .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,86,216,.1); }
.input::placeholder { color: #b6bfcc; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

.btn {
  height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: .15s; white-space: nowrap; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(24,86,216,.25); }
.btn-primary:hover { background: #1349bd; }
.btn-primary:disabled { background: #b8c6e4; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: #b9c4d4; background: #fafbfd; }
.btn-danger { background: var(--danger-weak); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-lg { height: 50px; font-size: 16px; border-radius: 12px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; color: #fff; display: grid; place-items: center;
  background: linear-gradient(135deg, #2f6ff0, #1247be); box-shadow: 0 4px 12px rgba(24,86,216,.3);
}
.brand .t { font-weight: 700; font-size: 15px; letter-spacing: .3px; line-height: 1.2; }
.brand .s { font-size: 11px; color: var(--text-3); letter-spacing: .6px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-group { font-size: 11px; color: var(--text-3); padding: 14px 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 9px;
  color: var(--text-2); font-size: 14px; margin-bottom: 2px; transition: .12s; cursor: pointer;
}
.nav-item:hover { background: #f4f7fc; color: var(--text); }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; min-width: 18px;
  height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; font-weight: 600;
}
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user-card:hover { background: #f4f7fc; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#e8f0ff,#d3e2ff);
  color: var(--primary); font-weight: 700; display: grid; place-items: center; font-size: 14px; flex: 0 0 34px;
}
.user-card .n { font-size: 13px; font-weight: 600; }
.user-card .r { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .desc { font-size: 12px; color: var(--text-3); margin-left: 4px; }
.topbar .spacer { flex: 1; }
.store-picker { display: flex; align-items: center; gap: 8px; }
.store-picker .select { height: 34px; width: auto; min-width: 150px; font-size: 13px; border-radius: 8px; }
.content { padding: 22px 28px 60px; flex: 1; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-h .hint { font-size: 12px; color: var(--text-3); }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid > .card { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-32 { grid-template-columns: 1.6fr 1fr; }
.grid-23 { grid-template-columns: 1fr 1.6fr; }
.stack-16 > * + * { margin-top: 16px; }

/* KPI */
.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi .lab { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 27px; font-weight: 700; letter-spacing: -.5px; margin: 8px 0 4px; line-height: 1.2; }
.kpi .val small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.kpi .foot { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .ico-bg {
  position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; background: var(--primary-weak); color: var(--primary);
}
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; letter-spacing: .3px;
  padding: 11px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
.tbl tbody tr:hover { background: #fafcff; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl .strong { font-weight: 600; }
.tbl .muted { color: var(--text-3); font-size: 12.5px; }
.tbl tfoot td { font-weight: 600; background: #fafbfc; border-top: 1px solid var(--line); }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.tag-blue { background: var(--primary-weak); color: var(--primary); }
.tag-ok { background: var(--ok-weak); color: var(--ok); }
.tag-warn { background: var(--warn-weak); color: var(--warn); }
.tag-danger { background: var(--danger-weak); color: var(--danger); }
.tag-gray { background: #f2f4f7; color: var(--text-2); }
.tag-info { background: #e6f7f4; color: #0d9488; font-family: ui-monospace, Menlo, Consolas, monospace; }
/* 赠品（v1.17）：橙色系标签与行高亮 */
.tag-gift { background: #fff1e6; color: #c2410c; border: 1px solid #fed7aa; font-weight: 600; }
.tbl tr.row-gift > td { background: #fffaf5 !important; }
.tbl tr.row-gift > td:first-child { box-shadow: inset 3px 0 0 #f97316; }
.num.gift-price, .gift-price { color: #c2410c; font-weight: 700; }
.cart-item.is-gift { background: #fffaf5; border-color: #fed7aa; }
.cart-item.is-gift .nm { color: #c2410c; }

.empty { padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .big { font-size: 34px; opacity: .35; display: block; margin-bottom: 8px; }

/* 进度条 */
.bar { height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4b86f5, #1856d8); }

/* ---------- 筛选条 ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input, .filters .select { width: auto; height: 36px; border-radius: 8px; font-size: 13px; }
.filters .grow { flex: 1; min-width: 160px; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 100;
  display: grid; place-items: center; padding: 24px; animation: fade .15s ease;
}
/* v1.24 弹窗叠层：识别弹窗叠在入库弹窗之上，层级由 JS 递增设置 */
.modal-layer { position: fixed; inset: 0; z-index: 1000; }
.modal-layer > .modal-mask { z-index: auto; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal.wide { max-width: 760px; }
.modal-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fbfcfe; border-radius: 0 0 14px 14px; }
.x-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); }
.x-btn:hover { background: #f2f4f7; color: var(--text); }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }

/* toast */
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1b2330; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: 90vw;
}
.toast.err { background: #b42318; }
.toast.ok { background: #0b7a53; }

/* ---------- 收银台：扫码 + 销售人 ---------- */
.scan-row { display: flex; gap: 8px; }
.scan-box {
  flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 12px;
  border: 1.5px solid var(--primary); border-radius: 10px; background: #f8fbff; color: var(--primary);
}
.scan-box:focus-within { box-shadow: 0 0 0 3px rgba(24,86,216,.12); }
.scan-ipt { flex: 1; height: 38px !important; border: 0 !important; background: transparent !important; padding: 0 !important; font-size: 15px !important; box-shadow: none !important; }
.scan-ipt::placeholder { font-weight: 400; color: var(--text-3); font-size: 13px; }
.sales-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 10px;
  background: linear-gradient(135deg,#f5f9ff,#eef4ff); border: 1px solid #e2ebfb; border-radius: 10px;
}
.sales-bar .sb-lab { font-size: 12px; color: var(--text-2); flex: none; }
.sales-bar .sb-sel { height: 34px; flex: 1; min-width: 0; font-weight: 600; }
.sales-bar .sb-fixed { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; }
.prod .cd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: var(--text-3); letter-spacing: .2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- 收银台 ---------- */
.pos { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.pos-left, .pos-right { min-width: 0; }
.pos-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-cats button { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); background: #fff; }
.pos-cats button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.prod {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; text-align: left;
  transition: .12s; position: relative; min-height: 96px; display: flex; flex-direction: column; gap: 4px;
}
.prod:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(24,86,216,.1); transform: translateY(-1px); }
/* v1.79 串码实时定位卡：输入串码后在商品网格顶部显示这台机器 */
.prod.serial-hit { border: 1.5px dashed var(--primary); background: #f0f5ff; }
.prod.serial-hit.is-dim { border-color: var(--line); background: #fafafa; }
.prod.serial-hit .sh-tag {
  font-size: 10.5px; font-weight: 700; color: var(--primary);
  background: rgba(24,86,216,.08); border-radius: 4px; padding: 2px 7px; align-self: flex-start;
}
.prod.serial-hit.is-dim .sh-tag { color: var(--text-3); background: #eee; }
.prod.serial-hit .sh-msg { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-top: auto; }
.prod.serial-hit .stb.st-ok { color: #fff; background: var(--primary); padding: 3px 10px; border-radius: 6px; font-weight: 700; }
.prod .nm { font-weight: 600; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .sp { font-size: 11.5px; color: var(--text-3); }
.prod .pr { margin-top: auto; color: var(--danger); font-weight: 700; font-size: 15px; }
.prod .pr small { font-size: 11px; font-weight: 500; }
.prod .st { position: absolute; right: 8px; top: 8px; font-size: 11px; color: var(--text-3); }
.prod.ops { border-color: #cfe0ff; background: #fafcff; }

/* ---------- v1.59 开单：库存徽章 ----------
   以前库存是右上角一行小灰字，三个问题：
   ① 和两行商品名重叠（「iPhone 15 Pro 256G」的名字被「51台」盖住）
   ② 剩 1 台和剩 200 件长得一样，紧张程度全靠读数
   ③ 低库存只是换个文字颜色，一屏扫过去注意不到。
   现在改为「价格 | 库存」同一行两端排布：
   · 库存是 <b>大数字</b>+<em>小单位</em> 的徽章，余量一眼可读
   · 三档状态：充裕=中性浅底；偏低(≤安全库存)=琥珀浅底；告急(≤2)=琥珀实底白字
   · 红色仍只留给购物车「超库存」，徽章不用红——开单页要的是
     「提醒补货」，不是「报错」，和 v1.55 类目配色的分工一致 */
.prod .ft {
  margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px;
}
.prod .ft .pr { margin-top: 0; }
.prod .stb {
  flex: none; display: inline-flex; align-items: baseline; gap: 2px;
  padding: 2px 8px; border-radius: 999px;
  background: #f1f5f9; color: #475569;
  font-size: 10.5px; line-height: 1.3; white-space: nowrap;
}
.prod .stb b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.prod .stb em { font-style: normal; font-size: 10px; opacity: .8; }
.prod .stb i { font-style: normal; font-size: 10px; opacity: .75; margin-right: 1px; }
.prod .stb.st-low {
  background: #fef3c7; color: #92400e;
}
.prod .stb.st-crit {
  background: #f59e0b; color: #fff;
}
.prod .stb.st-crit b, .prod .stb.st-crit em { color: #fff; }
/* 纯文字形态（总部视角兜底：qty 未知时无数字可放大） */
.prod .stb b:empty { display: none; }
/* 手机卡/号卡业务的「业务」角标保持右上角小字（v1.55 紫色语义不变） */
.prod.cat-bc .st { color: #6d28d9; font-weight: 600; }

/* ---------- v1.55 开单：品项类目配色 ----------
   一屏几十个商品，靠读文字分辨「手机 / 配件 / 号卡」太慢。
   左侧 3px 色条 + 角标同色，扫一眼就能分区。
   注意：这些色是"分类标识"，不表示状态，所以刻意避开 danger 红和 warn 琥珀，
   把红/琥珀留给「超库存」「低库存」这类真正的告警。 */
.prod::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: #d6dde8;
}
.prod.cat-ph::before { background: #2563eb; }   /* 手机：蓝，主销品类 */
.prod.cat-ac::before { background: #64748b; }   /* 配件：灰蓝，配角 */
.prod.cat-bc::before { background: #7c3aed; }   /* 号卡业务：紫，不压库存 */
.prod.cat-ot::before { background: #0d9488; }   /* 其它：青，兜底 */
.prod.cat-ph { padding-left: 15px; }
.prod.cat-ac { padding-left: 15px; }
.prod.cat-bc { padding-left: 15px; }
.prod.cat-ot { padding-left: 15px; }
/* 角标跟色条呼应：号卡显示「业务」用紫色，普通库存用中性灰，低库存仍走琥珀
   （v1.59 起普通商品的库存移到底部徽章 .stb，.st 只剩号卡「业务」） */
.prod.cat-ph .st { color: #1d4ed8; }
.prod.cat-ac .st { color: #475569; }

/* ---------- v1.53 开单：库存角标 ----------
   v1.59 起库存移到卡片底部徽章（.stb），这里保留 em 的通用定义；
   st-low 旧类目色规则已并入 .stb 三档状态 */
.prod .st em { font-style: normal; font-size: 10px; opacity: .75; margin-left: 1px; }
.prod .in-cart {
  position: absolute; left: 8px; bottom: 8px; font-size: 10.5px; font-weight: 700;
  color: var(--primary); background: var(--primary-weak); border-radius: 999px; padding: 1px 7px;
}
/* 已选明细里的库存余量：默认灰色小字，超库存转红 */
.ci-stock { margin-left: 6px; color: var(--text-3); }
.ci-stock-bad { color: #dc2626; font-weight: 700; }
.cart-item.is-over { background: #fff7f7; }
.cart-item.is-over .qty { border-color: #fca5a5; }

/* ---------- v1.53b 总部视角提示条 ---------- */
.pos-scope-tip {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; color: #92400e; line-height: 1.7; margin-bottom: 12px;
}
.pos-scope-tip b { color: #78350f; }
.pos-scope-sel {
  height: 28px; border: 1px solid #fcd34d; border-radius: 6px; background: #fff;
  font-size: 12.5px; padding: 0 6px; color: #78350f; font-weight: 600; max-width: 150px;
}
.pos-scope-tip .pst-sub { color: #a16207; font-size: 11.5px; margin-top: 3px; }

.cart-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-item .nm { font-size: 13px; font-weight: 600; }
.cart-item .sub { font-size: 11.5px; color: var(--text-3); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.qty button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-2); font-size: 15px; }
.qty button:hover { background: #f2f5fa; }
.qty span { min-width: 28px; text-align: center; font-size: 13px; font-weight: 600; }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 4px 0; }
.sum-row.total { font-size: 15px; color: var(--text); font-weight: 700; padding-top: 10px; }
.sum-row.total b { font-size: 22px; color: var(--danger); }
.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-grid button {
  height: 40px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; color: var(--text-2); background: #fff;
}
.pay-grid button.on { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.member-chip {
  display: flex; align-items: center; justify-content: space-between; background: #f7f9fd; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 13px;
}

/* 移动端底部 tab */
.mobile-tab { display: none; }
.mobile-top { display: none; }

/* 报量卡片 */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rep-field label { font-size: 12px; color: var(--text-2); display: block; margin-bottom: 5px; }
.rep-field label em { font-style: normal; color: var(--text-3); font-size: 11px; margin-left: 4px; }
.rep-field .input { height: 40px; font-size: 15px; font-weight: 600; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }

/* ---------- 报量三段式（新装 / 升级 / 加装） ---------- */
.sec { padding: 14px 0 16px; border-bottom: 1px dashed var(--line); }
.sec:first-of-type { padding-top: 4px; }
.sec:last-of-type { border-bottom: 0; padding-bottom: 6px; }
.sec-t {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 12px;
}
.sec-t em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.sec-t .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.d-blue { background: var(--primary); }
.d-amber { background: var(--warn); }
.d-green { background: var(--ok); }
.d-gray { background: var(--text-3); }
.d-cyan { background: #14b8a6; }

/* 升级组合：原套餐 → 新套餐 ×数量 */
#upg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.upg-row {
  display: grid; grid-template-columns: 1fr 20px 1fr 128px 92px 32px; gap: 8px; align-items: center;
  background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  margin-bottom: 8px;
}
.upg-row .select { height: 36px; font-size: 13px; padding: 0 28px 0 10px; }
.upg-row .upg-qty, .upg-row .upg-pts, .upg-row .upg-val { height: 36px; font-size: 13.5px; font-weight: 600; text-align: center; padding: 0 6px; }
.upg-row .upg-val { color: var(--brand); }
.upg-row .upg-biz { height: 36px; font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; padding: 0 8px; }
.upg-row .arrow { text-align: center; color: var(--text-3); font-size: 13px; }
.upg-row .x-btn { width: 32px; height: 32px; }

/* 新装套餐行 */
.inst-head, .inst-row {
  display: grid; grid-template-columns: 96px 1fr 128px 92px 32px; gap: 8px; align-items: center;
}
/* 加装业务行：加装项 / 业务号 / 价值 */
.add-head, .add-row {
  display: grid; grid-template-columns: 150px 1fr 92px 32px; gap: 8px; align-items: center;
}
.add-head { font-size: 11.5px; color: var(--text-3); padding: 0 9px 6px; font-weight: 600; }
.add-row {
  background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px;
}
.add-row .select { height: 36px; font-size: 13px; padding: 0 28px 0 10px; }
.add-row .add-biz { height: 36px; font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; padding: 0 8px; }
.add-row .add-val { height: 36px; font-size: 13.5px; font-weight: 600; text-align: center; padding: 0 6px; color: var(--brand); }
.add-row .x-btn { width: 32px; height: 32px; }
#add-list { display: flex; flex-direction: column; margin-bottom: 10px; }
.inst-head, .upg-head {
  font-size: 11.5px; color: var(--text-3); padding: 0 9px 6px; font-weight: 600;
}
.upg-head { grid-template-columns: 1fr 20px 1fr 128px 92px 32px; }
.inst-row {
  background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px;
}
.inst-row .select { height: 36px; font-size: 13px; padding: 0 28px 0 10px; }
.inst-row .inst-qty { height: 36px; font-size: 14px; font-weight: 600; text-align: center; padding: 0 6px; }
.inst-row .inst-biz { height: 36px; font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; padding: 0 8px; }
.inst-row .inst-val { height: 36px; font-size: 13.5px; font-weight: 600; text-align: center; padding: 0 6px; color: var(--brand); }
.inst-row .x-btn { width: 32px; height: 32px; }

/* 加装业务 5 项 */
.add-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

/* 提交条 */
.submit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 12px 14px; background: linear-gradient(135deg, #f5f9ff, #eef4ff);
  border: 1px solid #e2ebfb; border-radius: 12px;
}
.submit-bar .sum-tip { font-size: 13px; color: var(--text-2); }
.submit-bar .sum-tip b { font-size: 20px; color: var(--primary); margin: 0 3px; font-variant-numeric: tabular-nums; }

/* 简单柱状图 */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 100px 1fr 64px; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar .lab { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 22px; background: #f3f6fb; border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #6f9df7, #2463e5); }
.hbar .v { text-align: right; font-weight: 600; font-size: 12.5px; }

.linechart { width: 100%; height: 190px; display: block; }

/* 工资条 */
.payslip { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.payslip-h { padding: 14px 16px; background: linear-gradient(135deg,#f5f9ff,#edf3ff); display: flex; justify-content: space-between; align-items: center; }
.payslip-b { padding: 0 16px; }
.payslip-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.payslip-row:last-child { border-bottom: 0; }
.payslip-total { margin-top: 8px; padding: 14px 16px; background: #fafbfc; display: flex; justify-content: space-between; font-weight: 700; }
.payslip-total b { color: var(--danger); font-size: 19px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-32, .grid-23 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1.3fr 1fr; }
  /* 中等屏：员工表列较多，先隐藏次要列 */
  .hide-md { display: none !important; }
}
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { display: none; }
  .layout { display: block; padding-bottom: 68px; }
  .topbar { display: none; }
  .content { padding: 14px 14px 24px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 22px; }
  .kpi .ico-bg { display: none; }
  .mobile-top {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; background: #fff;
    position: sticky; top: 0; z-index: 30;
  }
  .mobile-top .ttl { font-size: 18px; font-weight: 700; }
  .mobile-top .store-picker .select { height: 30px; font-size: 12px; min-width: 0; }
  .mobile-tab {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; height: 62px;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-tab a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--text-3); font-size: 10.5px;
  }
  .mobile-tab a.active { color: var(--primary); font-weight: 600; }
  .mobile-tab a svg { width: 22px; height: 22px; }
  .pos { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .scan-ipt { font-size: 14px !important; }
  .modal { max-height: 88vh; border-radius: 14px; }
  .modal-mask { padding: 12px; align-items: end; }
  .modal { animation: sheet .2s ease; }
  /* v1.78：小屏弹窗内边距收窄，避免内容 + padding 超出视口宽度 */
  .modal-b { padding: 14px; }
  @keyframes sheet { from { transform: translateY(30px); opacity: .6 } }
  .form-grid { grid-template-columns: 1fr; }
  .filters .input, .filters .select { flex: 1; min-width: 0; }
  .tbl th, .tbl td { padding: 10px; }
  .hide-sm { display: none !important; }  .hbars .hbar { grid-template-columns: 76px 1fr 56px; }
  .add-grid { grid-template-columns: repeat(2, 1fr); }
  .upg-head { display: none; }
  .inst-head { display: none; }
  .upg-row {
    grid-template-columns: 1fr 16px 1fr; row-gap: 8px;
    grid-template-areas: "f a t" "q b b" "p p x";
  }
  .upg-row .upg-sel[data-k="from"] { grid-area: f; }
  .upg-row .arrow { grid-area: a; }
  .upg-row .upg-sel[data-k="to"] { grid-area: t; }
  .upg-row .upg-qty { grid-area: q; }
  .upg-row .upg-biz { grid-area: b; }
  .upg-row .upg-pts, .upg-row .upg-val { grid-area: p; }
  .upg-row .x-btn { grid-area: x; justify-self: end; }
  .inst-row { grid-template-columns: 96px 1fr 92px 32px; row-gap: 8px; }
  .inst-row .inst-biz { grid-column: 1/3; grid-row: 2; }
  .inst-row .inst-val { grid-column: 3; grid-row: 2; }
  .inst-row .x-btn { grid-column: 4; grid-row: 1; justify-self: end; }
  .add-head { display: none; }
  .add-row { grid-template-columns: 1fr 92px 32px; row-gap: 8px; }
  .add-row .add-biz { grid-column: 1/3; grid-row: 2; }
  .add-row .add-val { grid-column: 3; grid-row: 2; }
  .add-row .x-btn { grid-column: 3; grid-row: 1; justify-self: end; }
  .submit-bar { position: sticky; bottom: 70px; z-index: 20; }
  /* v1.20 移动端增强：表格列不再被挤压成竖排，允许横向滑动查看 */
  .tbl th, .tbl td { white-space: normal; }
  .tbl td { min-width: 76px; }
  .tbl td.num, .tbl td.mono, .tbl .sn-chip, .tbl td .tag { white-space: nowrap; }
  .table-wrap { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  /* 弹窗底部按钮过多时自动换行（订单详情等 4-5 个按钮） */
  .modal-f { flex-wrap: wrap; }
  .modal-f .btn { flex: 1 1 auto; justify-content: center; }
  .modal-f select { max-width: 46%; }
  /* 弹窗改为近全屏，小屏阅读更聚焦 */
  .modal { max-width: 100%; }
  .modal.wide { max-width: 100%; }
  /* 国补地址：省市县镇在窄屏两列排布，避免下拉被压得过窄 */
  .sf-addr { grid-template-columns: 1fr 1fr; }
  .sf-addr .sf-prov { grid-column: 1 / -1; }
  /* 入库串码行：窄屏每行 2 个输入，序号占整行首位 */
  .sn-row { grid-template-columns: 22px 1fr 1fr; }
  /* 订单/库存操作列按钮堆叠更整齐 */
  .tbl td.c .btn + .btn { margin-left: 4px; }
  /* 工资、员工等长表：首列吸附，滑动时仍能看到是谁 */
  .tbl th:first-child, .tbl td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
  .tbl th:first-child { background: #fafbfc; }
  .tbl tr.row-gift > td:first-child { background: #fffaf5; }
  .tbl tr.row-dim > td:first-child { background: #fff; }
}
@media (max-width: 400px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .add-grid { grid-template-columns: 1fr 1fr; }
  .sec-t { font-size: 13px; }
  .submit-bar { flex-direction: column; align-items: stretch; }
  .submit-bar .btn { width: 100%; }
  /* v1.20：小屏也保持两列商品卡，不再退化为单列（单列浏览效率太低） */
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .prod { padding: 10px; min-height: 88px; }
  .prod .pr { font-size: 14px; }
}

/* ---------- 开单：行改价 ---------- */
.price-edit { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.pe-lab { font-size: 11px; color: var(--text-3); }
.pe-ipt { width: 78px; height: 26px; padding: 0 7px; font-size: 12.5px; text-align: right; border-radius: 7px; }
.pe-orig { font-size: 11px; color: var(--text-3); text-decoration: line-through; }
.pe-reset { background: none; border: 0; padding: 0; font-size: 11px; color: var(--primary); cursor: pointer; }
.pe-floor { font-size: 11px; color: var(--text-3); }
.price-tip { font-size: 12px; color: var(--text-2); padding: 8px 0 0; line-height: 1.6; }
.price-tip .tag { margin-right: 4px; }

/* ---------- 通用：区块标题 / 表单网格 / 表格状态 ---------- */
.sec-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .fld { display: flex; flex-direction: column; gap: 5px; }
.form-grid .fld.full { grid-column: 1 / -1; }
.form-grid .fld > span { font-size: 12.5px; color: var(--text-2); }
.tbl .row-on { background: var(--primary-weak); }
.tbl .row-dim { opacity: .55; }
.tbl .row-dim td { text-decoration: none; }
/* v1.52 退货单行：淡红底 + 单号划线，和「已作废」的灰掉区分开 */
.tbl .row-return { background: #fff5f5; }
.tbl .row-return > td:first-child .mono { text-decoration: line-through; text-decoration-color: #f87171; }
.tbl .row-return .num.strong { color: #dc2626; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.mini-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-top: 6px; align-items: center; }
.mini-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ---------- 采购单行编辑 ---------- */
.warn-strip { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-weak); color: #92400e;
  font-size: 12.5px; line-height: 1.6; padding: 10px 12px; border-radius: 9px; margin-bottom: 14px; }
.pline { display: grid; grid-template-columns: 1fr 88px 100px 100px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.pline-h { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.pline-h span:first-child { padding-left: 2px; }
.pline .select, .pline .input { height: 34px; }
.pline-sum { text-align: right; font-weight: 600; font-size: 13px; }

/* ---------- 订单行编辑 ---------- */
.oline { display: grid; grid-template-columns: 1fr 100px 80px 100px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.oline-h { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.oline .input { height: 34px; }
.oline-sum { text-align: right; font-weight: 600; font-size: 13px; }

/* ---------- 修改日志 ---------- */
.chg-list { display: flex; flex-direction: column; gap: 8px; }
.chg-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.chg-h { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.chg-h .muted { font-size: 11.5px; }
.chg-reason { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.chg-diff { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.chg-diff b { color: var(--primary); }

@media (max-width: 1100px) {
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .pline { grid-template-columns: 1fr 60px 78px 32px; }
  .pline .pline-sum { display: none; }
  .oline { grid-template-columns: 1fr 78px 64px 32px; }
  .oline .oline-sum { display: none; }
}

/* ---------- 串码选择器（收银台） ---------- */
.sp-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sp-bar .hint { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.sp-list { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.sp-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.sp-item:last-child { border-bottom: 0; }
.sp-item:hover { background: #f8fafc; }
.sp-item.on { background: var(--primary-weak, #eef4ff); }
.sp-item input { accent-color: var(--primary); }
.sp-imei { font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.sp-sn { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sp-store { font-size: 11.5px; color: var(--text-3); }

/* 购物车串码 chip */
.c-serials { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 5px; }
.sn-chip { font-size: 11px; background: #eef2f7; color: #334155; border-radius: 5px; padding: 1px 6px; letter-spacing: .2px; }

/* ---------- 串码追踪 ---------- */
.trace-input { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 11px; background: #fbfcfe; color: var(--text-3); }
.trace-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 12px; background: linear-gradient(120deg, #f4f8ff, #fbfcfe); border: 1px solid var(--line); }
.th-imei { font-size: 19px; font-weight: 700; letter-spacing: .8px; }
.sold-card { border: 1px solid #dbeafe; background: #f5f9ff; border-radius: 12px; padding: 12px 14px; margin-top: 4px; }
.sold-card .sc-lab { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }

.timeline { position: relative; padding-left: 20px; margin-top: 4px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 10px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 4px; }
.tl-item.last { padding-bottom: 0; }
.tl-dot { position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary); box-shadow: 0 0 0 3px #fff; }
.tl-item.last .tl-dot { background: var(--primary); }
.tl-body { background: #fff; }
.tl-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tl-h .muted { font-size: 12px; }
.tl-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ---------- 入库逐台串码 ---------- */
/* 串码行（v1.18）：序号 + IMEI + IMEI2 + SN + 颜色 + 内存 */
.sn-inputs { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0 0; }
.sn-row { display: grid; grid-template-columns: 22px 158px 132px 128px 104px 92px 86px; gap: 6px; align-items: center; }
@media (max-width: 900px) {
  .sn-row { grid-template-columns: 22px 1fr 1fr; }
}
.sn-row .idx { font-size: 11.5px; color: var(--text-3); text-align: right; }
.sn-row .input { height: 32px; font-size: 12.5px; }
.sn-row .input.bad { border-color: var(--danger); background: #fff5f5; }
.pline-wrap { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fcfdff; }
.pline-wrap .pline { margin-bottom: 0; }
.sn-codes { font-size: 11.5px; color: var(--text-2); line-height: 1.7; }
.sn-codes .sn-chip { margin-right: 4px; }

@media (max-width: 860px) {
  .sn-inputs { grid-template-columns: 1fr; }
  .th-imei { font-size: 16px; }
  .tl-time { margin-left: 0; }
}

/* ---------- 报表：员工业绩排行 ---------- */
.medal { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; font-size: 11.5px; font-weight: 700; color: #fff; letter-spacing: 0; }
.medal.m1 { background: linear-gradient(135deg, #f7c948, #e0a800); box-shadow: 0 1px 4px rgba(224,168,0,.35); }
.medal.m2 { background: linear-gradient(135deg, #c4ccd8, #9aa4b2); box-shadow: 0 1px 4px rgba(154,164,178,.3); }
.medal.m3 { background: linear-gradient(135deg, #e0a878, #c07f4a); box-shadow: 0 1px 4px rgba(192,127,74,.3); }
.hbar-row { display: grid; grid-template-columns: 92px 1fr 78px; align-items: center; gap: 8px; margin-bottom: 7px; }
.hbar-row .hb-lab { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .hb-bar { height: 8px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.hbar-row .hb-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4f8ef7, #7aa9fa); }
.hbar-row .hb-val { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.pbar { display: inline-block; vertical-align: middle; width: 54px; height: 5px; border-radius: 4px; background: #eef2f7; overflow: hidden; margin-right: 6px; }
.pbar i { display: block; height: 100%; background: #4f8ef7; }
.yoy-up { color: var(--ok); font-weight: 600; }
.yoy-down { color: var(--danger); font-weight: 600; }
.trend-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 6px; background: #fff; }
.trend-box svg { display: block; width: 100%; height: auto; }

/* ---------- 库存盘点 ---------- */
.tk-tbl .tk-real { width: 84px; }
.tk-tbl input.tk-real:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,142,247,.12); }
.num.up { color: var(--ok); }
.num.down { color: var(--danger); }
.tk-tbl tr[data-row]:hover { background: #f8fafd; }
.tk-tbl .tk-rem { min-width: 90px; }

@media (max-width: 860px) {
  .hbar-row { grid-template-columns: 70px 1fr 64px; }
  .tk-tbl .tk-real { width: 66px; }
}

/* ---------- 看板 v2 ---------- */
.dash-hero { position: relative; overflow: hidden; border-radius: 16px; padding: 26px 30px; margin-bottom: 16px;
  background: linear-gradient(118deg, #123e9e 0%, #1856d8 46%, #3f7cf0 78%, #6f9df7 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: 0 10px 30px -12px rgba(24,86,216,.45); }
.dh-deco { position: absolute; border-radius: 50%; pointer-events: none; }
.dh-deco.d1 { width: 260px; height: 260px; right: -70px; top: -130px; background: rgba(255,255,255,.09); }
.dh-deco.d2 { width: 150px; height: 150px; right: 180px; bottom: -80px; background: rgba(255,255,255,.07); }
.dh-deco.d3 { width: 90px; height: 90px; left: 34%; top: -40px; background: rgba(255,255,255,.06); }
.dh-hi { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.dh-date { font-size: 12.5px; font-weight: 400; color: rgba(255,255,255,.75); margin-left: 10px; }
.dh-sub { margin-top: 9px; font-size: 13px; color: rgba(255,255,255,.88); }
.dh-sub b { font-weight: 700; }
.dh-tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.dh-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 11px;
  border-radius: 999px; background: rgba(255,255,255,.14); backdrop-filter: blur(2px); color: #fff; }
.dh-right { text-align: right; position: relative; z-index: 1; }
.dh-big-lab { font-size: 12.5px; color: rgba(255,255,255,.78); }
.dh-big { font-size: 38px; font-weight: 800; letter-spacing: -1px; line-height: 1.25; text-shadow: 0 2px 12px rgba(0,0,0,.12); }
.dh-big-foot { font-size: 12.5px; color: rgba(255,255,255,.85); }

.kpi-new { transition: transform .18s ease, box-shadow .18s ease; cursor: default; }
.kpi-new:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -10px rgba(16,24,40,.16); }
.kpi-new .lab { margin-top: 2px; }
.kpi-new .kico { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; color: #fff; box-shadow: 0 4px 10px -3px rgba(16,24,40,.25); }
.kico-blue { background: linear-gradient(135deg, #3f7cf0, #1856d8); }
.kico-cyan { background: linear-gradient(135deg, #22c1e8, #0284c7); }
.kico-green { background: linear-gradient(135deg, #34c98e, #059669); }
.kico-orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.kpi-new .ksp { position: absolute; right: 14px; bottom: 12px; opacity: .9; }
.kpi-new .ksp .spark { display: block; }

/* 可点击 KPI（跳转清单） */
.kpi-new.kpi-link { cursor: pointer; }
.kpi-new.kpi-link:hover { box-shadow: 0 14px 30px -12px rgba(24,86,216,.30); border-color: #c7daf8; }
.kpi-new.kpi-link:focus-visible { outline: 2px solid #1856d8; outline-offset: 3px; }
.kpi-new .kpi-go { position: absolute; left: 16px; bottom: 14px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; color: #1856d8; font-weight: 600; opacity: 0; transform: translateX(-3px); transition: .18s ease; }
.kpi-new.kpi-link:hover .kpi-go { opacity: 1; transform: translateX(0); }
.dh-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; border-radius: 4px; }
.dh-link:hover { color: #fff; text-decoration-style: solid; }
.dh-link:focus-visible { outline: 2px solid rgba(255,255,255,.9); outline-offset: 2px; }
.card.flash { animation: flashCard 1.6s ease; }
@keyframes flashCard {
  0%   { box-shadow: 0 0 0 0 rgba(24,86,216,0); }
  28%  { box-shadow: 0 0 0 3px rgba(24,86,216,.28); }
  100% { box-shadow: 0 0 0 0 rgba(24,86,216,0); }
}

.hbar-lg .track { height: 14px; border-radius: 7px; }
.hbar-lg .v { font-size: 12.5px; }
.biz-note { margin-top: 12px; font-size: 12px; color: var(--text-3); background: #f7f9fd; border-radius: 8px; padding: 8px 12px; }
.hbar-rk { grid-template-columns: 64px 1fr 64px; }
.hbar-rk .rk-mid { min-width: 0; }
.hbar-rk .rk-name { font-size: 12.5px; color: var(--text-1, #1d2939); margin-bottom: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.hbar-rk .track { height: 9px; border-radius: 5px; }
.hbar-rk .v { font-weight: 700; }
.rank-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--text-3); background: #f2f4f8; }

.dash-flex { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.ring-lab { font-size: 12px; color: var(--text-3); }
.rep-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.member-chip.rep-ok { border-color: #bbf0d4; background: #f4fcf8; }
.member-chip.rep-no { border-color: #fde4c3; background: #fffaf2; }

@media (max-width: 860px) {
  .dash-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .dh-right { text-align: left; }
  .dh-big { font-size: 30px; }
  .kpi-new .ksp { display: none; }
}

/* ==================== 门店收支 / 财务模块 ==================== */
.muted { color: var(--text-3); }
.strong { font-weight: 600; }
.hint { font-size: 12px; color: var(--text-3); }

/* KPI 新卡：左侧圆形图标 */
.kpi-new { display: flex; flex-direction: column; gap: 2px; }
.kico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  margin-bottom: 10px; background: var(--primary-weak); color: var(--primary);
}
.kico-green { background: var(--ok-weak); color: var(--ok); }
.kico-red { background: var(--danger-weak); color: var(--danger); }
.kico-warn { background: var(--warn-weak); color: var(--warn); }
.kico-blue { background: var(--primary-weak); color: var(--primary); }
.kico-purple { background: #f3eeff; color: #6b46c1; }
.kico-indigo { background: #eef1ff; color: #4f46e5; }

/* 按钮补充 */
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-danger-ghost {
  color: var(--danger); background: var(--danger-weak); border: 1px solid #f7cfcb;
}
.btn-danger-ghost:hover { background: #fbdcd8; }

/* 图表图例 */
.chart-legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-2);
}
.chart-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px;
}
.chart-legend > i + * { margin-left: 0; }

/* 筛选条 */
.fin-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.fin-bar .select, .fin-bar .input { height: 34px; font-size: 13px; }

/* ---------- 埋点/提示条 ---------- */
.tip-box {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: 9px;
  background: #f3f7ff; border: 1px solid #e2ecff;
  color: #34507d; font-size: 12px; line-height: 1.6;
}
.tip-box svg { flex: 0 0 auto; margin-top: 2px; color: var(--primary); }
.tip-box b { color: var(--primary-deep); }

/* ---------- 导入向导 ---------- */
.imp-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.imp-steps .st {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3);
  padding: 5px 12px 5px 6px; border-radius: 999px; background: #f5f7fa;
  transition: .18s;
}
.imp-steps .st i {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-style: normal; font-weight: 700;
  background: #e2e8f2; color: var(--text-3);
}
.imp-steps .st.on { color: var(--primary); background: var(--primary-weak); font-weight: 600; }
.imp-steps .st.on i { background: var(--primary); color: #fff; }
.imp-steps .st.ok { color: var(--ok); background: var(--ok-weak); }
.imp-steps .st.ok i { background: var(--ok); color: #fff; }
.imp-steps .ln { flex: 1; height: 1px; background: var(--line-strong); max-width: 40px; }

/* 拖拽区 */
.drop-zone {
  border: 2px dashed var(--line-strong); border-radius: 14px;
  padding: 40px 20px; text-align: center; cursor: pointer;
  background: #fbfcfe; transition: .18s;
}
.drop-zone:hover, .drop-zone.over {
  border-color: var(--primary); background: var(--primary-weak);
}
.drop-zone.done { border-style: solid; border-color: var(--ok); background: var(--ok-weak); cursor: default; }
.dz-t {
  font-size: 15px; font-weight: 600; color: var(--text); margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.dz-s { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.dz-ok {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; background: var(--ok); color: #fff;
}

/* 识别结果汇总 */
.imp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }
.imp-sum > div {
  background: #f7f9fc; border-radius: 9px; padding: 10px 12px;
}
.imp-sum .k { font-size: 11.5px; color: var(--text-3); }
.imp-sum .v { font-size: 17px; font-weight: 700; margin-top: 2px; letter-spacing: -.3px; }

/* 逐行勾选表 */
.imp-sheet { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.tbl .sub { font-size: 11px; color: var(--text-3); }

/* 导入完成 */
.imp-done { text-align: center; padding: 10px 0 4px; }
.imp-done .id-t { font-size: 17px; font-weight: 700; margin-top: 12px; }
.imp-done .id-s { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* 导入批次列表 */
.imp-batch {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px;
  background: #fbfcfe;
}
.imp-batch .fb { flex: 1; min-width: 0; }

/* ---------- 开票率列表 ---------- */
.inv-list { display: flex; flex-direction: column; gap: 9px; }
.inv-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.inv-row > .mono { flex: 0 0 60px; color: var(--text-2); }
.inv-bar {
  flex: 1; height: 8px; border-radius: 5px; background: #f0f3f8; overflow: hidden;
}
.inv-bar i {
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #7cc4f5, #1856d8); transition: width .3s;
}
.inv-row .pct { flex: 0 0 44px; text-align: right; font-weight: 700; font-size: 12px; }
.inv-row .pct.up { color: var(--ok); }
.inv-row .pct.down { color: var(--warn); }

/* ---------- 门店 × 月份矩阵 ---------- */
.fin-matrix { font-size: 12px; }
.fin-matrix th {
  position: sticky; top: 0; z-index: 2; background: #f7f9fc;
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; padding: 8px 10px;
}
.fin-matrix td { padding: 7px 10px; white-space: nowrap; }
.fin-matrix tbody tr:hover td { background: #fafbfd; }
.fin-matrix td:first-child {
  position: sticky; left: 0; z-index: 1; background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.fin-matrix tbody tr:hover td:first-child { background: #fafbfd; }
.fin-matrix td.up, .fin-matrix td.down { font-weight: 600; }

@media (max-width: 640px) {
  .imp-steps .st { padding: 4px 8px 4px 4px; font-size: 11.5px; }
  .imp-steps .st span { display: none; }
  .imp-steps .st.on span, .imp-steps .st.ok span { display: inline; }
  .drop-zone { padding: 26px 14px; }
  .dz-t { font-size: 14px; }
  .fin-bar { gap: 8px; }
  .fin-bar .select, .fin-bar .input { flex: 1 1 120px; min-width: 0; }
  .inv-row > .mono { flex-basis: 52px; }
  .inv-row .muted { display: none; }
}

/* 修复：财务页 hbar 结构（rk-mid 在 .hbar-lg 内）长科目名撑爆网格 */
.hbar .rk-mid { min-width: 0; }
.hbar .rk-name {
  font-size: 12.5px; margin-bottom: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.hbar-lg .track { display: block; width: 100%; }
.hbar-lg .fill { display: block; max-width: 100%; }
.hbar-lg .v { text-align: right; font-weight: 600; color: var(--text); }

/* 门店收支对比表：避免窄列挤压 */
#fin-pane-analysis .table-wrap table { min-width: 430px; }

/* 财务表格：数字与门店名不换行 */
#fin-pane-analysis .tbl td, #fin-pane-entries .tbl td { white-space: nowrap; }
#fin-pane-analysis .tbl td:nth-child(1) { max-width: 220px; }
#fin-pane-analysis .tbl td:nth-child(1) .strong,
#fin-pane-analysis .tbl td:nth-child(1) .muted {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 财务权限开关 */
.fin-switch { position: relative; display: inline-block; cursor: pointer; }
.fin-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.fin-switch i {
  display: inline-block; width: 36px; height: 20px; border-radius: 999px;
  background: #d7dde6; transition: .18s; vertical-align: middle; position: relative;
}
.fin-switch i::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.fin-switch input:checked + i { background: var(--ok); }
.fin-switch input:checked + i::after { transform: translateX(16px); }

/* 库存查询 · 串码展开 */
.ser-toggle { color: var(--text-3); display: inline-flex; vertical-align: -1px; transition: color .15s; }
.ser-toggle:hover { color: var(--primary); }
tr.row-open > td { background: #f7fbff; }
tr.row-open > td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.ser-row > td { background: #fbfdff; padding: 0 0 10px !important; border-bottom: 1px solid #eef2f7; }
.ser-box { border: 1px solid #e3edf7; border-radius: 10px; margin: 0 14px 10px; background: #fff; overflow: hidden; }
.ser-hd {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px;
  background: #f4f9ff; color: var(--text-2); border-bottom: 1px solid #eaf1f9;
}
.ser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1px; background: #eef4fa; }
.ser-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #fff; font-size: 12.5px;
}
.ser-item:hover { background: #f7fbff; }
.ser-no { color: var(--text-3); font-size: 11px; min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.ser-imei { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .2px; }
.ser-sn { font-size: 11.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .ser-grid { grid-template-columns: 1fr; }
  .ser-sn { display: none; }
  .ser-box { margin: 0 6px 8px; }
}

/* 收银 · 手机端悬浮收银台按钮 */
.pos-fab {
  display: none;
  position: fixed; right: 14px; bottom: 74px; z-index: 60;
  height: 44px; padding: 0 18px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(30, 90, 200, .35);
  align-items: center; gap: 4px; font-size: 14px;
}
.pos-fab.show { display: inline-flex; }

/* 库存 · 快捷筛选条 */
.inv-fbar { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-top: 8px; }
.inv-fbar .select { height: 32px; font-size: 12.5px; padding: 0 8px; max-width: 48%; flex: 1; min-width: 96px; }
@media (min-width: 861px) { .inv-fbar { width: auto; margin-top: 0; margin-left: auto; } }

/* ================= 知识库 ================= */
.kb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.kb-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.kb-chip {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-2); font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.kb-chip em { font-style: normal; font-size: 11px; color: var(--text-3); }
.kb-chip:hover { border-color: var(--primary); color: var(--primary); }
.kb-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.kb-chip.on em { color: rgba(255,255,255,.8); }
.kb-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.kb-chk { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.kb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.kb-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 12px;
  cursor: pointer; transition: .16s; display: flex; flex-direction: column; gap: 8px;
}
.kb-card:hover { border-color: #c7d9f5; box-shadow: 0 6px 20px rgba(24,86,216,.08); transform: translateY(-1px); }
.kb-card.kb-hidden { opacity: .62; background: #fafbfc; border-style: dashed; }
.kb-c-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.kb-title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.45; color: var(--text); }
.kb-body { display: flex; gap: 12px; align-items: flex-start; }
.kb-text { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.kb-thumb { position: relative; flex: 0 0 76px; height: 76px; border-radius: 8px; overflow: hidden; background: #f2f5fa; }
.kb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-more {
  position: absolute; right: 3px; bottom: 3px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 10.5px; padding: 1px 5px; border-radius: 4px;
}
.kb-meta {
  display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--text-3);
  padding-top: 8px; border-top: 1px solid #f2f5f9; flex-wrap: wrap;
}
.kb-meta span { display: inline-flex; align-items: center; gap: 4px; }
.kb-meta .btn { padding: 0 6px; height: 24px; font-size: 11.5px; }

/* 编辑器 */
.kb-form { display: flex; flex-direction: column; gap: 12px; }
.kb-form .field { display: flex; flex-direction: column; gap: 6px; }
.kb-form label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kb-textarea { min-height: 150px; line-height: 1.7; font-size: 13.5px; }
.kb-drop {
  border: 1.5px dashed #cbd8ea; border-radius: 10px; padding: 16px; text-align: center;
  color: var(--text-3); background: #fafcff; cursor: pointer; transition: .15s;
}
.kb-drop:hover, .kb-drop.over { border-color: var(--primary); background: #f2f8ff; color: var(--primary); }
.kb-drop-t { font-size: 12.5px; margin-top: 6px; }
.kb-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kb-th { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f4f7fb; }
.kb-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-th-x {
  position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; border: 0; cursor: pointer;
}
.kb-th-wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: #fff; background: rgba(0,0,0,.45); }

/* 详情 */
.kb-d-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.kb-d-text { font-size: 14px; line-height: 1.85; color: var(--text); white-space: pre-wrap; word-break: break-word;
  background: #fafbfd; border: 1px solid #f0f4f9; border-radius: 10px; padding: 14px 16px; }
.kb-d-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.kb-fig { margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f7f9fc; }
.kb-fig img { width: 100%; display: block; cursor: zoom-in; }
.kb-fig figcaption { font-size: 11.5px; color: var(--text-3); padding: 6px 8px; }

/* 大图预览 */
.kb-lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(10,16,26,.92);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.kb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.kb-lb-x {
  position: absolute; right: 20px; top: 20px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer;
}

@media (max-width: 860px) {
  .kb-list { grid-template-columns: 1fr; }
  .kb-row { grid-template-columns: 1fr; }
  .kb-tools { width: 100%; margin-left: 0; }
  .kb-d-imgs { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 系统设置 ================= */
.set-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--line); }
.set-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 0; background: transparent;
  border-radius: 9px; font: inherit; font-size: 13.5px; color: var(--text-2); cursor: pointer; transition: .15s;
}
.set-tab:hover { background: #f3f6fb; color: var(--text-1); }
.set-tab.on { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(24,86,216,.25); }

.brand-prev {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, #16213f, #1e3a6e); color: #fff;
}
.brand-prev .mark { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.brand-prev .t { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.brand-prev .s { font-size: 10.5px; letter-spacing: 1.6px; opacity: .55; margin-top: 2px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text-3); }
.kv b { color: var(--text-1); font-weight: 600; }

.chk-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.chk-line input { width: 16px; height: 16px; accent-color: var(--primary); }

.perm-tbl td { vertical-align: middle; }
.perm-tbl .c { text-align: center; }
.perm-tbl th.c { text-align: center; }
.perm-tbl .perm-grp td {
  background: #f7f9fd; font-size: 12px; font-weight: 700; color: var(--text-2);
  letter-spacing: .5px; padding: 8px 12px;
}
.chk { display: inline-flex; cursor: pointer; }
.chk input { display: none; }
.chk span {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #cfd8e6; background: #fff;
  display: inline-block; position: relative; transition: .15s;
}
.chk input:checked + span { background: var(--primary); border-color: var(--primary); }
.chk input:checked + span::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(42deg);
}
.chk input:disabled + span { background: #e8eef8; border-color: #d6e0ef; }
.chk input:disabled:checked + span { background: #9db8e6; border-color: #9db8e6; }

/* 职位列表项 */
.pos-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fcfdff; cursor: pointer; transition: .15s;
}
.pos-item:hover { border-color: #c7daf8; background: #f7fbff; }
.pos-item.on { border-color: var(--primary); background: #f2f7ff; box-shadow: 0 0 0 3px rgba(24, 86, 216, .08); }

/* ================= 门店收支（财务） ================= */
.fin-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.fin-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fin-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fin-sub { font-size: 12px; color: var(--text-3); margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.fin-sub::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--primary); display: inline-block; }
.fin-life { display: flex; gap: 26px; margin-bottom: 14px; }
.fin-life > div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.fin-life-n { font-size: 24px; font-weight: 700; line-height: 1.2; }

/* 导入区 */
.fin-drop {
  border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 26px 16px; text-align: center;
  color: var(--text-2); cursor: pointer; transition: .16s; background: #fbfdff;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fin-drop:hover, .fin-drop.on { border-color: var(--primary); background: #f2f7ff; color: var(--primary); }
.fin-drop svg { color: var(--primary); }
.fin-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.fin-form > label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.fin-form > label em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.fin-form .input, .fin-form .select { width: 100%; height: 36px; font-size: 13px; }
.fin-form .fin-check { flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; }
.fin-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }

.fin-pv { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fin-pv-h { background: #f2f7ff; color: var(--primary); font-size: 12.5px; padding: 10px 14px;
  display: flex; align-items: center; gap: 6px; }
.fin-pv-s { padding: 12px 14px; border-top: 1px solid var(--line); }
.fin-pv-s:first-of-type { border-top: 0; }
.fin-pv-warn { background: #fff7ed; color: #b45309; font-size: 12.5px; line-height: 1.6;
  padding: 9px 14px; border-top: 1px dashed #fcd9a8; display: flex; align-items: flex-start; gap: 6px; }
.fin-pv-warn svg { flex: none; margin-top: 2px; }
.fin-pv-t { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.fin-pv-t .muted { font-size: 12px; }
.fin-pv-m { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.fin-pv-m b { color: var(--text); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid > label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.form-grid .input, .form-grid .select { width: 100%; height: 36px; font-size: 13px; }

.kpi .kico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: #fff; }

@media (max-width: 820px) {
  .fin-form, .form-grid { grid-template-columns: 1fr; }
  .fin-life { gap: 18px; }
}

/* 看板今日报量未完成红色高亮 */
.kpi-new.kpi-alert { border-color: #f6b3b3; background: linear-gradient(180deg, #fff6f5, #fffdfd); box-shadow: 0 6px 18px -10px rgba(220, 38, 38, .35); }
.kpi-new.kpi-alert .lab { color: #b91c1c; font-weight: 600; }
.kpi-new.kpi-alert .val { color: #dc2626; }
.kpi-alert-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; display: inline-block;
  margin-right: 2px; animation: alertPulse 1.4s ease infinite; }
@keyframes alertPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

/* 工资条：提成明细分隔 */
.payslip-sep { font-size: 11.5px; color: var(--text-3); letter-spacing: .5px; margin: 12px 0 4px;
  padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.payslip-row em { font-style: normal; font-size: 11.5px; margin-left: 4px; }
.payslip-row.strong span { font-weight: 600; color: var(--text); }

/* 区域门店归属 */
.rg-sum { font-size: 12.5px; color: var(--text-2); background: #f7f9fd; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.rg-sum.warn { background: #fff7ed; color: #b45309; }
.rg-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.rg-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f1f4f8;
  font-size: 13px; cursor: pointer; transition: background .12s; }
.rg-row:last-child { border-bottom: 0; }
.rg-row:hover { background: #fafcff; }
.rg-row.on { background: #f0f7ff; }
.rg-row input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.rg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-code { font-size: 11.5px; flex: none; }
.rg-tag { flex: none; }

/* ===== v1.15 串码重复高亮 ===== */
.sn-inputs input.dup-local {
  border-color: var(--danger, #e5484d) !important;
  background: #fef1f1 !important;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, .15);
}
.sn-inputs input.dup-db {
  border-color: #f59e0b !important;
  background: #fff7ea !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .15);
}
.sn-dup-tip {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  background: #fef1f1; color: #c53030; font-size: 12.5px; line-height: 1.6;
  border: 1px solid #fbc9c9;
}

/* ===== v1.15 工资批量发放条 ===== */
.pay-batch-bar {
  display: flex; align-items: center; gap: 12px;
  background: #eef4ff; border: 1px solid #c9dbff;
  border-radius: 10px; padding: 10px 16px; margin-bottom: 12px; font-size: 13.5px;
}

/* ===== v1.16 国补 ===== */
.subsidy-box { margin-top: 4px; }
.subsidy-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; background: #fff7ea;
  border: 1px solid #f6dcb0; margin-bottom: 10px;
}
.sf-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: #b26a00; }
.sf-switch input { display: none; }
.sf-switch i {
  width: 38px; height: 21px; border-radius: 12px; background: #d8dbe2; position: relative; transition: .18s; flex: 0 0 auto;
}
.sf-switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .18s;
}
.sf-switch input:checked + i { background: #f59e0b; }
.sf-switch input:checked + i::after { transform: translateX(17px); }
.subsidy-form {
  border: 1px solid #f3e3c7; border-radius: 9px; padding: 12px; background: #fffdf8;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.sf-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 0; }
.sf-field.full { grid-column: 1 / -1; }
.sf-field .input, .sf-field .select { height: 32px; font-size: 13px; }
.sf-addr { display: grid; grid-template-columns: auto 1fr 1fr 1.6fr; gap: 8px; align-items: center; }
.sf-prov {
  height: 32px; display: grid; place-items: center; padding: 0 12px; border-radius: 6px;
  background: #eef1f6; color: var(--text-2); font-size: 13px; white-space: nowrap;
}
.sf-amt {
  grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px dashed #ecd9b5; font-size: 12.5px;
}
.sf-amt > div { display: flex; gap: 6px; align-items: baseline; }
.sf-amt span { color: var(--text-3); }
.sf-amt b { font-size: 14px; }
.sf-note { grid-column: 1 / -1; font-size: 11.5px; line-height: 1.6; color: #9a7b45; }
@media (max-width: 640px) {
  .subsidy-form { grid-template-columns: 1fr; }
  .sf-addr { grid-template-columns: auto 1fr; }
}
.subsidy-done {
  display: inline-flex; gap: 20px; flex-wrap: wrap; justify-content: center;
  margin: 12px auto 0; padding: 10px 16px; border-radius: 9px;
  background: #fff7ea; border: 1px solid #f6dcb0; font-size: 12.5px;
}
.subsidy-done > div { display: flex; gap: 6px; align-items: baseline; }
.subsidy-done span { color: var(--text-3); }
.subsidy-done b { font-size: 14px; }

/* v1.20 手机端补充：工资表姓名列隐藏副文本，避免长文本换行竖排 */
@media (max-width: 860px) {
  .pw-sub { display: none; }
  .tbl { font-size: 12.5px; }
  .tbl td { min-width: 64px; }
}

/* v1.21 看板下钻：各门店销售额 */
.ss-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.ss-head > div { background: #f6f9ff; border: 1px solid #e4edfb; border-radius: 10px; padding: 10px 12px; }
.ss-head span { display: block; font-size: 12px; color: var(--text-3); }
.ss-head b { font-size: 18px; }
.ss-head small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.ss-list { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow: auto; }
.ss-row { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px; cursor: pointer; transition: .15s; font: inherit; color: inherit; }
.ss-row:hover:not([disabled]) { border-color: var(--primary); box-shadow: 0 3px 12px rgba(24, 86, 216, .1); }
.ss-row[disabled] { opacity: .55; cursor: default; }
.ss-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ss-name { font-weight: 600; font-size: 13.5px; }
.ss-amt { font-size: 15px; font-weight: 700; color: var(--primary); }
.ss-track { height: 6px; background: #eef2f8; border-radius: 4px; margin: 8px 0 6px; overflow: hidden; }
.ss-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #60a5fa, #1856d8); }
.ss-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.ss-go { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); }

@media (max-width: 860px) {
  .ss-head { grid-template-columns: repeat(2, 1fr); }
  .ss-head b { font-size: 16px; }
}


/* v1.22 采购入库：商品搜索下拉 */
.prod-pick { position: relative; min-width: 0; }
.prod-pick .prod-kw { width: 100%; }
.prod-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
  max-height: 268px; overflow: auto; padding: 4px; }
.pd-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px;
  padding: 7px 9px; cursor: pointer; font: inherit; color: inherit; }
.pd-item:hover, .pd-item:focus { background: #f2f7ff; }
.pd-nm { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.pd-ms { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.pd-pr { font-size: 11.5px; color: var(--primary); margin-top: 1px; }
.pd-empty { padding: 14px 10px; text-align: center; color: var(--text-3); font-size: 12.5px; }

@media (max-width: 860px) {
  .pline { grid-template-columns: 1fr 74px 88px; row-gap: 6px; }
  .pline .pline-sum { grid-column: 1 / 3; text-align: right; }
  .sn-row { grid-template-columns: 18px 1fr 1fr; }
  .sn-row .input[data-sn-f="imei2"], .sn-row .input[data-sn-f="sn"] { grid-column: span 1; }
}

/* v1.23 库存查询：串码 / 颜色 / 内存直接平铺展示 */
.ser-row-inline > td { background: #f8fafd; padding: 0 10px 10px; border-top: 0; }
.ser-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.ser-grp { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 9px; background: #fff; }
.ser-grp-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.ser-color { font-size: 12.5px; font-weight: 600; }
.ser-mem { font-size: 12.5px; font-weight: 600; color: var(--primary);
  background: #eef4ff; border: 1px solid #dbe7ff; border-radius: 6px; padding: 1px 7px; }
.ser-cnt { font-size: 11.5px; color: var(--text-3); }
.ser-imes { display: flex; flex-wrap: wrap; gap: 6px; }
/* 串码字号放大（用户重点要求）：15.5px 加粗 + 等宽，扫一眼就能读清 */
.ser-imei-big { display: inline-flex; align-items: baseline; gap: 4px; font-size: 15.5px; font-weight: 700;
  letter-spacing: .5px; line-height: 1.5; cursor: pointer; user-select: all;
  background: #f4f8ff; border: 1px solid #dbe7ff; border-radius: 7px; padding: 3px 9px; transition: .15s; }
.ser-imei-big:hover { background: #e8f1ff; border-color: var(--primary); }
.ser-imei-big .i2 { font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.ser-imei-big .isn { font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.ser-empty { font-size: 12.5px; color: var(--text-3); padding: 2px 0 4px; }

@media (max-width: 860px) {
  .ser-inline { gap: 8px; }
  .ser-grp { padding: 7px 8px; }
  .ser-imei-big { font-size: 14.5px; padding: 2px 7px; }
  .ser-imei-big .i2, .ser-imei-big .isn { display: none; }
  .ser-row-inline > td { padding: 0 6px 8px; }
}

/* v1.24 入库拍照识别 / 自动建档 */
.shot-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.shot-bar .btn[for="shot-file"] { cursor: pointer; }
.shot-list { display: flex; flex-direction: column; gap: 6px; }
.shot-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: #fbfcfe; }
.shot-item.err { border-color: #f6c5c5; background: #fff7f7; }
.shot-n { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.shot-b { min-width: 0; flex: 1; }
.shot-nm { font-size: 12.5px; font-weight: 600; }
.shot-tx { font-size: 11.5px; color: var(--text-3); word-break: break-all; line-height: 1.5; }
.shot-item.err .shot-tx { color: var(--danger); }

.id-card { margin-top: 8px; border: 1px solid #dbe7ff; border-radius: 10px; background: #f7faff; padding: 10px 12px; }
.id-card-h { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px 12px; }
.id-grid > label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.id-grid > label > span { font-size: 11.5px; color: var(--text-3); }
.id-grid .input { height: 30px; font-size: 12.5px; padding: 0 8px; }
.id-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.id-row > span { color: var(--text-3); flex: none; }
.id-row > b { font-weight: 600; word-break: break-all; }
.id-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 1px 6px;
  border-radius: 5px; font-weight: 600; margin-left: 4px; flex: none; }
.id-tag.ok { background: #e8f7ee; color: #127a3d; border: 1px solid #c3e9d3; }
.id-tag.miss { background: #f4f5f7; color: var(--text-3); border: 1px solid var(--line); }
.id-tag.new { background: #fff5e6; color: #9a5b00; border: 1px solid #f6dcb0; }
.id-warn { margin-top: 7px; font-size: 12px; color: var(--danger); }

@media (max-width: 860px) {
  .id-grid { grid-template-columns: 1fr 1fr; }
  .shot-bar .btn { flex: 1 1 auto; justify-content: center; }
  .id-row { font-size: 12px; }
}

/* v1.25 库存查询：卡片视图 */
.seg-sm button { height: 26px; padding: 0 10px; font-size: 12px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; padding: 14px; }
.inv-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; transition: .15s; }
.inv-card:hover { border-color: #c9d8f2; box-shadow: 0 3px 14px rgba(24, 86, 216, .07); }
.inv-card-warn { border-color: #f6dcb0; background: linear-gradient(180deg, #fffdf8, #fff 60%); }
.inv-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.inv-card-nm { font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.inv-card-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.inv-card-kv { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 10px 0 4px; padding: 9px 12px;
  background: #f8fafd; border-radius: 9px; }
.inv-card-kv > div { display: flex; flex-direction: column; gap: 1px; }
.inv-card-kv span { font-size: 11px; color: var(--text-3); }
.inv-card-kv b { font-size: 15px; }
.inv-card-kv .warn-t { color: var(--warn); }
.inv-card-kv .down { color: var(--danger); }
.inv-card-ser { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.inv-card-f { margin-top: 8px; display: flex; justify-content: flex-end; }
/* 汇总视图：门店库存分布条 */
.inv-dist { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 2px; }
.inv-dist-i { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.6; }
.inv-dist-i b { font-weight: 500; color: var(--text-sub); white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.inv-dist-i .num { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-dist-bar { display: inline-block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #60a5fa, #1856d8); flex: none; }

@media (max-width: 860px) {
  .inv-grid { grid-template-columns: 1fr; gap: 10px; padding: 10px; }
  .inv-card-kv { gap: 8px 16px; }
  .inv-card-kv b { font-size: 14px; }
  .inv-dist { gap: 5px 10px; }
  .inv-dist-i b { max-width: 52px; }
}

/* v1.28 工资页：本期不参与计薪提示 */
.pay-excl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; }
.pay-excl-i { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border-radius: 8px;
  background: #fdf3f1; border: 1px solid #f6d9d3; font-size: 12.5px; font-weight: 600; color: #b4402c; }
.pay-excl-i em { font-style: normal; font-weight: 400; font-size: 11.5px; color: #a2604f; }
@media (max-width: 860px) {
  .pay-excl { gap: 6px 8px; padding: 10px 12px; }
}

/* v1.29 门店收支面板 */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sp-card { cursor: pointer; transition: .15s; padding: 14px 16px; }
.sp-card:hover { border-color: #c9d8f2; box-shadow: 0 3px 14px rgba(24, 86, 216, .08); transform: translateY(-1px); }
.sp-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.sp-card-gp { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 8px; }
.sp-card-gp .lab { font-size: 11.5px; color: var(--text-3); }
.sp-card-gp b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sp-card-gp .muted { font-size: 12px; }
.sp-card-kv { display: flex; gap: 10px 22px; padding: 8px 12px; background: #f8fafd; border-radius: 9px; }
.sp-card-kv > div { display: flex; flex-direction: column; gap: 1px; }
.sp-card-kv span { font-size: 11px; color: var(--text-3); }
.sp-card-kv b { font-size: 13.5px; }
.sp-spark { display: flex; align-items: flex-end; gap: 3px; height: 36px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sp-spark i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, #60a5fa, #1856d8); opacity: .85; }
.sp-bar { cursor: default; }
.sp-drill { cursor: pointer; }
.sp-drill:hover td { background: #f4f8ff; }
@media (max-width: 860px) {
  .sp-grid { grid-template-columns: 1fr; gap: 10px; }
  .sp-card-kv { gap: 8px 16px; }
  .sp-card-gp b { font-size: 18px; }
}

/* ============================================================
   v1.31 视觉打磨（token 层覆盖，不改结构）
   背景 / 侧栏 / 卡片 / KPI / 按钮 / 顶栏 / 登录 / 表格 / 动效
   ============================================================ */

/* ---------- 画布：柔和冷蓝渐变 + 顶部光晕 ---------- */
body {
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(63, 124, 240, .08), transparent 60%),
    radial-gradient(700px 380px at -6% 104%, rgba(16, 185, 129, .05), transparent 55%),
    linear-gradient(180deg, #f6f8fc 0%, #f2f5fa 100%);
  background-attachment: fixed;
}

/* ---------- 侧边栏：渐变白 + 激活项渐变胶囊 ---------- */
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-right: 1px solid rgba(219, 226, 236, .7);
}
.brand { padding: 22px 20px 16px; }
.nav-item {
  position: relative; height: 42px; border-radius: 10px; font-weight: 500;
}
.nav-item::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3.5px; height: 20px; border-radius: 0 4px 4px 0; background: var(--primary);
  transition: transform .18s ease;
}
.nav-item:hover { background: #f2f6fd; color: var(--text); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, #2f6ff0, #1856d8);
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(24, 86, 216, .32);
}
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.nav-item.active:hover { transform: none; }
.nav-group { letter-spacing: 1.2px; font-weight: 600; }

/* ---------- 顶栏：更通透 + 柔和底影 ---------- */
.topbar {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(232, 236, 242, .8);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02), 0 6px 20px -14px rgba(16, 24, 40, .12);
}
.topbar h1 { letter-spacing: .2px; }

/* ---------- 卡片：柔边浮起 ---------- */
.card {
  border: 1px solid rgba(232, 236, 242, .9);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 6px 24px -8px rgba(16, 24, 40, .07);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card:hover {
  border-color: rgba(197, 214, 242, .9);
  box-shadow: 0 2px 6px rgba(16, 24, 40, .04), 0 14px 34px -10px rgba(24, 86, 216, .14);
}
.card-h h3 { letter-spacing: .2px; }

/* ---------- KPI：顶部渐变细条 + 大数字 ---------- */
.kpi { overflow: hidden; }
.kpi::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #2f6ff0, #22c1e8);
  opacity: 0; transition: opacity .18s ease;
}
.kpi:hover::before { opacity: 1; }
.kpi .val { font-size: 24px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; }
.kpi .lab { color: var(--text-2); font-weight: 500; }

/* ---------- 按钮：渐变主按钮 + 微浮 ---------- */
.btn-primary {
  background: linear-gradient(135deg, #2f6ff0, #1856d8);
  box-shadow: 0 2px 10px rgba(24, 86, 216, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3d7af5, #1349bd);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(24, 86, 216, .36), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border-color: var(--line-strong); background: #fff; }
.btn-ghost:hover { border-color: #b9cdf2; background: #f6f9ff; }

/* ---------- 表格：表头淡底 + 行 hover ---------- */
.tbl thead th {
  background: #f8fafd; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover td { background: #f6f9ff; }

/* ---------- 登录页：右侧光斑装饰 ---------- */
.login-panel { position: relative; overflow: hidden; }
.login-panel::before, .login-panel::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.login-panel::before {
  width: 480px; height: 480px; right: -140px; top: -160px;
  background: radial-gradient(circle, rgba(63, 124, 240, .10), transparent 65%);
}
.login-panel::after {
  width: 420px; height: 420px; left: -120px; bottom: -160px;
  background: radial-gradient(circle, rgba(16, 185, 129, .08), transparent 65%);
}
.login-box h2 { letter-spacing: .3px; }

/* ---------- 页面进入动效 ---------- */
.content > * { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar-thumb { background: #cfd8e4; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b8c4d6; }

/* ---------- 模态框：入场更顺滑 ---------- */
.modal-mask { backdrop-filter: blur(3px); }
.modal { box-shadow: 0 24px 70px -12px rgba(16, 24, 40, .28); }

@media (max-width: 860px) {
  .content > * { animation-duration: .2s; }
}

/* v1.31 手机端底栏毛玻璃 + 顶栏柔影 */
@media (max-width: 860px) {
  .mobile-tab { background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 -6px 24px -12px rgba(16, 24, 40, .16); }
  .mobile-top { box-shadow: 0 6px 20px -14px rgba(16, 24, 40, .12); }
}

/* ================= v1.33 报量明细：区间筛选 + 三大业务分色卡片流 ================= */
.rd-bar { padding: 12px 14px; margin-bottom: 14px; }
.rd-bar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rd-nav { display: flex; align-items: center; gap: 6px; }
.rd-range { font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 168px; text-align: center;
  padding: 5px 10px; border-radius: 8px; background: var(--bg-soft, #f4f6fb); }
.rd-custom { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rd-custom .input { height: 32px; width: 140px; font-size: 12.5px; }

/* 区间 KPI 4 卡 */
.rd-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.rd-k { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px 12px; box-shadow: var(--shadow-sm, 0 1px 2px rgba(16,24,40,.05)); overflow: hidden; }
.rd-k::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; }
.rd-k-blue::after { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.rd-k-amber::after { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.rd-k-green::after { background: linear-gradient(90deg, #34d399, #059669); }
.rd-k-slate::after { background: linear-gradient(90deg, #a78bfa, #6d28d9); }
.rd-k-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-sub); }
.rd-k-blue .rd-k-h { color: #2563eb; }
.rd-k-amber .rd-k-h { color: #b45309; }
.rd-k-green .rd-k-h { color: #047857; }
.rd-k-slate .rd-k-h { color: #6d28d9; }
.rd-k-sub { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.rd-k-v { font-size: 26px; font-weight: 700; line-height: 1.25; margin: 6px 0 2px; letter-spacing: -.5px; }
.rd-k-v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.rd-k-f { font-size: 12px; color: var(--muted); }
.rd-k-bar { height: 4px; border-radius: 99px; background: #eef1f6; margin-top: 10px; overflow: hidden; }
.rd-k-bar span { display: block; height: 100%; border-radius: 99px; }

/* 图例 */
.rd-legend { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.rd-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.rd-legend .c-blue { background: #3b82f6; }
.rd-legend .c-amber { background: #f59e0b; }
.rd-legend .c-green { background: #10b981; }

/* 每日堆叠柱 */
.rd-stack { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding: 8px 2px 0; overflow-x: auto; }
.rd-stack-col { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 26px; }
.rd-stack-v { font-size: 11px; color: var(--muted); height: 16px; }
.rd-stack-body { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.rd-stack-body span { display: block; width: 100%; border-radius: 3px 3px 0 0; min-height: 0; }
.rd-stack-body .seg-inst { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.rd-stack-body .seg-upg { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.rd-stack-body .seg-add { background: linear-gradient(180deg, #34d399, #059669); border-radius: 0; }
.rd-stack-d { font-size: 10.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* 明细卡片流 */
.rd-list { display: flex; flex-direction: column; gap: 10px; }
.rd-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden;
  transition: box-shadow .18s, border-color .18s; }
.rd-item:hover { border-color: #cdd8ea; box-shadow: 0 6px 18px -12px rgba(16, 24, 40, .25); }
.rd-item-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fafbfe; flex-wrap: wrap; }
.rd-date { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.rd-store { font-size: 13.5px; font-weight: 600; }
.rd-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rd-chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.rd-chip.c-blue { background: #eaf2ff; color: #1d4ed8; }
.rd-chip.c-amber { background: #fff5e3; color: #b45309; }
.rd-chip.c-green { background: #e6f8f0; color: #047857; }
.rd-val { font-size: 15px; font-weight: 700; color: #6d28d9; }
.rd-val small { font-size: 11px; font-weight: 500; margin-left: 2px; }
.rd-reporter { font-size: 12px; }
.rd-item-empty { opacity: .82; }
.rd-item-b { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }

/* 三大业务分段 */
.rd-sec { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.rd-sec-blue { background: #f5f9ff; border-left: 3px solid #3b82f6; }
.rd-sec-amber { background: #fffaf0; border-left: 3px solid #f59e0b; }
.rd-sec-green { background: #f3fcf8; border-left: 3px solid #10b981; }
.rd-sec-t { flex: 0 0 96px; font-size: 12.5px; font-weight: 600; color: var(--text-sub); display: flex; align-items: center; gap: 5px; }
.rd-sec-t b { color: var(--text); font-size: 13.5px; }
.rd-sec-b { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rd-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rd-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: #dbeafe; color: #1e40af; }
.rd-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; padding: 3px 9px; border-radius: 7px;
  background: #fff; border: 1px solid var(--line); color: var(--text-sub); }
.rd-pill b { color: #6d28d9; font-weight: 600; }
.rd-pill.add { background: #ecfdf5; border-color: #c7f0e0; color: #047857; font-weight: 600; }
.rd-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rd-pill.from { background: #f7f8fb; color: #6b7280; border-color: #e6e9f0; }
.rd-pill.to { background: #fff7e8; border-color: #fbe0b8; color: #b45309; font-weight: 600; }
.rd-arrow { color: #b9c2d4; display: inline-flex; }
.rd-biz { font-size: 11.5px; color: var(--text-sub); background: #f4f6fb; padding: 2px 7px; border-radius: 5px; }
.rd-valpill { font-size: 11.5px; font-weight: 600; color: #6d28d9; background: #f3eeff; padding: 2px 8px; border-radius: 99px; }
.rd-bizline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; padding-top: 2px; border-top: 1px dashed var(--line); }
.rd-bizlist { display: flex; gap: 5px; flex-wrap: wrap; }
.rd-note { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #b45309; background: #fff8e6;
  padding: 5px 10px; border-radius: 7px; }
.rd-note.muted { color: var(--muted); background: #f7f8fb; }

@media (max-width: 1100px) {
  .rd-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .rd-bar-row { gap: 8px; }
  .rd-nav { flex: 1 1 100%; justify-content: space-between; }
  .rd-range { min-width: 0; flex: 1; }
  .rd-custom { margin-left: 0; flex: 1 1 100%; }
  .rd-custom .input { flex: 1; width: auto; min-width: 0; }
  .rd-kpi { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .rd-k { padding: 11px 12px 10px; }
  .rd-k-v { font-size: 22px; }
  .rd-k-sub { display: none; }
  .rd-sec { flex-direction: column; gap: 5px; }
  .rd-sec-t { flex: none; }
  .rd-stack { height: 150px; }
}

/* ================= v1.76 库存查询卡片重设计：KPI 卡（总量+构成三段式） ================= */
.inv-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.inv-kpi.v2 { display: flex; flex-direction: column; align-items: stretch; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px 12px;
  box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: .18s; min-width: 0; }
.inv-kpi.v2.ik-click { cursor: pointer; }
.inv-kpi.v2.ik-click:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -10px rgba(16,24,40,.2); }
.kpi2-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi2-go { font-size: 11px; color: var(--muted); white-space: nowrap; }
.kpi2-main { margin: 6px 0 3px; display: flex; align-items: baseline; gap: 6px; }
.kpi2-main .v { font-size: 26px; font-weight: 800; letter-spacing: -.8px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi2-main .u { font-size: 12px; color: var(--muted); }
.kpi2-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi2-sub .sep { margin: 0 5px; color: var(--line); }
.kpi2-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 8px; max-width: 210px; }
.kpi2-bar i { height: 100%; }
.kpi2-legend { display: flex; gap: 8px; margin-top: 6px; font-size: 10.5px; color: var(--text-3); flex-wrap: wrap; }
.kpi2-legend s { display: inline-block; width: 6px; height: 6px; border-radius: 2px; text-decoration: none; margin-right: 3px; vertical-align: middle; }
/* 状态着色：琥珀=预警、灰=空态；主数只此一处 */
.inv-kpi.v2.ik-amber { border-color: #fbe0b8; background: linear-gradient(180deg, #fffdf7, #fff 60%); }
.inv-kpi.v2.ik-amber .kpi2-main .v { color: #b45309; }

/* ================= v1.76 概览条：分类 Top6 占比 chip + 门店卡 ================= */
.inv-overview { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.io-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.io-lab { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted);
  flex: none; width: 52px; }
.io-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.io-chip-v2 { display: inline-flex; flex-direction: column; gap: 4px; padding: 7px 12px 8px; min-width: 86px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: .15s; text-align: left; }
.io-chip-v2 .r1 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-sub); }
.io-chip-v2 .r1 b { color: var(--text); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.io-chip-v2 .bar { height: 5px; border-radius: 3px; background: #edf1f8; overflow: hidden; }
.io-chip-v2 .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #60a5fa, #1856d8); }
.io-chip-v2 .pct { font-size: 10px; color: var(--text-3); }
.io-chip-v2:hover { border-color: #b9cdf0; background: #f3f7ff; }
.io-chip-v2.on { border-color: var(--primary); background: #eef4ff; }
.io-chip-v2.on .r1 { color: var(--primary); }
.chip-more { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px;
  padding: 8px 12px; background: none; cursor: pointer; align-self: center; }
.chip-more:hover { border-color: #b9cdf0; color: var(--primary); }
.storecard { display: inline-flex; flex-direction: column; gap: 4px; padding: 8px 13px; min-width: 150px; max-width: 240px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; transition: .15s; text-align: left; }
.storecard .r1 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.storecard .r1 .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.storecard .r1 b { font-size: 15px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.storecard .r2 { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.storecard .r2 .bar { flex: 1; height: 5px; border-radius: 3px; background: #edf1f8; overflow: hidden; }
.storecard .r2 .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #60a5fa, #1856d8); }
.storecard:hover { border-color: #b9cdf0; background: #f3f7ff; }
.storecard.on { border-color: var(--primary); background: #eef4ff; }
.io-lowdot { width: 7px; height: 7px; border-radius: 99px; background: #f59e0b; box-shadow: 0 0 0 2.5px rgba(245,158,11,.22); flex: none; }

/* 卡片右上库存大数徽章 */
.inv-card { position: relative; }
.inv-qty-badge { position: absolute; top: 10px; right: 12px; text-align: right; line-height: 1; z-index: 1; }
.inv-qty-badge b { font-size: 26px; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.inv-qty-badge span { font-size: 11px; color: var(--muted); margin-left: 2px; }
.inv-qty-badge.low b { color: #d97706; }
.inv-qty-badge.out b { color: var(--danger); }
/* 徽章与原状态标签并存：标签下移一点避免重叠（门店卡片视图仍用） */
.inv-card .inv-card-h .tag { margin-right: 56px; }

/* ================= v1.76 汇总卡 v2：数量单源 + 属性行 + 占比分布 ================= */
.inv-card.v2 .inv-card-h .tag { margin-right: 0; }
.card-h-v2 { display: flex; align-items: flex-start; gap: 10px; }
.card-h-v2 .ttl { flex: 1; min-width: 0; }
.card-h-v2 .qty { flex: none; text-align: right; line-height: 1; }
.card-h-v2 .qty b { font-size: 25px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; color: var(--text); }
.card-h-v2 .qty span { font-size: 11px; color: var(--muted); margin-left: 2px; }
.card-h-v2 .qty.low b { color: #b45309; }
.card-h-v2 .qty.out b { color: var(--danger); }
.attr-line { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; min-width: 0; }
.st-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.st-reason { font-size: 11.5px; color: #b45309; }
.dist-v2 { margin-top: 10px; border-top: 1px solid #f0f3f9; padding-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.dist-v2 .drow { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.dist-v2 .drow .dn { width: 88px; flex: none; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-v2 .drow .dbar { flex: 1; height: 7px; border-radius: 4px; background: #eef2f9; overflow: hidden; }
.dist-v2 .drow .dbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #60a5fa, #1856d8); }
.dist-v2 .drow.is-low .dbar i { background: linear-gradient(90deg, #fbbf24, #d97706); }
.dist-v2 .drow .dq { flex: none; width: 78px; text-align: right; }
.dist-v2 .drow .dq b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dist-v2 .drow .dq .pct { color: var(--text-3); font-size: 10.5px; margin-left: 4px; }
.dist-v2 .drow .dlow { flex: none; font-size: 10.5px; color: #b45309; background: #fff5e3; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.kv2 { display: flex; align-items: center; gap: 18px; margin-top: 9px; padding: 8px 12px; background: #f8fafd; border-radius: 9px; flex-wrap: wrap; }
.kv2 > div { display: flex; align-items: baseline; gap: 5px; }
.kv2 span { font-size: 11px; color: var(--text-3); }
.kv2 b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.kv2 .gap { flex: 1; }
.kv2 .act { font-size: 12px; color: var(--primary); background: #fff; border: 1px solid #c9d8f2; border-radius: 7px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.kv2 .act:hover { background: #eef4ff; }

/* 串码折叠按钮 */
.ser-more { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: #2563eb;
  background: #eef4ff; border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; margin-top: 2px; }
.ser-more:hover { background: #dfe9ff; }

@media (max-width: 1100px) { .inv-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .inv-kpis { gap: 9px; }
  .inv-kpi.v2 { padding: 11px 12px 10px; }
  .kpi2-main .v { font-size: 20px; }
  .kpi2-bar { max-width: none; }
  .card-h-v2 .qty b { font-size: 21px; }
  .dist-v2 .drow .dn { width: 64px; }
  .kv2 { gap: 10px; }
  .storecard { max-width: 100%; }
}

/* ================= v1.35 销售订单毛利展示 ================= */
.ord-sum { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.os-i { background: #fff; padding: 12px 16px; display: flex; flex-direction: column; gap: 3px; }
.os-i > span { font-size: 12px; color: var(--muted); }
.os-i b { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.os-i b small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.os-i.os-hl { background: linear-gradient(180deg, #f8fbff, #fff); }
.os-i.os-dim { background: #fafbfc; opacity: .8; }
.os-bar { display: block; height: 4px; border-radius: 99px; background: #eef1f6; margin-top: 4px; overflow: hidden; }
.os-bar em { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #059669); }

/* 列表毛利列 */
.ord-pf { min-width: 92px; }
.pf-v { font-size: 14px; font-weight: 700; }
.pf-ok .pf-v { color: #059669; }
.pf-bad .pf-v { color: #dc2626; }
.pf-bar { height: 3px; border-radius: 99px; background: #eef1f6; margin: 4px 0 3px; overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 99px; background: #34d399; }
.pf-bad .pf-bar i { background: #f87171; }
.pf-r { font-size: 11px; color: var(--muted); }

/* 详情毛利汇总 */
.od-pf { display: flex; justify-content: flex-end; gap: 22px; margin-top: 12px; padding: 10px 14px;
  background: #f8fbff; border: 1px solid #e3edfb; border-radius: 10px; font-size: 12.5px; }
.od-pf > div { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.od-pf span { color: var(--muted); font-size: 12px; }
.od-pf b { font-size: 16px; }

@media (max-width: 1100px) { .ord-sum { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .ord-sum { grid-template-columns: repeat(3, 1fr); }
  .os-i { padding: 10px 12px; }
  .os-i b { font-size: 16px; }
  .pf-r { display: none; }
  .od-pf { gap: 14px; flex-wrap: wrap; }
}

/* ================= 考勤排班格子 ================= */
.sched-cell {
  width: 22px; height: 24px; margin: auto; line-height: 24px;
  font-size: 11px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 3px; color: var(--text-2);
  user-select: none;
}
.sched-cell:hover { border-color: var(--brand, #2563eb); }
.sched-cell.sched-rest { background: #fff3d6; color: #b45309; border-color: #f0c14b; font-weight: 700; }

/* ================= 首页待办提醒 + 知识库快速搜索 ================= */
.home-alerts { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.home-alert {
  flex: 1 1 260px; display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: #fff;
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-alert:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -12px rgba(15, 23, 42, .35); }
.ha-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ha-body { flex: 1; min-width: 0; }
.ha-title { font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.ha-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-go { color: var(--text-3); flex: none; }

/* 知识库未读：蓝色高亮 */
.home-alert.hb-kb { border-color: #bcd2f8; background: linear-gradient(180deg, #f2f7ff, #fff); }
.home-alert.hb-kb .ha-ico { background: #e3eeff; color: #1856d8; }
.home-alert.hb-kb .ha-title { color: #12439f; }
/* 未报量：橙色高亮 */
.home-alert.hb-report { border-color: #fbd9a5; background: linear-gradient(180deg, #fff8ec, #fff); }
.home-alert.hb-report .ha-ico { background: #fff0d6; color: #c2740a; }
.home-alert.hb-report .ha-title { color: #a35a06; }
/* 考勤未打卡：红色高亮 */
.home-alert.hb-att { border-color: #f7c2c2; background: linear-gradient(180deg, #fff5f5, #fff); }
.home-alert.hb-att .ha-ico { background: #ffe4e4; color: #c62828; }
.home-alert.hb-att .ha-title { color: #b91c1c; }

/* 搜索框 */
.home-search { position: relative; margin-bottom: 16px; }
.hs-box {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
  box-shadow: 0 2px 10px -8px rgba(15, 23, 42, .5); color: var(--text-3);
}
.hs-box:focus-within { border-color: #1856d8; box-shadow: 0 0 0 3px rgba(24, 86, 216, .1); }
.hs-input { flex: 1; border: 0; outline: 0; font-size: 14px; background: transparent; color: var(--text-1); min-width: 0; }
.hide-if-empty { visibility: hidden; }
.hs-res { display: none; }
.hs-res.on { display: block; }
.hs-panel {
  position: absolute; left: 0; right: 0; top: 52px; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .45); max-height: 420px; overflow: auto;
}
.hs-item { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.hs-item:last-child { border-bottom: 0; }
.hs-item:hover { background: #f6f9ff; }
.hs-t { font-weight: 600; font-size: 13.5px; color: var(--text-1); }
.hs-d { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hs-m { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; }
@media (max-width: 720px) {
  .home-alerts { flex-direction: column; }
  .hs-panel { max-height: 60vh; }
}

/* 考勤规则弹窗：表单网格 */
.rg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rg-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.rg-tbl input.input { width: 100%; min-width: 88px; padding: 5px 7px; font-size: 12.5px; }
.rg-tbl td { padding: 6px 8px; vertical-align: middle; }

/* ================= 出入库管理 ================= */
.sm-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.sm-tabs { display: flex; background: #eef1f6; border-radius: 9px; padding: 3px; }
.sm-tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 7px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.sm-tab.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }

.btn-in { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; border: 0; }
.btn-in:hover { filter: brightness(1.06); }
.btn-out { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; border: 0; }
.btn-out:hover { filter: brightness(1.06); }

.kpi .val.in { color: #0d9488; }
.kpi .val.out { color: #ea580c; }
.kpi .val.warn { color: #d97706; }
.kpi .val .unit { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--text-3); }

.sm-badge {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 1.7;
}
.bd-in { background: #ccfbf1; color: #0d9488; }
.bd-out { background: #ffedd5; color: #ea580c; }

.sm-tbl td { font-size: 13px; }
.sm-brief { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-qty { font-weight: 700; }
.sm-qty.q-in { color: #0d9488; }
.sm-qty.q-out { color: #ea580c; }
.sm-void { opacity: .5; }
.sm-void .mono { text-decoration: line-through; }

/* 开单弹窗 */
.sm-frm { display: flex; flex-direction: column; gap: 14px; }
.sm-frm .row2 { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 12px; }
.sm-frm .fld { display: flex; align-items: center; gap: 8px; }
.sm-frm .fld > span { font-size: 13px; color: var(--text-2); white-space: nowrap; }

.sm-pick { position: relative; }
.sm-sugg {
  display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px;
  box-shadow: 0 8px 24px rgba(16,24,40,.12); max-height: 260px; overflow: auto;
}
.sm-sugg-item {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px;
  cursor: pointer; font-size: 13px;
}
.sm-sugg-item:hover { background: #f4f7fd; }
.sm-sn { font-weight: 500; }
.sm-sm { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.sm-sugg-empty { padding: 12px 14px; color: var(--text-3); font-size: 13px; }

.sm-cart {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.sm-cart-empty { padding: 26px; text-align: center; color: var(--text-3); font-size: 13px; }
.sm-crow {
  display: grid; grid-template-columns: 1fr 76px 100px 1fr 56px;
  gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #f1f4f9;
}
.sm-crow:last-child { border-bottom: 0; }
.sm-cname { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-csku { font-size: 11px; color: var(--text-3); margin-left: 6px; font-weight: 400; }
.sm-crow .input { padding: 6px 8px; font-size: 13px; }
.sm-noser { color: var(--text-3); text-align: center; font-size: 12px; }
.sm-total { text-align: right; font-size: 13px; color: var(--text-2); }
.sm-total b { color: var(--text); font-size: 15px; }

/* 详情弹窗 */
.sm-dhead { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; color: #fff; position: relative; }
.sm-dhead.dh-in { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.sm-dhead.dh-out { background: linear-gradient(135deg, #fb923c, #ea580c); }
.sm-dqty { font-size: 34px; font-weight: 700; line-height: 1; }
.sm-dmeta { font-size: 13px; line-height: 1.7; opacity: .95; }
.sm-void-tag {
  position: absolute; top: 12px; right: 14px; font-size: 12px;
  background: rgba(255,255,255,.25); padding: 3px 10px; border-radius: 999px;
}
.sm-dser {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--text-2);
  background: #f6f8fb; padding: 3px 7px; border-radius: 5px; margin-top: 4px; word-break: break-all;
}
.sm-dremark { margin-top: 12px; font-size: 13px; color: var(--text-2); background: #f8fafc; padding: 10px 14px; border-radius: 8px; }

@media (max-width: 900px) {
  .sm-frm .row2 { grid-template-columns: 1fr; }
  .sm-crow { grid-template-columns: 1fr 64px 88px 60px; }
  .sm-crow .sm-cser { display: none; }
}

/* ===== 出入库：销售出库（=开单收银）相关 ===== */
.sm-hint {
  margin: 0 0 12px;
  padding: 9px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 12.5px;
  color: #047857;
  line-height: 1.55;
}
.sm-ord-tag {
  margin-top: 3px;
  font-size: 11.5px;
  color: #0d9488;
  white-space: nowrap;
}
.sm-dorder {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d1fae5;
}

/* ---------- v1.56 调拨弹窗：商品搜索 ----------
   下拉从「只能滚」变成「先搜再选」：
   · 输入框带放大镜，视觉上明确这是筛选器，不是第二个表单字段
   · 下拉加高到 8 行，一屏能看到足够多的候选，而不是只露一条
   · 用 size 属性的 listbox 而不是原生小下拉——后者在 Chrome 里最多显示 6 行，
     而且展开时会盖住输入框，搜一下就得先收起来再重新点开，很别扭 */
.tf-search {
  position: relative;
  margin-bottom: 6px;
}
.tf-search > svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.tf-search .input {
  padding-left: 32px; height: 36px; font-size: 13px;
}
/* 去掉 type=search 的原生清除按钮（Safari/Chrome 各有一套，长得不一样） */
.tf-search .input::-webkit-search-cancel-button { -webkit-appearance: none; }

#tf-prod[size] {
  height: auto;
  min-height: 168px;
  padding: 4px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
#tf-prod[size] option {
  padding: 5px 8px;
  border-radius: 5px;
}
#tf-prod[size] option:checked {
  background: #e0edff linear-gradient(0deg, #e0edff, #e0edff);
  color: #1d4ed8;
  font-weight: 600;
}

/* ---------- v1.57 调拨：必填标记 ----------
   调出门店从「可留空 = 总部仓库」改成必选，视觉上要能看出这是必填项，
   否则用户还是照着旧习惯直接点提交，白挨一次报错。 */
.form-grid .req {
  color: var(--danger);
  margin-left: 2px;
  font-weight: 700;
}

/* ---------- v1.58 调拨：串码选择 ----------
   手机类商品调拨要指定具体哪几台，弹窗里就地勾选。
   · 清单固定高度 + 内部滚动：单店同机型可能几十台，不滚动会把
     底部的备注和提交按钮挤到屏幕外
   · 每台两行：IMEI 大字 + SN/颜色内存小字，扫一眼能认出是哪台
   · 选中行整行变色而不是只亮复选框——勾选区域越小越容易点错 */
.tf-ser-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.tf-ser-bar .input { flex: 1; height: 34px; font-size: 13px; }
.tf-ser-cnt {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tf-ser-cnt.warn { color: var(--primary); font-weight: 600; }
.tf-ser-list {
  max-height: 186px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.tf-ser-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.tf-ser-item:last-child { border-bottom: 0; }
.tf-ser-item:hover { background: #f8fafc; }
.tf-ser-item.on { background: #eff6ff; }
.tf-ser-item input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.tf-ser-info { min-width: 0; flex: 1; }
.tf-ser-info > div:first-child { font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.tf-ser-info .sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.tf-ser-info .sub b { color: var(--primary); }

/* 调拨单列表里的串码摘要：一行一个 IMEI，多台时自动换行 */
.tr-ser {
  margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px;
}
.tr-ser span {
  font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: #eff6ff; color: #1d4ed8;
}

/* ================= v1.61 商品批量处理 =================
   批量栏贴在表格上方而不是浮在底部：勾选发生在表格里，
   操作按钮紧贴表格上沿，视线不用来回跳（底部悬浮条会挡住最后几行）。
   颜色上「停用」用危险色、其余用中性 ghost，避免一排彩色按钮看起来都很安全。 */
.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 9px 12px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  animation: bbIn .16s ease-out;
}
@keyframes bbIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bb-cnt { font-size: 13px; color: #1e40af; }
.bb-cnt b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 1px; }
.batch-bar .btn { background: #fff; }
.batch-bar .btn:hover { border-color: #93c5fd; }

/* 选中行：左侧竖条 + 浅底，比整行深色底更轻，不会把表格纹理打断 */
.tbl tbody tr.row-sel { background: #f0f7ff; }
.tbl tbody tr.row-sel > td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.tbl thead input[type="checkbox"], .tbl tbody input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle;
}

/* 弹窗里「将对 N 个商品执行」的抬头 */
.bb-head {
  font-size: 13.5px; color: var(--text-2); line-height: 1.6;
  padding: 9px 12px; border-radius: 9px; background: #f8fafc; border: 1px solid var(--line);
}
.bb-head b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
/* 商品名可能很长，独立一行、超长省略，不把抬头撑成两段 */
.bb-sub {
  display: block; margin-top: 3px;
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 改价预览：把「前几个商品改前→改后」摆出来，是这套批量功能最重要的防错设计 */
.bb-preview {
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff;
}
.bpv-row {
  display: grid; grid-template-columns: 1fr 74px 16px 74px; align-items: center; gap: 6px;
  padding: 7px 11px; font-size: 12.5px; border-bottom: 1px solid var(--line);
}
.bpv-row:last-of-type { border-bottom: 0; }
.bpv-row > span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2);
}
.bpv-row s { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bpv-row i { text-align: center; font-style: normal; color: var(--text-3); }
.bpv-row b {
  text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text);
}
.bpv-row b.up { color: var(--danger); }
.bpv-row b.down { color: var(--ok); }
.bpv-warn {
  padding: 7px 11px; font-size: 12px; color: #92400e; background: #fef3c7;
  border-top: 1px solid #fde68a;
}
.bpv-more {
  padding: 6px 11px; font-size: 11.5px; color: var(--text-3); background: #fafafa;
}
.bpv-more:empty { display: none; }

/* ================= v1.63 科目录入（宽表） =================
   来源：工资系统 finance 页的「科目 × 月份」网格。
   工资系统用 12 个纵向卡片列，窄屏只能横滚；这里改成一张表，月份即列，
   首列科目吸左、末列合计吸右，中间横滑也不丢参照。
*/
.mx-card { overflow: hidden; }
.mx-wrap { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
.mx-tbl { border-collapse: separate; border-spacing: 0; min-width: 940px; }
.mx-tbl th, .mx-tbl td { padding: 0; border-bottom: 1px solid var(--line); }

/* 表头：月份列窄而等宽 */
.mx-tbl thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f7f9fc; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  text-align: center; padding: 8px 4px; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}
.mx-tbl thead th.mx-cat { text-align: left; padding-left: 12px; }
.mx-tbl thead th.mx-total { padding-right: 12px; }

/* 首列吸左 */
.mx-tbl .mx-cat {
  position: sticky; left: 0; z-index: 2; background: #fff;
  min-width: 132px; max-width: 132px; padding: 7px 10px 7px 12px;
  font-size: 12.5px; color: var(--text-2);
  border-right: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 末列吸右 */
.mx-tbl .mx-total {
  position: sticky; right: 0; z-index: 2; background: #fff;
  min-width: 96px; padding: 7px 12px 7px 8px; text-align: right;
  border-left: 1px solid var(--line); font-size: 12.5px;
}

.mx-tbl .mx-cell { width: 62px; text-align: center; }

/* 输入框：看起来像单元格，聚焦才显出输入态 */
.mx-in {
  width: 100%; height: 32px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--text-1);
  font-size: 12.5px; text-align: right; padding: 0 6px;
  font-variant-numeric: tabular-nums;
  transition: background .12s, border-color .12s;
}
.mx-in:hover:not([readonly]) { background: #f7f9fc; border-color: var(--line-strong); }
.mx-in:focus {
  outline: none; background: #fff; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak); z-index: 1; position: relative;
}
.mx-in[readonly] { color: var(--text-3); cursor: default; }
/* 保存态：绿闪=已存 / 红边=失败 / 灰=提交中 */
.mx-in.mx-saving { background: #f5f7fa; color: var(--text-3); }
.mx-in.mx-ok { background: var(--ok-weak); border-color: var(--ok); }
.mx-in.mx-err { border-color: var(--danger); background: var(--danger-weak); }

/* 分区行：收入 / 支出 */
.mx-tbl tr.mx-sec > td {
  background: #f2f6fd; font-size: 11.5px; font-weight: 700; color: var(--primary-deep);
  padding: 5px 12px; letter-spacing: 1px; border-bottom: 1px solid var(--line-strong);
}
.mx-tbl tr.mx-sec > td.mx-cat { background: #f2f6fd; }
.mx-tbl tr.mx-sec > td.mx-total { background: #f2f6fd; }

/* 合计行 */
.mx-tbl tr.mx-sum > td {
  background: #fbfcfe; font-weight: 600; color: var(--text-1);
  font-size: 12.5px; padding: 8px 4px; border-top: 1px solid var(--line-strong);
}
.mx-tbl tr.mx-sum > td.mx-cat { background: #fbfcfe; font-weight: 600; }
.mx-tbl tr.mx-sum > td.mx-total { background: #fbfcfe; }

/* 净利润行：整表唯一需要一眼看到的数字 */
.mx-tbl tr.mx-profit > td {
  background: #fff; font-weight: 700; padding: 10px 4px;
  border-top: 2px solid var(--line-strong); font-size: 13px;
}
.mx-tbl tr.mx-profit > td.mx-cat { background: #fff; }
.mx-tbl tr.mx-profit > td.mx-total { background: #fff; }

/* 历史科目（电信结算导入的自由文本科目）：压暗，避免跟固定口径抢注意力 */
.mx-tbl tr.mx-legacy .mx-cat { color: var(--text-3); }
.mx-tbl tr.mx-legacy .mx-in { color: var(--text-2); }

.mx-tbl td.up { color: var(--danger); }   /* 中国习惯：盈利为红 */
.mx-tbl td.down { color: var(--ok); }

@media (max-width: 760px) {
  .mx-tbl { min-width: 860px; }
  .mx-tbl .mx-cat { min-width: 108px; max-width: 108px; font-size: 12px; }
  .mx-tbl .mx-cell { width: 56px; }
  .mx-in { font-size: 12px; }
}

/* ================= v1.78 分类树（分类管理弹窗） ================= */
.cat-row.is-child { background: #fcfdff; }
.cat-row.cat-dragging { opacity: .4; }
.cat-row.cat-over { background: #eef4ff; box-shadow: inset 3px 0 0 var(--primary); }
.cat-name { display: flex; align-items: center; gap: 7px; }
.cat-elbow { color: #b8c4d9; font-size: 11px; width: 12px; display: inline-block; text-align: center; }
.cat-row[draggable="true"] { cursor: grab; }
.cat-row[draggable="true"]:active { cursor: grabbing; }
/* 分类下拉里的层级缩进 */
.cat-opt-lv { display: inline-block; }
