/* ==========================================================================
 * MVP功能清单管理后台 · 样式表
 * 设计：浅色企业后台，主色 var(--primary)，卡片化 + 响应式
 * ========================================================================== */

:root {
  /* 20261029 全局视觉刷新：更冷静的墨蓝主色（降饱和、提深度），
     中性灰阶去掉蓝味，圆角收敛（卡 10 / 控件 6），阴影压到几乎不可见 ——
     靠 1px 边框和留白分层，不靠投影，整体更"安静、高级"。 */
  --bg: #EAEAEA;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --border: #e0e0e0;
  --border-strong: #c9c9c9;
  --text: #111111;
  --text-2: #4a4a4a;
  --muted: #666666;
  --primary: #111111;
  --primary-dark: #000000;
  --primary-weak: #f0f0f0;
  --success: #3f7a5c;
  --success-weak: #eef3ef;
  --warn: #a87f3a;
  --warn-weak: #f6f1e6;
  --danger: #D53740;
  --danger-weak: #fbe9e9;
  --purple: #6a6178;
  /* 深色区统一墨色系。之前侧栏 / 导航悬浮面板 / 登录页品牌栏各写各的
     （#131d33 / #1b2745 / #101d3a），并排看是三种蓝 —— 越是"深色"越容易显脏。
     --ink-1/--ink-3 是三处共用的起止色，--ink-mid / --ink-fly-* 只做局部层次。 */
  --ink-1: #1a1a1a;
  --ink-2: #111111;
  --ink-3: #0d0d0d;
  --ink-mid: #242424;
  --ink-fly-1: #262626;
  --ink-fly-2: #1a1a1a;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .07);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, .20);
  --sidebar-w: 208px;
  --topbar-h: 56px;
  --purple-weak: #efece9;
  --link: #111111;
  --focus-ring: rgba(17,17,17,.16);
  --nav-active-bg: rgba(255,255,255,.16);
  --nav-active-ink: #ffffff;
  --nav-active-bar: rgba(255,255,255,.55);
  --brand-mark: #ffffff;
  --brand-mark-ink: #111111;
  --overlay: rgba(0,0,0,.42);
  --danger-ink: #b0252d;
  --success-ink: #2f6b4e;
  --warn-ink: #8a6420;
  --sum-bg: #f2f2f2;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.app-root { min-height: 100%; }

/* ------------------------------------------------------------ 通用组件 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; transition: .15s ease; font-size: 13px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .18); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger-weak); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--primary-weak); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
/* 键盘焦点环：Tab 走过的按钮/链接要有明确落点。
   仓管常用扫码枪 + 键盘连续操作，焦点看不见就得靠鼠标点回原位。
   只作用于 :focus-visible —— 鼠标点击不会冒出蓝框。 */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px;
}

.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none; transition: .15s ease;
}
.textarea { height: auto; padding: 8px 11px; resize: vertical; min-height: 78px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); outline: 2px solid var(--text); outline-offset: 0; box-shadow: 0 0 0 3px var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: #a7b1c2; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%238a97ab' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); min-height: 16px; }
.req::after { content: " *"; color: var(--danger); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; line-height: 19px;
  background: var(--primary-weak); color: var(--primary); white-space: nowrap;
}
.badge-开发中 { background: var(--primary-weak); color: var(--primary); }
.badge-待验收 { background: var(--warn-weak); color: var(--warn-ink); }
.badge-已完成 { background: var(--success-weak); color: var(--success-ink); }
.badge-已上线 { background: #eae4ff; color: var(--purple); }
.badge-已搁置 { background: var(--danger-weak); color: var(--danger); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-hd h3 { font-size: 14.5px; }
.card-hd .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.card-bd { padding: 13px 16px; }

.empty { padding: 46px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- 登录页 */
/* 20261029 重设计：左侧深墨蓝品牌栏（叠细网格纹理 + 两团极淡光晕），
   右侧白底表单。信息层级靠字重和留白拉开，不靠颜色堆。 */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(880px 480px at 6% -6%, #e2eafc 0%, rgba(226, 234, 252, 0) 55%),
    radial-gradient(720px 400px at 102% 110%, #dff2ec 0%, rgba(223, 242, 236, 0) 52%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: .95fr 1fr;
  background: var(--surface); border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 24px 64px -16px rgba(12, 24, 52, .24), 0 2px 8px rgba(12, 24, 52, .06);
}
.login-aside {
  padding: 44px 38px 40px; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(560px 340px at 92% -12%, rgba(86, 134, 255, .38) 0%, rgba(86, 134, 255, 0) 62%),
    radial-gradient(440px 320px at -18% 112%, rgba(24, 168, 128, .28) 0%, rgba(24, 168, 128, 0) 55%),
    linear-gradient(162deg, var(--ink-1) 0%, var(--ink-mid) 52%, var(--ink-3) 100%);
}
/* 细网格纹理：只在左上角亮起来，往右下淡出 —— 有质感但不抢字 */
.login-aside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(480px 360px at 26% 16%, #000 0%, transparent 76%);
  mask-image: radial-gradient(480px 360px at 26% 16%, #000 0%, transparent 76%);
}
.login-aside::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -120px; bottom: -130px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
}
.login-aside .brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 600; letter-spacing: .3px; position: relative; z-index: 1; }
.login-aside .brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  display: grid; place-items: center; font-size: 17px; font-weight: 700;
}
.login-aside h2 { font-size: 25px; margin: 34px 0 10px; line-height: 1.32; letter-spacing: .2px; position: relative; z-index: 1; }
.login-aside p { color: rgba(255, 255, 255, .72); font-size: 13px; margin: 0 0 26px; line-height: 1.7; position: relative; z-index: 1; }
.login-aside ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; position: relative; z-index: 1; }
.login-aside li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .88); line-height: 1.6; }
.login-aside li i {
  flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 2px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  display: grid; place-items: center; font-style: normal; font-size: 10.5px; color: #9db9f5;
}
.login-aside .meta { position: absolute; bottom: 24px; left: 38px; right: 38px; font-size: 11.5px; color: rgba(255, 255, 255, .5); }
.login-form { padding: 44px 42px 38px; }
.login-form h3 { font-size: 21px; letter-spacing: -.2px; }
.login-form .lead { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-form form { display: grid; gap: 14px; }
.login-form .field > label { font-size: 12.5px; }
.login-form .input { height: 40px; }
.login-form .btn-primary { height: 40px; font-size: 14px; }
.login-form .filter-bar { margin-top: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 8px; margin-bottom: 20px; }
.tabs button {
  flex: 1; height: 32px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-2); cursor: pointer; font-size: 13px; transition: .15s;
}
.tabs button.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }

