/* ==========================================================================
   仓储管理系统 · 界面样式
   使用场景：仓库里单手拿手机（可能戴手套）+ 扫码枪，日光与日光灯混合；办公室电脑看订单和报表。
   → 只有浅色、高对比、大触控区；主色藏青只用于操作和选中状态，印章朱红只在品牌处出现。
   颜色约定：
   - 客户颜色：每个客户固定一种，只作辅助识别，旁边始终有客户名
   - 状态（正常/关注/超期）：始终 图标 + 文字 + 颜色 一起出现，不单靠颜色
   颜色用十六进制而不是新语法，保证老款安卓手机浏览器也能正常显示。
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --font: system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --bg: #f4f6f9;          /* 页面底色：冷调浅灰 */
  --surface: #ffffff;     /* 卡片、弹窗 */
  --surface-2: #eef1f5;   /* 表头、分段控件底 */
  --surface-3: #e4e8ef;   /* 悬停 */
  --ink: #141a26;         /* 正文 */
  --ink-2: #3b4455;       /* 次要文字 */
  --ink-3: #5f6a7c;       /* 标签、说明（白底对比度 ≥ 5:1） */
  --line: #e3e7ee;
  --line-strong: #d0d6e0;

  --primary: #24489c;     /* 主色：藏青 */
  --primary-hover: #1c3a80;
  --primary-ink: #ffffff;
  --primary-soft: #ebf0fa;
  --primary-soft-ink: #1c3a80;
  --focus: rgba(36, 72, 156, .2);
  --accent: #c0392b;      /* 朱红：取自 Logo 印章，只做点睛 */
  --accent-soft: #fdecea;

  --danger: #c62828; --danger-soft: #fdecec; --danger-ink: #a61b1b;
  --success: #1f7a3d; --success-soft: #e7f5ec;

  --st-ok: #0ca30c; --st-warn: #fab219; --st-danger: #d03b3b;
  --st-ok-ink: #0b6620; --st-warn-ink: #7a5200; --st-danger-ink: #a32020;
  --st-ok-bg: #e5f5e7; --st-warn-bg: #fff3d6; --st-danger-bg: #fdeaea;

  --g-wait: #c3c2b7; --g-make: #2a78d6; --g-store: #eb6834;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-2: 0 4px 16px rgba(17, 24, 39, .08), 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-3: 0 16px 48px rgba(17, 24, 39, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar-w: 236px;
  --tabbar-h: 64px;

  /* z-index 分层 */
  --z-sticky: 20; --z-nav: 30; --z-dropdown: 40; --z-backdrop: 50; --z-modal: 60; --z-toast: 70;

  /* 兼容旧变量名（模板里有用到） */
  --surface-1: var(--surface); --page-plane: var(--bg); --hairline: var(--line); --muted-ink: var(--ink-3); --brand: var(--primary);

  /* 覆盖 Bootstrap */
  --bs-body-font-family: var(--font);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--ink-3);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 36, 72, 156;
  --bs-link-hover-color: var(--primary-hover);
  --bs-primary: var(--primary);
  --bs-primary-rgb: 36, 72, 156;
  --bs-emphasis-color: var(--ink);
}

/* ---------- 基础 ---------- */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
@media (max-width: 767px) { body { font-size: 15.5px; } }
h1, h2, h3 { text-wrap: balance; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn:hover, .nav-link:hover, .tabbar a:hover, .side-link:hover, a.stat-link:hover, a.zcell:hover, a.batch-row:hover, .list-group-item:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--primary-soft); color: var(--primary-soft-ink); }
.text-muted-ink, .text-secondary-ink { color: var(--ink-3) !important; }
.text-body-secondary { color: var(--ink-3) !important; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.qr svg { width: 100%; height: auto; display: block; }
hr { border-color: var(--line); opacity: 1; }

/* ---------- 整体布局：电脑左侧导航；手机顶栏 + 底部栏 ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: var(--z-nav);
  background: var(--surface-2); border-right: 1px solid var(--line);
  display: none; flex-direction: column;
}
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.side-group { margin-top: 14px; }
.side-group:first-child { margin-top: 4px; }
.side-group-label { font-size: 12px; color: var(--ink-3); padding: 0 10px 4px; font-weight: 600; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s; }
.side-link i { font-size: 17px; width: 20px; text-align: center; color: var(--ink-3); transition: color .15s; }
.side-link:hover { background: var(--surface-3); color: var(--ink); }
.side-link.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); font-weight: 600; }
.side-link.active i { color: var(--primary); }
.side-foot { border-top: 1px solid var(--line); padding: 10px; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: 6px 8px; border-radius: var(--radius-sm); width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; }
.user-chip:hover { background: var(--surface-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-soft-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.user-chip .who { line-height: 1.2; min-width: 0; }
.user-chip .who small { color: var(--ink-3); display: block; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-nav); height: 56px;
  display: flex; align-items: center; gap: .5rem; padding: 0 12px 0 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, white)) { .topbar { background: var(--surface); } }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.main { padding: 20px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); max-width: 1440px; margin: 0 auto; }
.app-main { padding-bottom: calc(var(--tabbar-h) + 28px) !important; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(17, 24, 39, .04);
}
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; border: 0; background: transparent; }
.tabbar i { font-size: 22px; line-height: 1; }
.tabbar .active { color: var(--primary); }
.tabbar .tab-primary span.fab { width: 50px; height: 50px; margin-top: -18px; border-radius: 16px; background: var(--primary); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px -6px rgba(36, 72, 156, .55); }
.tabbar .tab-primary span.fab i { font-size: 26px; }
.tabbar .tab-primary { color: var(--ink-2); }

@media (min-width: 1200px) {
  .sidebar { display: flex; }
  .topbar, .tabbar { display: none; }
  .main { margin-left: var(--sidebar-w); padding: 28px 32px 40px; max-width: none; }
  .main > .main-inner { max-width: 1380px; margin: 0 auto; }
  .app-main { padding-bottom: 40px !important; }
}

/* 手机菜单（抽屉） */
.offcanvas { background: var(--surface-2); border-color: var(--line) !important; }
.offcanvas .side-nav { padding: 0 6px 12px; }

/* ---------- 页面标题 ---------- */
.page-title { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 16px; }
.page-title > i:first-child { color: var(--ink-3); font-size: 20px; }
.page-title .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; font-size: 15px; font-weight: 400; }
@media (min-width: 1200px) { .page-title { font-size: 22px; margin-bottom: 20px; } }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); --bs-card-bg: var(--surface); --bs-card-border-color: var(--line); --bs-card-cap-bg: transparent; }
.card-body { padding: 18px; }
@media (max-width: 575px) { .card-body { padding: 14px; } }
.card-footer, .card-header { border-color: var(--line); }
.section-title { font-size: 15px; font-weight: 650; margin-bottom: 10px; display: flex; align-items: center; gap: .5rem; }
.section-title .more { margin-left: auto; font-size: 13px; font-weight: 500; }

/* ---------- 按钮 ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: 10px; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: .95rem; --bs-btn-font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-y: .32rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: 13.5px; --bs-btn-border-radius: 8px; }
.btn-lg { --bs-btn-padding-y: .72rem; --bs-btn-padding-x: 1.2rem; --bs-btn-font-size: 16.5px; --bs-btn-border-radius: 12px; min-height: 50px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--primary-ink); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-hover-color: var(--primary-ink); --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-active-color: var(--primary-ink); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-disabled-color: var(--primary-ink); box-shadow: 0 1px 2px rgba(36, 72, 156, .25); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--line-strong); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--primary-soft); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--primary-soft-ink); --bs-btn-active-bg: var(--primary-soft); --bs-btn-active-color: var(--primary-soft-ink); --bs-btn-active-border-color: var(--primary); }
.btn-outline-secondary, .btn-light { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line-strong); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--surface-3); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--line-strong); }
.btn-secondary { --bs-btn-bg: var(--ink-2); --bs-btn-border-color: var(--ink-2); --bs-btn-color: var(--surface); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: var(--surface); --bs-btn-active-bg: var(--ink); --bs-btn-active-color: var(--surface); }
.btn-success { --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success); --bs-btn-hover-bg: #186531; --bs-btn-hover-border-color: #186531; }
.btn-outline-success { --bs-btn-color: var(--success); --bs-btn-border-color: var(--line-strong); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--success-soft); --bs-btn-hover-color: var(--success); --bs-btn-hover-border-color: var(--success); }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #a61b1b; --bs-btn-hover-border-color: #a61b1b; }
.btn-outline-danger { --bs-btn-color: var(--danger); --bs-btn-border-color: var(--line-strong); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--danger-soft); --bs-btn-hover-color: var(--danger-ink); --bs-btn-hover-border-color: var(--danger); }
.btn-link { --bs-btn-color: var(--primary); --bs-btn-font-weight: 500; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn .spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group .btn { --bs-btn-border-radius: 8px; }

/* 分段按钮（视图切换） */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg a:hover { color: var(--ink); background: var(--surface-3); }
.seg .on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.seg .count { font-size: 12px; color: var(--ink-3); margin-left: 3px; font-variant-numeric: tabular-nums; }
.seg .on .count { color: var(--primary); }

/* ---------- 表单：柔和填充式输入框 ----------
   做法：输入框不画灰色边框，用比卡片略深的浅灰底色表示"这里可以填"；
   悬停稍深一点，聚焦时变白 + 主色细描边 + 柔和光晕。所有可填写、可点选的控件
   （输入框、下拉、边打边搜、数量、区号、选项胶囊）都用同一套语言。 */