/* --------------------------------------------------- 数据迁移（备份导入模式选择） */
.radio-group { display: grid; gap: 8px; margin-top: 14px; }
.radio-line {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: .15s;
}
.radio-line:hover { border-color: rgba(36, 86, 217, .35); }
.radio-line.on { border-color: var(--primary); background: var(--primary-weak); }
.radio-line input { margin-top: 3px; }
.radio-line span { display: block; }
.radio-line b { font-weight: 600; font-size: 13.5px; color: var(--text); }
.radio-line i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.inline-lab { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.login-tip {
  margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--primary); color: var(--text-2); font-size: 12.5px; line-height: 1.7;
}
.login-tip b { font-weight: 600; }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.alert-error { background: var(--danger-weak); color: #a8322f; }

/* ---------------------------------------------------------------- 主框架 */

/* 2026-11-24 顶栏迁移：shell 由「横排（深色侧栏 + 内容）」改成「竖排（全局菜单栏 + 内容）」 */
.shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ---- 全局菜单栏（2026-11-24 顶栏迁移）------------------------------------
   品牌 + 10 个一级菜单横排 + 右侧状态区（铃 / 账套 / 角色 / 用户 / 退出）。
   为什么搬到顶栏：一级只有 10 项且二级本来就是"点开才展开"的悬浮面板，
   竖栏常占 208px，1440 下内容区被挤到 1232 —— 表格页最吃亏。
   浅色毛玻璃是为了压住下面的内容滚动（与效果图 _qa/ui-v2/menu-home.png 一致）。 */
.appbar {
  flex: none; height: var(--topbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 20px; position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.ab-brand { display: flex; align-items: center; gap: 9px; flex: none; }
.ab-brand .logo {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--text); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.ab-brand .txt { font-weight: 650; font-size: 14.5px; line-height: 1.2; white-space: nowrap; }
.ab-brand .txt small { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); }
.ab-nav {
  /* 竖排 stretch：一级项撑满整条 56px（效果图里下划线就在栏底），
     同时让「左对齐的浮层 top:100%」和「右对齐到窗口的浮层 top:100%」算出同一个值 ——
     两边差 7px 的话，鼠标横扫菜单时下拉框会上下跳。 */
  display: flex; align-items: stretch; align-self: stretch; gap: 2px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.ab-nav::-webkit-scrollbar { display: none; }
/* 顶栏里的一级项：横排、按文字宽度、不换行。.nav-item 的基础样式来自 :266，
   但深色侧栏那段（:1014 起）把颜色改成了 rgba(255,255,255,.66) —— 白底上不可见，
   所以这里必须用两段选择器（0,2,0）把颜色/悬停/选中三项全部覆盖回来。 */
.ab-nav .nav-item {
  position: relative; width: auto; height: auto; margin: 0; padding: 0 10px;
  align-self: stretch; flex: none; gap: 0; border-radius: 0; font-size: 13px; white-space: nowrap;
  color: var(--text-2); background: transparent; box-shadow: none;
}
/* 有浮层的一级项外面还包一层 .nav-wrap：让它也撑满整条高度，
   并把里面的 .nav-item 拉满 —— 否则 nav-wrap 只有文字高（36px），
   浮层 top:100% 算出来 42px，而右对齐那三项是 62px，鼠标横扫时下拉框会上下跳。 */
.ab-nav > .nav-wrap { display: flex; align-self: stretch; }
.ab-nav > .nav-wrap > .nav-item { flex: 1; }
/* 效果图里顶栏只有文字，没有一级图标（二级浮层里的结构不动） */
.ab-nav .nav-item .ico { display: none; }
.ab-nav .nav-item:hover { background: var(--surface-2); color: var(--text); }
.ab-nav .nav-item.active:hover { background: transparent; }
/* 选中态：字重 + 底部 2px 短横线。不用浅色块 —— 顶栏本身是白底，
   色块会和毛玻璃底糊在一起；下划线是效果图里的形态（menu-home.png 的「工作台」）。 */
.ab-nav .nav-item.active {
  background: transparent; color: var(--text); font-weight: 600; box-shadow: none;
}
.ab-nav .nav-item.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0;
  height: 2px; border-radius: 1px; background: var(--text);
}
.ab-right { display: flex; align-items: center; gap: 12px; flex: none; }

/* 2026-11-24：`.sidebar` 已停用（顶栏迁移，viewShell 不再输出这个元素）。
   规则**保留不删**，两个原因：
     ① `.sb-nav` 还被 app.js:30517 的弹窗树（科目树）用到，那处结构与顶栏无关；
     ② legacy 主题块（:3333 附近）与判据都还按这些选择器存在，删了要连带改多处。
   新代码不要再引用 `.sidebar / .sb-brand / .sb-foot`。 */
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sb-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--border); flex: none;
}
.sb-brand .logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--brand-mark); color: var(--brand-mark-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.sb-brand .txt { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.sb-brand .txt small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.sb-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sb-nav .group { font-size: 11px; color: var(--muted); padding: 12px 10px 6px; letter-spacing: .06em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 11px;
  border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; margin-bottom: 2px;
  border: 0; background: transparent; width: 100%; text-align: left; font-size: 13px; transition: .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; flex: none; }
.nav-item .cnt {
  margin-left: auto; font-size: 11.5px; color: var(--muted); background: var(--surface-2);
  padding: 0 7px; border-radius: 999px; line-height: 18px;
}
.nav-item.active .cnt { background: rgba(255, 255, 255, .18); color: var(--nav-active-ink); }
.sb-foot { padding: 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }

.main { flex: 1; width: 100%; min-width: 0; display: flex; flex-direction: column; }

/* 原 header.topbar：顶栏迁移后它只剩「面包屑 + 版本信息」，改名为 .crumbbar。
   去掉 sticky/z-index —— 全局菜单栏（.appbar）才是常驻 sticky 的那一条；
   两条都 sticky 会在窄屏上把内容区顶掉一大块。 */
.crumbbar {
  flex: none; display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
/* ☰ 原来是「开/关侧栏」。侧栏已删 → 它是死控件，一律隐藏（元素与 data-act 保留，
   免得动全局点击分发那 5 处；JS 分支的清理已记遗留）。 */
.crumbbar .burger { display: none; }
.crumb { font-size: 15px; font-weight: 600; }
.crumbbar .spacer { flex: 1; }
/* 原 .sb-foot 的「单总仓 · 版本 · 本地/共享」搬到这里：排障第一眼要看的是它，
   而窄屏顶栏放不下（≤1024 整条隐藏）。 */
.cb-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.user-chip:hover { border-color: var(--primary); }
.avatar {
  width: 27px; height: 27px; border-radius: 50%; flex: none; color: #fff;
  background: linear-gradient(140deg, var(--success), var(--success-ink)); display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.user-chip .nm { font-size: 13px; line-height: 1.15; }
.user-chip .nm small { display: block; font-size: 11px; color: var(--muted); }

.content { padding: 20px; flex: 1; }
.page { display: grid; gap: 16px; }
/* D1（2026-11-05）：grid 子项默认 min-width:auto，会被超宽表格撑破——拖宽后表格 2100px，
   卡片跟着 2100px，横向滚动条出现在整个页面上而不是表格里。子项 min-width:0 后
   卡片回到容器宽，超宽交回 .tbl-wrap 内部滚动（overflow-x:auto 早就写好了）。 */
.page > * { min-width: 0; }
.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-hd h2 { font-size: 18px; letter-spacing: -.2px; }
.page-hd .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.kpi.k-green::before { background: var(--success); }
.kpi.k-purple::before { background: var(--purple); }
.kpi .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.3px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .val em { font-size: 13px; font-weight: 500; color: var(--muted); font-style: normal; margin-left: 3px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 5px; }
.kpi .foot b { color: var(--text-2); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1180px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 999px; transition: width .4s ease; }

.stat-list { display: grid; gap: 13px; }
.stat-row { display: grid; grid-template-columns: 84px 1fr 56px; align-items: center; gap: 12px; font-size: 13px; }
.stat-row .nm { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row .vl { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 图表 */

.chart-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chart-donut svg { max-width: 200px; flex: none; }
.dn-total { font-size: 26px; font-weight: 700; fill: var(--text); }
.dn-cap { font-size: 12px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 170px; }
.lg-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.lg-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.lg-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.lg-val em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 11.5px; margin-left: 5px; }

.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 210px; padding: 8px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; min-width: 0; }
.bar-val { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: #f3f5fa; border-radius: 7px; overflow: hidden; }
.bar-fill { width: 100%; border-radius: 7px 7px 0 0; transition: height .45s ease; }
.bar-label { font-size: 12px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.chart-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.chart-hbars li { display: grid; grid-template-columns: 108px 1fr 62px; align-items: center; gap: 11px; font-size: 13px; }
.hb-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 999px; transition: width .45s ease; }
.hb-val { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 搜索框前置放大镜：设计稿里搜索框左侧有图标，一眼能认出这是搜索而不是普通输入框。
   用内联 SVG 做背景，不额外引图标库（离线也要能显示）。 */
.filter-bar input.input[data-act$="-q"] {
  padding-left: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a97ab' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center; background-size: 14px 14px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .x { opacity: .7; }
.chip.on .x { opacity: .9; }

.checkbox { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--muted); }
.pager .pages { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.pager .pages button {
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 12.5px;
}
.pager .pages button:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.pager .pages button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pages button[disabled] { opacity: .45; cursor: not-allowed; }
/* 列表页的分页条直接放在卡片内容区里（表格下方）：左右内边距归零到与表格同一条基准线，
   原来多出来的 18px 让「共 N 条」比表格第一列往右缩了一截，上下两块看着不像一个整体。
   只作用于 .card-bd 的直接子级，作为独立卡尾出现的分页条不受影响。 */
.card-bd > .pager { padding: 12px 12px 2px; }

/* ---------------------------------------------------------------- 弹窗 */

.modal-mask {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 660px; max-height: 90vh; background: var(--surface);
  border-radius: var(--radius-modal); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.985); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex: none; }
.modal-hd h3 { font-size: 16px; }
.modal-hd .x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-hd .x:hover { background: var(--surface-2); color: var(--text); }
.modal-bd { padding: 18px 20px; overflow-y: auto; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .modal { max-width: 100%; } }

/* 金蝶式紧凑基本信息网格：一行四列、小字号、矮输入框 */
/* 金蝶式紧凑基本信息网格：一行四列、小字号、矮输入框。
   行距 7px → 9px（20261029）："挤"的观感主要来自行距而不是框高，
   放行距一屏能放的字段数几乎不变，呼吸感却明显好转。框高 27px 保持 —— 填单是键盘流。 */
.kd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 12px; }
.kd-grid .field { gap: 2px; }
.kd-grid .field > label { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.kd-grid .field .input { padding: 2px 9px; font-size: 12.5px; height: 27px; }
.kd-grid .field textarea.input { height: auto; padding: 5px 9px; }
.kd-grid .field .cell-sub { font-size: 11px; margin-top: 1px; }
.kd-grid .full { grid-column: 1 / -1; }
@media (max-width: 1024px) { .kd-grid { grid-template-columns: repeat(2, 1fr); } }
/* 编辑态两模块（订单/采购同构）：左区比整页窄，字段两列；窄屏退单列 */
.kd-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1024px) { .kd-grid--2 { grid-template-columns: 1fr; } }

/* 收货地址簿下拉 */
.addr-wrap { position: relative; }
.addr-wrap .addr-row { display: flex; gap: 6px; }
.addr-wrap .addr-row .input { flex: 1; }
.addr-dd { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.14); padding: 4px; display: none; }
.addr-wrap.open .addr-dd { display: block; }
.addr-dd .addr-it { padding: 6px 10px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.addr-dd .addr-it:hover { background: #f2f6fc; }

/* -------------------------------------------------------------- 文件区 */

.drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 20px;
  text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: var(--surface-2);
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }
.drop b { display: block; color: var(--text-2); font-size: 13.5px; margin-bottom: 3px; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); display: flex; flex-direction: column;
}
.thumb .tb {
  height: 112px; background: #f2f5fa center/cover no-repeat; display: grid; place-items: center;
  color: var(--muted); font-size: 24px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.thumb .tb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .tb img { pointer-events: none; }
.thumb .meta { padding: 9px 11px; }
.thumb .meta .n { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .meta .m { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.thumb .acts { display: flex; gap: 6px; padding: 0 11px 11px; }

/* -------------------------------------------------------------- 通知条 */

.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 9px; }
.toast {
  min-width: 240px; max-width: 360px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-md); border-left: 3px solid var(--primary);
  font-size: 13.5px; animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(16px); opacity: 0 } to { transform: none; opacity: 1 } }
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
/* 通知条上的「撤销」：误操作后的补救入口 */
.toast { display: flex; align-items: center; gap: 10px; }
.toast-undo {
  flex: none; margin-left: auto; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--primary-dark); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.toast-undo:hover { background: var(--primary-weak); border-color: var(--primary-weak); }

.backdrop { position: fixed; inset: 0; background: rgba(19, 30, 51, .4); z-index: 35; display: none; }
.backdrop.on { display: block; }

/* -------------------------------------------------------------- 响应式 */

@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .crumbbar .burger { display: none; }   /* 死控件，见 .crumbbar .burger 的注释 */
  /* 窄屏菜单横排：横向滚动（滚动条隐藏），右侧状态区只留必要项，
     否则 390 下「品牌 + 菜单 + 铃+账套+角色+用户+退出」必然撑出横向滚动条 */
  .ab-nav { overflow-x: auto; }
  /* 窄屏菜单只能横滚（390 下可见 3 项）。没有任何提示的话，用户不会知道右边还有 7 项 ——
     用一条右侧渐隐给出"还能往右滑"的信号。真要解决"一眼看全 10 项"得改成抽屉/横向分页，
     属另一件事，本轮不做（已记遗留）。 */
  /* 只在**没有展开浮层**时加渐隐：mask 会给子元素造包含块 + 裁剪，
     一旦浮层（position:fixed）在里面，就会被这个 mask 一起裁掉 —— 实测 390 下浮层直接看不见。
     所以用 :has() 在浮层展开时把 mask 摘掉（不支持 :has 的浏览器会整条忽略 = 没有渐隐，fail-open）。 */
  .ab-nav:not(:has(.nav-wrap.open)) {
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 82%, transparent 100%);
  }
  .ab-brand .txt { display: none; }
  .ab-right { gap: 8px; }
  .appbar .role-chip { display: none; }   /* 基础规则 .role-chip{display:inline-flex} 在文件更后面，同权重会盖掉这条 */
  .cb-meta { display: none; }
  .content { padding: 16px; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content { padding: 12px; }
  .crumbbar { padding: 0 12px; gap: 8px; }
  .appbar { padding: 0 12px; gap: 8px; }
  .ab-nav .nav-item { padding: 0 8px; font-size: 12.5px; }
  /* 320 下宽度预算：品牌 26 + 菜单(可滚) + 🏢 + 铃 + 头像 + 退出，账套名让位 */
  .co-chip b, .co-chip i { display: none; }
  .crumb { font-size: 14px; }
  .user-chip .nm { display: none; }
  .user-chip { padding: 4px; }
  .kpi .val { font-size: 23px; }
  .page-hd .actions .btn { flex: 1; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .form-grid { grid-template-columns: 1fr; }
  .chart-bars { height: 180px; gap: 8px; }
  .stat-row { grid-template-columns: 72px 1fr 48px; font-size: 12.5px; }
  .login-card { grid-template-columns: 1fr; max-width: 440px; }
  .login-aside { display: none; }
  .login-form { padding: 28px 22px; }
  .pager .pages button { min-width: 29px; height: 28px; }
}

/* ==========================================================================
 * 商贸批发管理系统 · 补充样式（业务模块）
 * ========================================================================== */

/* KPI 卡组 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi .foot { margin-top: 8px; font-size: 12px; color: var(--muted); }
.kpi.k-blue::before { background: var(--primary); }
.kpi.k-green::before { background: var(--success); }
.kpi.k-amber::before { background: var(--warn); }
.kpi.k-purple::before { background: var(--purple); }
.kpi.k-orange::before { background: var(--warn); }
.kpi.k-red::before { background: var(--danger); }
.kpi.k-mute::before { background: #adb5bd; }

/* ---- 数据看板：按角色分的待办区块 ---- */
.kpis.kpi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* z38：仓库看板 7 张卡删了（第一大块 = 纯文字计数条 .wh-strip），基础规则跟着删。 */
/* 看板分区块（仓库内部 / 出库配送） */
.kb-sec + .kb-sec { margin-top: 16px; }
.kb-sec-hd { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 500;
  padding-bottom: 6px; margin-bottom: 9px; border-bottom: 0.5px solid var(--line, var(--border)); }
.kb-sec-hd em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
/* 单元格两行显示（单号/客户、配货/送货、签收人/日期） */
.cell-2l { display: flex; flex-direction: column; line-height: 1.4; }
.cell-2l > span { color: var(--muted); font-size: 11.5px; }
.who-remark { max-width: 180px; color: var(--muted); }
@media (max-width: 1180px) { .kpis.kpi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-block { border-left: 3px solid var(--primary); }
.dash-block.d-fin { border-left-color: var(--primary); }
.dash-block.d-clerk { border-left-color: var(--success); }
.dash-block.d-wh { border-left-color: var(--warn); }
.dash-block.d-sales { border-left-color: var(--purple); }
.dash-block > .card-hd h3 { display: flex; align-items: center; gap: 8px; }
/* 滞留分档条 */
.dash-stay { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--danger-weak); border-radius: var(--radius); padding: 9px 14px; margin: 12px 0 0; }
.dash-stay .st-lbl { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.dash-stay .st-item { font-size: 13px; color: var(--danger); }
.dash-stay .st-item b { font-size: 15px; font-weight: 700; margin-left: 4px; }
.dash-stay .st-item.st-3 { opacity: .75; }
.dash-stay .st-item.st-7 { opacity: .9; }
/* 备货建议：勾选中的行 */
.tbl tr.sel-row { background: var(--primary-weak); }
.tbl tr.sel-row:hover { background: var(--primary-weak); }

/* 徽章：全系统六色的唯一定义处。
   以前 b-amber / b-purple 在文件后半段又被写了第二遍，改这里不生效、改那里又只影响部分页面，
   现在两处重复定义已删，要调色只改这一块。 */
.badge.b-gray { background: var(--surface-2); color: var(--text-2); }
.badge.b-green { background: var(--success-weak); color: var(--success-ink); }
.badge.b-blue { background: var(--primary-weak); color: var(--primary); }
.badge.b-amber { background: var(--warn-weak); color: var(--warn-ink); }
.badge.b-purple { background: var(--purple-weak); color: var(--purple); }
.badge.b-red { background: var(--danger-weak); color: var(--danger-ink); }

/* 设计稿的状态是「小圆点 + 文字」而不是色块。
   圆点比色块轻：一行里出现三四个色块时整张表像打了补丁，圆点只占 6px，
   扫视时颜色依然一眼能分，但要读的字不受背景干扰。 */
.badge.b-dot {
  background: transparent; padding: 0; gap: 6px; font-weight: 500;
  color: var(--text-2); font-size: 12.5px;
}
.badge.b-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.badge.b-dot.b-gray { color: var(--muted); }
.badge.b-dot.b-green { color: var(--success); }
.badge.b-dot.b-blue { color: var(--text-2); }
.badge.b-dot.b-amber { color: var(--warn); }
.badge.b-dot.b-purple { color: var(--purple); }
.badge.b-dot.b-red { color: var(--danger); }
.badge.b-dot.b-gray::before { background: transparent; border: 1.5px solid currentColor; width: 7px; height: 7px; }
.badge.b-dot.b-blue::before { background: currentColor; width: 7px; height: 7px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
/* 表格：对齐设计稿的「无竖线 + 极淡横线 + 表头无底色」。
   表头以前有一层 #fafbfd 的灰底，配上 10 列的密集数字会显得很重；
   设计稿的做法是表头纯白、只用 12.5px 灰字和一条细线区分，扫描时更干净。 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 6px 12px; color: var(--muted); font-weight: 500; font-size: 12px;
  letter-spacing: .3px; border-bottom: 1px solid var(--border); white-space: nowrap; background: transparent; }
.tbl td { padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 1.4; }
/* 紧凑档（2026-11-04，先挂销售订单列表）：行距 9px→5px，对标金蝶的单行密度。
   单据类列表一天要扫几百行，行高是第一生产力；列宽不受影响。 */
.tbl.tbl-compact th { padding-top: 6px; padding-bottom: 6px; }
.tbl.tbl-compact td { padding-top: 5px; padding-bottom: 5px; }
.tbl.tbl-compact td .cell-sub { margin-top: 1px; }
/* 金蝶式整行不折行：总宽超容器时宁可横向滚动，也不让日期/单号被压成两行
   （客户/备注/摘要列内部是 nowrap+省略的 div，不受影响；进度列的说明是块级 sub，照常换行） */
.tbl.tbl-compact tbody > tr:not(.row-detail) > td { white-space: nowrap; }
.tbl.tbl-compact tbody > tr:not(.row-detail) > td div[style*="ellipsis"] { max-width: 100%; }

/* ---- 订单列表 · 格子风（对标金蝶，2026-11-05 用户反馈）----
   列多到 20 列时，无边框表格靠颜色扫读会串列——金蝶用竖向格线解决。
   只挂订单列表（tbl-compact 之上再叠一档）：行高压到最紧、列间 1px 竖线。
   悬停底色保住"我在这行"，数据行的归属感不靠格线也能看清。 */
.tbl.tbl-grid { font-size: 12.5px; }
.tbl.tbl-grid th { padding: 5px 8px; border-right: 1px solid var(--border); white-space: nowrap; }
.tbl.tbl-grid td { padding: 3px 8px; border-right: 1px solid var(--border); }
.tbl.tbl-grid th:last-child, .tbl.tbl-grid td:last-child { border-right: 0; }
/* 金额列的右内边距回归格子风统一值（默认 18px 是为无边框表留的呼吸位） */
.tbl.tbl-grid th.num, .tbl.tbl-grid td.num { padding-right: 12px; }
.tbl.tbl-grid td .cell-sub { margin-top: 0; font-size: 11px; }
.tbl.tbl-grid tbody > tr:hover > td { background: var(--primary-weak); }
/* D1（2026-11-05）：紧凑/格子风表的单元格超宽改省略号，不再硬裁半截字。
   完整文本由两路兜底：单元格里已有 title 的走 title；
   没有 title 的由 app.js 的 mouseover 钩子按 scrollWidth 现补（见 colw 事件区）。 */
.tbl.tbl-compact > tbody > tr:not(.row-detail) > td,
.tbl.tbl-grid > tbody > tr:not(.row-detail) > td { overflow: hidden; text-overflow: ellipsis; }
/* 悬停写在 td 上而不是 tr 上：底色要能被「已勾选 / 已作废」这些行级状态覆盖住，
   写在 tr 上会被单元格自己的背景压掉，出现「勾了又不像勾了」的割裂感。 */
.tbl tbody tr:hover > td { background: #f4f8ff; }
/* 悬停时行首浮出一条 2px 主色细线：整行可双击打开这件事，
   靠文字提示不如鼠标扫过去就能看见。 */
.tbl tbody tr[data-dblview]:hover > td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
/* 展开的商品子行跟着父行一起亮：否则鼠标停在主行上时子行还是灰的，
   看起来像两条不相干的记录，而不是「一张单 + 它的明细」。 */
.tbl tbody tr[data-dblview]:hover + tr.row-detail > td { background: #f4f8ff; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .empty, .empty { text-align: center; color: var(--muted); padding: 28px 0; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }

/* 订单列表工具栏：紧贴表格上方，按钮按勾选行启用/置灰 */
.ord-toolbar { margin-top: 10px; }
/* 让操作条和下面的表格拼成一体：筛选 → 操作 → 数据，三段读下来是一条动线，
   而不是三块各自独立的卡片。
   必须写成 .doc-toolbar.ord-toolbar：.doc-toolbar 定义在文件更靠后、特异性相同，
   只写 .ord-toolbar 会被它整体盖掉（这个坑之前踩过）。 */
.doc-toolbar.ord-toolbar {
  margin: 12px 0 0;
  background: var(--surface-2);
  border-radius: 10px 10px 0 0;
  border-bottom-color: var(--border-strong);
}
/* 未勾选时按钮置灰：用「字色变浅」而不是整块半透明。
   半透明会让「下推入库」这类四字按钮糊成一团灰，看不出这到底是个什么操作，
   字色变浅仍能读清按钮名，用户知道「有这个功能、只是现在不能用」。 */
.doc-toolbar.ord-toolbar .btn[disabled] {
  opacity: 1; color: #b3bdcd; border-color: var(--border); background: #fbfcfe;
}
.ord-toolbar .tb-count { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.ord-toolbar .tb-count b { color: var(--primary); font-variant-numeric: tabular-nums; }
.ord-toolbar .btn { height: 30px; font-size: 12.5px; padding: 0 11px; }
/* 采购价记忆提示：单价格下方的一行小字（上次成交价 / 陈旧 / 偏离警告） */
.pm-hint { font-size: 11px; line-height: 1.3; margin-top: 3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.pm-hint.stale { color: #b7791f; }
.pm-hint.warn { color: var(--danger); font-weight: 600; }

/* 单据「打印」下拉：预览 / 导出 Excel / 打印设置。
   用绝对定位的小面板而不是原生 <select>：三个选项是动作不是取值，
   原生下拉在部分浏览器里会被表格容器裁切，也不好放分隔线。 */
.print-dd { position: relative; display: inline-block; }
.print-dd .dd-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 70;
  min-width: 134px; padding: 4px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); box-shadow: 0 10px 28px rgba(24, 39, 75, .16);
}
.print-dd.open .dd-menu { display: block; }
.print-dd .dd-menu button {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  border: 0; border-radius: 7px; background: none; color: var(--text);
  font-size: 13px; line-height: 1.4; cursor: pointer; white-space: nowrap;
}
.print-dd .dd-menu button:hover { background: var(--primary-weak); color: var(--primary-dark); }
/* 表头/工具栏里的下拉不要被相邻单元格盖住 */
.tbl-wrap .print-dd.open .dd-menu, .doc-toolbar .print-dd.open .dd-menu { z-index: 90; }
.input.pm-warn { border-color: var(--danger); background: #fff5f5; }
.tbl .ops { white-space: nowrap; }
.tbl .ops .btn + .btn { margin-left: 6px; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.tbl-foot .sub { color: var(--muted); font-size: 12.5px; }

.pg-btns { display: inline-flex; gap: 8px; }
/* 分页脚右侧：每页行数 + 翻页 */
.pg-right { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pg-size { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.pg-sel {
  height: 26px; padding: 0 6px; font-size: 12.5px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.pg-sel:hover { border-color: var(--primary-weak); color: var(--primary-dark); }
.pg-sel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-weak); }

/* 表单分节 */
.form-sec { margin: 18px 0 10px; font-size: 13.5px; color: var(--text); border-left: 3px solid var(--primary); padding-left: 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* 别名行 */
.alias-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13px; flex-wrap: wrap; }
.alias-row .btn { margin-left: auto; }

/* 页头动作区 · 圆润胶囊按钮组（v20261022n） */
.hd-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hd-acts .btn {
  height: 34px; padding: 0 15px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; letter-spacing: .1px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  box-shadow: 0 1px 2px rgba(23, 43, 77, .05);
  transition: all .18s cubic-bezier(.4, 0, .2, 1);
}
.hd-acts .btn:hover {
  color: var(--primary); border-color: rgba(0, 0, 0, .18); background: var(--surface-2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .06); transform: translateY(-1px);
}
.hd-acts .btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(23, 43, 77, .06); }
.hd-acts .btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: var(--shadow-sm);
}
.hd-acts .btn-primary:hover {
  background: var(--primary-dark); border-color: transparent; color: #fff;
  box-shadow: 0 5px 16px rgba(36, 86, 217, .35); transform: translateY(-1px);
}
.hd-acts .btn-danger { color: var(--danger); border-color: var(--danger-weak); background: var(--danger-weak); }
.hd-acts .btn-danger:hover {
  background: var(--danger); border-color: var(--danger); color: #fff;
  box-shadow: 0 3px 10px rgba(217, 58, 64, .24);
}
/* 卡片头部右侧小按钮同步圆润化 */
.card-hd > .btn, .card-hd > .btn-sm {
  height: 30px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 12.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  box-shadow: 0 1px 2px rgba(23, 43, 77, .05); transition: all .18s cubic-bezier(.4, 0, .2, 1);
}
.card-hd > .btn:hover {
  color: var(--primary); border-color: rgba(0, 0, 0, .18); background: var(--surface-2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .06); transform: translateY(-1px);
}

/* ---- 单据抬头表格化（详情页基本信息） ---- */
.doc-ft-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
}
.doc-ft { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.doc-ft th {
  width: 88px; padding: 9px 12px; background: var(--surface-2); color: var(--muted);
  font-weight: 500; text-align: right; white-space: nowrap;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-ft td {
  padding: 9px 12px; color: var(--text); border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-all;
}
.doc-ft tr:last-child th, .doc-ft tr:last-child td { border-bottom: 0; }
.doc-ft tr th:last-child, .doc-ft tr td:last-child { border-right: 0; }
.doc-ft .cell-sub { margin-top: 2px; }

/* ---- 明细网格线（详情页只读表） ---- */
.tbl.tbl-grid th, .tbl.tbl-grid td { border-right: 1px solid var(--border); }
.tbl.tbl-grid th:last-child, .tbl.tbl-grid td:last-child { border-right: 0; }
.tbl.tbl-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 附件卡片 */
.thumb { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.thumb-img { height: 120px; background-size: cover; background-position: center; cursor: pointer;
  background-color: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.thumb-icon { font-size: 44px; }
.thumb-bd { padding: 10px 12px; }
.thumb-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.thumb-ops { margin-top: 8px; display: flex; gap: 6px; }

/* 拖拽上传区 */
.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px;
  display: flex; align-items: center; gap: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--primary); background: var(--primary-weak); }
.drop-ico { font-size: 26px; color: var(--primary); }

/* 看板 grid 间距 */
.grid-2, .grid-3 { margin-bottom: 14px; }

/* ==========================================================================
 * 模糊搜索下拉（combo）、AI 智能报价、批量粘贴导入
 * ========================================================================== */

/* 模糊搜索下拉 */
.combo { position: relative; }
.combo .combo-input { width: 100%; padding-right: 26px; }
.combo::after { content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px; pointer-events: none; }
.combo-list { position: absolute; z-index: 80; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 260px; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(20, 35, 70, .16); display: none; }
.combo.open .combo-list { display: block; }
.combo-item { padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.combo-item + .combo-item { border-top: 1px solid var(--border); }
.combo-item:hover, .combo-item.active { background: var(--primary-weak); }
.combo-item .ci-label { font-size: 13px; color: var(--text); }
.combo-item .ci-sub { font-size: 12px; color: var(--muted); }
.combo-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }
/* 下方空间不足时向上翻转展开，避免选项被视口/弹窗底部截断而点不到 */
.combo.flip-up .combo-list { top: auto; bottom: calc(100% + 4px); }

/* 金蝶式多列表格下拉（商品编码列）：面板加宽，选项以列对齐呈现 */
.combo-list.combo-grid { min-width: 860px; max-width: 1040px; max-height: 300px; }
.form-lines .combo-list.combo-grid { left: 0; right: auto; min-width: 860px; max-width: 1040px; }
.combo-grid .cg-hd { display: flex; align-items: center; gap: 12px; padding: 7px 14px;
  background: #f4f6fa; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); position: sticky; top: 0; z-index: 1; }
.combo-grid .combo-item { flex-direction: row; align-items: center; gap: 12px; padding: 6px 14px; }
.combo-grid .combo-item + .combo-item { border-top: 1px solid var(--border-weak, var(--border)); }
.combo-grid .cg-c { flex: 1 1 0; min-width: 0; font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-grid .cg-hd .cg-c { font-size: 12px; color: var(--text-2); }
.combo-grid .combo-item:hover .cg-c:first-child { color: var(--primary); }

/* 明细表头「＋添加」快捷入口（金蝶云星辰式，点击在表尾追加一行） */

/* 下拉底部操作条（如客户下拉「＋ 新增客户」），仅展开时显示 */
.combo-ft { display: none; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.combo.open .combo-ft { display: block; }
.combo-new { display: block; width: 100%; padding: 9px 14px; border: 0; background: none;
  text-align: left; font-size: 12.5px; color: var(--primary); cursor: pointer; }
.combo-new:hover { background: var(--primary-weak); }

/* AI 智能报价 */
.ai-banner { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 14px;
  border: 1px solid #ddd0ff; background: #f7f3ff; border-radius: var(--radius); }
.ai-banner .ico { font-size: 26px; line-height: 1.2; }
.ai-banner b { display: block; margin-bottom: 3px; }
.ai-banner p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.ai-task { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.ai-task-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-task-hd .fico { font-size: 22px; }
.ai-task-hd .nm { font-weight: 600; font-size: 13.5px; }
.ai-task-hd .meta { color: var(--muted); font-size: 12px; }
.ai-task-hd .ops { margin-left: auto; display: flex; gap: 6px; }
/* AI 报价弹窗顶部：**一行**服务状态。
   原来是「服务地址输入框 + 重新检测 + 模型配置 + 四段提示」的卡片，现在只剩徽章 + 一句能力边界。
   服务地址与 Key 归「系统设置 → AI 报价配置」，业务员这边不出现。 */
.ai-svc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-svc-note { font-size: 12.5px; }
.ai-brandbar {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 12px; background: var(--surface-2);
}
.ai-brandbar-hd {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.ai-brandbar-hd b { font-size: 13px; }
.ai-brandbar-hd .cell-sub { font-size: 12px; }
.ai-brandbar-hd .ops { margin-left: auto; display: flex; gap: 6px; }
.ai-brandbar .chips { margin-bottom: 8px; }
.ai-strict {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer;
}
.ai-strict input { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.ai-result { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.ai-result-hd { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; flex-wrap: wrap; }
/* 解析结果：客户型号 / 匹配型号 并列对照 */
.ai-cust { margin-left: auto; font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.ai-cust b { font-weight: 600; color: var(--text); }
tr.row-warn td { background: #fffaf0; }
tr.ai-line-warn td { background: var(--warn-weak); border-top: none; padding: 2px 10px 6px; font-size: 12.5px; color: var(--warn-ink); }
tr.ai-line-warn td:first-child { border-right: none; }
/* AI 智能报价：大框架 + 高密度内容（一屏看更多行） */
.modal.modal-ai { max-width: min(96vw, 1280px); max-height: 94vh; }
.modal.modal-ai .modal-hd { padding: 12px 16px; }
.modal.modal-ai .modal-hd h3 { font-size: 15px; }
.modal.modal-ai .modal-bd { padding: 12px 16px; }
.modal.modal-ai .modal-ft { padding: 10px 16px; }
.modal.modal-ai .badge { font-size: 11.5px; padding: 1px 7px; }
.modal.modal-ai .hint { font-size: 12px; line-height: 1.7; }
.modal.modal-ai .btn-sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.modal.modal-ai .drop { padding: 14px 16px; gap: 12px; }
.modal.modal-ai .drop-ico { font-size: 22px; }
.modal.modal-ai .ai-task { padding: 10px 12px; margin-bottom: 8px; }
.modal.modal-ai .ai-task-hd .nm { font-size: 13px; }
.modal.modal-ai .ai-result { margin-top: 10px; padding-top: 10px; }
.modal.modal-ai .form-sec { margin: 14px 0 8px; }
/* 紧凑表格：字号 / 行距收紧，仅用于 AI 解析预览与内联商品选择 */
.tbl.tbl-dense { font-size: 12.5px; }
.tbl.tbl-dense th { padding: 6px 8px; font-size: 11.5px; }
.tbl.tbl-dense td { padding: 4px 8px; }
.tbl.tbl-dense tbody tr { height: 30px; }
.tbl.tbl-dense .input { height: 26px; font-size: 12px; padding: 0 6px; border-radius: 6px; }
.tbl.tbl-dense .empty { padding: 20px 0; font-size: 12.5px; }
tr.ai-line-warn td { padding: 1px 8px 5px; font-size: 12px; }

/* 行内「换商品」商品选择器 */
.ai-pick { border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary-weak);
  padding: 10px 12px; margin: 4px 0 8px; }
.ai-pick-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-pick-hd b { font-size: 13px; }
.ai-pick-hd span { font-size: 12px; color: var(--text-2); }
.ai-pick-hd button { margin-left: auto; }
.ai-pick .input { height: 30px; font-size: 12.5px; }
.ai-pick-box { max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 8px; }
.ai-pick-box table { margin: 0; }
tr.ai-pick-item { cursor: pointer; }
tr.ai-pick-item:hover td { background: var(--primary-weak); }
input.ai-spec { width: 100%; min-width: 76px; padding: 4px 6px; font-size: 12.5px; }
input.ai-qty { width: 100%; min-width: 56px; padding: 4px 6px; font-size: 12.5px; text-align: right; }
td.ai-why { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.ai-remember { display: block; margin-top: 9px; padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px; cursor: pointer; }
.ai-remember input { vertical-align: -1px; margin-right: 5px; }
.ai-remember .cell-sub { display: block; margin-left: 19px; margin-top: 2px; }
.spin { width: 15px; height: 15px; border: 2px solid var(--primary-weak); border-top-color: var(--primary);
  border-radius: 50%; animation: rot .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* AI 模型配置（管理员） */
.ai-cfg-grid { display: grid; grid-template-columns: 132px 1fr; gap: 12px 14px; align-items: center; }
.ai-cfg-lb { font-size: 13px; color: var(--text-2); font-weight: 600; }
.ai-cfg-grid .cell-sub { grid-column: 2; margin-top: -6px; }
@media (max-width: 720px) {
  .ai-cfg-grid { grid-template-columns: 1fr; }
  .ai-cfg-grid .cell-sub { grid-column: 1; }
}

/* 批量粘贴导入 */
.paste-area { width: 100%; min-height: 180px; font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.6; resize: vertical; }
.imp-err { color: var(--danger); font-size: 12px; }
.imp-ok { color: var(--success); font-size: 12px; }
.imp-warn { color: var(--warn-ink); font-size: 12px; }
tr.row-err td { background: #fff6f6; }
.imp-sum { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
/* 重复编码逐字段对比：系统值 / 导入值 / 判定 / 覆盖勾选 */
.imp-diff-hd { font-size: 12px; color: var(--text-2); padding: 8px 2px 6px; }
.mini-items .tbl.mini th { background: #f3f5fa; }
.mini-row-wrap .mini-items { padding-left: 42px; }
.code-flex { display: flex; gap: 6px; }
.code-flex .input { flex: 1; }

/* ---- 报价校验（草稿池核对）：结论条 + 逐行问题提示 ---- */
.qc-sum { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.qc-sum b { font-size: 13.5px; font-weight: 600; }
.qc-sum span { font-size: 12.5px; color: var(--muted); }
.qc-sum.qc-ok { border-color: rgba(45, 164, 108, .35); background: rgba(45, 164, 108, .08); }
.qc-sum.qc-ok b { color: var(--success); }
.qc-sum.qc-bad { border-color: rgba(214, 74, 74, .35); background: rgba(214, 74, 74, .08); }
.qc-sum.qc-bad b { color: var(--danger); }
.qc-iss { font-size: 12px; line-height: 1.6; }
.qc-iss.blk { color: var(--danger); }
.qc-iss.wrn { color: var(--warn-ink); }
.qc-iss.ok { color: var(--success); }

/* ==========================================================================
 * v20261012d · UI 高级化：深色侧栏 / 页签导航 / 金额条 / 紧凑筛选
 * ========================================================================== */

/* ---- 深色高级侧栏 ---- */
.sidebar {
  background: linear-gradient(180deg, var(--ink-1) 0%, var(--ink-2) 60%, var(--ink-3) 100%);
  border-right: 1px solid rgba(255, 255, 255, .055);
}
.sb-brand { border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sb-brand .logo { background: var(--brand-mark); color: var(--brand-mark-ink); }
.sb-brand .txt { color: #fff; letter-spacing: .01em; }
.sb-brand .txt small { color: rgba(255, 255, 255, .42); }
.sb-nav .group { color: rgba(255, 255, 255, .35); letter-spacing: .09em; }
.nav-item { color: rgba(255, 255, 255, .66); }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
/* 选中项与登录页品牌栏同源的墨蓝（不是旧亮蓝 #3a78f2）。
   选中的识别度靠"纯色块 + 字重 + 左侧亮条"，不再靠投影 —— 深色底上的投影会糊成一团。 */
.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--nav-active-bar);
}
.nav-item .cnt { color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .09); }
.nav-item.active .cnt { background: rgba(255, 255, 255, .22); color: #fff; }
.sb-foot { border-top: 1px solid rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .35); }

/* ---- 主按钮渐变与微交互 ---- */
/* 主按钮：纯色，不用渐变。渐变在浅色底上会显"塑料感"，
   而且旧值 #3a78f2 是硬编码、不读 --primary —— 20261029 换主色时它没跟着变。 */
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: var(--shadow-sm); }
.btn { transition: all .15s ease; }
.card { transition: box-shadow .18s ease; }
.card:hover { box-shadow: 0 3px 14px rgba(23, 43, 77, .07); }

/* ---- KPI 悬浮微抬升 ---- */
.kpi { transition: transform .18s ease, box-shadow .18s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---- 页签导航（金蝶风格下划线页签） ---- */
.doc-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tab {
  position: relative; border: 0; background: transparent; cursor: pointer;
  padding: 12px 15px 13px; font-size: 13.5px; color: var(--text-2);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: .15s;
}
.doc-tab:hover { color: var(--primary); }
.doc-tab.on { color: var(--primary); font-weight: 600; }
.doc-tab.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px;
  border-radius: 3px 3px 0 0; background: var(--primary);
}
.dt-cnt {
  font-size: 11px; font-weight: 500; padding: 0 6px; line-height: 17px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums;
}
.doc-tab.on .dt-cnt { background: var(--primary-weak); color: var(--primary); }
.dt-tabs-card { overflow: hidden; }
.dt-tabs-card .doc-tab { padding: 13px 17px 14px; }

/* ---- 详情页金额条 ---- */
.dt-hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
/* v20261016f · 极简高级：细分隔线 + 字号收敛，主金额单点强调 */
.dt-cell { display: flex; flex-direction: column; gap: 3px; padding: 11px 18px 12px; min-width: 0; position: relative; }
.dt-cell + .dt-cell::before {
  content: ""; position: absolute; left: 0; top: 24%; bottom: 24%; width: 1px; background: var(--border);
}
.dt-cell .k { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dt-cell .v { font-size: 16px; font-weight: 600; letter-spacing: -.2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 主金额不铺底色：设计稿是用「更大的字 + 主色」强调，铺一块浅蓝反而像标签，压不住场面 */
.dt-cell.hl { background: transparent; }
.dt-cell.hl .k { color: var(--muted); opacity: 1; }
.dt-cell.hl .v { color: var(--primary); font-size: 22px; font-weight: 700; }
/* 指标卡的副行（不含税金额、未收多少）与进度条 */
.dt-cell .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-cell .bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.dt-cell .bar i { display: block; height: 100%; border-radius: 3px; background: var(--success); }
.dt-cell.ok .v { color: var(--success); }
.dt-cell.bad .v { color: var(--danger); }

/* 面包屑：详情页顶部那一行「销售订单 › SO2026...」 */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--text-2); cursor: pointer; }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { color: #c6cede; }
.crumbs .cur { color: var(--text); font-weight: 500; }
@media (max-width: 900px) {
  .dt-hero { grid-template-columns: 1fr 1fr; }
  .dt-cell { border-bottom: 1px solid var(--border); }
  .dt-cell + .dt-cell::before { display: none; }
}

/* ---- 紧凑筛选控件（更小更精致） ---- */
.filter-bar { gap: 8px; }
.filter-bar .input { height: 30px; font-size: 12.5px; padding: 0 9px; border-radius: 7px; }
.filter-bar .input[type="date"] { padding: 0 6px; color: var(--text-2); }
.filter-bar .input:focus { box-shadow: 0 0 0 3px rgba(36, 86, 217, .1); }

/* ---- 表格精修 ----
   这里不能再给 .tbl th 写 background：上面「表头无底色」是有意为之（见 .tbl th 处的说明），
   而本段位于文件更靠后、特异性又相同，之前写了 background:#f8fafd 把白表头又盖回灰底，
   和设计稿不一致。现在只保留字距/字色，背景交回给前面的规则。 */
.tbl th { letter-spacing: .02em; color: #76839a; }
.tbl tbody tr { transition: background .12s ease; }
/* 表体最后一行不再画横线：下方要么是合计行、要么是分页条，本身已有分隔线，
   两线并排会显得脏。 */
.tbl tbody tr:last-child > td { border-bottom-color: transparent; }
/* 合计行：目前由 viewOrders / viewPurchase 在 <tr> 上写死 inline style（#fff8e6 + 700），
   inline 优先级高于 CSS，主题化改不动。等 app.js 把那段 inline 换成 class="sum-row"，
   下面这条自动生效（取值与现在完全一致，换过去时画面不会跳）。 */
.tbl tfoot tr.sum-row td { background: var(--sum-bg); font-weight: 700; }
.page-hd h2 { letter-spacing: -.2px; }
tfoot tr td { border-top: 1px solid var(--border-strong); }

/* ---- 细滚动条 ---- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #ccd5e5; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b3c0d8; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: #ccd5e5 transparent; }

/* ---- 顶栏微调 ---- */
.crumbbar { background: rgba(255, 255, 255, .92); }
.crumb { letter-spacing: -.1px; }

/* ---- 详情页头部 ---- */
.page-hd h2 .badge { transform: translateY(-1px); }

/* ---- 页内编辑（金蝶式）：明细网格中的输入控件紧凑化 ---- */
.tbl .input, .tbl .combo .input { height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; }
.tbl td .cell-sub { font-size: 11.5px; }
.tbl .combo { width: 100%; }

/* ---- 精斗云式列表：过滤方案 / 查看明细 / 列设置 ---- */
.filter-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.scheme-bar { display: flex; align-items: center; gap: 6px; }
.scheme-bar .input { height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; }
.scheme-bar .btn { height: 30px; font-size: 12.5px; padding: 0 10px; }
.scheme-def { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.colset-wrap { position: relative; }
.colset-pop { position: absolute; right: 0; top: 36px; z-index: 60; background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; box-shadow: 0 12px 32px rgba(30,42,66,.14); padding: 12px 14px; min-width: 200px; }
.colset-hd { font-weight: 700; font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.colset-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; cursor: pointer; color: var(--text-2); }
/* 展开的商品子行：整块左缩 42px，让它一眼看出是挂在上面那张单下面。
   之前子表和主表左边缘齐平，扫下来时很容易把明细行当成另一张单。
   缩进量与 .mini-row-wrap（另一种展开写法）的 42px 对齐，两种展开看起来是同一种东西。 */
.row-detail > td { background: var(--surface-2); padding: 8px 12px 12px 42px; }
/* 子表套一层极淡边框：灰底上放一张纯白无边的表，边界是"糊"的，
   加了框才像一张嵌在行里的卡片，也和上面主行拉开层次。 */
.mini-items .tbl { font-size: 12px; background: #fff; border-radius: 8px; border: 1px solid var(--border);
  /* 让小表避开右上角浮着的「收起」按钮：清空右侧浮动后，空带由浏览器按按钮
     实际高度自动让出，不用写死 26px，也不会出现按钮压住表头那 2px。 */
  clear: right; }
.mini-items .tbl th { font-size: 11.5px; padding: 6px 8px; background: #f3f5fa; }
/* 明细块右上角的「收起」：右对齐用 float，不用 absolute。
   小表是块级的、天然从容器最顶端开始排，absolute 定位的按钮会正好压住表头和首行
   （V-05 之前用 inline 的 top:6px 就是这个问题）。
   按钮 float:right + 小表 clear:right，空带由浏览器按按钮实际高度自动让出：
   不写死高度、不依赖 :has()，老浏览器也对。
   注意：这条要和「去掉按钮 inline 定位」成对生效，中间态（只发 CSS 不改 app.js）
   会退回按钮压表头——所以请一条 commit 一起发。 */
.mini-items > button[data-act$="-row-close"] {
  float: right; margin: 0 0 5px 0;
  height: 22px; padding: 0 9px; font-size: 11.5px; line-height: 20px; border-radius: 6px;
  color: var(--muted); background: var(--surface); border-color: var(--border);
}
.mini-items > button[data-act$="-row-close"]:hover { color: var(--primary); border-color: var(--primary); }
.mini-items .tbl td { padding: 6px 8px; }
/* 列表内联展开的明细行（明细/收起） */
.mini-row-wrap > td { background: var(--surface-2); padding: 0; }
.mini-row-wrap .mini-items { padding: 10px 12px 12px 42px; }
tr.mini-row > td { font-size: 12.5px; background: #fff; }
tr.mini-row:hover > td { background: #f2f7ff; }
.tbl tbody tr[data-dblview] { cursor: pointer; }
/* 主行「已展开」：底色比其它行深一档，说明这一行下面还挂着内容。
   等 app.js 在展开时给主行加 class="row-open" 即生效；
   在那之前靠子行的缩进 + 悬停联动已经能表达归属，缺了它不影响使用。 */
.tbl tbody tr.row-open > td { background: #f4f8ff; }
.tbl tbody tr.row-open:hover > td { background: #eaf1ff; }

/* ---- 列表多选：勾选列 / 批量操作条 ---- */
/* 勾选列：表头和数据行必须共用同一套对齐 —— 以前 .sel-col(0,1,0) 的居中
   被 .tbl th(0,1,1) 的 text-align:left 压掉，全选框靠左、行勾选框居中，
   上下两排框错位（用户截图红框问题）。用 .tbl 前缀抬权重，一处定义两边生效。 */
.tbl th.sel-col, .tbl td.sel-col { width: 40px; text-align: center; padding-left: 6px; padding-right: 6px; }
.sel-col input { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.tbl tbody tr.sel-row > td { background: #eef4ff; }
/* 勾选中的行悬停时再深一档：否则鼠标扫过去没反应，
   会以为这张单"点不动"，其实只是已经选中了。 */
.tbl tbody tr.sel-row:hover > td { background: #e3ecff; }
.batch-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: #f0f5ff; border: 1px solid #d6e2ff; border-radius: 10px; }
.batch-bar .bb-txt { font-size: 12.5px; color: var(--text-2); margin-right: 4px; }
.batch-bar .btn { height: 30px; font-size: 12.5px; padding: 0 12px; }

/* ---- 单号超链接（行首展开箭头图标已移除，单击单号展开明细） ---- */
.doc-link { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: none; }
.doc-link:hover { text-decoration: underline; }
/* 单号链接现在也承担「点开看那张单」，键盘用户要能看到焦点落点 */
.doc-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
/* 作废单据里的链接跟着行一起变灰（它已经不能带出有效信息） */
tr.row-void .doc-link { color: var(--muted); }

/* ---- 报表中心 ---- */
.rp-bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.rp-bar > i { display: block; height: 7px; background: var(--primary); border-radius: 4px; }
.rank-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.rank-row { display: grid; grid-template-columns: 28px 190px 1fr 130px; align-items: center; gap: 12px; }
.rank-row .rk { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rank-row:nth-child(1) .rk { background: var(--warn-weak); color: var(--warn-ink); }
.rank-row:nth-child(2) .rk { background: #e8eef8; color: #4a5b7a; }
.rank-row .nm { font-size: 13px; font-weight: 600; color: #1f2a3d; overflow: hidden; text-overflow: ellipsis; }
.rank-row .bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.rank-row .bar > i { display: block; height: 10px; background: linear-gradient(90deg, var(--primary), #7d9ff0); border-radius: 5px; }
.rank-row .vl { text-align: right; font-size: 13px; font-weight: 700; }

/* ---- 打印（仅打印时显示 #print-root，屏幕上隐藏） ---- */
#print-root { display: none; }
.print-doc { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #000; padding: 6px 4px 18px; }
.print-doc .p-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
.print-doc .p-co { font-size: 19px; font-weight: 700; letter-spacing: 2px; }
.print-doc .p-title { font-size: 17px; font-weight: 700; letter-spacing: 6px; }
.print-doc .p-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 12.5px; margin-bottom: 8px; }
.print-doc .p-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-doc .p-tbl th, .print-doc .p-tbl td { border: 1px solid #333; padding: 5px 6px; }
.print-doc .p-tbl th { background: #f0f0f0; font-weight: 700; text-align: center; }
.print-doc .p-tbl .c { text-align: center; }
.print-doc .p-tbl .r { text-align: right; }
.print-doc .p-tbl .sm { font-size: 11px; color: #444; }
.print-doc .p-tbl .p-sum td { font-weight: 700; background: #fafafa; }
.print-doc .p-upper { margin-top: 8px; font-size: 12.5px; }
.print-doc .p-remark { margin-top: 6px; font-size: 12.5px; }
.print-doc .p-foot { margin-top: 26px; display: flex; justify-content: space-between; font-size: 12.5px; }
.print-doc .p-stamp { color: var(--danger); }
.print-doc .p-tip { margin-top: 6px; font-size: 11.5px; color: #444; }
/* `.p-break` 是 `.print-doc` 的兄弟节点，不是后代 —— 旧选择器匹配不到，
   批量打印会连成一张。这里按真实 DOM 关系写，并让最后一页不再追加分页。 */
.p-break { page-break-after: always; break-after: page; }
.p-break:last-child { page-break-after: auto; break-after: auto; }
@media print {
  /* 应用壳的高度/背景会把打印内容顶到第二页：打印时整块隐藏并解除 100% 高度。
     新平台用 iframe 打印，这一层是给旧链路兜底，也防回退时再次出现首页空白。 */
  html, body { height: auto !important; min-height: 0 !important; }
  body.printing #app,
  body.printing .app-root { display: none !important; }
  body.printing .shell { display: none !important; }
  body.printing #print-root { display: block !important; }
  @page { margin: 12mm 10mm; }
}

/* ---- 打印模板设置：左侧配置 + 右侧纸张实时预览 ---- */
.ptpl-tabs { max-width: 520px; margin: 0 0 14px; }
.ptpl-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(430px, 800px); gap: 16px; align-items: start; }
@media (max-width: 1280px) { .ptpl-grid { grid-template-columns: 1fr; } }
.ptpl-paper {
  background: #fff; border: 1px solid #d8deea; border-radius: 4px;
  box-shadow: 0 6px 18px rgba(24, 39, 75, .10);
  padding: 14mm 10mm; overflow: auto; max-height: 78vh;
}
.ptpl-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }
/* ---- 编码规则：下一编号预览 ---- */
.code-next { color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* ---------------- 商品管理：三层类别树 + 仓库关联 ---------------- */
.sku-layout { display: flex; gap: 14px; align-items: flex-start; }
.sku-layout .sku-main { flex: 1; min-width: 0; }
.sku-layout .inv-tree { position: sticky; top: 74px; }
@media (max-width: 900px) {
  .sku-layout { flex-direction: column; }
  .sku-layout .inv-tree { flex: none; max-width: none; width: 100%; position: static; }
  .sku-layout .tree-body { max-height: 220px; }
}

/* 类别维护弹窗 */
.catset-add { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.catset-list { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 380px; overflow: auto; }
.catset-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.catset-row:last-child { border-bottom: none; }
.catset-row .cs-code { width: 70px; flex: none; font-size: 12px; color: var(--muted); font-family: Consolas, monospace; }
.catset-row .cs-name { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.catset-row .cs-name .input { max-width: 240px; }
.catset-row .cs-cnt { flex: none; font-size: 12px; color: var(--muted); }
.catset-row .cs-ops { flex: none; display: flex; gap: 4px; }

/* 商品表单：仓库关联 */
.wh-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.wh-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.wh-check input { accent-color: var(--primary); }

@media (max-width: 900px) {
  .sku-layout { flex-direction: column; }
}

/* 单据表单明细（报价/订单/采购）：铺满容器、不出横向滚动条。
   overflow 必须 visible：明细格内的商品模糊下拉（.combo-list 绝对定位）否则会被整体裁掉（金蝶式下拉打不开的根因） */
.form-lines { border: 1px solid var(--border-strong); border-radius: 8px; overflow: visible; background: var(--surface); }
/* 圆角补偿：overflow visible 后表格角会盖住容器圆角 */
.form-lines th:first-child { border-top-left-radius: 7px; }
.form-lines th:last-child { border-top-right-radius: 7px; }
.form-lines tbody tr:last-child td:first-child { border-bottom-left-radius: 7px; }
.form-lines tbody tr:last-child td:last-child { border-bottom-right-radius: 7px; }
.form-lines .lines-sum { border-radius: 0 0 7px 7px; }
.form-lines table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
/* 明细网格的行距：原来 4px/27px 是为了「一屏塞更多行」压出来的，
   结果输入框贴着上下边框，鼠标点错行的概率明显变高；放到 6px/30px 更稳。 */
.form-lines th { text-align: left; padding: 5px 9px; color: var(--muted); font-weight: 600; font-size: 12.5px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-lines td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.form-lines tbody tr:last-child td { border-bottom: 0; }
/* 2026-11-06 与详情页对齐：编辑态明细表也带竖格线（详情是 tbl.tbl-grid，编辑是 form-lines），
   两页切换时表格不再一个有线一个没线。只加竖线，padding 不动（格里是输入框，要留手）。 */
.form-lines th, .form-lines td { border-right: 1px solid var(--border); }
.form-lines th:last-child, .form-lines td:last-child { border-right: 0; }
.form-lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.form-lines .cell-sub { white-space: normal; word-break: break-all; line-height: 1.4; }
/* 明细行内输入框：30px 高刚好能放进 13px 字并留出上下呼吸，且整行约 42px */
.form-lines .input { height: 30px; font-size: 13px; padding: 0 8px; }
/* 列表单元格里的输入框/下拉也收到 30px：34px + 上下各 6px 的内边距仍然是 46px 行高，
   光压 padding 压不动 —— 行高的大头是控件本身。与单据明细表(.form-lines .input)取同一值，
   两处行高才是一致的。 */
.tbl td .input, .tbl td .select { height: 30px; font-size: 13px; }
.form-lines textarea.input { height: auto; min-height: 0; padding: 4px 8px; }
.form-lines .btn-sm { padding: 2px 9px; font-size: 12px; }
.form-lines .lines-sum { display: flex; justify-content: flex-end; gap: 14px; padding: 7px 12px;
  background: var(--surface-2); border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.form-lines .lines-sum b { color: var(--text); }
/* 表内合计行（金蝶式 tfoot） */
.form-lines tfoot td { padding: 6px 8px; background: var(--sum-bg); border-top: 1px solid var(--border); font-weight: 700; font-size: 12.5px; }
.form-lines tfoot .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 明细编辑汇总条：表格下方独立汇总栏（共 N 行 / 数量 / 金额 / 税额 / 价税合计），滚动时粘底跟随 */
.form-lines tfoot td.po-sum-cell { padding: 0; border-top: 0; background: transparent; font-weight: 400;
  position: sticky; bottom: 0; z-index: 6; }
.po-sum-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 8px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); box-shadow: 0 -4px 14px rgba(16, 24, 40, .07); }
.po-sum-bar .ps-left { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.po-sum-bar .ps-left b { color: var(--text); }
.po-sum-bar .ps-right { display: flex; align-items: center; gap: 22px; min-width: 0; flex-wrap: wrap; }
.po-sum-bar .ps-item { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.po-sum-bar .ps-item b { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 4px; }
.po-sum-bar .ps-total { display: inline-flex; align-items: baseline; gap: 7px; padding: 4px 13px;
  border-radius: 999px; background: var(--primary-weak); color: var(--primary);
  font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.po-sum-bar .ps-total b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
/* 明细格内下拉：不受单元格宽度限制，加宽为金蝶式搜索面板 */
.form-lines .combo-list { right: auto; min-width: 380px; max-width: 560px; }
.form-lines td { vertical-align: top; }
/* 明细行首列：显示行号，悬停浮出 ＋ 插入 / － 删除（金蝶式行操作） */
.form-lines th.row-ops-hd { text-align: center; font-size: 11.5px; color: var(--muted); }
.form-lines .row-ops { text-align: center; padding: 4px 2px !important; white-space: nowrap; }
.form-lines .row-ops .row-no { display: inline-block; min-width: 19px; color: var(--muted);
  font-size: 12px; font-variant-numeric: tabular-nums; line-height: 19px; }
.form-lines .row-ops .row-btns { display: none; }
.form-lines .row-ops:hover .row-no { display: none; }
.form-lines .row-ops:hover .row-btns { display: inline-block; }
.form-lines .row-ops .rop { display: inline-block; width: 19px; height: 19px; line-height: 16px;
  margin: 0 1px; padding: 0; border-radius: 50%; font-size: 13px; cursor: pointer;
  background: #fff; user-select: none; }
.form-lines .row-ops .rop-add { border: 1px solid rgba(17, 17, 17, .45); color: var(--primary); }
.form-lines .row-ops .rop-add:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.form-lines .row-ops .rop-del { border: 1px solid rgba(224, 49, 49, .4); color: var(--danger); }
.form-lines .row-ops .rop-del:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
/* 列宽拖拽手柄（金蝶式：鼠标移到表头右缘出现分隔线，左右拖动改列宽，双击复原） */
.form-lines th { position: relative; }
/* 列宽拖拽手柄：全系统表格通用（列表 / 报表 / 明细），表头右侧 8px 热区 */
th { position: relative; }
.col-rz { position: absolute; top: 0; right: 0; width: 8px; height: 100%;
  cursor: col-resize; z-index: 2; user-select: none; }
.col-rz::after { content: ''; position: absolute; top: 3px; bottom: 3px; right: 3px;
  width: 1px; background: var(--border-strong); }
.col-rz:hover::after { background: var(--primary); width: 2px; right: 3px; }
/* 冻结过列宽的表：fixed 布局下表头表体严格共列，表头过长自动省略号不串列 */
table.colw-fixed { table-layout: fixed; }
.colw-fixed th { overflow: hidden; text-overflow: ellipsis; }
.tbl.colw-fixed td { overflow: hidden; }
/* 行内展开的明细（嵌套小表）比主表宽时：在小格里横向滚动，不撑破主表列宽 */
.tbl.colw-fixed .row-detail > td { overflow-x: auto; overflow-y: hidden; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing * { cursor: col-resize !important; user-select: none; }
.form-lines .combo { position: relative; }

/* ---- v20261017a · 金蝶式填单工具栏 ---- */
.doc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.doc-toolbar .tb-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 3px; }
.doc-toolbar .tb-spacer { flex: 1; }
.doc-toolbar .btn { box-shadow: none; }

/* ---- v20261016b · 分级模块导航：悬停多列悬浮面板 ---- */
@media (min-width: 1025px) {
  .sb-nav { overflow: visible; }
  /* 一级项现在在 .ab-nav 里：桌面端必须 overflow:visible，否则 absolute 的悬浮面板
     会被这个滚动容器裁掉（横轴一旦是 auto，纵轴也算 auto） */
  .ab-nav { overflow: visible; }
}
.nav-wrap { position: relative; }
.nav-flyout {
  /* 2026-11-24：从「侧栏项向右弹」改成「顶栏项向下弹」——
     left:0 = 与触发项左对齐，top:100% = 贴着这一行下沿。 */
  display: none; position: absolute; left: 0; top: 100%; margin-top: 6px; z-index: 70;
  /* 2026-11-24 顶栏化后改浅色：白顶栏下挂深色浮层突兀，也与「墨白·单红」+ 苹果风不符。
     一律用既有浅色 token，不新引一套色；--ink-fly-1/2 两个 token 保留（legacy 主题块仍引用），
     只是本规则不再用它们。 */
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  /* 列间距从 30px 收到 14px（z165 第二步）：6 列面板原来合成 890px 宽，
     在 1236 宽的窗口下从「财务」（左缘 x≈578）往右弹会到 1470、往左弹到 -312 —— **两个方向都放不下**，
     于是只能贴窗口边缘，「对应下方位置」在物理上做不到。
     收窄到约 650px 之后：财务左对齐放得下、基础资料与设置右对齐放得下（右缘对齐按钮右缘），
     三者在 1236 与 1440 下都真的落在触发项下方了。 */
  padding: 12px 14px 14px; gap: 14px; cursor: default;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .16);
  max-height: calc(100vh - 130px); overflow-y: auto;
  /* D3（2026-11-05 后端转达）：桌面端强制单行——系统设置分 6 组后换行成两排，
     看起来像"上下结构"被误读成搬错了布局。改 nowrap + 超宽横向滚动；
     ≤1024 窄屏退回换行（见下方 media）。 */
  flex-wrap: nowrap; max-width: calc(100vw - 24px); overflow-x: auto;
}
/* 靠右的几项（财务 / 基础资料 / 设置）**不再**改定位参照。
   曾经这里是「nth-last-child(-n+3) → position:static + right:8px」，把面板挂到整条顶栏的右缘；
   后果是三个浮层全贴窗口右边、跟鼠标下的菜单项毫无位置关系（PO 2026-11-25 截图）。
   当时的判断是「6 列约 890px，左对齐在 1440 下溢出 69，右对齐触发项又顶出屏幕左侧」——
   两条都对，但都是**按 1440 这一个宽度算的**。面板宽度是内容长出来的（3 列 ~450 / 6 列 ~890），
   窗口宽度也是运行时值，按位置猜、按宽度穷举 media query 都会在另一个尺寸上翻车。
   现在改成打开时量一次真实几何再决定对齐：`navFlyoutFit()`（app.js 的 nav-mod 分支里调）。 */
@media (max-width: 1024px) {
  .nav-flyout { flex-wrap: wrap; overflow-x: visible; }
}
.nav-wrap.open .nav-flyout { display: flex; }
.fly-col { min-width: 92px; }
.fly-hd {
  font-size: 11.5px; color: var(--muted); letter-spacing: .05em;
  padding: 2px 8px 9px; border-bottom: 1px solid var(--border);
  margin-bottom: 7px; white-space: nowrap;
}
.fly-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-2); padding: 6px 8px;
  border-radius: 7px; transition: .12s; white-space: nowrap; font-family: inherit;
}
.fly-item:hover { background: var(--surface-2); color: var(--text); }
.fly-item.on { color: var(--text); font-weight: 600; }
.fly-cnt {
  font-size: 10.5px; color: var(--muted); background: var(--surface-2);
  padding: 0 6px; border-radius: 999px; line-height: 16px; flex: none;
}
/* ---- 悬停菜单项出现的「查询」快捷入口（金蝶式：直达该单据列表页） ----
   ⚠ 背景**不许**再写 `--surface-2`：`.fly-item:hover` 的底色就是 `--surface-2`，
   同色叠同色 ⇒ 这个按钮只剩两个字，看起来像菜单项的副标题、不像能点的东西
   （PO 2026-11-25 截图：「修改按钮颜色，已融为一体」）。
   改成白底 + 一圈描边：与 `.btn` 同一套语义（次要按钮），在浅灰行底上边界清楚。
   判据 `tests/test_z165_list_polish.py` 钉的是**对比关系**（两者不许同色），不是这个色值。 */
.fly-q {
  display: none; font-style: normal; font-size: 11px; line-height: 16px; flex: none;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 1px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
.fly-item:hover .fly-q { display: inline-block; }
.fly-item:hover .fly-cnt { display: none; }   /* 悬停时数量徽标让位给「查询」 */
.fly-q:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 1024px) {
  /* 窄屏不用 position:static —— 横向顶栏里静态折叠面板会把这一行挤变形，
     而且会跟着菜单一起横向滚动。改成挂在窗口上的全宽下拉：
     top:var(--topbar-h) 正好贴住 sticky 顶栏下沿（.appbar 有 backdrop-filter，
     它本身就是 fixed 的包含块，所以这里的 0/100% 都相对顶栏，两种解释结果一致）。 */
  .nav-flyout {
    position: fixed; left: 0; right: 0; top: var(--topbar-h);
    max-width: none; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
    border-radius: 0 0 12px 12px; margin: 0;
    padding: 14px 16px 16px; flex-wrap: wrap; gap: 22px;
  }
  .nav-wrap.open .nav-flyout { display: flex; }
  .fly-col { min-width: 45%; }
  .fly-hd { border-bottom-color: var(--border); }   /* 浅色化后原白线在白底上等于没有 */
  /* 触屏无悬停：查询入口常显 */
  .fly-q { display: inline-block; }
  .fly-item:hover .fly-cnt { display: inline-block; }
}

/* ---- v20261016c · 多页签工作区（可切换/可关闭） ---- */
.page-tabs {
  display: flex; align-items: flex-end; gap: 2px; flex: none;
  padding: 8px 14px 0; background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px 7px 13px; font-size: 12.5px; line-height: 1.3;
  color: var(--text-2); background: transparent; border: 0;
  border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap;
  user-select: none; transition: .12s; font-family: inherit;
}
.page-tab:hover { color: var(--primary); background: var(--surface-2); }
.page-tab.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.page-tab .tclose {
  font-style: normal; width: 16px; height: 16px; display: grid; place-items: center;
  border-radius: 4px; font-size: 10.5px; color: var(--muted); line-height: 1;
}
.page-tab .tclose:hover { background: #ffd9d9; color: #d6453d; }
.page-tab.on .tclose { color: var(--primary); }
.page-tab.on .tclose:hover { background: #ffd9d9; color: #d6453d; }
@media (max-width: 640px) { .page-tabs { padding: 6px 8px 0; } .page-tab { padding: 5px 8px 6px 10px; } }

/* ---------------- 降级常驻横幅（P0-1） ----------------
   整条红底横贯内容区顶部，不能关、不能忽略：它出现就意味着
   「你现在录的单只存在这台电脑上」，而界面上其它地方看起来一切正常。 */
.mode-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; flex: none;
  background: #fdecec; color: #a3231c;
  border-bottom: 1px solid #f3c2c0;
  cursor: pointer; user-select: none;
}
.mode-banner:hover { background: #fbe0e0; }
.mode-banner .mb-ico { font-size: 17px; line-height: 1; }
.mode-banner .mb-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode-banner .mb-txt b { font-size: 13px; }
.mode-banner .mb-txt span { font-size: 12px; color: #8a2a24; line-height: 1.5; }
.mode-banner .mb-btn {
  margin-left: auto; flex: none;
  padding: 5px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  background: #a3231c; color: #fff;
}
@media (max-width: 640px) {
  .mode-banner { padding: 9px 10px; gap: 8px; }
  .mode-banner .mb-txt span { display: none; }
}


/* ---------------- 库存查询：左树右表（品牌→类别→商品） ---------------- */
.inv-layout { display: flex; gap: 14px; align-items: flex-start; }
.inv-tree { flex: 0 0 236px; max-width: 236px; position: sticky; top: 74px; }
.inv-main { flex: 1; min-width: 0; }
.tree-hd { padding: 12px 12px 0; font-size: 13.5px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.tree-body { padding: 6px 6px 10px; max-height: calc(100vh - 210px); overflow: auto; }
.tree-node { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; white-space: nowrap; }
.tree-node:hover { background: var(--surface-2); color: var(--text); }
.tree-node.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.tree-tw { width: 14px; text-align: center; font-size: 10px; color: var(--muted); flex: 0 0 14px; }
.tree-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); margin: 0 4px 0 5px; flex: 0 0 5px; }
.tree-node.on .tree-dot { background: var(--primary); }
.tree-lb { overflow: hidden; text-overflow: ellipsis; }
.tree-ct { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; line-height: 16px; }
.tree-node.on .tree-ct { background: #fff; border-color: var(--primary-weak); color: var(--primary); }

/* 树行上的操作图标：默认隐形，悬停/选中才浮现，避免每行一排方块按钮 */
.tree-node .cs-ops { flex: none; display: flex; gap: 2px; margin-left: 4px; opacity: 0; transition: opacity .12s ease; }
.tree-node:hover .cs-ops,
.tree-node.on .cs-ops,
.tree-node.editing .cs-ops,
.tree-node:focus-within .cs-ops { opacity: 1; }
.tree-op {
  width: 22px; height: 22px; padding: 0; border: 0; background: transparent; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: background .12s ease, color .12s ease;
}
.tree-op svg { display: block; }
.tree-op:hover { background: var(--primary-weak); color: var(--primary); }
.tree-op:active { transform: scale(.94); }
.tree-op.danger:hover { background: var(--danger-weak); color: var(--danger); }

/* 树面板标题右侧的「编辑分类」幽灵按钮 */
.tree-hd-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border: 0; background: transparent; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--muted); transition: background .12s ease, color .12s ease;
}
.tree-hd-btn svg { display: block; }
.tree-hd-btn:hover { background: var(--primary-weak); color: var(--primary); }
.tree-hd-btn span { line-height: 1; }

/* 商品列表：当前分类面包屑 + 一键回到全部 */
.tree-crumb { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; line-height: 16px; }
.tree-chip-reset {
  width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); background: var(--surface);
  border-radius: 50%; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1;
}
.tree-chip-reset:hover { background: var(--primary-weak); border-color: var(--primary-weak); color: var(--primary); }
@media (max-width: 900px) {
  .inv-layout { flex-direction: column; }
  .inv-tree { flex: none; max-width: none; width: 100%; position: static; }
  .tree-body { max-height: 220px; }
}

/* ---------------- 列宽记忆：卡片头右侧小徽标 + 下拉菜单 ---------------- */
.colw-chip { position: relative; margin-left: auto; flex: 0 0 auto; }
.colw-chip-standalone { margin: 0 0 6px; text-align: right; }
.colw-chip .cc-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px;
  color: var(--muted); background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; cursor: pointer; line-height: 18px; }
.colw-chip .cc-btn:hover, .colw-chip.open .cc-btn { color: var(--primary); border-color: var(--primary); }
.colw-chip .cc-btn em { font-style: normal; background: var(--primary); color: #fff;
  border-radius: 999px; font-size: 10.5px; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; padding: 0 4px; font-weight: 600; }
.colw-chip .cc-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); min-width: 224px; padding: 6px; text-align: left; }
.colw-chip.open .cc-menu { display: block; }
.colw-chip .cc-info { font-size: 11.5px; color: var(--muted); padding: 5px 8px 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 5px; white-space: nowrap; }
.colw-chip .cc-info b { color: var(--text-2); font-weight: 600; }
.colw-chip .cc-it { display: block; width: 100%; text-align: left; font-size: 12px; padding: 6px 9px;
  border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.colw-chip .cc-it:hover { background: rgba(36, 86, 217, .08); color: var(--primary); }
.colw-chip .cc-it.cc-danger:hover { background: var(--danger-weak); color: var(--danger); }

/* ===================== 可用库存悬停浮窗 =====================
   鼠标停在「可用库存」数字上展开：现存 / 已锁 / 可用 + 在途 + 已锁库订单 */
.avail-lk { cursor: help; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.avail-pop {
  position: fixed; left: 0; top: 0; z-index: 150; display: none; width: 312px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-size: 12px; line-height: 1.5; color: var(--text); overflow: hidden;
}
.avail-pop .ap-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.avail-pop .ap-hd b { font-size: 13px; }
.avail-pop .ap-sub { color: var(--muted); font-size: 11px; }
.avail-pop .ap-wh { margin-left: auto; background: var(--primary-weak); color: var(--primary);
  border-radius: 999px; padding: 1px 9px; font-size: 11px; }
.avail-pop .ap-kv { display: flex; border-bottom: 1px solid var(--border); }
.avail-pop .ap-kv > div { flex: 1; padding: 7px 8px; text-align: center; }
.avail-pop .ap-kv > div + div { border-left: 1px solid var(--border); }
.avail-pop .ap-kv i { display: block; font-style: normal; color: var(--muted); font-size: 11px; }
.avail-pop .ap-kv b { font-size: 15px; }
.avail-pop .ap-kv .ap-kv-main b { color: var(--success); font-size: 17px; }
.avail-pop .ap-kv .ap-alert b, .avail-pop .ap-kv > .ap-alert i { color: var(--danger); }
.avail-pop .ap-ft { padding: 6px 12px; background: var(--surface-2); color: var(--text-2);
  border-bottom: 1px solid var(--border); font-size: 11px; }
.avail-pop .ap-sec { padding: 7px 0 5px; }
.avail-pop .ap-sec + .ap-sec { border-top: 1px dashed var(--border); }
.avail-pop .ap-sec-hd { display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 5px; color: var(--text-2); font-size: 11px; }
.avail-pop .ap-sec-hd b { font-size: 13px; }
.avail-pop .ap-tr .ap-sec-hd b { color: var(--warn-ink); }
.avail-pop .ap-lk .ap-sec-hd b { color: var(--primary); }
.avail-pop .ap-none { padding: 0 12px 3px; color: var(--muted); font-size: 11px; }
.avail-pop .ap-doc { display: flex; align-items: center; gap: 8px; padding: 4px 12px;
  color: var(--text); text-decoration: none; }
.avail-pop .ap-doc:hover { background: var(--primary-weak); }
.avail-pop .ap-no { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 11px;
  color: var(--primary); text-decoration: underline; text-decoration-color: transparent; }
.avail-pop .ap-doc:hover .ap-no { text-decoration-color: var(--primary); }
.avail-pop .ap-party { flex: 1; min-width: 0; color: var(--text-2); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avail-pop .ap-party i { font-style: normal; color: var(--muted); margin-left: 4px; }
.avail-pop .ap-q { font-size: 11px; color: var(--muted); white-space: nowrap; }
.avail-pop .ap-q b { color: var(--text); font-size: 12px; }

/* ===================== 权限管理 ===================== */
/* 功能权限矩阵：模块分组标题行 + 批量操作行 */
.perm-grp > td {
  background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--text-2);
  padding: 6px 10px; border-top: 1px solid var(--border);
}
.perm-tools > td { background: var(--surface-2); border-top: 1px dashed var(--border); padding: 5px 8px; }
.perm-tools .btn-sm { padding: 1px 7px; font-size: 11px; height: auto; line-height: 1.6; }
/* 无功能权限的按钮：置灰并提示，避免点了才知道无权 */
.perm-denied { opacity: .42; cursor: not-allowed !important; }
.perm-denied:hover { opacity: .42; }
/* 顶栏角色徽标 */
.role-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); cursor: default;
}
.role-chip b { color: var(--text); font-weight: 600; }
.role-chip .warn { color: var(--warn-ink); }

/* 顶栏账套切换：一眼看到「现在在哪家公司」，点开可切换 */
.co-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--primary);
  font-size: 12.5px; color: var(--text); cursor: pointer; flex: none;
}
.co-chip:hover { background: var(--surface-2); }
.co-chip b { font-weight: 600; }
.co-chip i { font-style: normal; color: var(--muted); font-size: 10px; }
/* 账套列表当前行高亮 */
.tbl tr.row-on td { background: rgba(18, 184, 134, .07); }

/* ---- 仓库作业看板（Kanban 四列 + 送货安排） ---- */
/* z17：仓库看板是**固定六档**（待配货/配货中/待安排配送/已安排配送/配送中/已完成），
   所以用显式列数，不用 auto-fit —— auto-fit 会让「列宽不一致」，看着像布局坏了。
   3 列两行是默认：实测一张卡片的最小可读宽度约 334px
   （单号 ~105 + 客户 ≥50 + 件数 ~57 + 作业按钮 ~72 + 行内边距 24 + 列边框 2 + 3×gap 24），
   而 1280 宽下每列约 325px —— 差 9px 由客户名省略号吸收，是这套卡片的极限。
   六列一行需要 6×334 + 5×12 + 侧栏与内边距 ~282 ≈ 2350px，
   所以宽屏断点取 2350（不是 1560：1560 宽下六列只有约 200px，客户名会被吃掉）。 */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* 2026-11-12：这里原来有一条 `@media (min-width: 2350px) { .kanban { repeat(6) } }` ——
   它是**六档时代**留下的：那时候一屏就是 6 列，宽屏就摊成 6 列。
   现在「仓库内部」只有 3 列，宽屏（2361px）下这条规则把 3 列塞进 6 格网格，
   右边整整空出一半 —— PO 截图里那块大空白就是它，而代码里没有任何一处"少了一列"。
   **删掉，并且列数一律写在调用处**（.kb-2 / .kb-3 / .wh-days / .wh-plan-grid）：
   列数是页面结构，不是屏宽的函数。z38 删过 .kb-2（当时方案丙的两列不存在了），
   z51 又把它加回来：撤掉「待接单」之后「仓库内部」正好是 待配货 / 配货中 两列。 */
.kanban.kb-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kanban.kb-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .kanban, .kanban.kb-2, .kanban.kb-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 窄屏先让「件数」而不是「客户名」退场（z17，PO 认可）。
   为什么是件数：看板的使用场景是"扫一眼知道这单发到哪、发多少" ——
   **客户名是用来认单的，件数只是用来核对的**。客户名一旦被 ellipsis 截到两三个字，
   整张卡就没法认单了，那比看不到件数严重得多；而件数在下方的 .kb-r-sub 里还有一份。
   为什么断点 1320：三列要舒服，每列至少 334px（单号 105 + 客户 ≥50 + 件数 57 +
   作业按钮 72 + 行内边距 24 + 列边框 2 + 分摊 gap 24），
   加上侧栏与内边距 282px → 3×334 + 2×12 + 282 = **1308**，取整到 gap 的整数倍 1320。
   低于它就把 57px 的件数让给客户名（三列的下限随之降到 1137），
   再窄（<1100）走上面的两列规则。
   **只减 DOM 里的可见性、不改 DOM 结构**：用 CSS 隐藏而不是 JS 判断窗口宽度渲染 ——
   否则不同宽度下 DOM 不一样，判据/快照/将来的 SSR 都要处理两种形态。 */
@media (max-width: 1320px) { .kb-r-qty { display: none; } }
.kb-col { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; }
.kb-hd { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--border); }
.kb-cnt { background: var(--border); color: var(--text-2); border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 400; }
/* 列体改列表式（2026-11-04）：一单一卡片 → 一单两行紧凑条目。
   日单量 10–30、周 50+ 时卡片式一屏放不下 3 单；条目式一屏 12+ 单。
   去掉卡片间隙与内边距，条目之间只用 1px 线分隔——列表密度。 */
.kb-body { padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 360px); min-height: 120px; overflow-y: auto; }
.kb-row { padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.kb-row:last-child { border-bottom: none; }
.kb-row:hover { background: var(--surface-2); }
/* 逾期不整行泛红（内容会看不清），行首一条 2px 红线 + 送货日红字，同审批队列的做法 */
.kb-row.is-late { box-shadow: inset 2px 0 0 var(--danger); }
.kb-r-main { display: flex; align-items: center; gap: 8px; }
.kb-r-no { font-weight: 600; font-size: 12.5px; white-space: nowrap; letter-spacing: -.1px; }
.kb-r-cust { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.kb-r-qty { flex: none; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-r-ops { display: flex; gap: 4px; flex: none; }
.kb-r-ops .btn { padding: 0 8px; height: 24px; font-size: 12px; }
.kb-r-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; }
.kb-r-sep { color: var(--border); font-style: normal; }
.kb-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 14px 0; }
.sch-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.sch-day { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2); min-width: 0; }
.sch-day.sch-late { background: var(--danger-weak); border-color: var(--danger); }
.sch-d { font-weight: 500; font-size: 12.5px; margin-bottom: 8px; }
.sch-car { background: var(--surface); border-radius: 6px; padding: 8px; margin-bottom: 6px; font-size: 12px; }
.sch-car b { font-weight: 500; }
.sch-n { color: var(--muted); margin-left: 6px; font-weight: 400; }
.sch-who { color: var(--text-2); margin-top: 2px; }
.sch-nos { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; }
.sch-none { color: var(--muted); font-size: 12px; text-align: center; padding: 10px 0; }
/* 作业流转时间轴（出库单详情 / 订单详情共用） */
.ship-tl { margin-top: 6px; }
.ship-tl .tl-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.ship-tl .tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: none; }
.ship-tl .tl-t { font-weight: 500; }
.ship-tl .tl-w, .ship-tl .tl-at { color: var(--muted); }
.ship-tl .tl-n { color: var(--text-2); }

/* ---- 商品智能引入（五步向导） ---- */
.wiz-steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 16px; }
.wiz-step { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.wiz-step.on { color: var(--primary); font-weight: 600; }
.wiz-step.done { color: var(--text-2); }
.wiz-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2, var(--surface-2)); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.wiz-step.on .wiz-dot { background: var(--primary); color: #fff; }
.wiz-step.done .wiz-dot { background: var(--success, #2e9e5b); color: #fff; }
.wiz-line { width: 34px; height: 1px; background: var(--border, #dde3ec); flex: none; }
.wiz-prog { height: 8px; border-radius: 4px; background: var(--bg-2, var(--surface-2)); overflow: hidden; margin: 10px 30px; }
.wiz-prog-bar { height: 100%; background: var(--primary); border-radius: 4px; transition: width .25s; }
.wiz-done { width: 54px; height: 54px; margin: 14px auto 0; border-radius: 50%; background: var(--success, #2e9e5b);
  color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; }

/* 断网横幅（P4）：连不上服务端时常驻显示，直到恢复。
   放底部中间而不是顶部——顶部有页头和操作条，压在上面会挡住「保存」按钮。 */
.net-bar {
  position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%) translateY(140%);
  z-index: 90; display: flex; align-items: center; gap: 12px;
  max-width: min(760px, calc(100vw - 32px));
  background: #fff5f5; border: 1px solid #f3c9ca; color: #8c2b2f;
  border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 10px 28px rgba(30, 42, 66, .16);
  font-size: 13px; line-height: 1.6;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.net-bar.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.net-bar-txt { flex: 1; }
.net-bar-btn { white-space: nowrap; flex: 0 0 auto; }

/* 服务端角色权限页：左列角色、右侧勾选面板。
   为什么用 grid 而不是表格矩阵：一个角色一屏，勾选项带说明，
   管理员能看清「这一项到底是什么」，误勾成本低。 */
.srvperm-wrap { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 14px; align-items: start; }
.srvperm-side .card-bd { padding: 10px; }
.srvperm-role { padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; }
.srvperm-role:hover { background: var(--surface-2); }
.srvperm-role.on { background: #eef4ff; border-color: #cddcf7; }
.srvperm-role-nm { font-weight: 600; font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.srvperm-role-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.srvperm-h { margin: 16px 0 8px; font-size: 13px; color: #33415c; letter-spacing: .3px; }
.srvperm-grp h4 { margin: 14px 0 6px; font-size: 13px; color: #33415c; }
.srvperm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 6px 10px; }
.srvperm-item { display: flex; gap: 7px; align-items: flex-start; padding: 6px 9px;
  border-radius: 7px; border: 1px solid #e6ebf3; cursor: pointer; background: #fff; }
.srvperm-item:hover { border-color: #cddcf7; }
.srvperm-item.on { background: #f2f8f4; border-color: #cfe6d4; }
.srvperm-item input { margin: 2px 0 0; flex: 0 0 auto; }
.srvperm-lab b { display: block; font-weight: 600; font-size: 12.5px; color: #25324a; }
.srvperm-lab i { display: block; font-style: normal; color: var(--muted); font-size: 11.5px;
  margin-top: 2px; line-height: 1.55; }
@media (max-width: 960px) {
  .srvperm-wrap { grid-template-columns: 1fr; }
}

/* 已作废的单据：整行淡化。
   减轻视觉权重，但不隐藏、不加删除线 —— 它是库存流水的凭证，
   对账时要能翻出来，只是不该和有效单据抢注意力。 */
tr.row-void td { color: var(--muted); background: #fafafa; }
tr.row-void td b { color: var(--muted); }
tr.row-void td .badge { opacity: 1; }

/* ==========================================================================
 * 20261029 全局视觉刷新 · 细节层
 * ========================================================================== */

/* 细滚动条：系统默认滚动条又宽又灰，是"廉价感"最大的来源之一。
   只对 WebKit 生效（Chrome/Edge），Firefox 走 scrollbar-width。 */
* { scrollbar-width: thin; scrollbar-color: #cdd5e0 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cdd5e0; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b4bfce; border: 3px solid transparent; background-clip: content-box; }

/* 文字选区：主色弱底，选中一段金额时不会刺眼 */
::selection { background: var(--primary-weak); color: var(--primary-dark); }

/* 数字统一等宽（表格、KPI、汇总条之外的漏网处）：金额竖向对齐是克制感的一部分 */
.kpi .foot b, .card-hd .sub { font-variant-numeric: tabular-nums; }

/* ==========================================================================
 * 20261029 · 内联硬编码色收编层（视觉侧 A3）
 *
 * 背景：app.js 里有 1155 处 inline style，其中 202 处硬编码颜色。
 * 内联样式优先级高于任何选择器 —— 设计变量盖不住，结果就是"改了样式表，
 * 页面只有一半跟着变"。#8a97ab 出现 125 次（旧的次要文字灰，本轮已换令牌值），
 * 还有 #e03131 / #c0392b / #2f9e44 这类压根不在配色体系里的野色。
 *
 * 两条腿走路：
 *   ① 兜底（本段，立刻生效）：用属性选择器命中内联值，强制统一到令牌。
 *      以后调 --muted / --danger 一处，这 200 处全部跟随。
 *   ② 根治（台账 V-08，交业务侧）：把 inline 换成下面的 .t-* 语义类。
 *      替换完 inline 里就没有 color 了，① 自动失效，那时可整段删除。
 *
 * 迁移映射（业务侧照此替换即可，间距类属性留在 inline 里不用管）：
 *   color:#8a97ab                              → class="t-muted"
 *   color:#56657e                              → class="t-2"
 *   color:#a6b0bf / #c3ccd9                    → class="t-faint"
 *   color:#e03131 / #c0392b / #c92a2a          → class="t-danger"
 *   color:#2f9e44 / #1a9c5b / #12b886          → class="t-success"
 *   color:#b06f16 / #c2410c / #e8590c / #c47f17 / #b26a00 → class="t-warn"
 *   color:#2f6fed / #1668dc / #1c7ed6          → class="t-primary"
 *   font-size:12px / 12.5px                    → class="t-xs" / "t-sm"
 * ========================================================================== */

/* 两个类名重复一次，把权重抬到 (0,2,0)。
   原因：这几个类替换掉的是**内联** color，内联本来就压过一切选择器；
   换成单类后，任何带后代组合的规则（`.login-aside p`、`.field .hint`、`.doc-ft td`
   ……全站 183 条）都会反过来压住它，颜色会悄悄变回容器色 —— 那就不是"根治"而是改版了。
   抬到 (0,2,0) 后能盖住 1 个父级 + 1 个自身的组合，与替换前的内联行为一致。
   要覆盖它需要 3 级选择器或 !important，属于有意为之的情况，那时别用这些类。 */
/* 特异性：站内 206 条设置了 color 的后代/复合选择器（.tbl td / .field .hint / .kpi .foot …），
   特异性 (0,1,1)+ 会压过单类 (0,1,0)，颜色会静默变回容器色 —— 业务侧在 v72 提出的 R-02 成立。
   修法用 !important 而不是"双类守卫"（.t-muted.t-muted 要求 class 在同一个元素上写两遍才匹配，
   app.js 里 186 处全是单写，那条规则一次都不会命中，是死代码）。
   utility 类的语义本就是"我说什么色就是什么色"，Bootstrap utilities / Tailwind 的 ! 前缀同思路。
   代价：不能再用别的 CSS 规则覆盖 .t-* —— 要改就改 HTML 上的 class，这是刻意的。 */
.t-muted   { color: var(--muted) !important; }
.t-2       { color: var(--text-2) !important; }
.t-faint   { color: #a3aebf !important; }
.t-primary { color: var(--primary) !important; }
.t-danger  { color: var(--danger) !important; }
.t-success { color: var(--success) !important; }
.t-warn    { color: var(--warn) !important; }
/* 字号同理：.tbl td / .mini-items .tbl td 这类后代规则也会压掉字体大小 */
.t-xs      { font-size: 12px !important; }
.t-sm      { font-size: 12.5px !important; }

/* ① 兜底：命中内联里的旧硬编码色，强制归到令牌。
   只匹配 color 前缀，background/border 不受影响。 */
[style*="color:#8a97ab"], [style*="color: #8a97ab"] { color: var(--muted) !important; }
[style*="color:#56657e"], [style*="color: #56657e"] { color: var(--text-2) !important; }
[style*="color:#a6b0bf"], [style*="color: #a6b0bf"],
[style*="color:#c3ccd9"], [style*="color: #c3ccd9"] { color: #a3aebf !important; }
[style*="color:#e03131"], [style*="color: #e03131"],
[style*="color:#c0392b"], [style*="color: #c0392b"],
[style*="color:#c92a2a"], [style*="color: #c92a2a"] { color: var(--danger) !important; }
[style*="color:#2f9e44"], [style*="color: #2f9e44"],
[style*="color:#1a9c5b"], [style*="color: #1a9c5b"],
[style*="color:#12b886"], [style*="color: #12b886"] { color: var(--success) !important; }
[style*="color:#b06f16"], [style*="color: #b06f16"],
[style*="color:#c2410c"], [style*="color: #c2410c"],
[style*="color:#e8590c"], [style*="color: #e8590c"],
[style*="color:#c47f17"], [style*="color: #c47f17"],
[style*="color:#b26a00"], [style*="color: #b26a00"] { color: var(--warn) !important; }
[style*="color:#2f6fed"], [style*="color: #2f6fed"],
[style*="color:#1668dc"], [style*="color: #1668dc"],
[style*="color:#1c7ed6"], [style*="color: #1c7ed6"] { color: var(--primary) !important; }

/* ==========================================================================
 * 20261029 · 列表页工作动线降噪（文员/财务视角）
 * 结构性裁剪（控件去留、列增删）在台账 V-10~V-13，由业务侧改 app.js；
 * 本段只做视觉层的降级与对齐，不依赖新 DOM。
 * ========================================================================== */

/* 金额列：数字贴着下一条列的边线看，位数一多容易读串行。
   右侧多留 6px，金额和列分隔线之间有呼吸位（表头表体统一）。 */
.tbl th.num, .tbl td.num { padding-right: 18px; }

/* 副行文字（已出 x/y、未收 xx）：行高压到 1.35，主行两行式不会显得虚胖；
   12px 的字用默认 1.6 行高，两行文字之间的空隙比信息本身还高。 */
.cell-sub { line-height: 1.35; }

/* 「过滤方案 / 存为方案 / 下次直接以该方案进入」是系统视角的功能，
   文员用不到也不该第一眼看到 —— 视觉降级为次要（透明按钮 + 浅灰字）。
   控件本身先保留（等 V-10 收进「更多筛选」后由业务侧移除），先让它退后。 */
.scheme-bar .btn { border-color: transparent; background: transparent; color: var(--muted); }
.scheme-bar .btn:hover { border-color: var(--border-strong); background: var(--surface); color: var(--text-2); }
.scheme-bar .input { border-color: transparent; background: transparent; color: var(--text-2); }
.scheme-bar .input:hover, .scheme-bar .input:focus { border-color: var(--border-strong); background: var(--surface); }
.scheme-def { color: #a3aebf; }

/* 工具栏右侧的操作提示（「勾选左侧复选框后可批量处理」）：熟练后是噪音。
   不删（新手还需要），但压到最浅灰，不与数据争夺注意力。
   订单/采购两个工具栏共用 .ord-toolbar 类（purToolbarHtml 复用同名容器）。 */
.doc-toolbar .tb-hint { color: #a3aebf; }

/* ==========================================================================
 * 20261029 · 背景语义类 .bg-*（回应业务侧 §3 R-05）
 * 与 .t-* 是同一套：内联 background 同样压过选择器、换肤盖不住。
 * 业务侧逐处替换后，内联底色的棘轮就能收到 0。
 *
 * 迁移映射（对应 app.js 现存 7 处内联底色）：
 *   background:#fafbfd / #f6f8fc（只读输入、浅底块）→ class="bg-soft"
 *   background:#fff5f5 + border:1px solid #ffc9c9（错误块）→ class="bg-danger-weak"
 *   background:#fff8e6（提示块）                        → class="bg-warn-weak"
 *   background:#fff（iframe 白底）                      → class="bg-white"
 *   #edf0f6（进度槽底）                                 → class="bg-track"
 * 与 .t-* 一样带 !important：utility 类的语义是无条件生效，
 * 要覆盖只能改 HTML 上的 class（否则会被 .tbl td 这类后代规则压掉）。
 * ========================================================================== */

.bg-soft        { background: var(--surface-2) !important; }
.bg-white       { background: #fff !important; }
.bg-track       { background: var(--surface-2) !important; }
.bg-primary-weak{ background: var(--primary-weak) !important; }
.bg-success-weak{ background: var(--success-weak) !important; }
.bg-warn-weak   { background: var(--warn-weak) !important; }
/* 错误块原来还带一圈浅红描边，一起收进来，替换时连 border 一起删 */
.bg-danger-weak { background: var(--danger-weak) !important; border: 1px solid #f5c6c7 !important; }

/* ==========================================================================
 * 20261029 · 明细网格首尾列冻结 + 列宽拖拽手感（视觉侧）
 * 结构性改动（序号列改字/锁列、拖拽最小宽分级）在台账 V-17 / V-18，业务侧改 app.js。
 * ========================================================================== */

/* ---- 首尾列冻结：2026-11-07 从列表页整体撤除（勿恢复）----
   原先这里挂的是 .tbl.tbl-grid 的 th/td:last-child{ position:sticky; right:0 }，
   注释写着「明细网格（出库/入库/订单/采购共 5 张）」。但全项目 9 处 .tbl.tbl-grid
   全是**列表页**，明细开单表是 .form-lines table，从来没拿到这个类 ——
   于是这段冻结只作用在列表上，成了事故：
     用户把某列拖宽 → 表宽超出 .tbl-wrap → 末列（审核状态）带实心底色
     钉在右边缘，把左邻的「已付 / 未付」压掉半列（2026-11-07 用户截图）。
   列表页的正确语义是「整表横滚，谁都不冻」：冻结列按定义就要盖住从它下面
   滑过的列，只要允许横滚就一定会遮信息，不存在「冻了但不遮」的写法。
   明细开单表是定宽布局、弹性列吃满、永不横滚 → 本来就没有冻结的需求。
   所以这里不留例外，两端都撤。真要给某张表冻结，必须是「该表从不横滚」的表。 */

/* 冻结列必须不透明，否则滑过的内容会从底下透出来：
   行底色有三种来源 —— ① 无底色 ② tr 上的 inline 底色（库存不足浅红/追加浅蓝）
   ③ hover（写在 td 上）。td 用 inherit 跟随 tr；无底色行由下面这条补白底。
   ②的 inline 在 tr 上、③的规则特异性更高，三者互不打架。 */
.tbl.tbl-grid tbody tr { background-color: var(--surface); }
.tbl.tbl-grid tbody td { background-color: inherit; }
.tbl.tbl-grid thead th { background: var(--surface); }

/* border-collapse: collapse 下 sticky 单元格的边框在滚动时会丢（浏览器已知问题），
   用内嵌阴影补一条自己的竖线；没滚动时与原 border 重合，无视觉差。 */
.tbl.tbl-grid thead th:first-child,
.tbl.tbl-grid tbody td:first-child { box-shadow: inset -1px 0 0 var(--border); }
.tbl.tbl-grid thead th:last-child,
.tbl.tbl-grid tbody td:last-child { box-shadow: inset 1px 0 0 var(--border); }

/* 序号列：等业务侧给表头加 class="seq-col" 生效（V-17） */
.tbl-grid .seq-col { text-align: center; }
.tbl-grid .seq-col.cell-sub, .tbl-grid td.seq-col { text-align: center; }

/* ---- 拖拽手感 ----
   热区从 8px 加宽到 11px 并向右越界 4px，骑在列缝上（两边都好抓，Excel 式）；
   视觉线位置不变（原来 8px 热区只有右缘 1px 能对准，实际很难抓中）。 */
.col-rz { width: 11px; right: -4px; }
.col-rz::after { right: 4px; }
.col-rz:hover::after { right: 4px; }
/* 拖拽中的手柄常亮：等业务侧 mousedown 时给当前 th 加 class="col-dragging"（V-18） */
th.col-dragging .col-rz::after { width: 2px; background: var(--primary); }

/* ==========================================================================
 * v20261029 · 列表功能区：三段式「纸面框架」（页签 / 筛选 / 操作）
 *
 * 用户要的是「高级简单」，不是「少」：线在、层次在、按钮有形。
 * 做法 —— 抬头（页签+筛选）与数据（表格）是同一张纸，用 1px 线分段，
 * 抬头区给极浅底、数据区纯白，靠「底色差 + 分隔线」分层，不靠投影和圆角堆。
 *
 * 结构（等 app.js 合并成 .list-head，见台账 V-10）：
 *   ┌ 抬头 · --surface-2 浅底 ─────────────────┐
 *   │ 页签带 42px                    （下沿 1px）│
 *   │ 筛选带 46px：高频控件 ｜ 视图与工具        │
 *   └ 下沿 1px 线 ─────────────────────────────┘
 *     操作带 40px（白底，与表格同色）  ← 抬头与数据的过渡
 *     表格（白底）
 * ====================================================================== */

/* ---- ① 框架线：抬头（页签+筛选）浅底 + 下沿一条线，与表格同左缘 ----
   注意：v80 里 .list-head 实际包住了「页签 + 筛选 + 工具 + 表格 + 分页」
   整块内容，所以浅底**只能刷在两个直接子带上**，刷在 .list-head 上会连
   表格一起染色。线与表格左右缘对齐（都在 16px 内距里），不冲到卡片边。 */
.list-head { padding: 0; }
/* 2026-11-24 PO 反馈「灰栏拉满 + 内容内缩」：页签条/筛选条/工具栏的浅灰底要**铺满卡片宽度**，
   而内容在灰底内部左右留 16px。所以 `.list-head` 本身不再加 padding（否则灰底被挤在中间、
   两边露白），改成给它的两个直接子带各加 16px 左右内距。工具栏 `.ord-toolbar` 同理。
   表格、分页是白底区，保持 16px 左右留白（下面那条兄弟选择器）。 */
.list-head ~ .tbl-wrap,
.list-head ~ .tbl-foot { padding-left: 16px; padding-right: 16px; }
.list-head > .doc-tabs,
.list-head > .filter-bar { background: var(--surface-2); }
.list-head > .doc-tabs { padding: 0 16px; border-bottom-color: var(--border); }
.list-head > .filter-bar {
  padding: 8px 16px 9px; min-height: 46px;
  border-bottom: 1px solid var(--border);
}

/* ---- ② 节奏钉死：三带高度固定，内容增减不抖（按钮显隐是最常见的抖动源）---- */
.doc-toolbar.ord-toolbar {
  min-height: 40px; padding: 5px 16px 7px; margin-bottom: 0;
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
}

/* ---- ③ 按钮「有骨」：次级/禁用按钮保留 1px 边框，只去掉底色和投影 ----
   第一版把禁用按钮退成无框淡字，结果整行像一排飘着的词 —— 简单不等于没有形。
   现在是：线在（淡）、字淡、无投影；勾选后 disabled 解除，自动变回实体按钮。 */
.doc-toolbar .btn[disabled] {
  border-color: var(--border); background: transparent;
  color: var(--muted); opacity: 1; box-shadow: none;
}
.doc-toolbar .btn[disabled]:hover { color: var(--muted); border-color: var(--border); }

/* ---- ④ 筛选带右侧：入口类按钮统一「描边幽灵按钮」 ----
   与左侧实体输入框形成对比：左边是填的，右边是按的。悬停给主色弱底，
   买点明确的反馈（比单纯变字色更像一个按钮）。 */
.filter-right .btn {
  background: transparent; color: var(--text-2);
  box-shadow: none; font-size: 12.5px; border-color: var(--border-strong);
}
.filter-right .btn:hover {
  color: var(--primary); border-color: var(--primary); background: var(--primary-weak);
}
/* 开关型入口（查看明细）按下后保持点亮态，否则看不出「现在展开了」 */
.filter-right .btn.on { color: var(--primary); border-color: var(--primary); background: var(--primary-weak); }
.scheme-def {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}

/* ---- ⑤ 竖分隔线：分组靠线不靠留白（留白在窄屏会被压没）---- */
.filter-bar .vr { width: 1px; height: 20px; background: var(--border-strong); flex: none; margin: 0 2px; }

/* ---- ⑥ 分段日期控件 .seg（等 app.js 加，V-21）----
   「今日 / 本周 / 本月 / 上月」一键设定，比两个 date input 各点一次快得多；
   文员财务 80% 的查找都是这几个区间。选中段主色弱底 + 主色字，段间 1px 线，
   整体一个 6px 圆角框 —— 视觉上是一个控件，不是四个按钮。 */
.seg {
  display: inline-flex; align-items: stretch; height: 30px; flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.seg > button {
  border: 0; border-left: 1px solid var(--border); background: transparent;
  padding: 0 11px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; white-space: nowrap; transition: .13s;
}
.seg > button:first-child { border-left: 0; }
.seg > button:hover { color: var(--primary); background: var(--surface-2); }
.seg > button.on { color: var(--primary); background: var(--primary-weak); font-weight: 600; }

/* ---- ⑦ 图标按钮 .icon-btn（等 app.js 加，V-21）----
   刷新 ⟳ / 清空筛选 ✕ / 更多筛选 ▾ 这类「动作入口」：30×30 有框有圆角，
   与筛选控件同高，一排看过去是齐的；不裸奔、不靠 emoji 撑体积。 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; min-width: 30px; padding: 0 9px; flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-size: 12.5px;
  cursor: pointer; transition: .13s; white-space: nowrap;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-weak); }
.icon-btn[disabled] { color: var(--muted); opacity: .55; cursor: default; }
.icon-btn[disabled]:hover { color: var(--muted); border-color: var(--border-strong); background: var(--surface); }
.icon-btn .ico { font-size: 13px; line-height: 1; }
/* 生效条件数角标：筛了几个条件，按钮上就显示几 —— 防止「以为数据丢了，
   其实是自己筛过」这类最常见的一线困惑 */
.icon-btn .dot-n {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--primary-weak); border-radius: 999px;
  padding: 0 5px; line-height: 16px; font-variant-numeric: tabular-nums;
}

/* ---- ⑧ 视觉统一：所有计数用等宽数字，翻页/筛选时不左右跳 ---- */
.filter-bar .input, .doc-toolbar .tb-count b, .icon-btn .dot-n, .dt-cnt { font-variant-numeric: tabular-nums; }

/* ---- ⑨ 右上角入口按钮 .filter-text-btn（v80 已用上，这里是完整定义）----
   业务只写了 class="filter-text-btn"（没带 .btn .btn-sm），所以这个类必须
   自成一套：尺寸、圆角、字号、状态全在这里，否则会掉回浏览器默认按钮样式。
   高 30 与筛选输入框同高，一排看过去底边是齐的。 */
.filter-text-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px; flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2);
  font-size: 12.5px; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: .13s;
}
.filter-text-btn:hover {
  color: var(--primary); border-color: var(--primary); background: var(--primary-weak);
}
/* 开关态（查看明细 / 展开中）：不加 .on 就看不出「现在是展开的」 */
.filter-text-btn.on {
  color: var(--primary); border-color: var(--primary);
  background: var(--primary-weak); font-weight: 600;
}

/* ---- ⑩ 「更多筛选 ▾」弹层：里面装的是下拉和方案条，不是菜单项 ----
   原 .dd-menu 是按「一列文字按钮」排的（padding 4px、button 铺满），
   装 <select> 会挤在一起，这里给弹层内元素留出间距并让方案条竖排。 */
.filter-right .dd-menu { min-width: 210px; padding: 10px; display: none; }
.filter-right .print-dd.open .dd-menu { display: flex; flex-direction: column; gap: 8px; }
.filter-right .dd-menu .input { width: 100%; }   /* 下拉上的 inline max-width 仍生效，不抢 */
.filter-right .dd-menu .scheme-bar { flex-direction: column; align-items: stretch; gap: 6px; }
.filter-right .dd-menu .scheme-bar .input,
.filter-right .dd-menu .scheme-bar .btn { width: 100%; }
.filter-right .dd-menu .scheme-def { white-space: normal; font-size: 12px; }
/* 弹层内分组标题（业务可加 .dd-hd 给「筛选条件 / 过滤方案」分组） */
.filter-right .dd-menu .dd-hd {
  font-size: 11.5px; color: var(--muted); letter-spacing: .04em;
  padding: 2px 2px 0;
}
.filter-right .dd-menu .dd-hd + * { margin-top: 0; }

/* ==========================================================================
 * v20261029d · 列表「操作带」与表格的分界修正
 *
 * 用户反馈：操作带和表格之间有一大块空白，「像出了 bug」。
 * 真凶：列宽记忆徽章（colw-chip）被自动塞进操作带右端，操作带 flex-wrap
 * 一换行它就独占一整行 —— 一行里只有一个「📐 列宽 ⑨ ▾」，其余全空。
 * 处理：① 列表区不再显示该徽章（CSS 侧隐藏，立即可生效）；
 *       ② 「恢复默认列宽」的入口改由业务收进「列设置」弹层（V-22）；
 *       ③ 操作带与表头之间补一条 1px 分界线，表格区成块，分界是有意的。
 *
 * 徽章落位（app.js colwChipHost）在 v80 之后实际走到兜底分支：
 * 列表页已无 .card-bd/.filter-bar 结构 → 徽章被插进 .tbl-wrap 里、表格上方
 * （colw-chip-standalone），右对齐独占一行 —— 这就是那块「空白带」。
 * 三个口子一起堵：工具栏内、滚动容器内、list-head 内任何位置都不显示。
 * 卡片标题栏（card-hd）里的落位不受影响，别的页面照常。 */
.doc-toolbar > .colw-chip,
.tbl-wrap > .colw-chip,
.list-head .colw-chip { display: none !important; }
.list-head > .tbl-wrap { border-top: 1px solid var(--border); }
/* 徽章藏起后操作带恒为一行：min-height 从 40 收到 36，空白感进一步消失 */
.doc-toolbar.ord-toolbar { min-height: 36px; }

/* ==========================================================================
 * v20261029e · 单据详情页 .dt-*（V-23，严格按台账 §2.1 的 DOM 骨架与尺寸写）
 *
 * 业务 v83 已把详情页结构改成拍板的四段式（单据头 / 进度带 / 三组信息 / 明细），
 * 但一个样式都没写 —— 现在线上是素版，这是当时的阻塞项。
 *
 * 设计语言沿用列表区那一套「纸面框架」：靠 1px 线 + 极浅底分层，不靠投影；
 * 全页只有「价税合计」一个强调点，其余都是安静的深色字。
 * 金额显示权仍旧在 money()/costMoney()/profitMoney() 手里，CSS 只管排版，
 * 不碰任何数字本身（字段权限照旧生效，可能出现 ***，属正常）。
 * ====================================================================== */

/* ---- 单据头：page-hd 原本是 space-between 的 flex，两行结构下必须改块流 ---- */
.page-hd.dt-hd {
  display: block;                 /* 覆盖 .page-hd 的 flex，否则两行会并排 */
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);   /* 与列表抬头同一条语言：线分段 */
  margin-bottom: 0;
}
.dt-hd-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dt-hd-row .hd-acts { margin-left: auto; }   /* 按钮组永远靠右，与单号同一行 */
.dt-no {
  font-size: 16px; font-weight: 600; letter-spacing: -.2px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dt-hd-row .badge { transform: translateY(0); }   /* 取消 .page-hd h2 .badge 的偏移 */
.dt-meta {
  margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.5;
}

/* ---- 页签：本来裹在 .card 里会多一层盒子 + 双线，拆成裸的一条带 ---- */
.dt-tabs-card.card {
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
  overflow: visible; margin-bottom: 14px;
}
.dt-tabs-card .doc-tabs { border-bottom: 1px solid var(--border); }
.dt-tabs-card .doc-tab { padding: 10px 16px 11px; }

/* ---- 进度带：一条浅底整条替代原来的 6 张指标卡 ----
   三段用竖线分开（窄屏留白会被压没，线不会）；左看件数、中看钱、右看明细。 */
.dt-band {
  display: flex; align-items: stretch; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
}
.dt-band-l { flex: 1 1 240px; min-width: 220px; }
.dt-band-m {
  flex: 0 0 auto; padding: 0 22px;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.dt-band-r {
  flex: 1 1 200px; display: flex; align-items: flex-end; justify-content: flex-end;
  font-size: 12px; color: var(--muted); line-height: 1.5; text-align: right;
}
.dt-band-num { font-size: 13px; color: var(--text-2); }
.dt-band-num b {
  font-size: 20px; font-weight: 600; color: var(--text);
  margin: 0 2px; font-variant-numeric: tabular-nums;
}
.dt-bar {
  height: 6px; border-radius: 3px; background: #e8edf5;
  overflow: hidden; margin: 7px 0 5px; max-width: 320px;
}
.dt-bar > i {
  display: block; height: 100%; border-radius: 3px;
  background: var(--primary); transition: width .25s ease;
}
.dt-band-sub { font-size: 12px; color: var(--muted); }
/* 中段是整条带唯一的强调项：价税合计 / 成交金额 */
.dt-band-amt {
  font-size: 18px; font-weight: 600; color: var(--primary);
  letter-spacing: -.2px; font-variant-numeric: tabular-nums; line-height: 1.35;
}

/* ---- 三组信息：等宽三列，组内是「标签 + 值」 ---- */
.dt-info {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  margin-bottom: 14px;
}
.dt-grp {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px 13px; min-width: 0;
}
.dt-grp-hd {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.dt-grp-hd .btn, .dt-grp-hd .sub { margin-left: auto; }
.dt-grp-hd .sub { font-weight: 400; font-size: 11.5px; }
.dt-kv {
  display: grid; grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px; align-items: baseline; padding: 3px 0;
}
.dt-kv > span { font-size: 11px; color: var(--muted); line-height: 1.6; }
.dt-kv > b {
  font-weight: 500; font-size: 12.5px; color: var(--text);
  word-break: break-all; line-height: 1.55;
}
@media (max-width: 980px) {
  .dt-info { grid-template-columns: 1fr; }
  .dt-band-m { border-right: 0; padding-right: 0; }
  .dt-band-r { justify-content: flex-start; text-align: left; }
}

/* ==========================================================================
 * v20261029f · 会计凭证页三件小事（业务点名，不阻塞）
 * ====================================================================== */

/* ① 分录金额输入框右对齐：表格里 .num 列是右对齐的，输入框却是左对齐，
      列头、合计行、输入框三者基线对不上，输错一位小数看不出来。
      顺手去掉 number 的上下小箭头 —— 它既占位又会让人误点改金额。 */
.tbl td.num input.input {
  text-align: right; font-variant-numeric: tabular-nums; padding-right: 8px;
}
.tbl td.num input[type="number"] { -moz-appearance: textfield; }
.tbl td.num input[type="number"]::-webkit-outer-spin-button,
.tbl td.num input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
/* 通用金额输入框（业务想在任何地方用就加 class="input amt"） */
.input.amt { text-align: right; font-variant-numeric: tabular-nums; }

/* ② 借贷平衡提示的状态色。这个通用基类是为凭证页补的（它用裸类，不靠工具栏），
      订单/采购工具栏那条 `.ord-toolbar .tb-hint` 已在 z156 删除。
      用法：<span class="tb-hint is-ok">借贷平衡 ✓</span> / is-bad 为不平。 */
.tb-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tb-hint.is-ok { color: var(--success); font-weight: 500; }
.tb-hint.is-bad { color: var(--danger); font-weight: 500; }

/* ③ 「借贷平衡 ✓」小胶囊（锦上添花，业务说不会依赖，不加 class 也无副作用） */
.acc-balance {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--success-weak); color: var(--success);
  border: 1px solid rgba(15, 157, 108, .22);
}
.acc-balance.is-bad {
  background: var(--danger-weak); color: var(--danger);
  border-color: rgba(220, 61, 67, .22);
}
.acc-balance b { font-weight: 600; }

/* ④ 科目表「（有下级，不记账）」：原来是 11.5px，夹在 12.5px 的科目名后面
      小到像渲染问题。定 12px —— 同一行的注解只比正文小半档，够区分又不费眼。 */
.tbl td .cell-sub { font-size: 12px; }

/* ==========================================================================
 * v20261030 · 登录页重设计（用户拍板：02 极简中置）
 *
 * 方向：登录页是「每天过两秒」的地方，不是给人欣赏的。
 * 原来的左墨蓝叙事栏（大标题 + 三条价值点）第一次有用，第 300 次就是噪声。
 * 现在把品牌压成一个标 + 一行字放在卡片上方，眼睛直奔两个输入框。
 *
 * 实现说明（重要）：DOM 一行没改，纯 CSS 达成 ——
 *   · .login-card 变成透明容器（不再是那张 880px 双栏大卡），
 *     白卡改由 .login-form 自己承担，于是 .login-aside（品牌）自然落在卡外上方；
 *   · 左栏的 h2「商贸批发管理系统」降成品牌下标语，p / ul 全部收起；
 *   · 底部落款复用左栏原有的 .meta，绝对定位到卡片下沿，不新增 DOM。
 * ====================================================================== */

/* ---- 背景：极淡网格纸，比原来两团彩色光晕安静 ---- */
.login-wrap {
  align-items: center; justify-content: center;
  padding: 40px 24px;
  background-color: #f7f8fa;
  background-image:
    linear-gradient(rgba(20, 30, 55, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 30, 55, .032) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---- 容器：透明；白卡由 .login-form 承担 ---- */
.login-card {
  display: block;                 /* 覆盖原来的 grid 双栏 */
  width: 100%; max-width: 392px;
  background: transparent; border: 0; border-radius: 0; overflow: visible;
  box-shadow: none;
  position: relative; padding-bottom: 44px;   /* 给底部落款留位 */
}

/* ---- 品牌头：logo + 名称 + 一行下标语 ---- */
.login-aside {
  position: static;               /* 让 .meta 能相对 .login-card 定位 */
  overflow: visible; padding: 0; margin-bottom: 22px;
  background: none; color: inherit; text-align: center;
}
.login-aside::before, .login-aside::after { display: none; }   /* 去掉深色纹理与光晕圈 */
.login-aside .brand {
  flex-direction: column; gap: 0; justify-content: center;
  font-size: 16px; font-weight: 600; letter-spacing: .3px; color: var(--text);
}
.login-aside .brand .logo {
  width: 42px; height: 42px; border-radius: 12px; margin: 0 auto 12px;
  background: var(--primary); border: 0; color: #fff;
  font-size: 19px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(36, 86, 217, .26);
}
/* h2「商贸批发管理系统」不再显示 —— 用户 2026-10-30：品牌标下面只留公司名就够了，
   系统名是进去以后才知道的事，登录页不用报菜名。之前把它降成下标语，现在直接收起。 */
.login-aside h2 { display: none; }
.login-aside p, .login-aside ul { display: none; }   /* 三条价值点收起 */
/* 底部落款：复用原有 .meta，绝对定位到卡片下沿 */
.login-aside .meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 11.5px; color: #a2abb9; text-align: center; line-height: 1.6;
}

/* ---- 备案号 / 公司落款预留位（V-26，素材待用户提供）----
   位置：卡片下沿再往下 22px（落在 .login-wrap 的 40px 内边距里，
   所以有没有这一行都不会把卡片顶上去 —— 现在不加也看不出空档）。
   业务侧插入 <div class="login-foot">…</div> 即可，样式全包。 */
.login-foot {
  position: absolute; left: 0; right: 0; bottom: -22px;
  text-align: center; font-size: 11.5px; color: #a2abb9; line-height: 1.7;
}
/* 备案号按规定要能点进工信部备案系统，链接做成「淡灰 + 悬停变深」，
   不加下划线 —— 落款是背景信息，不该抢登录按钮 */
.login-foot a { color: #a2abb9; text-decoration: none; }
.login-foot a:hover { color: var(--text-2); text-decoration: underline; }
.login-foot .sep { margin: 0 6px; color: #c6ccd6; }

/* ---- Logo 换成图片的预留（V-26）----
   现在是文字方块（<span class="logo">泓</span>）。换成图片时业务只需：
   把内容换成 <img src="…"> 并给外层加 class="logo logo-img" —— 蓝底、边框、
   投影会自动撤掉（图片自带底色时再套蓝底会脏），图片按 contain 居中不变形。 */
.login-aside .brand .logo img {
  width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 10px;
}
.login-aside .brand .logo.logo-img {
  background: transparent; border: 0; box-shadow: none;
}

/* ---- 白卡 ---- */
.login-form {
  padding: 32px 30px 26px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(16, 24, 40, .10);
}
.login-form h3 { font-size: 19px; letter-spacing: -.1px; }
.login-form .lead { font-size: 12.5px; color: var(--muted); margin: 6px 0 24px; line-height: 1.6; }
.login-form form { display: grid; gap: 15px; }
.login-form .field > label { font-size: 12.5px; }
.login-form .input { height: 44px; border-radius: 10px; }
/* viewLogin（非服务端登录分支）的按钮带 inline height:40px ——
   用 min-height 顶上去，不用 !important 也能赢过内联样式 */
.login-form .btn-primary {
  min-height: 44px; height: 44px; font-size: 14.5px; letter-spacing: .4px; border-radius: 10px;
}

/* ---- 记住账号（v107 已接，checkbox 在 form 内、form 自带 gap:15px，不再加 margin）---- */
.login-remember {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 0; font-size: 12px; color: var(--muted); cursor: pointer;
}
.login-remember input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }

@media (max-width: 520px) {
  .login-wrap { padding: 28px 16px; }
  .login-form { padding: 26px 22px 22px; }
}

/* ---- 侧栏品牌 logo 换图（V-26 配套：用户定了「登录页 + 后台侧栏/顶栏」全套换）----
   侧栏 logo 现在是 30px 渐变蓝方块里一个「贸」字（app.js ~2931 .sb-brand）。
   换成图片同样只加一个 class：把内容换成 <img> 并给外层加 class="logo logo-img"，
   渐变底与投影自动撤掉；图片 contain 居中，不拉伸。 */
.sb-brand .logo img {
  width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px;
}
.sb-brand .logo.logo-img {
  background: none; box-shadow: none; color: inherit;
}

/* ==========================================================================
 * v20261103 · 出库审批（022）· 财务待办
 *
 * 这一页是「队列」不是「台账」：财务每天点开一次，扫一眼有没有压单，处理完就走。
 * 结构只留三段 —— 页头（我要做什么）/ 三个数字（现在什么情况）/ 表（逐条处理）。
 * 不加筛选面板和列设置：待审通常不到 20 条，多一层入口只是给「处理」添岔口。
 * ====================================================================== */

/* ---- 三个数字：比默认卡片矮一档，因为它们是背景信息，主角是下面那张表 ---- */
.sap-kpis .kpi { padding: 13px 16px; }
.sap-kpis .kpi .val { font-size: 22px; }
.sap-kpis .kpi.is-late .val { color: var(--danger); }

/* ---- 表上方一行：左边说规模，右边放「只看压单」+ 刷新 ----
   用浅底 + 1px 线，把「这一块是表格的顶」交代清楚（与列表页 list-head 同一套语言） */
.sap-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.sap-bar .sap-sum { font-size: 12.5px; color: var(--text-2); }
.sap-bar .sap-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.sap-bar .sap-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---- 审批表 ---- */
.sap-table .sap-no { font-weight: 600; letter-spacing: -.1px; white-space: nowrap; }
.sap-table td .cell-sub { margin-top: 1px; }
/* 压单：行首一条 2px 红线 + 等待时长标红。整行变红会看不清内容，只标这两处 */
.sap-table tr.is-late > td:first-child { box-shadow: inset 2px 0 0 var(--danger); }
.sap-wait { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sap-wait.is-late { color: var(--danger); font-weight: 600; }
.sap-wait .cell-sub { font-weight: 400; }

/* ---- 空状态：.empty 里给了 strong + 一行解释 ----
   原来只有「没有待审批的出库申请」—— 财务看不出是「真没活」还是「页面坏了」。
   strong 是结论，cell-sub 是下一步该干什么。 */
.sap-table td .empty { padding: 44px 18px; }
.sap-table td .empty .cell-sub { display: block; margin-top: 6px; }

/* ==========================================================================
 * 驳回弹窗（替代 window.prompt）
 * 原生 prompt：不能多行、不能标重点、手机上会被键盘顶掉，而且看起来不像这个系统的一部分。
 * ====================================================================== */
/* 单据摘要：让财务确认「我驳的是这一张」，而不是凭记忆 */
.rj-sum {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.rj-kv span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.rj-kv b { font-size: 12.5px; font-weight: 600; word-break: break-all; }
/* 多行输入：.input 默认定高，textarea 必须放开 */
.modal textarea.input {
  height: auto; min-height: 76px; padding: 8px 10px;
  line-height: 1.6; resize: vertical;
}
/* 常用原因：点了只填字，不提交（财务多半还要补一句自己的话） */
.rj-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rj-chip {
  height: 26px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 12px; font-family: inherit; transition: .12s;
}
.rj-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }

/* ==========================================================================
 * 订单详情「出库审批」状态条
 *
 * 业务员打开单子的第一个问题不是金额，是「它卡在哪」。原来这条信息只体现在
 * 按钮变灰上（⏳ 等待财务审核），说不清谁在什么时候卡的、为什么驳回。
 * 用一条带子而不是大色块：它是状态，不是警报，天天看的东西不该天天刺激人。
 * ====================================================================== */
.sap-band {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 12px;
  border: 1px solid var(--border); border-left-width: 2px;
  border-radius: var(--radius); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2);
}
.sap-band .sap-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none; background: #b3bdcd;
}
.sap-band b { font-weight: 600; }
.sap-band .sap-txt .cell-sub { margin: 1px 0 0; display: block; }
.sap-band .sap-meta {
  margin-left: auto; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sap-band.is-pending {
  background: var(--warn-weak); border-color: #f0dcb4; border-left-color: var(--warn); color: #8a5a00;
}
.sap-band.is-pending .sap-dot { background: var(--warn); }
.sap-band.is-approved {
  background: var(--success-weak); border-color: rgba(15, 157, 108, .2);
  border-left-color: var(--success); color: #0b7a5c;
}
.sap-band.is-approved .sap-dot { background: var(--success); }
.sap-band.is-rejected {
  background: var(--danger-weak); border-color: rgba(220, 61, 67, .2);
  border-left-color: var(--danger); color: var(--danger);
}
.sap-band.is-rejected .sap-dot { background: var(--danger); }
.sap-band.is-rejected b { color: var(--danger); }
.sap-band.is-cancelled { color: var(--muted); }

/* 侧栏「出库审批」角标：待审数量是「有活」，用暖色而不是灰色计数 */
.fly-cnt.is-hot { background: var(--warn-weak); color: var(--warn-ink); font-weight: 600; }
.fly-item:hover .fly-cnt.is-hot { display: none; }

/* ---- 窄屏（P2）：先砍背景信息，保住「是谁的单、多少钱、怎么处理」 ---- */
@media (max-width: 1180px) {
  .sap-table .sap-c-who { display: none; }
}
@media (max-width: 1024px) {
  .sap-table .sap-c-qty { display: none; }
  .sap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
 * v20261104a · 转达三件（测试员 20261104）
 * ① 订单详情「出库申请历史」：财务驳回写的原因必须送到业务员眼前
 * ② 科目余额表「未审核凭证」提示：只算已审核是口径没错，但要交代清楚
 * ====================================================================== */

/* ---- 出库申请历史：紧贴 sap-band 的一个紧凑记录块 ----
   与状态条同一套语言（浅底 + 1px 线），行距收窄——它是流水记录，不是主角。
   显示条件由 JS 控制：≥2 次申请或当前被驳回才出现，单次申请状态条已说完。 */
.sap-hist {
  margin: 0 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.sap-hist-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.sap-hist-tt { font-size: 12.5px; font-weight: 600; }
.sap-hist-act { margin-left: auto; }
.sap-hist-bd { padding: 0; }
.sap-hist-row { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.sap-hist-row:last-child { border-bottom: none; }
.sap-hist-ln { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sap-hist-no { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sap-hist-main { min-width: 0; font-size: 12.5px; color: var(--text-2); }
.sap-hist-res { font-weight: 600; }
.sap-hist-res.is-approved { color: var(--success); }
.sap-hist-res.is-rejected { color: var(--danger); }
.sap-hist-res.is-pending { color: var(--warn); }
.sap-hist-res.is-cancelled { color: var(--muted); }
/* 驳回原因原文：浅红底整行呈现，不截断（验收点）——财务写的就是给业务员看的指令 */
.sap-hist-why {
  margin-top: 5px; padding: 6px 10px; border-radius: 6px;
  background: var(--danger-weak); color: var(--danger);
  font-size: 12.5px; line-height: 1.7; word-break: break-all;
}
.sap-hist-bd > .cell-sub { display: block; padding: 10px 12px; }

/* ---- 余额表「未审核凭证」提示：琥珀胶囊，排在期间选择旁 ----
   有事才出现（N=0 隐藏）；措辞说清「未计入 + 去哪审」，不给"凭证丢了"的错觉 */
.acc-draft-note {
  display: inline-flex; align-items: center; gap: 2px;
  height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--warn-weak); border: 1px solid var(--warn);
  color: var(--warn-ink); font-size: 12px; white-space: nowrap;
}
.acc-draft-note b { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- 窄屏：历史块换行收纳；提示胶囊允许收缩换行 ---- */
@media (max-width: 1024px) {
  .sap-hist-act { margin-left: 0; }
  .acc-draft-note { white-space: normal; height: auto; line-height: 1.6; padding: 3px 11px; }
}

/* 表头拖拽排序：只做"落点在哪一侧"的提示，不改变任何列的布局 */
.page table.tbl thead th.cs-dragging { opacity: .55; }
.page table.tbl thead th.cs-drop-before { box-shadow: inset 2px 0 0 var(--primary); }
.page table.tbl thead th.cs-drop-after { box-shadow: inset -2px 0 0 var(--primary); }
/* 列设置弹窗里拖行排序：行是上下排列，指示线画在上/下边 */
.cs-cols .cs-row.cs-dragging { opacity: .5; }
.cs-cols .cs-row.cs-drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.cs-cols .cs-row.cs-drop-after { box-shadow: inset 0 -2px 0 var(--primary); }
.cs-cols .cs-grip:active { cursor: grabbing; }

/* ---------- 列表控制弹窗（cs-*）· 2026-11-05 设计换皮（D2）+ 上下结构改版 ----------
   后端已落结构（880 弹窗 / 四页签 / 立即保存 + 完成），这版只做皮。
   11-05 二次反馈：右侧 320px 预览放不下真实列数（20 列只见 5 列，右边全被裁掉）
   → 改上下结构：设置在上、预览在下占满弹窗宽度，横向滚动可见全部列；
     弹窗同步加宽到 1040px。
   · 间距走 4/8/12/16 阶梯；页签 40px 下划线式；行 44px；控件高 28（表格内档）
   · 焦点环 / 骨架 / 空态统一走 D1 组件层（见文件末尾「D1 组件层」段） */
.cs-modal { border-radius: 10px; box-shadow: var(--shadow-modal); max-height: 700px; }
.cs-modal .modal-hd { min-height: 48px; padding: 8px 20px; }
/* ✕ 点击区 ≥32×32（§五）：字号维持 20px，用 padding 撑大热区，不改视觉大小 */
.cs-modal .modal-hd .x { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.cs-modal .modal-ft { min-height: 56px; padding: 12px 20px; }
/* 底部按钮高度统一 32（§6-6 高度差 ≤4）：btn-sm 28 → 32，btn-primary 34 → 32 */
.cs-modal .modal-ft .btn { height: 32px; min-height: 32px; padding-top: 0; padding-bottom: 0; }
.cs-modal .modal-bd { padding: 0; overflow: hidden; }

/* 上下两段：设置区在上（内部滚动），预览区在下（全宽 + 横向滚动）。
   列多时上下各自滚，页签 / 预览脚注 / 底部操作条都钉住不动 */
.cs-bd { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.cs-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 16px 12px; }
.cs-prev {
  flex: none; min-height: 0;
  border-top: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; overflow: hidden;
}
.cs-prev-hd {
  flex: none; display: flex; align-items: baseline; gap: 8px;
  padding: 10px 16px 6px; font-size: 13px; font-weight: 600; color: var(--text);
}
.cs-prev-hd .cs-prev-cap { font-size: 11px; font-weight: 400; color: var(--muted); }
/* 预览区全宽之后横向基本放得下，纵向留个上限别把设置区挤没；超了内部滚 */
.cs-prev-bd { padding: 0 16px; overflow: auto; max-height: 216px; scrollbar-width: thin; }
/* 滚动条要看得见：预览列多时"右边还有列"全靠它交代，隐藏式滚动条等于裁切 */
.cs-prev-bd::-webkit-scrollbar { height: 8px; width: 8px; }
.cs-prev-bd::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.cs-prev-bd::-webkit-scrollbar-track { background: transparent; }
.cs-prev-ft { flex: none; padding: 6px 16px 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* 页签：40px 高、下划线式（活跃 = 主色下划线 + 主色文字） */
.cs-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 -16px 12px; padding: 0 16px; }
.cs-tab {
  border: 0; background: transparent; height: 40px; padding: 0 16px; cursor: pointer;
  font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.cs-tab:hover { color: var(--text); }
.cs-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.cs-note { font-size: 12px; color: var(--text-2); margin: 0 0 8px; line-height: 1.6; }

/* 列方案（z62）：方案下拉 + 另存为 / 改名 / 删除。
   放在页签上方而不是藏进「选项」里 —— 换方案是这一屏的第一件事，
   藏起来的结果是没人知道有多套方案（也就没人会去建）。 */
.cs-scheme {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.cs-scheme-hd { font-size: 12px; color: var(--text-2); }
.cs-scheme-sel { max-width: 220px; height: 30px; }
.cs-scheme .cs-note { margin: 0; }
.cs-scheme .btn[disabled] { opacity: .45; cursor: not-allowed; }

.cs-cols { border-top: 1px solid var(--border); }
.cs-row {
  /* 上下结构后弹窗全宽：列名封顶，别把「显示/对齐/分组」控件拉到一屏远 */
  display: grid; grid-template-columns: 22px minmax(90px, 240px) 84px 108px 116px 56px;
  align-items: center; gap: 8px; min-height: 44px; padding: 4px 4px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.cs-row:hover { background: var(--primary-weak); }
.cs-grip { cursor: grab; text-align: center; opacity: .35; user-select: none; }
.cs-row:hover .cs-grip { opacity: .7; }
.cs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-name.fixed { opacity: .55; }
.cs-chk { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
/* 批 6 ④ 之后补：没有金额权限的列在面板里要「置灰 + **写明原因**」。
   原因「无金额权限」比「显示」两个字宽得多，塞在 84px 的格子里会被右边的「对齐」
   下拉压住 —— 界面上只读得到「无金额」，等于原因没写出来（2026-11-21 真机）。
   所以锁住的这一行单独给宽一点的格子，理由也单独做成小胶囊。 */
.cs-row.cs-locked { grid-template-columns: 22px minmax(90px, 168px) 158px 108px 116px 56px; }
.cs-lock {
  font-size: 11px; line-height: 17px; padding: 0 5px; border-radius: 6px;
  background: rgba(120, 128, 150, .12); color: var(--text-2); white-space: nowrap;
}
.cs-chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.cs-al, .cs-grp { height: 28px; font-size: 12px; }
.cs-ops { display: flex; gap: 4px; }
.cs-mini {
  width: 28px; height: 28px; line-height: 1; border: 1px solid var(--border);
  border-radius: 6px; background: transparent; cursor: pointer; color: var(--text-2);
}
.cs-mini:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
/* 固定列（勾选/单号）钉在最前，不参与排序：按钮置灰而不是点了没反应 */
.cs-mini:disabled { opacity: .3; cursor: not-allowed; }
.cs-mini:disabled:hover { border-color: var(--border); color: var(--text-2); background: transparent; }
.cs-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cs-seg label { padding: 6px 14px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.cs-seg label + label { border-left: 1px solid var(--border); }
.cs-seg label.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.cs-seg input { display: none; }
.cs-opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.cs-opt .cs-note { margin: 2px 0 0; }
.cs-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: 0 0 38px; }
.cs-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cs-switch i { display: block; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.cs-switch i::after {
  content: ''; display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); transform: translate(2px, 2px); transition: transform .15s;
  box-shadow: var(--shadow-ctl);
}
.cs-switch input:checked + i { background: var(--primary); }
.cs-switch input:checked + i::after { transform: translate(18px, 2px); }
.cs-switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.cs-ft { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cs-ft-main { display: flex; gap: 8px; margin-left: auto; }
.cs-ft-dirty { font-size: 12px; color: var(--warn); white-space: nowrap; }

/* ---- 预览迷你表：列结构是真的，数据是假的 ---- */
.cs-pv {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  font-size: 12px; table-layout: auto;
}
.cs-pv th, .cs-pv td {
  padding: 6px 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis;
}
.cs-pv th { background: var(--surface-2); font-weight: 600; color: var(--text-2); }
.cs-pv td { color: var(--text-2); }
.cs-pv tbody tr:last-child td { border-bottom: 0; }
.cs-pv .al-l { text-align: left; }
.cs-pv .al-c { text-align: center; }
.cs-pv .al-r { text-align: right; }
/* 冻结区：前 N 列浅主色底 + 内侧 1px 分界，一眼看出"这块被钉住" */
.cs-pv th.frz, .cs-pv td.frz { background: var(--primary-weak); }
.cs-pv th.frz:not(:last-child), .cs-pv td.frz:not(:last-child) { box-shadow: inset -1px 0 0 var(--primary-weak); }
.cs-pv .pv-num { font-variant-numeric: tabular-nums; }
.cs-pv tfoot td {
  font-weight: 600; color: var(--text); background: var(--surface-2);
  border-top: 1px solid var(--border-strong); border-bottom: 0;
}
.cs-pv tfoot .pv-sum-cap { color: var(--muted); font-weight: 500; }
/* 分组表头：上层分组格浅主色底 + 居中（与叶子表头明确分层） */
.cs-pv .cs-grp-tr th.cs-grp-th {
  background: var(--primary-weak); color: var(--primary);
  text-align: center; border-bottom: 1px solid var(--border);
}
.cs-pv .cs-grp-void { display: none; }
.cs-pv-skel { padding: 4px 0; }

/* ---- 窄屏：弹窗全屏化；预览区上限跟着屏高走 ---- */
@media (max-width: 768px) {
  .cs-prev-bd { max-height: 26vh; }
  .cs-modal { max-width: 100vw; width: 100%; max-height: 92vh; }
  .cs-modal .modal-ft { flex-wrap: wrap; }
}


/* ==========================================================================
 * D1 组件层（2026-11-05 设计交付 · 面板重做第一批零件）
 *
 * 目的：全系统共用一套最小组件语义，替代散落的内联样式。
 * 规则（《UI-HANDOFF-PANELS》§5）：
 *   间距阶梯 4/8/12/16/24/32（禁止 5/7/10/15 随手值）
 *   字号 11 辅助 / 12 副文本 / 13 正文 / 14 强调 / 16 卡片标题
 *   圆角 控件 6 / 卡片 8 / 弹窗 10 / 徽章 999
 *   控件高 32（舒适 36）；表格内 28；点击区 ≥ 32×32
 *   焦点 outline: 2px solid var(--primary); offset 2px —— 不做 outline:none
 * 颜色一律走 CSS 变量（契约 R-04 棘轮拦内联色值）。
 * ====================================================================== */

/* ---- ① 焦点环：键盘可达性的底线。只对 :focus-visible 生效，
   鼠标点击不出环，不干扰既有 :focus 表单样式 ---- */
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- ② 骨架屏：数据未回来时占位，替代「整块闪白」。
   只给形状不给字：高度即内容高度，宽度按内容长短错开 ---- */
.skel {
  position: relative; overflow: hidden;
  background: var(--skel-bg); border-radius: var(--radius-ctl);
}
.skel::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-shine), transparent);
  animation: skel-sweep 1.2s ease-in-out infinite;
}
@keyframes skel-sweep { to { transform: translateX(100%); } }
.skel--row { height: 32px; margin: 8px 0; }
.skel--row:nth-child(2n) { width: 86%; }
.skel--row:nth-child(3) { width: 64%; }
.skel--inline { display: inline-block; height: 12px; width: 120px; vertical-align: middle; }

/* ---- ③ 空状态：一句话说明 + 一个可点的下一步。
   用于弹窗 / 侧栏内的局部空态（全局空态替换是 D5，别提前铺开） ---- */
.cs-empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; padding: 32px 16px; color: var(--text-2);
}
.cs-empty-ic {
  width: 40px; height: 40px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--muted); font-size: 16px;
}
.cs-empty b { font-size: 13px; font-weight: 600; color: var(--text); }
.cs-empty span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.cs-empty .btn { margin-top: 8px; }

/* ---- ④ 组件 token：给后续 D3/D5 用的统一出口（只新增，不改既有值） ---- */
:root {
  --radius-ctl: 4px;      /* 控件圆角 */
  --radius-modal: 8px;   /* 弹窗圆角（.cs-modal 已按此值落地） */
  --shadow-modal: 0 12px 32px rgba(0, 0, 0, .18);
  --shadow-ctl: 0 1px 2px rgba(0, 0, 0, .15);   /* 小控件投影（开关旋钮等） */
  --ctl-h: 32px;          /* 标准控件高（舒适 36，表格内 28 见 .cs-al/.cs-grp） */
  --skel-bg: #e9e9e9;
  --skel-shine: rgba(255, 255, 255, .72);          /* 骨架扫光高光 */
}

/* 表格设置页签头部：左说明 + 右冻结步进器，同一基线 */
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.cs-fz { width: 60px; height: 28px; font-size: 12px; margin: 0 4px; }

/* ==========================================================================
 * v20261105j · 设计第三轮（2026-11-05 用户反馈 + D3-D5）
 *   ① 列表控制预览改上下结构（见上方 .cs-* 段，随改）
 *   ② 订单列表格子风（.tbl-grid，见 .tbl-compact 段随改）
 *   ③-D3 统一列设置三栏（本段 .ucs-*）
 * ====================================================================== */

/* ---- D3 · 统一列设置三栏：单据树 220 / 列清单自适应 / 预览+模板 300 ----
   与列表控制弹窗同一套语言：1px 线分层、下划线页签、浅底悬停。
   右栏预览复用 .cs-pv 迷你表（吃 csDraft 草稿，改完即变）。 */
.ucs-wrap { display: flex; align-items: stretch; padding: 0; min-height: 480px; }
.ucs-tree {
  flex: 0 0 220px; width: 220px; padding: 12px 8px 16px;
  border-right: 1px solid var(--border); background: var(--surface-2);
  max-height: 72vh; overflow: auto;
}
.ucs-grp { margin-bottom: 12px; }
.ucs-grp-hd {
  font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: .04em; padding: 4px 12px 6px;
}
.ucs-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: transparent; font-family: inherit;
  font-size: 13px; color: var(--text-2);
  padding: 8px 12px; border-radius: var(--radius-ctl);
}
.ucs-item:hover { background: var(--primary-weak); color: var(--text); }
.ucs-item.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }

.ucs-main { flex: 1 1 auto; min-width: 0; padding: 14px 16px 16px; max-height: 72vh; overflow: auto; }
/* 「显示」这类短标签在窄列里被折成竖排（显/示 两行）——列清单文字一律不折行 */
.ucs-main .tbl th, .ucs-main .tbl td label { white-space: nowrap; }
.ucs-tkbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ucs-tabs {
  display: flex; gap: 4px; align-items: center;
  border-bottom: 1px solid var(--border); margin: 0 0 12px; padding: 0;
}
.ucs-tab {
  border: 0; background: transparent; height: 40px; padding: 0 14px; cursor: pointer;
  font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-family: inherit;
}
.ucs-tab:hover { color: var(--text); }
.ucs-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ucs-sp { flex: 1; }

.ucs-side {
  flex: 0 0 300px; width: 300px; padding: 14px 16px 16px;
  border-left: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 12px;
  max-height: 72vh; overflow: auto;
}
.ucs-side-bd { min-width: 0; }
/* 预览表在 300px 栏里横滚：滚动条可见（同列表控制弹窗的交代方式） */
.ucs-side-bd .cs-prev-bd { padding: 0; }
.ucs-tpl { border-top: 1px solid var(--border); padding-top: 12px; }
.ucs-tpl-hd { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.ucs-tpl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.ucs-tpl-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.ucs-tpl-btns { display: flex; gap: 8px; margin-top: 10px; }

@media (max-width: 1080px) {
  .ucs-side { flex-basis: 260px; width: 260px; }
}
@media (max-width: 900px) {
  .ucs-wrap { flex-direction: column; }
  .ucs-tree { flex: none; width: auto; border-right: 0; border-bottom: 1px solid var(--border); max-height: 32vh; }
  .ucs-main { max-height: none; overflow: visible; }
  .ucs-side { flex: none; width: auto; border-left: 0; border-top: 1px solid var(--border); max-height: none; }
}

/* D5 · 表格内富空态 / 加载骨架：外层 td 自带内边距，收一档 */
.tbl td .cs-empty { padding: 26px 16px; }
.skel-stack { padding: 18px 16px; }
.skel-stack .skel--row { margin: 10px 0; }


/* ======================= 对账版（20261105n）：体检 / 对账 / 待办铃铛 ======================= */

/* 体检结果 */
.hc-banner {
  display: flex; flex-direction: column; gap: 4px;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.hc-banner b { font-size: 14px; }
.hc-banner span { font-size: 12px; color: var(--text-2); }
.hc-banner.ok { background: var(--primary-weak); border-color: var(--primary); }
.hc-banner.ok b { color: var(--primary); }
.hc-banner.bad { background: var(--danger-weak); border-color: var(--danger); }
.hc-banner.bad b { color: var(--danger-ink); }
.hc-banner.warn { background: #fff6e0; border-color: #e0a52e; }
.hc-banner.warn b { color: #a06b00; }
.hc-grp { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.hc-grp.bad { border-color: var(--danger); }
.hc-grp.warn { border-color: #e0a52e; }
.hc-grp-hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); }
.hc-grp-hd b { font-size: 13px; }
.hc-cnt { margin-left: auto; font-size: 12px; color: var(--text-2); }
.hc-grp.bad .hc-cnt { color: var(--danger-ink); font-weight: 600; }
.hc-grp.warn .hc-cnt { color: #a06b00; font-weight: 600; }
.hc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.hc-grp.bad .hc-dot { background: var(--danger); }
.hc-grp.warn .hc-dot { background: #e0a52e; }
.hc-note { padding: 8px 14px; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--border); line-height: 1.6; }

/* 对账表：差额高亮 */
.page table.tbl td.num.bad { color: var(--danger-ink); font-weight: 700; }
.page table.tbl td.num.bad-warn { color: #a06b00; }

/* 顶栏待办铃铛 */
.todo-wrap { position: relative; display: inline-flex; }
.todo-bell {
  position: relative; border: 1px solid var(--border); background: transparent;
  border-radius: 8px; height: 32px; min-width: 40px; cursor: pointer;
  font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.todo-bell:hover { border-color: var(--primary); background: var(--primary-weak); }
.todo-bell b {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  font-style: normal;
}
.todo-pop {
  position: absolute; top: 40px; right: 0; z-index: 60; width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px;
}
.todo-pop-hd { font-size: 12px; color: var(--text-2); padding: 6px 10px 4px; font-weight: 600; }
.todo-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  border: 0; background: transparent; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text); font-family: inherit;
}
.todo-item:hover { background: var(--primary-weak); }
.todo-item b { color: var(--danger); font-size: 12px; }

/* ==========================================================================
 * v20261105s · D2 详情页两大模块（2026-11-06 改方案 B：左单卡 3 列，见下方 .dt2-b 段）
 *   · dt2 左右布局：左信息卡（单据 + 往来字段，方案 B 下为单卡 3 列）；右款项卡
 *     flex stretch 与左侧等高（左高右矮时右侧卡身撑满、内容靠上）
 *   · 字号整体收小一档（用户反馈）：kv 值 12px、款项主数字 18px
 *   · 原 dt-band 进度带在详情页取消（列表进度列不动）；dt-* 旧样式保留未删
 * ====================================================================== */
.dt2 {
  display: flex; align-items: stretch; gap: 14px;
  margin-bottom: 14px; min-width: 0;
}
.dt2-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.dt2-sec {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px 13px; min-width: 0;
}
.dt2-sec-hd {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.dt2-sec-hd .btn, .dt2-sec-hd .sub { margin-left: auto; }
.dt2-sec-hd .sub { font-weight: 400; font-size: 11.5px; }
/* 双列 kv：一格 76px 标签 + 自适应值；窄屏退单列 */
.dt2-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}
.dt2-grid .dt-kv > b { font-size: 12px; }

/* ==========================================================================
 * v20261106a · D2 改方案 B（用户 2026-11-06 改选，取代 s 版 B/C 融合）
 *   · 左信息卡**一张**：单据 + 往来字段共用 3 列网格混排（B 方案原稿布局）
 *   · 长文本（地址/备注/注释）跨 2 列，避免一句话压成四五行
 *   · 右款项竖卡仍与左侧等高（用户上一条明确要求）；≤1280 退 2 列，≤980 单列
 * ====================================================================== */
.dt2-b .dt2-sec-hd .sub { margin-left: 6px; margin-right: auto; }
/* 左卡只有一节，默认不会被 flex 拉高（右侧 8 行金额比左侧 6 行字段高）→ 底边参差。
   flex:1 让信息卡跟着行高走，两张卡底边齐平（用户上一条：右边跟左边一样高）。 */
.dt2-b .dt2-main > .dt2-sec { flex: 1 1 auto; }
.dt2-b .dt2-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* 行距 8→6：详情页字段行密一点（2026-11-06 用户「尽量压缩一下行高」），
     标签 11px / 值 12px 本身不变，只收行间空白 */
  column-gap: 24px; row-gap: 6px;
}
.dt2-b .dt2-grid > .span2 { grid-column: span 2; }
.dt2-b .dt2-grid > .span3 { grid-column: 1 / -1; }
@media (max-width: 1280px) {
  .dt2-b .dt2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .dt2-b .dt2-grid { grid-template-columns: 1fr; }
  .dt2-b .dt2-grid > .span2, .dt2-b .dt2-grid > .span3 { grid-column: auto; }
}

/* ==========================================================================
 * v20261106b · 新建/编辑单据头 = 详情页同一套格式（用户：直接照搬详情页）
 *   · 同一张信息卡、同一个 3 列网格；只是右侧「值」换成控件
 *   · 行高/字号贴着 kv：标签 11px 灰、控件 28px / 12px，跨列规则与 span2/span3 一致
 *   · 微调：客户/供应商跨 2 列（要能看清长名字），地址/备注整行
 * ====================================================================== */
.dt2-form .dt2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dt-fv {
  display: grid; grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px; align-items: center; padding: 3px 0; min-width: 0;
}
.dt-fv > label { font-size: 11px; color: var(--muted); line-height: 1.5; }
.dt-fv > .fv { min-width: 0; }
.dt-fv.span2 { grid-column: span 2; }
.dt-fv.span3 { grid-column: 1 / -1; }
.dt2-form .input { height: 28px; font-size: 12px; padding: 0 8px; }
.dt2-form textarea.input { height: auto; padding: 5px 8px; }
.dt2-form select.input { padding: 0 6px; }
.dt2-form .combo, .dt2-form .addr-wrap { min-width: 0; }
.dt2-form .addr-wrap .addr-row .input { min-width: 0; }
.dt2-form .dt-fv.topped { align-items: start; }
.dt2-form .dt-fv.topped > label { padding-top: 5px; }
@media (max-width: 1280px) {
  .dt2-form .dt2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .dt2-form .dt2-grid { grid-template-columns: 1fr; }
  .dt2-form .dt-fv.span2, .dt2-form .dt-fv.span3 { grid-column: auto; }
}

/* 款项卡：与左侧等高的竖卡。主数字 + 若干行「标签左 / 数字右」
   2026-11-06 用户：右边太窄、左边太宽 → 300px 定宽改比例（33%，340~440 自适应），
   本单金额在上、客户/供应商往来余额贴底（分隔线 + margin-top:auto）。 */
.dt2-pay {
  flex: 0 0 33%; width: 33%; min-width: 340px; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px 13px;
  display: flex; flex-direction: column;
}
.dt2-pay-hd {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.dt2-pay-main { padding: 8px 0 12px; border-bottom: 1px solid var(--border); }
.dt2-pay-main > span { display: block; font-size: 11px; color: var(--muted); }
.dt2-pay-main > b {
  display: block; font-size: 18px; font-weight: 600; color: var(--primary);
  font-variant-numeric: tabular-nums; letter-spacing: -.2px; line-height: 1.4;
  margin: 2px 0 1px; word-break: break-all;
}
.dt2-pay-main > i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.dt2-pay-rows { padding-top: 4px; display: flex; flex-direction: column; flex: 1 1 auto; }
/* 本单 / 往来余额的分界：margin-top:auto 把「这个客户/供应商」那一组压到卡片底部，
   右卡与左卡等高时不会被撑出一片空白（内容超了 auto 自动归零）。 */
.dt2-pay-sep { height: 1px; background: var(--border); margin: 10px 0 3px; }
.dt2-pay-rows > .dt2-pay-sep:first-of-type { margin-top: auto; }
.dt2-pay-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 5px 0 0;
}
.dt2-pay-row > span { font-size: 11px; color: var(--muted); }
.dt2-pay-row > b {
  font-size: 12px; font-weight: 500; color: var(--text);
  font-variant-numeric: tabular-nums; word-break: break-all; text-align: right;
}
.dt2-pay-row.is-warn > b { color: var(--warn); }

/* 再窄一档就别按比例了：33% 会把左卡 2 列挤到 190px（标签 76px 后放不下金额），
   改成固定 320px，余额数字仍能完整显示。 */
@media (max-width: 1180px) {
  .dt2-pay { flex: 0 0 320px; width: 320px; min-width: 0; }
}

@media (max-width: 980px) {
  .dt2 { flex-direction: column; }
  .dt2-pay { flex: none; width: auto; }
  .dt2-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
 * v20261106g · 出库单右卡「单据影像」（送货单 / 签收单）
 *   接口未接，先本地预览：两列窄格，各一个 ＋ 格 + 缩略图（可删）
 *   移动端司机拍照上传的落点，就是这个 ＋ 格
 * ====================================================================== */
.pay-up { margin-top: 6px; }
.pay-up-hd { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--muted); padding-bottom: 5px; }
.pay-up-hd .up-hint { margin-left: auto; font-size: 10.5px; color: var(--muted); opacity: .85; }
.up-cols { display: flex; gap: 8px; }
.up-col { flex: 1 1 0; min-width: 0; }
.up-col-hd { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.up-n { margin-left: auto; font-size: 10px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 0 5px; }
.up-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.up-th { position: relative; width: 44px; height: 44px; border-radius: 5px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.up-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-del { position: absolute; top: 0; right: 0; width: 15px; height: 15px; line-height: 13px; border: 0; padding: 0;
  background: rgba(20, 28, 42, .66); color: #fff; font-size: 11px; cursor: pointer; border-bottom-left-radius: 4px; }
.up-add { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px dashed var(--border-strong); border-radius: 5px; color: var(--muted); font-size: 16px;
  cursor: pointer; background: #fbfcfe; }
.up-add:hover { border-color: var(--primary); color: var(--primary); background: #f5f8ff; }
.up-add input { display: none; }

/* 详情页只读明细表：行高再压一档（2026-11-06 用户「尽量压缩一下行高」）
   只挂 .tbl-tight（配送记录 / 订单/采购/出库的明细），编辑态表格不加 —— 那里格里是输入框，要留手。 */
.tbl.tbl-grid.tbl-tight th { padding: 4px 8px; }
.tbl.tbl-grid.tbl-tight td { padding: 2px 8px; line-height: 1.3; }
.tbl.tbl-grid.tbl-tight td .cell-sub { margin-top: 0; line-height: 1.15; }
.tbl.tbl-grid.tbl-tight tfoot td { padding: 4px 8px; }
.tbl.tbl-grid.tbl-tight tbody > tr:hover > td { background: var(--primary-weak); }

/* 2026-11-12（PO 第 5 条 / 方案 A）：仓库订单信息 + 右侧作业抽屉。
   抽屉放在文档流里（不是 fixed/absolute）—— 列表仍然可滚可点，能连着处理下一单；
   sticky 只是让它在长列表里跟着视野走。 */
.wh-body.is-open { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; align-items: start; }
.wh-main { min-width: 0; }
.dw { background: var(--card, #fff); border: 0.5px solid var(--line, var(--border)); border-radius: 12px;
  padding: 14px; position: sticky; top: 12px; }
.dw-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.dw-hd .x { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.dw-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.dw-step { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--surface-2); color: #8a94a6; white-space: nowrap; }
.dw-step.done { background: var(--primary-weak); color: var(--primary); }
.dw-step.cur { background: var(--primary); color: #fff; font-weight: 500; }
.dw-sum { font-size: 12px; color: var(--muted); padding: 7px 0 10px;
  border-bottom: 0.5px solid var(--line, var(--border)); margin-bottom: 10px; }
.dw-field { margin-bottom: 9px; }
.dw-field label, .dw-field2 label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.dw-field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 9px; }
.dw-ft { display: flex; gap: 8px; margin-top: 6px; }
.dw-remark { margin-top: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 6px;
  font-size: 12px; color: var(--muted); }
tr.row-open { cursor: pointer; }
tr.row-open:hover td { background: var(--surface-2); }
@media (max-width: 1280px) {
  .wh-body.is-open { grid-template-columns: 1fr; }
  .dw { position: static; }
}

/* ==========================================================================
 * 2026-11-12（z35）· 仓库作业看板与订单信息列表的密度/形态调整
 * PO 六条反馈：② 三列一个框架 + 50 张基准的高度与行高；③ 顶部再压缩；
 *              ④ 列表去操作列改工具栏 + 列设置；⑥ 看板点一行出**浮窗**面板。
 * ========================================================================== */

/* ---- ⑥ 看板上的作业面板：浮窗（列表页仍是固定右栏） ----
   为什么必须分两种：看板是七列横向布局，**没有右栏可占** —— 硬塞一个固定栏
   会把七列挤窄，而七列正是这一页的全部价值；列表页相反，它本来就是"一行一行
   往下核对"，面板固定开在右边才能边看边点下一行。同一份内容，两种挂载方式。 */
.dw-scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .28); z-index: 60; }
.dw-float {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  z-index: 61; border-radius: 0; border: 0; border-left: 1px solid var(--line, var(--border));
  overflow-y: auto; padding: 14px 16px;
  box-shadow: -10px 0 28px rgba(16, 24, 40, .14);
  animation: dwIn .16s ease-out;
}
@keyframes dwIn { from { transform: translateX(24px); opacity: .5 } to { transform: none; opacity: 1 } }

/* ---- ② 仓库内部三列一个框架 ----
   高度按 **50 张**基准：行高压到 ~36px，一列可见 13 行左右；50 张分三列 ≈ 17 行/列，
   框内滚动 —— 页面高度不再随单量增长（这是之前最难受的地方：单一多，下面的
   「送货安排」直接被推到两屏之外）。 */
.kb-frame {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: 8px 10px 10px;
}
.kb-frame > .kb-sec-hd { padding: 2px 2px 8px; margin: 0; }
.kb-frame .kanban { gap: 10px; }
.kb-frame .kb-col { background: var(--surface); }
.kb-frame .kb-body { max-height: 470px; min-height: 240px; }
.kb-frame .kb-hd { padding: 7px 10px; }

/* ---- ② 行高压缩（两处区块共用，保持同一套密度）---- */
.kb-row { padding: 4px 10px; }
.kb-row .kb-r-main { gap: 6px; }
.kb-row .kb-r-sub { margin-top: 1px; font-size: 11px; gap: 2px 6px; }
.kb-row .kb-r-ops .btn { height: 22px; padding: 0 7px; font-size: 11.5px; }

/* ---- 卡片整行可点（点开浮窗）---- */
.kb-row.row-open { cursor: pointer; }
.kb-row.row-open:hover { background: var(--surface-2); }

/* ---- ③ 顶部再压缩：只作用于看板这一页的卡片内边距。
   z38 起 KPI 卡删了（第一大块 = 纯文字计数条），kpi-7 的规则跟着删。 ---- */
.kb-top { padding: 10px 12px; }

/* ---- ④ 仓库订单信息：工具栏紧贴表格（与其它列表同一条间距）---- */
.wh-main > .doc-toolbar { margin: 0 0 8px; }
.wh-main .tbl-wrap { margin-top: 0; }


/* ==========================================================================
 * 2026-11-12（z37 建 / z38 沿用）· 模块卡片 kb-car + 状态圆点
 *   kb-cars / kb-car 原是「按车分组」的样式；z38 起由送货安排的
 *   「按司机 / 按车辆」模式使用（whCrewListHtml），按天框架见下一节。
 * ========================================================================== */

/* 按车分组：块自适应铺满、块内滚动 —— 一个块里 10 张也不会把页面顶长 */
.kb-cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.kb-car { border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.kb-car-hd { display: flex; align-items: baseline; gap: 7px; padding: 6px 10px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); }
.kb-car-hd .t { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.kb-car-hd .c { font-size: 11.5px; color: var(--text-2); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.kb-car-hd .n { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.kb-car-bd { max-height: 232px; overflow-y: auto; }
.kb-car.is-late { border-color: #f0cccc; }
.kb-car.is-late .kb-car-hd { background: var(--danger-weak); }
.kb-car.is-late .kb-car-hd .t { color: var(--danger); }

/* ==========================================================================
 * 2026-11-12（z38）· 配送时间：每天一个框架，框架内分上下午
 * 数据看板第一大块与作业看板「送货安排·按天」共用。列数写死 5（PO：就 5 天），
 * 不随屏宽伸缩 —— 列数是页面结构，不是屏宽的函数。
 * ========================================================================== */
.wh-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.wh-day { border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  min-width: 0; display: flex; flex-direction: column; }
.wh-day.is-late { border-color: #f0cccc; }
.wh-day-hd { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px 10px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--border); }
.wh-day.is-late .wh-day-hd { color: var(--danger); background: var(--danger-weak); }
.wh-day-hd .kb-cnt { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.wh-slot { padding: 3px 5px 5px; min-width: 0; }
.wh-slot + .wh-slot { border-top: 1px dashed var(--border); }
.wh-slot-lbl { display: flex; align-items: center; gap: 5px; font-size: 11px;
  color: var(--muted); padding: 2px 5px; }
.wh-slot-lbl b { color: var(--text); font-weight: 600; }
.wh-day .kb-row { padding: 3px 8px; }
.wh-day .kb-empty { padding: 2px 8px 4px; }

/* 送货安排框架头右侧的模式切换（按天 / 按司机 / 按车辆） */
.kb-sec-ops { float: right; display: flex; gap: 5px; }
.kb-sec-ops .btn { height: 22px; padding: 0 9px; font-size: 11.5px; }

/* 第四大块「待安排配送」：一个框架 + 三列行网格。行就是 whCardHtml（行上带「安排配送」），
   等最久的排最前（创建时间正序），一眼看到最先要处理的。 */
.wh-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px;
  align-content: start; max-height: 470px; overflow-y: auto; }

/* 行内项目 / 备注（PO：仓库内部行内要有项目名 / 订单备注）：长文本截断，全名放 title */
.kb-r-proj, .kb-r-rem { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-r-rem { color: var(--text-2); }

/* 第一大块计数条：一条文字行（~20px），数字与下方框架一一对应；逾期整段标红 */
.wh-strip { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.wh-strip span { white-space: nowrap; }

/* 状态圆点：四档四色。行里不写状态名（一行要放下单号 + 客户 + 件数），
   但每个点都有 title —— 颜色不能是唯一的信息载体（色弱 / 打印 / 截图给人看）。 */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.d-amber { background: var(--warn); }
.dot.d-blue { background: var(--primary); }
.dot.d-purple { background: var(--purple); }
.dot.d-green { background: var(--success); }
.dot.d-gray { background: var(--border-strong); }
.kb-r-main .dot { margin-right: 1px; }

/* 只读形态（数据看板）：同一种行，但没有「可以点」的暗示 */
.kb-row-plain { cursor: default; }
.kb-plain .kb-body { max-height: 300px; }
.kb-plain .kb-col { background: var(--surface); }
.kb-ft { padding: 5px 10px; border-top: 1px solid var(--border); font-size: 11.5px;
  color: var(--muted); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* 库内三档的一行报数：七张数字卡删了，但「还有几张没人接」不能跟着消失 */
.wh-mini { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.wh-mini b { color: var(--text); font-weight: 600; }
.wh-mini b.t-danger { color: var(--danger); }

/* 启动门禁页（连不上服务端时整页拦住）。
   理由见 app.js 的 p4RestoreShared：宁可停在登录口，也不给一份"看起来正常"的
   本地缓存 —— 那会让人对着本机数据录一整天单，还以为在共享账上。 */
.gate-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--surface-2, #f5f7fb); }
.gate-card { max-width: 520px; width: 100%; padding: 26px 28px; }
.gate-card h2 { margin: 0 0 10px; font-size: 18px; color: var(--text); }
.gate-why { margin: 0 0 10px; font-size: 13.5px; line-height: 1.7; color: #8c2b2f;
  background: #fff5f5; border: 1px solid #f3c9ca; border-radius: 8px; padding: 10px 12px; }
.gate-act { margin: 16px 0 12px; }

/* 旧主题回退开关：给 <html> 加 data-theme="legacy" 即整体回退旧视觉（2026-11-24 之前的墨蓝）。
   默认不命中；纯 CSS 覆盖，零 JS、零 HTML 改动。不要把它写进 index.html。 */
html[data-theme="legacy"] {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc;
  --border: #e7eaf0; --border-strong: #d4dae4;
  --text: #1b2333; --text-2: #55607a; --muted: #8e99ac;
  --primary: #2456d9; --primary-dark: #1a41ad; --primary-weak: #e9efff;
  --success: #0f9d6c; --success-weak: #e5f7f0;
  --warn: #e8930c; --warn-weak: #fdf3e1;
  --danger: #dc3d43; --danger-weak: #fdebeb;
  --purple: #6d4fd4; --purple-weak: #f3ecff;
  --ink-1: #131d33; --ink-2: #0e1728; --ink-3: #0c1422;
  --ink-mid: #172544; --ink-fly-1: #1a2642; --ink-fly-2: #131d33;
  --radius: 10px; --radius-sm: 6px; --radius-ctl: 6px; --radius-modal: 10px;
  --skel-bg: #eef1f6;
  --link: #2456d9;
  --focus-ring: rgba(36,86,217,.13);
  --nav-active-bg: #2456d9; --nav-active-ink: #ffffff; --nav-active-bar: transparent;
  --brand-mark: #2456d9; --brand-mark-ink: #ffffff;
  --overlay: rgba(19,30,51,.45);
  --danger-ink: #dc3d43; --success-ink: #0b8f6a; --warn-ink: #a86500;
  --sum-bg: #fff8e6;
}
html[data-theme="legacy"] .hd-acts .btn,
html[data-theme="legacy"] .card-hd > .btn { border-radius: 999px; }
html[data-theme="legacy"] .badge.b-dot.b-gray::before { background: currentColor; border: 0; width: 6px; height: 6px; }
html[data-theme="legacy"] .badge.b-dot.b-blue::before { width: 6px; height: 6px; }

/* ---- 未开发菜单项（2026-11-06 PO 签字：置灰 + 写明原因）----
   显示但不可点：span.fly-item.is-todo，title 说明「该功能尚未开发，暂不可用」。
   色值走「白底专用」：#999 对白底约 2.85:1 —— 比正常项（--text-2 #4a4a4a）明显浅一档，
   一眼能看出不可用，但仍读得清字（不是"消失"）。深色浮层时代那个 rgba(255,255,255,.42)
   放白底上等于隐形，所以 2026-11-24 浅色化时一起换掉。
   hover 里把背景/颜色打回去：留着悬停高亮会让灰项看起来能点。 */
.fly-item.is-todo { color: #999999; cursor: not-allowed; }
.fly-item.is-todo:hover { background: transparent; color: #999999; }

/* ==========================================================================
 * 工作台（2026-11-24 重做，docs/145 §六 第 2 步）
 * A 每日配送安排滑轨（固定 5 天，横向滚动 + 左右渐隐/箭头）
 * B 待办卡片（6 张，按业务类型分，按权限裁）
 * 色板只用现有 token：墨白（--text/--surface/--border）+ 单红（--danger）；
 * "橙"取 --warn、"绿"取 --success，不新引 hex —— 新 hex 一定会和主题漂开。
 * ========================================================================== */

/* ---- A. 配送滑轨 ---- */
.dr-wrap .card-bd { padding: 12px 14px 6px; }
.dr-box { position: relative; }
.dr-rail {
  display: flex; align-items: stretch; gap: 14px; overflow-x: auto;
  padding: 2px 2px 10px; scrollbar-width: none;
}
.dr-rail::-webkit-scrollbar { display: none; }
.dr-day {
  flex: none; width: 330px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.dr-day-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px 9px; border-bottom: 1px solid var(--border);
}
.dr-day-lb { font-size: 13px; font-weight: 650; color: var(--text); }
.dr-day-hd em { font-style: normal; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dr-day-cnt {
  margin-left: auto; font-size: 11px; color: var(--muted); background: var(--surface-2);
  border-radius: 999px; padding: 0 7px; line-height: 18px; font-variant-numeric: tabular-nums;
}
.dr-day-bd { padding: 10px 13px 12px; display: grid; gap: 10px; align-content: start; }
.dr-veh-hd { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); }
.dr-sst { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--border-strong); }
.dr-sst.is-green { background: var(--success); }
.dr-sst.is-orange { background: var(--warn); }
.dr-sst.is-red { background: var(--danger); }
.dr-veh-hd b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dr-drv { color: var(--text-2); }
.dr-from { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dr-lines { margin: 6px 0 0 3px; padding-left: 11px; border-left: 1px solid var(--border); display: grid; gap: 4px; }
.dr-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.dr-line b { color: var(--text); font-weight: 600; }
.dr-qty { font-variant-numeric: tabular-nums; }
.dr-cust::before { content: "· "; color: var(--muted); }
.dr-line time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.dr-more { font-size: 11px; color: var(--muted); }
.dr-empty { font-size: 12px; color: var(--muted); padding: 10px 2px; }
.dr-fade {
  position: absolute; top: 0; bottom: 10px; width: 54px;
  display: flex; align-items: center; pointer-events: none;
}
.dr-fade.is-l { left: 0; justify-content: flex-start; background: linear-gradient(90deg, var(--surface), rgba(255, 255, 255, 0)); }
.dr-fade.is-r { right: 0; justify-content: flex-end; background: linear-gradient(270deg, var(--surface), rgba(255, 255, 255, 0)); }
.dr-fade.is-off { opacity: 0; }
.dr-arw {
  pointer-events: auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-family: inherit;
}
.dr-arw:hover { border-color: var(--text); }
.dr-fade.is-off .dr-arw { cursor: default; opacity: .35; }

/* ---- B. 待办卡片 ---- */
.dtd-hd { display: flex; align-items: center; margin: 6px 0 10px; }
.dtd-hd h3 { margin: 0; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
/* 列数自适应：每列至少 300px，宽度够就多排一列。
   为什么不用「≥1400 再加一条 media query」：那是给"当时正好 7 张卡"打的补丁，
   下次加/减一张卡又得回来改断点。auto-fill + minmax 让列数只由容器宽度决定：
   1440 内容区 → 4 列 / 1024 → 3 列 / 768 → 2 列 / 640 以下单列。
   300 这个下限是按卡片内容定的：再多一张卡也不会把「单号 · 客户 + 已等 N 小时」挤到换行。 */
.dtd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
/* 640 以下仍显式单列：320 宽时 minmax 的 300px 下限会顶出横向溢出 */
@media (max-width: 640px) { .dtd-grid { grid-template-columns: 1fr; } }
.td-card {
  min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm); padding: 14px 16px 10px;
}
.td-hd { display: flex; align-items: center; gap: 8px; }
.td-tt { font-size: 13px; font-weight: 650; color: var(--text); }
.td-all {
  margin-left: auto; border: 0; background: transparent; padding: 0; cursor: pointer;
  color: var(--muted); font-size: 11.5px; font-family: inherit;
}
.td-all:hover { color: var(--text); }
.td-num {
  display: flex; align-items: baseline; gap: 6px; margin: 8px 0 10px; line-height: 1;
  font-size: 28px; font-weight: 650; letter-spacing: -.5px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.td-num small { font-size: 12px; font-weight: 400; color: var(--muted); }
.td-pill {
  margin-left: 4px; font-size: 10.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border-radius: 999px; padding: 2px 7px;
}
.td-pill.is-red { color: var(--danger); background: var(--danger-weak); }
.td-rows { display: grid; gap: 2px; }
.td-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-top: 1px solid var(--surface-2); font-size: 11.5px; }
.td-row:first-child { border-top: 0; }
.td-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: #c0c0c0; }
.td-dot.is-red { background: var(--danger); }
.td-dot.is-orange { background: var(--warn); }
.td-dot.is-gray { background: #c0c0c0; }
.td-main { flex: 1; min-width: 0; color: var(--text); }
/* 主行与副行各自一行省略：`.td-main` 以前自己带 nowrap + ellipsis，加上副行之后
   会把整块裁掉 —— 省略必须落到**每一行**上（z175 待办卡加副行）。 */
.td-l1 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-l1 b { font-weight: 600; }
.td-sub { display: block; margin-top: 1px; font-size: 11px; line-height: 1.35; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-wait { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-wait.is-red { color: var(--danger); }
/* 橙档文字：圆点只有 6px，橙(#a87f3a) 与灰(#c0c0c0) 的亮度差仅 2.0:1，
   1x 缩放下这两档分不出来，等于三档退化成两档。文字尺寸大、可读，
   给橙档补第二重编码。用 --warn-ink(#8a6420，对白底 ≈5.4:1)，不新引裸色值。
   灰档（<2h）**故意不上色**：它就是「不急」，给它颜色等于稀释重点。 */
.td-wait.is-orange { color: var(--warn-ink); }
/* 灰档显式写出来：class 由 waitLevel() 统一给出（三档都有类名），
   值等于继承来的 --muted —— 不写也对，写出来是为了让「三档」在 CSS 里也能一眼看全。 */
.td-wait.is-gray { color: var(--muted); }
/* 「只标记」卡（加急审核）右侧的加急说明：人写的一行字，不是算出来的时长。
   限宽 + 省略号，别让它把单号挤成省略号 —— 单号是这张卡里唯一必须读全的东西。 */
.td-note { flex: none; max-width: 46%; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-empty { font-size: 11.5px; color: var(--muted); padding: 6px 0; }

/* ===== 加急（z168）=====
   两个标记在列表里是**徽章**、在工作台/仓库看板上是**整块**，所以只做一枚徽章：
   同一件事两种长相，第二种迟早与第一种不一致。配色沿用 .badge 的语义：
   加急审核 = 危险（催人），优先备货 = 提醒（催货），都不上红：红只留给"已超时"。 */
.nav-item .cnt.is-hot { background: var(--warn-weak); color: var(--warn-ink); font-weight: 600; }
.ug {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px;
  font-size: 10.5px; line-height: 16px; white-space: nowrap; vertical-align: 1px;
  border: 1px solid transparent;
}
.ug-a { background: var(--danger-weak, #fdecec); color: var(--danger, #c0392b); border-color: currentColor; }
.ug-p { background: var(--warn-weak); color: var(--warn-ink); border-color: currentColor; }
/* 徽章自己的一行：换行只许发生在徽章之间，不许跨到备注那一行去 */
.ug-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.ug-row .ug { margin-left: 0; }
/* 页头权限徽章：只读 / 只读·可加急。只在**权限有缺口**时出现 ——
   有权限是正常状态，不需要一句标语告诉用户"你可以审核"。
   存在的意义是顶替原来表格上方那一整段解释（「…所以那两颗按钮是灰的 ——
   这不是单据的问题」）：版面上一枚徽章，比一句 60 字的话更快读懂。 */
.pg-cap {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px;
  font-size: 11.5px; font-weight: 500; vertical-align: 3px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  cursor: help;
}
.pg-cap.b-urg { background: var(--warn-weak); color: var(--warn-ink); border-color: currentColor; }
/* 加急弹窗的两个选项：整块可点（label 包住复选框），说明文字换行不挤在一行 */
.ug-opt {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.ug-opt:hover { background: var(--surface-2); }
.ug-opt input { margin-top: 2px; flex: none; }
/* 只命中**选项标题**那一层。写成 `.ug-opt b` 会连带把说明文字里的 <b>工作台看板</b>
   也变成块级 —— 实拍效果是「推到」/「工作台看板」/「，提醒…」断成三行，
   中间那行还比上下文大一号，读起来像三个不相关的短语。
   （浏览器实测 2026-11-26 发现；判据 test_z172_audit_ui.py 钉住选择器不许回退成 .ug-opt b） */
.ug-opt > span > b { display: block; font-size: 13px; }
.ug-opt em { display: block; font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.6; }
.ug-opt em b { display: inline; font-size: inherit; }