:root {
  --field: #f1f4f8; --field-hover: #e8ecf3; --field-focus: #ffffff;
  --field-ring: 0 0 0 1px var(--primary), 0 0 0 5px rgba(36, 72, 156, .12);
  --field-radius: 12px;
}
.form-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; letter-spacing: .01em; }
.form-label.small, label.small { font-weight: 500; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.form-control, .form-select {
  min-height: 48px; border-radius: var(--field-radius); border: 1px solid transparent; background-color: var(--field);
  color: var(--ink); font-size: 16px; padding: .6rem .95rem;
  transition: background-color .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.form-control:hover, .form-select:hover { background-color: var(--field-hover); }
.form-control:focus, .form-select:focus { background-color: var(--field-focus); border-color: transparent; box-shadow: var(--field-ring); outline: none; }
.form-select { padding-right: 2.5rem; background-position: right .95rem center; }
.form-control-lg, .form-select-lg { min-height: 54px; font-size: 17px; border-radius: 14px; padding: .7rem 1.05rem; }
.form-control-sm, .form-select-sm { min-height: 38px; font-size: 14px; border-radius: 10px; padding: .35rem .7rem; }
.form-control::placeholder { color: var(--ink-3); opacity: 1; }
.form-control:disabled, .form-select:disabled { background-color: var(--surface-2); color: var(--ink-3); }
.form-control-color { min-height: 48px; width: 64px; padding: 6px; }
.form-text { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.form-check-input { width: 1.15em; height: 1.15em; border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--focus); }
.req::after { content: "*"; color: var(--danger); font-weight: 500; margin-left: 3px; }
.field-error { color: var(--danger-ink); font-size: 13px; margin-top: 6px; }
.is-invalid, .is-invalid:focus { box-shadow: 0 0 0 1px var(--danger), 0 0 0 5px rgba(198, 40, 40, .1) !important; }
textarea.form-control { min-height: 84px; line-height: 1.55; resize: vertical; }
input[type="date"].form-control, input[type="datetime-local"].form-control { min-height: 48px; }

/* 折叠区 */
.form-section { border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; }
.form-section > summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 600; display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .2s var(--ease); margin-right: 4px; }
.form-section[open] > summary::before { transform: rotate(45deg); }
.form-section > summary small { color: var(--ink-3); font-weight: 400; }

/* 选项胶囊（单位、开向等） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { min-height: 42px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; cursor: pointer; user-select: none; background: var(--field); color: var(--ink-2); font-weight: 500; transition: background-color .15s var(--ease), color .15s, box-shadow .15s; }
.chips label:hover { background: var(--field-hover); color: var(--ink); }
.chips input:checked + label { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.chips input:focus-visible + label { box-shadow: var(--field-ring); }

/* 区号格 */
.zone-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (min-width: 992px) { .zone-grid { grid-template-columns: repeat(12, 1fr); } }
.zone-grid input { position: absolute; opacity: 0; pointer-events: none; }
.zone-grid label { display: flex; align-items: center; justify-content: center; height: 54px; border-radius: 12px; font-size: 18px; font-weight: 650; cursor: pointer; user-select: none; background: var(--field); color: var(--ink); font-variant-numeric: tabular-nums; transition: background-color .15s var(--ease), color .15s, box-shadow .2s var(--ease), transform .1s var(--ease); }
.zone-grid label:hover { background: var(--field-hover); }
.zone-grid label:active { transform: scale(.95); }
.zone-grid input:checked + label { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px -6px rgba(36, 72, 156, .55); }
.zone-grid input:focus-visible + label { box-shadow: var(--field-ring); }

/* 数量：一体式步进器 */
.qty-box { display: inline-flex; align-items: stretch; border-radius: 14px; overflow: hidden; background: var(--field); transition: background-color .18s var(--ease), box-shadow .18s var(--ease); }
.qty-box:hover { background: var(--field-hover); }
.qty-box:focus-within { background: var(--field-focus); box-shadow: var(--field-ring); }
.qty-box .btn { width: 54px; border: 0; border-radius: 0; font-size: 22px; font-weight: 400; color: var(--ink-2); --bs-btn-bg: transparent; --bs-btn-hover-bg: rgba(0, 0, 0, .04); --bs-btn-active-bg: rgba(0, 0, 0, .08); --bs-btn-color: var(--ink-2); --bs-btn-hover-color: var(--ink); box-shadow: none; }
.qty-box input, .qty-box input:hover, .qty-box input:focus { border: 0; border-radius: 0; text-align: center; font-size: 24px; font-weight: 700; width: 112px; min-height: 54px; background: transparent; box-shadow: none !important; font-variant-numeric: tabular-nums; }

/* 扫码栏 */
.scanbar { display: flex; gap: 8px; }
.scanbar input { font-family: var(--font-mono); font-size: 16px; letter-spacing: .02em; }
.scanbar .btn { white-space: nowrap; min-width: 52px; }
.scan-flash { animation: flash .6s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(12, 163, 12, .55); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }

/* 底部固定操作条（入库、出库页） */
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: var(--z-sticky); margin: 0 -16px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red 50%, white)) { .sticky-actions { background: var(--bg); } }
@media (min-width: 1200px) { .sticky-actions { bottom: 0; margin: 0; padding: 12px 0; border-top: 0; } }

/* ---------- Tom Select（边打边搜）：与普通输入框同一套填充式外观 ---------- */
.ts-wrapper.form-select, .ts-wrapper.form-control, .ts-wrapper.single, .ts-wrapper.multi {
  min-height: 48px; padding: 0 !important; border: 1px solid transparent !important; border-radius: var(--field-radius) !important;
  background: var(--field) !important; box-shadow: none !important; display: flex; align-items: stretch;
  transition: background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.ts-wrapper:hover { background: var(--field-hover) !important; }
.ts-wrapper.form-select-lg, .ts-wrapper.form-control-lg { min-height: 54px; border-radius: 14px !important; font-size: 17px; }
.ts-wrapper.focus, .ts-wrapper.focus:hover { background: var(--field-focus) !important; box-shadow: var(--field-ring) !important; }
.ts-wrapper .ts-control, .ts-wrapper.form-select .ts-control, .ts-wrapper.form-control .ts-control, .ts-wrapper.single.input-active .ts-control {
  flex: 1; min-height: 0; border: 0 !important; border-radius: inherit !important; background: transparent !important; box-shadow: none !important;
  color: var(--ink); font-size: inherit; padding: .55rem 2.5rem .55rem .95rem !important; display: flex; align-items: center; flex-wrap: nowrap; cursor: text;
}
.ts-wrapper.form-select-lg .ts-control, .ts-wrapper.form-control-lg .ts-control { padding-left: 1.05rem !important; }
.ts-wrapper .ts-control > .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-wrapper .ts-control > input { color: var(--ink); font-size: inherit !important; min-width: 2rem !important; }
.ts-wrapper .ts-control > input::placeholder { color: var(--ink-3); }
.ts-wrapper.single .ts-control::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border: 0; border-right: 1.75px solid var(--ink-3); border-bottom: 1.75px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s var(--ease), margin .2s var(--ease); }
.ts-wrapper.single.dropdown-active .ts-control::after { margin-top: -1px; transform: rotate(-135deg); }
/* 自由输入的框（产品名称、颜色等）不是下拉选择，不显示箭头 */
.ts-wrapper.combo-text .ts-control::after { display: none; }
.ts-wrapper.combo-text .ts-control { padding-right: .95rem !important; }
.ts-wrapper.has-items .ts-control > input::placeholder { color: transparent; }
.ts-dropdown { z-index: var(--z-dropdown); border: 1px solid var(--line) !important; border-radius: 14px !important; background: var(--surface) !important; color: var(--ink); box-shadow: 0 12px 32px -8px rgba(17, 24, 39, .18), 0 2px 6px rgba(17, 24, 39, .06) !important; margin-top: 8px !important; overflow: hidden; font-size: 15.5px; animation: dd-in .16s var(--ease); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ts-dropdown .ts-dropdown-content { max-height: 300px; padding: 6px; }
.ts-dropdown .option, .ts-dropdown .create, .ts-dropdown .no-results { padding: 10px 12px !important; border-radius: 9px; }
.ts-dropdown .active { background: var(--primary-soft) !important; color: var(--primary-soft-ink) !important; }
.ts-dropdown .create { color: var(--primary); font-weight: 600; }
.ts-dropdown .create strong { color: var(--ink); }
.ts-dropdown .no-results { color: var(--ink-3); }
.ts-dropdown .highlight { background: transparent; color: var(--primary); font-weight: 700; }
.ts-dropdown .opt-sub { color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.ts-wrapper .item .opt-sub { display: none; }

/* ---------- 表格 ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-hover-bg: var(--surface-2); --bs-table-border-color: var(--line); margin-bottom: 0; }
.table > thead th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: 13px; white-space: nowrap; border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
.table > thead th a { color: var(--ink-3); }
.table td, .table th { vertical-align: middle; padding-left: 12px; padding-right: 12px; }
.table-sm td, .table-sm th { padding-left: 10px; padding-right: 10px; }
.card > .table-wrap .table > thead th:first-child { border-top-left-radius: var(--radius); }
.card > .table-wrap .table > thead th:last-child { border-top-right-radius: var(--radius); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-warning { --bs-table-bg: var(--st-warn-bg); --bs-table-color: var(--ink); }
.table-success { --bs-table-bg: var(--st-ok-bg); --bs-table-color: var(--ink); }
.table-danger { --bs-table-bg: var(--danger-soft); --bs-table-color: var(--ink); }

/* ---------- 提示、徽章 ---------- */
.alert { border-radius: var(--radius); border: 1px solid transparent; padding: 12px 16px; }
.alert-success { background: var(--success-soft); color: var(--ink); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-danger { background: var(--danger-soft); color: var(--ink); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--st-warn-bg); color: var(--ink); border-color: color-mix(in srgb, var(--st-warn) 35%, transparent); }
.alert-info { background: var(--primary-soft); color: var(--ink); border-color: color-mix(in srgb, var(--primary) 18%, transparent); }
.alert a { font-weight: 600; }
.badge { font-weight: 600; border-radius: 6px; }
.text-bg-secondary { background: var(--surface-3) !important; color: var(--ink-2) !important; }
.text-bg-light { background: var(--surface-2) !important; color: var(--ink-2) !important; }

/* 客户颜色块 */
.cchip { display: inline-block; width: .75em; height: .75em; border-radius: 3px; vertical-align: -.02em; flex: none; }
.cbar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.cbar span { display: block; height: 100%; }

/* 状态徽章：图标 + 文字 + 颜色 */
.aging { display: inline-flex; align-items: center; gap: .3em; padding: .12em .55em; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.5; }
.aging.ok { background: var(--st-ok-bg); color: var(--st-ok-ink); }
.aging.warn { background: var(--st-warn-bg); color: var(--st-warn-ink); }
.aging.danger { background: var(--st-danger-bg); color: var(--st-danger-ink); }
.stage { display: inline-flex; align-items: center; gap: .3em; padding: .1em .55em; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.stage-WAIT { color: var(--ink-3); }
.stage-MAKING, .stage-PART_IN { color: #1f63b8; background: #e6f0fc; }
.stage-READY, .stage-SHIPPING { color: #b84a17; background: #fdece4; }
.stage-DONE { color: var(--st-ok-ink); background: var(--st-ok-bg); }
.stage-CANCEL { color: var(--ink-3); text-decoration: line-through; }
.zone-tag { display: inline-flex; align-items: center; padding: 0 .45em; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; margin: 1px 3px 1px 0; color: var(--ink-2); background: var(--surface); }
a.zone-tag:hover { border-color: var(--primary); color: var(--primary); }
.legend-item { display: inline-flex; align-items: center; gap: .35em; margin-right: 1rem; font-size: 13px; color: var(--ink-2); }

/* ---------- 统计、快捷操作 ---------- */
.stat { padding: 14px 16px; height: 100%; }
.stat .label { color: var(--ink-3); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: .3rem; }
.stat .value { font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .value small { font-size: 14px; font-weight: 500; color: var(--ink-3); }
a.stat-link { color: inherit; display: block; height: 100%; }
a.stat-link .card { transition: border-color .15s, box-shadow .15s; }
a.stat-link:hover .card { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.quick-actions .btn { flex-direction: column; gap: 4px; padding: 14px 6px; font-size: 14px; height: 100%; }
.quick-actions .btn i { font-size: 24px; }

/* 首次使用引导 */
.onboard { display: grid; gap: 8px; }
.onboard-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.onboard-step .num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--ink-3); flex: none; }
.onboard-step.done .num { background: var(--success); border-color: var(--success); color: #fff; }
.onboard-step.done .t { color: var(--ink-3); text-decoration: line-through; }
.onboard-step .t { font-weight: 600; }
.onboard-step .d { font-size: 13px; color: var(--ink-3); }
.onboard-step .go { margin-left: auto; }

/* 空状态 */
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 12px; }
.empty .t { font-weight: 650; color: var(--ink); font-size: 16px; }
.empty .d { color: var(--ink-3); font-size: 14px; max-width: 36em; margin: 4px auto 14px; }

/* ---------- 库存看板 ---------- */
.cust-card .card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 16px; }
.cust-card .cust-name { font-weight: 700; font-size: 16px; }
.batch-row { display: grid; grid-template-columns: 52px 1fr auto; gap: .6rem; padding: .55rem .25rem; border-top: 1px solid var(--line); align-items: center; color: inherit; border-radius: 6px; }
.batch-row:first-child { border-top: 0; }
.batch-row:hover { background: var(--surface-2); }
.batch-row .d { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; line-height: 1.25; }
.batch-row .p { min-width: 0; }
.batch-row .p div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-row .q { text-align: right; font-variant-numeric: tabular-nums; font-size: 16px; }
#timeline { width: 100%; }

/* 矩阵热力表（单一蓝色 浅→深 表示数量） */
.matrix td, .matrix th { text-align: center; font-variant-numeric: tabular-nums; padding: .35rem .4rem; min-width: 40px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 130px; }
.matrix .s1 { background: var(--seq-1); color: #0b0b0b; } .matrix .s2 { background: var(--seq-2); color: #0b0b0b; }
.matrix .s3 { background: var(--seq-3); color: #0b0b0b; } .matrix .s4 { background: var(--seq-4); color: #fff; }
.matrix .s5 { background: var(--seq-5); color: #fff; } .matrix .s6 { background: var(--seq-6); color: #fff; }

/* 区域地图 */
.zmap { display: grid; gap: 10px; }
.zcell { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; color: inherit; display: flex; flex-direction: column; gap: 6px; min-height: 124px; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.zcell:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.zcell.empty { background: var(--surface-2); box-shadow: none; }
.zcell .zn { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.zcell .zn small { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 1px; }
.zcell .zq { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.zcell .zc { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
@media (max-width: 767px) { .zmap { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; } .zcell { min-height: 108px; padding: 10px; } .zcell { grid-row: auto !important; grid-column: auto !important; } }

/* ---------- 订单周期甘特图：灰=等开工 蓝=生产中 橙=已入库待出货；竖线=交期 ---------- */
.gantt-row { display: grid; grid-template-columns: minmax(240px, 34%) 1fr; gap: .9rem; padding: .7rem 0; border-top: 1px solid var(--line); align-items: center; }
.gantt-row:first-child { border-top: 0; }
.ginfo { min-width: 0; }
.ginfo .small { color: var(--ink-2); }
.gtrack { position: relative; height: 26px; border-radius: 6px; background: var(--surface-2); }
.gtrack.axis { background: transparent; height: 36px; }
.gtick { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gtoday-label { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-2); background: var(--surface); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.gseg { position: absolute; top: 6px; height: 14px; border-radius: 4px; box-shadow: 0 0 0 1.5px var(--surface-2); }
.gseg.wait { background: var(--g-wait); } .gseg.make { background: var(--g-make); } .gseg.store { background: var(--g-store); }
.gtoday { position: absolute; top: -4px; bottom: -4px; border-left: 1.5px dashed var(--ink-3); }
.gin { position: absolute; top: 2px; width: 2px; height: 22px; margin-left: -1px; background: var(--ink); opacity: .5; border-radius: 1px; }
.gdue { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.gdue.late { background: var(--st-danger); }
.gkey { display: inline-block; width: 18px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.gkey.wait { background: var(--g-wait); } .gkey.make { background: var(--g-make); } .gkey.store { background: var(--g-store); }
.gkey.due { width: 3px; height: 14px; background: var(--ink); }
.gkey.in { width: 2px; height: 14px; background: var(--ink); opacity: .5; }
.gkey.today { width: 0; height: 14px; border-left: 1.5px dashed var(--ink-3); }
@media (max-width: 767px) { .gantt-row { grid-template-columns: 1fr; gap: .4rem; } .gantt-axis .ginfo { display: none; } }
.progress { background: var(--surface-2); border-radius: 999px; }
.progress-thin { height: 6px; }
.timeline-ev { border-left: 2px solid var(--line); margin-left: .4rem; padding-left: 1rem; position: relative; padding-bottom: .7rem; }
.timeline-ev::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.timeline-ev.ev-入库::before { border-color: var(--g-make); background: var(--g-make); }
.timeline-ev.ev-出货::before { border-color: var(--g-store); background: var(--g-store); }
.timeline-ev.ev-约定交期::before { border-color: var(--st-danger); }

/* ---------- 登录 / 首次设置 ---------- */
.auth-page { background: var(--bg); }
.auth-page .main { margin-left: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 28px; }
.auth-sub { color: var(--ink-3); font-size: 14px; }

/* ---------- 提示条、确认框 ---------- */
.toast-stack { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); width: min(440px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 1200px) { .toast-stack { left: auto; right: 24px; transform: none; bottom: auto; top: 20px; } }
.wms-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-3); font-size: 15px; line-height: 1.45; animation: toast-in .25s var(--ease); }
.wms-toast i.lead { font-size: 18px; margin-top: 1px; }
.wms-toast.ok i.lead { color: #5fd36f; } .wms-toast.error i.lead { color: #ff8a8a; } .wms-toast.warn i.lead { color: #ffc94d; } .wms-toast.info i.lead { color: #a9a4ff; }
.wms-toast .body { flex: 1; min-width: 0; }
.wms-toast a { color: inherit; text-decoration: underline; }
.wms-toast .x { border: 0; background: transparent; color: inherit; opacity: .6; font-size: 18px; line-height: 1; padding: 0 2px; }
.wms-toast .btn-light { --bs-btn-bg: rgba(255,255,255,.14); --bs-btn-color: inherit; --bs-btn-border-color: transparent; --bs-btn-hover-bg: rgba(255,255,255,.24); --bs-btn-hover-color: inherit; }
.wms-toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog.wms-dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); }
dialog.wms-dialog::backdrop { background: rgba(10, 12, 20, .45); }
dialog.wms-dialog[open] { animation: dlg-in .2s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.wms-dialog .dlg-body { padding: 22px 22px 8px; font-size: 16px; }
.wms-dialog .dlg-body .t { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.wms-dialog .dlg-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 20px; }

.modal-content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-active-bg: var(--primary-soft); --bs-dropdown-link-active-color: var(--primary-soft-ink); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: 8px 10px; }

/* ---------- 打印：只保留内容 ---------- */
@media print {
  .sidebar, .topbar, .tabbar, .no-print, .alert, .toast-stack { display: none !important; }
  body { background: #fff; }
  .main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 入库页：订单与产品选择 ---------- */
.form-narrow { max-width: 900px; margin: 0 auto; }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; width: 100%; text-align: left; padding: 11px 14px; border: 0; border-radius: 12px; background: var(--field); color: var(--ink); font-size: 14.5px; transition: background-color .15s var(--ease), box-shadow .15s; }
.pick:hover { background: var(--field-hover); }
.pick .no { font-family: var(--font-mono); font-weight: 600; font-size: 13.5px; }
.pick .sum { color: var(--ink-2); min-width: 0; }
.pick .due { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.pick.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.pick.on .no { color: var(--primary-soft-ink); }
.pick-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--field); color: var(--ink-2); font-weight: 500; font-size: 14px; transition: background-color .15s var(--ease), color .15s, box-shadow .15s; }
.pick-chip:hover { background: var(--field-hover); color: var(--ink); }
.pick-chip.on { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.hint-empty { color: var(--ink-3); font-size: 14px; padding: 4px 0; }
.auth-page .main-inner { width: 100%; max-width: 400px; }
.order-line { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--surface); }
.order-line.removing { opacity: .5; }
.line-more > summary { cursor: pointer; padding: 4px 0; }
/* "新建"选项放在已有候选的下面，回车优先选已有的 */
.ts-dropdown .ts-dropdown-content { display: flex; flex-direction: column; }
.ts-dropdown .ts-dropdown-content .create { order: 99; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 2px; }
.ts-dropdown .ts-dropdown-content .create:first-child:last-child { border-top: 0; margin-top: 0; }

/* ==========================================================================
   第 4 版视觉：深色侧边栏 + 明亮内容区（导航退后，内容突出）
   ========================================================================== */
:root {
  --side-bg: #13203d; --side-ink: rgba(255, 255, 255, .68); --side-ink-strong: #ffffff;
  --side-hover: rgba(255, 255, 255, .07); --side-active: rgba(255, 255, 255, .12); --side-label: rgba(255, 255, 255, .4);
  --bg: #f5f6f9; --line: #e6e8ee;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
}
.sidebar { background: var(--side-bg); border-right: 0; }
.sidebar .side-group-label { color: var(--side-label); font-weight: 600; letter-spacing: .02em; }
.sidebar .side-link { color: var(--side-ink); }
.sidebar .side-link i { color: rgba(255, 255, 255, .45); }
.sidebar .side-link:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.sidebar .side-link:hover i { color: rgba(255, 255, 255, .8); }
.sidebar .side-link.active { background: var(--side-active); color: #fff; box-shadow: none; }
.sidebar .side-link.active i { color: #fff; }
.sidebar .side-foot { border-top-color: rgba(255, 255, 255, .08); }
.sidebar .user-chip { color: #fff; }
.sidebar .user-chip:hover { background: var(--side-hover); }
.sidebar .user-chip .who small { color: var(--side-label); }
.sidebar .avatar { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar .side-nav::-webkit-scrollbar { width: 6px; }
.sidebar .side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.card { border-radius: 14px; border-color: var(--line); }
.page-head { display: flex; align-items: flex-end; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; margin: 0; line-height: 1.25; }
.page-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
@media (min-width: 1200px) { .page-head h1 { font-size: 26px; } }

/* 大号操作按钮 */
.action-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.action-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--line-strong); color: var(--ink); }
.action-tile .ic { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 21px; flex: none; }
.action-tile .tt { font-weight: 700; font-size: 16px; line-height: 1.2; }
.action-tile .dd { font-size: 12.5px; color: var(--ink-3); }
.action-tile.in .ic { background: var(--primary-soft); color: var(--primary); }
.action-tile.out .ic { background: #fff1e6; color: #c2410c; }
.action-tile.move .ic { background: #e6f6f2; color: #0f766e; }
.action-tile.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.action-tile.primary:hover { color: #fff; }
.action-tile.primary .ic { background: rgba(255, 255, 255, .16); color: #fff; }
.action-tile.primary .dd { color: rgba(255, 255, 255, .78); }
@media (max-width: 575px) {
  .action-tiles { gap: 8px; }
  .action-tile { flex-direction: column; text-align: center; gap: 6px; padding: 12px 6px; }
  .action-tile .dd { display: none; }
}

/* 指标条 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); overflow: hidden; }
.kpi { padding: 14px 18px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .l { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .v small { font-size: 14px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.kpi .v.sm { font-size: 19px; }
@media (max-width: 767px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-bottom: 1px solid var(--line); }
  .kpi:nth-child(2n) { border-right: 0; }
}

/* 实时刷新提示 */
.live-dot { display: inline-flex; align-items: center; gap: .4rem; font-size: 12.5px; color: var(--ink-3); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st-ok); box-shadow: 0 0 0 3px rgba(12, 163, 12, .18); }

/* 区域格：按客户高亮 */
.zfilter { display: flex; flex-wrap: wrap; gap: 6px; }
.zmap.filtering .zcell { opacity: .3; }
.zmap.filtering .zcell.hit { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-2); }

/* 记录列表 */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); }
.feed-item:first-child { border-top: 0; }
.feed-item:hover { background: var(--surface-2); border-radius: 8px; color: var(--ink); }
.feed-kind { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.feed-kind.IN { background: var(--primary-soft); color: var(--primary); }
.feed-kind.OUT { background: #fff1e6; color: #c2410c; }
.feed-kind.MOVE { background: #e6f6f2; color: #0f766e; }
.feed-kind.GAIN, .feed-kind.LOSS, .feed-kind.VOID { background: var(--surface-2); color: var(--ink-3); }
.feed-main { min-width: 0; }
.feed-main .a { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-main .b { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-qty { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.feed-qty small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }

/* 客户在库列表 */
.cust-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); }
.cust-row:first-child { border-top: 0; }
.cust-row:hover { background: var(--surface-2); border-radius: 8px; color: var(--ink); }
.cust-row .n { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-row .q { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cust-row .z { grid-column: 1 / -1; }

/* 入库页 */
.field-block + .field-block { margin-top: 22px; }
.field-hint { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.auto-note { display: flex; align-items: center; gap: .5rem; color: var(--ink-3); font-size: 13px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.more-card > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.more-card > summary::-webkit-details-marker { display: none; }
.more-card > summary .chev { margin-left: auto; transition: transform .2s var(--ease); color: var(--ink-3); }
.more-card[open] > summary .chev { transform: rotate(180deg); }
.more-card > summary small { color: var(--ink-3); font-weight: 400; }
.more-card .more-body { padding: 0 18px 10px; }
.out-row.blocked { opacity: .55; }
.qty-input { max-width: 110px; text-align: right; font-weight: 600; }
[data-fill] { white-space: nowrap; }
.onboard-step .go { white-space: nowrap; flex: none; }

/* ---------- 品牌：千木道书法字标 ---------- */
.brand-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px 22px 20px; text-decoration: none; }
.brand-side .brand-logo { width: 132px; height: auto; display: block; }
.brand-side .brand-sub { color: rgba(255, 255, 255, .55); font-size: 12.5px; font-weight: 500; letter-spacing: .32em; padding-left: 2px; }
.brand-side:hover .brand-sub { color: rgba(255, 255, 255, .8); }
.brand-top { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-top .brand-logo { height: 28px; width: auto; display: block; }
.brand-top .brand-sub { color: var(--ink-3); font-size: 13px; font-weight: 600; letter-spacing: .08em; padding-left: 10px; border-left: 1px solid var(--line-strong); line-height: 1.1; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 26px; }
.auth-brand .auth-logo { width: 168px; height: auto; margin-bottom: 8px; }
.auth-title { font-size: 18px; font-weight: 700; letter-spacing: .12em; }

/* ---------- 出库：勾选列表 ---------- */
.pick-head { display: flex; align-items: center; gap: 8px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pick-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; user-select: none; }
.pick-all .form-check-input, .pick-row .form-check-input { width: 1.3em; height: 1.3em; margin: 0; flex: none; }
.pick-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .15s var(--ease); }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--surface-2); }
.pick-row.on { background: var(--primary-soft); }
.pick-row.blocked { cursor: not-allowed; opacity: .55; }
.pick-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-meta { font-size: 13px; color: var(--ink-3); margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.pick-meta .cchip { margin-right: 2px; }
.pick-qty { display: flex; align-items: center; gap: 8px; }
.pick-qty .qty-input { width: 84px; min-height: 42px; text-align: center; }
.pick-row.on .pick-qty .qty-input { background: var(--surface); }
.pick-qty .of { font-size: 13px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
  .pick-row { grid-template-columns: auto 1fr; padding: 12px 14px; }
  .pick-qty { grid-column: 2; }
}

/* 登录页底部备案号（法规要求在首页底部显示） */
.auth-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 20px; font-size: 12.5px; }
.auth-footer a { color: var(--ink-3); text-decoration: none; }
.auth-footer a:hover { color: var(--ink); text-decoration: underline; }
