/* restock/static/app.css — 本地手写,零外链 */
:root {
  --w1: 96px;
  --w2: 330px;
  --w3: 210px;
  --w4: 190px;
  --wm: 74px;
  --wp: 96px;
  --ink: #1f2937;
  --ink-dim: #6b7280;
  --line: #e2e8f0;
  --thead-bg: #1e293b;
  --thead-ink: #f1f5f9;
  --accent: #2563eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: #eef1f5;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.brand {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fld { display: flex; align-items: center; gap: 6px; color: var(--ink-dim); }
/* 只作用于直接子控件;v1.21 的 .ms 多选组件也嵌在 .fld 里,若用后代
   选择器,其内部 checkbox 会被拉成 220px 再被 flex 挤压,行布局整体歪掉 */
.fld > select, .fld > input {
  font: inherit;
  color: var(--ink);
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  outline: none;
}
.fld > select:focus, .fld > input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.fld > input { width: 220px; }
/* 数字类输入收窄(设置页交期/天数等,文本输入保持 220px) */
.fld > input[type="number"] { width: 110px; }
.btn {
  font: inherit;
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: #1d4ed8; }
.meta { margin-left: auto; color: var(--ink-dim); white-space: nowrap; }
.meta .sep { margin: 0 6px; color: #cbd5e1; }

/* ---------- 表格容器:横向滚动 + 纵向滚动 ---------- */
.table-wrap {
  height: calc(100vh - 57px - 35px - 42px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: #c3cad6; border-radius: 5px; }
.table-wrap::-webkit-scrollbar-track { background: #f1f5f9; }

.grid {
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
}
col.w-img { width: var(--w1); }
col.w-info { width: var(--w2); }
col.w-inv { width: var(--w3); }
col.w-sale { width: var(--w4); }
col.w-metric { width: var(--wm); }
/* auto 布局下 col 宽度失效,期列用 min-width 兜底 */
.grid th.pc, .grid td.num { min-width: 88px; }
col.w-p { width: var(--wp); }

.grid th, .grid td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 6px 8px;
  line-height: 1.55;
  overflow: hidden;
}

/* ---------- 表头吸顶 ---------- */
.grid thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--thead-bg);
  color: var(--thead-ink);
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  padding: 8px 6px;
  white-space: nowrap;
  border-right: 1px solid #334155;
  border-bottom: 2px solid #0f172a;
}
.grid thead th.pc { font-weight: 500; font-size: 11.5px; }

/* ---------- 首 4 列冻结 ---------- */
.grid .fz {
  position: sticky;
  z-index: 3;
}
.grid thead .fz { z-index: 7; }
.grid .c1 { left: 0; }
.grid .c2 { left: var(--w1); }
.grid .c3 { left: calc(var(--w1) + var(--w2)); }
.grid .c4 { left: calc(var(--w1) + var(--w2) + var(--w3)); }
td.c1 { text-align: center; vertical-align: middle; }
td.c2, td.c3, td.c4 { vertical-align: top; }
td.c2 { min-width: 330px; }
td.c1 img { border-radius: 6px; background: #f1f5f9; display: inline-block; }
td.c1 .img-stockout-placeholder {
  box-sizing: border-box;
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f1f5f9;
  /* v1.18:#4b5563(ink-dim 在 #f1f5f9 上 4.42:1,11px 小字不达 4.5) */
  color: #4b5563;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

/* ---------- 行标签列(预估日均/库存结余/备货计划)冻结 ---------- */
.grid .mc {
  position: sticky;
  left: calc(var(--w1) + var(--w2) + var(--w3) + var(--w4));
  z-index: 3;
  border-right: 2px solid #c7d0dd;
}
.grid thead .mc { z-index: 7; }

/* ---------- 斑马纹(按 SKU 组,3 行一组) ---------- */
tr.g0 td { background: #ffffff; }
tr.g1 td { background: #f5f7fb; }
tr.g0.sub-balance td { background: #eef4fb; }
tr.g1.sub-balance td { background: #e6eefa; }

/* ---------- 信息列文本 ---------- */
.l { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.k { color: var(--ink-dim); margin-right: 2px; }
.hl { font-weight: 600; }
.sku { font-weight: 600; }
.mc {
  color: var(--ink-dim);
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
}
/* v1.18:绿字 #15803d 在 #dcf5e3 上 4.35:1(12px 小字不达 4.5),提 #166534 ≈6.2:1 */
.b-green { background: #dcf5e3; color: #166534; }
.b-red { background: #fde2e1; color: #b91c1c; }
.b-orange { background: #ffedd5; color: #c2410c; }
.b-gray { background: #e5e7eb; color: #4b5563; }

/* ---------- v1.8 批次4a:畅销/利润徽章点选(产品信息列 ASIN 下方) ---------- */
.badge-set { display: inline-flex; gap: 3px; }
.badge-btn {
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-dim);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}
.badge-btn.hot.on { background: #ffedd5; border-color: #c2410c; color: #c2410c; font-weight: 700; }
.badge-btn.profit.on { background: #dcf5e3; border-color: #15803d; color: #15803d; font-weight: 700; }
.badge-btn.ok { box-shadow: 0 0 0 2px rgba(22, 163, 74, .45); }
.badge-btn.err { box-shadow: 0 0 0 2px rgba(185, 28, 28, .45); }
/* v1.18:悬停反馈(原无 hover 态) */
.badge-btn:hover { border-color: #4f46e5; color: #4f46e5; }

/* ---------- 推演网格 ---------- */
td.num {
  text-align: center;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  padding: 6px 4px;
}
td.bal { font-weight: 600; }
tr td.zero { background: #fde2e1; color: #b91c1c; }
/* v1.6 V3「一定会断货」深红:最快物流当月天数也救不回的结余 ≤0 格;
同时有 zero 时 sure0 优先(更高优先级 + 书写在后) */
tr td.bal.sure0 { background: #fee2e2; color: #b91c1c; font-weight: 700; box-shadow: inset 0 0 0 1px #fca5a5; }
/* 2026-11:前六期(手动区)结余为 0 的格同样深红,悬停文案区分(见模板 title) */
tr td.bal.zero6 { background: #fee2e2; color: #b91c1c; font-weight: 700; box-shadow: inset 0 0 0 1px #fca5a5; }
/* 「不再备货」行:计划格置灰(在途小行保持原色);v1.18 文字提到 #4b5563
   (原 #9ca3af/#6b7280 在 #f3f4f6 上仅 2.3/4.4:1,小字不达 4.5:1) */
td.num.plan.nr { background: #f3f4f6; color: #4b5563; }
td.num.plan.nr .line-ship { color: #4b5563; }
/* 不再备货滑块(行级开关) */
.nr-toggle { position: relative; width: 34px; height: 18px; border-radius: 9px; border: 1px solid #d1d5db; background: #e5e7eb; color: transparent; cursor: pointer; padding: 0; vertical-align: middle; }
.nr-toggle::after { content: ""; position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.nr-toggle.on { background: #b91c1c; border-color: #b91c1c; }
.nr-toggle.on::after { left: 17px; }
.nr-toggle:hover { border-color: #9ca3af; }
.nr-toggle.on:hover { border-color: #b91c1c; }
tr td.plan { color: var(--ink-dim); font-size: 11.5px; }
tr td.plan.has { background: #dcf5e3; color: #166534; font-weight: 600; font-size: 12px; }
tr td.plan.sug { background: #ffedd5; }
tr td.plan.has.sug { background: linear-gradient(180deg, #dcf5e3 50%, #ffedd5 50%); }
tr td.plan .line-ship { color: #166534; font-weight: 600; font-size: 12px; }
tr td.plan .line-sug { color: #c2410c; font-weight: 600; font-size: 12px; }
tr td.plan.urg .line-sug { color: #b91c1c; }
.urg-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fde2e1;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 1px;
}
.decision-btn {
  border: 1px solid #fb923c;
  border-radius: 4px;
  padding: 0 4px;
  background: #fff7ed;
  color: #c2410c;
  cursor: pointer;
  font: inherit;
}
.decision-btn.pending { border-style: dashed; }
.decision-btn.allow { border-color: #b91c1c; color: #b91c1c; }
.decision-btn.expedited { border-color: #dc2626; }
.decision-btn.default_bridge { border-color: #2563eb; }
.decision-readonly.pending { color: #b45309; }
.decision-readonly.allow { color: #b91c1c; }
.decision-dialog .decision-meta { font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.decision-dialog #decision-route { min-width: 220px; }

/* ---------- 悬停 ---------- */
tr.sub-daily:hover td, tr.sub-balance:hover td, tr.sub-plan:hover td, tr.sku-row:hover td { background: #fff7e0; }

/* ---------- SKU 展开明细 ---------- */
.sku-toggle {
  display: inline-block;
  margin-top: 6px;
  font: inherit;
  font-size: 11.5px;
  padding: 1px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.sku-toggle:hover { border-color: var(--accent); background: #eff6ff; }
tr.sku-row td { padding-top: 3px; padding-bottom: 3px; }
.sku-sum {
  font-size: 12px;
  color: var(--ink-dim);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sku-sum .sku { color: var(--ink); margin-right: 4px; }

td.empty { text-align: center; padding: 48px 0; color: var(--ink-dim); }

/* ---------- v1.23.1 左侧导航边栏(仿领星:深色窄栏,图标在上文字在下) ---------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidenav {
  width: 64px; flex: none; background: #1b2233;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; justify-content: center; padding: 12px 0 10px; flex: none; }
.side-brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.side-menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; flex: 1; min-height: 0; overflow-y: auto; }
.side-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: 10px; text-decoration: none;
  color: #9aa7bd; font-size: 10px; line-height: 1.2; white-space: nowrap;
}
.side-item svg { width: 18px; height: 18px; flex: none; }
.side-item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.side-item.on { color: #fff; background: rgba(59, 130, 246, .28); font-weight: 600; }
.side-foot { padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.side-who {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .12);
  color: #e2e8f0; font-size: 12px; font-weight: 600; cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.side-foot-links { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.side-foot-links a { color: #9aa7bd; line-height: 0; padding: 5px; border-radius: 8px; }
.side-foot-links a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.side-foot-links svg { width: 16px; height: 16px; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 页签栏:仿浏览器/领星页签;激活=白底+顶部蓝条;× 悬停/激活/键盘聚焦才显示 */
.tabbar {
  display: flex; align-items: flex-end; gap: 6px;
  position: sticky; top: 0; z-index: 50; flex: none;
  padding: 8px 12px 0; overflow-x: auto;
  background: #fff; border-bottom: 1px solid var(--line);
}
.rtab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; font: inherit; font-size: 13px;
  color: var(--ink); background: #f8fafc; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0;
}
.rtab:hover { background: #f1f5f9; }
.rtab.on { background: #fff; color: var(--accent); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
.rtab-x {
  border: 0; background: none; padding: 0 3px; margin-right: -3px;
  font-size: 13px; line-height: 1; color: var(--ink-dim); cursor: pointer;
  border-radius: 4px; visibility: hidden;
}
.rtab:hover .rtab-x, .rtab.on .rtab-x, .rtab-x:focus-visible { visibility: visible; }
.rtab-x:hover { color: #b91c1c; background: #fee2e2; }

/* ---------- v1.23.1 补货建议列表格:列折叠/拖拽调宽/省略号/复制钮悬停 ---------- */
/* 折叠(.cf-inv/.cf-sale 挂在 table.grid):整列隐藏 + 列变量置 0,
   c4/mc/组头行的 sticky 偏移 calc(var(--w1)+…) 自动跟随;展开恢复默认宽 */
.grid.cf-inv { --w3: 0px; }
.grid.cf-inv col.w-inv, .grid.cf-inv .c3 { display: none; }
.grid.cf-sale { --w4: 0px; }
.grid.cf-sale col.w-sale, .grid.cf-sale .c4 { display: none; }
.col-fold {
  border: 0; background: none; cursor: pointer; color: var(--ink-dim);
  font-size: 10px; padding: 0 3px; margin-left: 3px; border-radius: 4px; vertical-align: 1px;
}
.col-fold:hover { color: var(--accent); background: #eff6ff; }
.col-restore {
  display: none;
  border: 1px solid var(--line); background: #f8fafc; cursor: pointer;
  color: var(--ink-dim); font-size: 10px; padding: 0 5px; margin-left: 4px;
  border-radius: 8px; vertical-align: 1px;
}
.grid.cf-inv .col-restore[data-col="inv"],
.grid.cf-sale .col-restore[data-col="sale"] { display: inline; }
.col-restore:hover { color: var(--accent); border-color: var(--accent); }
/* 产品信息列拖拽热区(th.c2 本身 sticky,直接作包含块) */
.col-grip {
  position: absolute; top: 0; right: -4px; width: 8px; height: 100%;
  cursor: col-resize; z-index: 8;
}
.grid.col-dragging { user-select: none; }
.grid.col-dragging .col-grip { background: rgba(37, 99, 235, .25); }
/* 产品信息列内容省略号(max-width 让 auto 布局把列宽约束回 col 变量宽) */
.grid td.c2 { overflow: hidden; max-width: 1px; }
.grid td.c2 .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* 复制按钮:悬停所在行(或键盘聚焦)才显示;title="复制" 气泡已有 */
.cp { visibility: hidden; }
tr:hover .cp, .cp:focus-visible { visibility: visible; }

/* ---------- 登录 / 改密卡片 ---------- */
.login-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 26px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .10);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card .brand { text-align: center; }
.card-title { margin: 0 0 12px; font-size: 17px; }
.fldv { display: flex; flex-direction: column; gap: 5px; color: var(--ink-dim); }
.fldv input {
  font: inherit;
  color: var(--ink);
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}
.fldv input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.btn-block { width: 100%; padding: 8px 0; }
.alert {
  background: #fde2e1;
  color: #b91c1c;
  border-radius: 6px;
  padding: 8px 10px;
}
/* v1.21 顶部统一同步横幅:整页宽条,不可手动关,同步恢复 ok 即消失 */
.sync-banner {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.sync-banner.blocked { background: #fde2e1; color: #b91c1c; }
.sync-banner.running { background: #dbeafe; color: #1d4ed8; }
.notice {
  background: #dcf5e3;
  color: #166534;
  border-radius: 6px;
  padding: 8px 10px;
}
.notice a { color: #166534; font-weight: 600; }
/* v1.8 批次6c:JS 镜像自测页失败汇总(红) */
.notice.planjs-err { background: #fee2e2; color: #b91c1c; }

/* ---------- 主页同步异常横幅 ---------- */
.sync-alert {
  margin: 10px 18px 0;
  padding: 10px 14px;
  background: #fde2e1;
  border: 1px solid #f3b4b2;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  color: #b91c1c;
}

/* ---------- 预估日均输入框 ---------- */
td.fc-cell { padding: 3px 4px; }
input.fc {
  width: 72px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 3px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  outline: none;
}
input.fc:hover:not(:disabled) { border-color: #cbd5e1; }
input.fc:focus:not(:disabled) {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}
input.fc.man { color: #1d4ed8; font-weight: 700; border-bottom: 2px solid #93c5fd; }
input.fc:disabled { color: var(--ink-dim); cursor: not-allowed; }
input.fc.ok { background: #dcf5e3; }
input.fc.err { background: #fde2e1; }

/* ---------- v1.18:预估日均划选:整格与 input 同步橙显,计数仍只取 input ---------- */
/* 划选描边 #d97706(原 #f59e0b 对白底 2.1:1,非文本指示物不达 3:1) */
body.fc-dragging { user-select: none; }
body.fc-dragging input.fc:not(:disabled) { cursor: crosshair; }
td.fc-cell.fc-sel {
  background: #ffedd5;
  box-shadow: inset 0 0 0 2px #d97706;
}
input.fc.fc-sel {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .35);
}
#fc-batch-pop {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
  font-size: 13px;
}
#fc-batch-pop[hidden] { display: none; }
.fc-batch-info { color: var(--ink-dim); white-space: nowrap; }
#fc-batch-val {
  width: 90px;
  font: inherit;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
}

/* ---------- 分页栏 ---------- */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 18px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.pg-info { color: var(--ink-dim); }
.pg-btn {
  padding: 4px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  background: #fff;
}
.pg-btn:hover { border-color: var(--accent); background: #eff6ff; }

.prod-pager {
  height: auto;
  min-height: 48px;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 6px 16px;
}
.prod-pg-info { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prod-pg-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  overflow-x: auto;
}
.prod-pg-controls > .pg-btn { flex: none; }
.prod-pager .pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}
.prod-pager .prod-pg-page { border-color: transparent; }
.prod-pager .prod-pg-page[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.prod-pager .pg-btn.is-disabled,
.prod-pager .pg-btn.is-disabled:hover {
  border-color: var(--line);
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}
.prod-pg-ellipsis { min-width: 20px; text-align: center; color: var(--ink-dim); }
.prod-pg-jump { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-dim); white-space: nowrap; }
.prod-pg-jump input {
  width: 58px;
  min-width: 0;
  height: 32px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.prod-pager .pg-btn:focus-visible, .prod-pg-jump input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 后台页面 ---------- */
.admin-wrap { max-width: 960px; margin: 22px auto; padding: 0 18px; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select, .row-actions input, .user-ops input {
  font: inherit;
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}
.admin-table { border-collapse: collapse; width: 100%; margin-bottom: 10px; }
.admin-table th, .admin-table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  font-size: 12.5px;
}
.admin-table th { background: #f1f5f9; }
.admin-table td.wrap { white-space: normal; word-break: break-all; }

/* 每日定时同步时间点(v1.21.1):本地增删的 chip 列表 */
.schedule-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.schedule-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}
.chip-x {
  border: 0;
  background: none;
  color: #b91c1c;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.chip-x:hover { color: #7f1d1d; }

/* ---------- 生产需求页(2026-11 企业看板改版:Swiss/Minimal,密度 8) ---------- */
.demand-wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px 32px; }
.demand-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin: 24px 0 16px;
}
.demand-title { margin: 0; font-size: 21px; font-weight: 800; color: #0f172a; letter-spacing: .01em; }
.demand-sub { margin: 5px 0 0; font-size: 12px; color: #7c8aa0; max-width: 560px; line-height: 1.6; }
.demand-kpis { display: flex; gap: 8px; flex-wrap: nowrap; width: 1080px; margin-inline: auto; overflow-x: auto; padding-bottom: 2px; }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid #1e40af;
  border-radius: 12px;
  padding: 8px 10px 8px;
  flex: 1 1 0;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: box-shadow .15s;
}
.kpi-sub { font-size: 10px; color: #a5b4c8; margin-left: 4px; }
.kpi:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .09); }
.kpi-amber { border-left-color: #d97706; }
.kpi-slate { border-left-color: #475569; }
.kpi-label { display: block; font-size: 11.5px; color: #7c8aa0; }
.kpi-value {
  display: block;
  font-size: 23px;
  font-weight: 800;
  color: #16233b;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  margin-top: 1px;
}
.kpi-indigo .kpi-value { color: #1e3a8a; }
.kpi-amber .kpi-value { color: #92400e; }
.kpi-slate .kpi-value { color: #334155; }
.kpi-value .cell-unit { font-size: 11px; font-weight: 500; color: #94a3b8; margin-left: 3px; }
.kpi-extra { display: block; font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.demand-panel { padding: 0; overflow: hidden; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #eef2f7;
}
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.panel-tag {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px 11px;
}
/* 宽表横向滚动容器(审查项:可复用类) */
.table-scroll { overflow-x: auto; }
/* 固定布局:店铺/合计列定宽,月列剩余宽度自动均分(等宽);
   min-width 保证列多时不被压到内容溢出,而是出横向滚动条 */
.demand-table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 13px;
  table-layout: fixed;
  width: 100%;
  min-width: 960px;
}
.demand-table th, .demand-table td {
  border: none;
  border-bottom: 1px solid #eef2f7;
  padding: 8px;
}
.demand-table td { overflow: hidden; }
/* 表头:月份双行(11月 / 2026) */
.demand-table thead th {
  background: #fbfcfe;
  color: #64748b;
  font-weight: 600;
  font-size: 11.5px;
  text-align: right;
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
}
.demand-table thead th.dh-store { text-align: left; padding-left: 18px; width: 116px; }
.mh-m { display: block; font-size: 13px; font-weight: 700; color: #334155; }
.mh-y { display: block; font-size: 10.5px; font-weight: 500; color: #a5b4c8; margin-top: 1px; }
.demand-table tbody tr:nth-child(even) { background: #fafbfd; }
.demand-table tbody th.dh-store, .demand-table tbody td {
  background: transparent;
}
.dh-store { text-align: left; min-width: 112px; font-weight: 600; color: #1e293b; }
.demand-table tbody th.dh-store {
  position: sticky;
  left: 0;
  background: inherit;
  padding-left: 18px;
  box-shadow: 1px 0 0 #eef2f7;
  z-index: 1;
}
.demand-table thead th.dh-store {
  position: sticky;
  left: 0;
  z-index: 3;
}
/* 待配货/待发货列:跟在店铺列后的左吸附组(偏移 116 / 208px),
   浅灰蓝底色区分「当前状态列」与「月份列」 */
.demand-table thead th.dh-pa, .demand-table tbody td.dh-pa {
  position: sticky;
  left: 116px;
}
.demand-table thead th.dh-ps, .demand-table tbody td.dh-ps {
  position: sticky;
  left: 208px;
}
.demand-table thead th.dh-pa, .demand-table thead th.dh-ps {
  z-index: 3;
  width: 92px;
}
.demand-table tbody td.dh-pa, .demand-table tbody td.dh-ps {
  background: #f6f8fc;
  z-index: 1;
}
.demand-table tbody td.dh-pa, .demand-table tbody td.dh-ps {
  box-shadow: 1px 0 0 #eef2f7;
}
/* v1.20 发货需求表等宽契约:首列(店铺/国家)定宽 150px,其余 6 列
   (待配货/待发货/4 个月列)完全等宽——table-layout fixed 下 6 列不指定
   宽度=均分剩余(1080-150)/6=155px;去掉按列数缩放的内联 min-width;
   合计行已删(v1.20),无同行规则问题。sticky 吸附偏移=150/305px 随定宽 */
.demand-fixed { table-layout: fixed; width: 1080px; min-width: 1080px; }
.demand-fixed thead th.dh-store { width: 150px; }
/* 覆盖 .demand-table 既有的 dh-pa/dh-ps 92px 定宽:6 列均分剩余 155px */
.demand-fixed thead th.dh-pa { width: auto; left: 150px; }
.demand-fixed thead th.dh-ps { width: auto; left: 305px; }
.demand-fixed tbody td.dh-pa { left: 150px; }
.demand-fixed tbody td.dh-ps { left: 305px; }
.demand-table td.num {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.demand-table td.num .cell-unit { font-size: 10.5px; font-weight: 500; color: #a5b4c8; margin-left: 2px; }
/* 件数副行(箱数为主时) */
.cell-sub { display: block; font-size: 10.5px; font-weight: 500; color: #a5b4c8; margin-top: 1px; }
.kpi-none { color: #cbd5e1; }
.dh-none { color: #d3dce8; }
/* 可点击单元格:指针 + 悬停/聚焦描边(审查项:interactive states) */
td.demand-cell { cursor: pointer; transition: box-shadow .12s; }
td.demand-cell:hover, td.demand-cell:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(30, 64, 175, .55);
}
/* 合计行 */
.demand-table tr.dh-sum th, .demand-table tr.dh-sum td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  border-bottom: none;
  font-weight: 700;
  color: #0f172a;
}
.demand-table tr.dh-sum th.dh-store {
  background: #f1f5f9;
}
.demand-table tr.dh-sum td .cell-sub { color: #7c8aa0; }
/* 构成明细浮层(点击/回车展开;Esc/点外部关闭,逻辑在 app.js 委托) */
.demand-pop {
  position: absolute;
  z-index: 40;
  min-width: 200px;
  max-width: 340px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.8;
  white-space: nowrap;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}
.demand-pop .demand-pop-title {
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 3px;
}
/* 构成浮层分组标签(2026-11-06 五组:计划到货/待配货/逾期待配货/待发货/
   逾期待发货),空组不渲染(JS 控制) */
.demand-pop .dpg-label {
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
  margin-top: 5px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 3px;
}
/* 页级筛选(2026-11-06 国别/店铺) */
.demand-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; }
.df-lbl { font-size: 12.5px; color: #64748b; }
.df-select {
  font-size: 12.5px;
  color: #1e293b;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
}
.df-select:focus-visible { outline: 2px solid rgba(37, 99, 235, .4); outline-offset: 1px; }
.df-hint { font-size: 11.5px; color: #a5b4c8; }
/* v1.20.2 两表内嵌筛选表单(发货需求 country/store、实际发货 acountry/
   astore,分别位于各自 panel-head,独立提交) */
.df-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px; flex-wrap: wrap; }
/* 月份格/KPI 卡里的待配货/待发货琥珀行:已被 v1.20 .cell-row 色条行
   取代,此处仅留待*列(pending_cell)的含逾期红字 */
.cell-overdue { color: #dc2626; font-weight: 600; font-size: 11px; margin-left: 4px; white-space: nowrap; }
.cell-overdue b { font-size: 13px; font-weight: 700; }
.cell-overdue small { font-size: 10px; font-weight: 500; color: #dc2626; }
/* 五层格式(v1.20 重设计):主行「A+B 箱」15px/700 + 右侧同行「a+b 件」
   10px 深灰;明细三行 10.5px、3px 左侧色条(建议=靛蓝 #1e40af/待配货=
   琥珀 #92400e/待发货=青绿 #0f766e,白底对比度 8.7/7.1/5.5 全 ≥4.5),
   逾期红字后缀「·逾期 C箱c件」仅 >0,全零行省略 */
.cell-main { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 700; color: #1e293b; }
.cell-main-boxes { white-space: nowrap; }
.cell-main .cell-unit { font-size: 11px; font-weight: 500; color: #94a3b8; margin-left: 2px; }
.cell-main-pcs { font-size: 10px; font-weight: 500; color: #475569; white-space: nowrap; }
.cell-row { display: block; margin-top: 3px; padding-left: 6px; border-left: 3px solid; font-size: 10.5px; font-weight: 600; line-height: 1.5; white-space: normal; }
.cell-row small { font-weight: 500; opacity: .82; }
.cell-row-plan { border-color: #1e40af; color: #1e40af; }
.cell-row-alloc { border-color: #92400e; color: #92400e; }
.cell-row-ship { border-color: #0f766e; color: #0f766e; }
.cell-overdue-suffix { color: #dc2626; font-weight: 700; font-size: 10px; white-space: nowrap; }
/* KPI 卡:五行同构,主行放大;整卡可点(v1.20)=button 重置 + 焦点可见 */
.kpi .cell-main { font-size: 21px; font-weight: 700; color: #1e3a8a; }
.kpi .cell-main .cell-unit { font-size: 11px; }
button.kpi-modal { font: inherit; text-align: left; cursor: pointer; }
button.kpi-modal:focus-visible { outline: 2px solid rgba(37, 99, 235, .5); outline-offset: 2px; }
/* 视图切换(国家视图↔店铺视图,demand 两表各一组) */
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: auto; }
.vs-btn { padding: 4px 12px; font-size: 12px; color: #64748b; background: #fff; text-decoration: none; }
.vs-btn + .vs-btn { border-left: 1px solid var(--line); }
.vs-btn.on { background: #1e40af; color: #fff; }
.vs-btn:hover { text-decoration: none; }
.vs-btn:not(.on):hover { background: #f1f5f9; }
/* 格子弹窗(发货单维度五组 × 七列,app.js initDemandDetail;v1.20 加宽到
   720px 容纳 店铺/单号/状态/预计发货时间/系统 ETA/箱数/件数) */
.demand-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; }
.dm-panel { background: #fff; border-radius: 10px; max-width: 720px; width: 100%; max-height: 84vh; overflow: auto; overscroll-behavior: contain; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); padding: 14px 18px 18px; }
.dm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dm-title { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.dm-close { border: 0; background: none; font-size: 20px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 2px 6px; }
.dm-close:hover { color: #0f172a; }
.dm-group { margin-top: 10px; }
.dm-group-name { font-size: 12.5px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.dm-group-name a { color: #1d4ed8; text-decoration: none; }
.dm-group-name a:hover { text-decoration: underline; }
.dm-count { margin-left: 8px; font-size: 11px; font-weight: 500; color: #94a3b8; }
.dm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dm-table th, .dm-table td { border: 1px solid #eef2f7; padding: 4px 8px; text-align: left; }
.dm-table th { background: #f8fafc; color: #64748b; font-weight: 600; }
.dm-table td.r, .dm-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.dm-table a { color: #1d4ed8; text-decoration: none; }
.dm-table a:hover { text-decoration: underline; }
.dm-table td.nw, .dm-table th.nw { white-space: nowrap; }
.dm-overdue { color: #dc2626; font-weight: 700; font-size: 11px; }
.dm-days { color: #64748b; font-size: 11px; }
.dm-est-late { color: #dc2626; font-weight: 700; }
/* 多行月份格顶部对齐,四行结构可扫读 */
td.demand-cell { vertical-align: top; }
/* 「实际发货」曲线图(2026-11 计划B;绘制逻辑在 app.js initActualChart) */
.actual-chart-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 4px;
}
.actual-chart-lbl { font-size: 12px; color: #64748b; }
.actual-chart-select {
  font-size: 12.5px;
  color: #1e293b;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
}
.actual-chart { padding: 2px 18px 14px; }
.actual-chart svg { display: block; width: 100%; height: auto; }
.actual-chart .ac-grid { stroke: #f1f5f9; stroke-width: 1; }
.actual-chart .ac-axis { stroke: #e2e8f0; stroke-width: 1; }
.actual-chart .ac-bar { fill: rgb(30, 64, 175); cursor: pointer; }
.actual-chart .ac-bar:hover, .actual-chart .ac-bar:focus-visible {
  fill: #1e3a8a;
  outline: none;
}
.actual-chart .ac-bar-zero { fill: #e2e8f0; cursor: pointer; }
.actual-chart .ac-lbl { font-size: 10.5px; fill: #94a3b8; }
.actual-chart .ac-val { font-size: 9.5px; fill: #64748b; }
.actual-empty { padding: 30px 0; text-align: center; font-size: 12.5px; color: #cbd5e1; }
/* hover 浮层:复用 .demand-pop 主体样式,仅覆盖定位锚点 */
.actual-tip { transform: translateX(-50%); pointer-events: none; }
@media (max-width: 900px) {
  .demand-head { align-items: flex-start; flex-direction: column; }
}
.row-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.row-actions .inline { display: inline-flex; gap: 6px; }
.btn-muted { background: #64748b; }
.btn-muted:hover { background: #475569; }
.btn-danger { background: #b91c1c; }
.btn-danger:hover { background: #991b1b; }
.btn:disabled { background: #94a3b8; cursor: not-allowed; }
.user-table td { vertical-align: middle; }
.user-ops { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-ops .inline { display: inline-flex; gap: 6px; }
.user-ops input { width: 110px; }
.grant-summary { white-space: nowrap; }
.grant-row td { background: #f8fafc; }
.hint { color: var(--ink-dim); font-size: 12.5px; margin-left: 10px; }
.panel .hint:first-child, .panel p.hint { margin-left: 0; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }

/* ---------- 设置页:运输天数矩阵 ---------- */
.trans-matrix th, .trans-matrix td { text-align: center; padding: 4px 5px; }
.trans-matrix td.region { text-align: left; white-space: nowrap; font-weight: 600; }
.trans-matrix input { width: 54px; font: inherit; padding: 4px 4px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: center; outline: none; }
.trans-matrix input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.sales-n input { width: 90px; font: inherit; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; outline: none; }
.sales-n input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }

/* ---------- 行警告块(补货建议 c3;v1.18 由 div 改 <button>,键盘/读屏可触达) ---------- */
.row-warn {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: #b45309;
  cursor: help;
}
.row-warn.blk { color: #b91c1c; }
.row-warn[hidden] { display: none; }
/* v1.7 B6:带明细的警告(no_valid_eta)可点击弹明细 */
.row-warn.has-details { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.row-warn.has-details:hover { color: #92400e; }
.row-warn.has-details.blk:hover { color: #991b1b; }
.warn-dialog { max-width: 640px; }

/* ---------- 历史期列(当前 24 期之前,默认收起,全部只读) ---------- */
.grid .hist { display: none; }
.grid.show-hist .hist { display: table-cell; }
.grid.show-hist col.hist { display: table-column; }
td.hcell { font-size: 11.5px; color: var(--ink-dim); }
td.hcell .h-est, td.hcell .h-act { white-space: nowrap; }
td.hcell .h-act { color: var(--ink); }
tr td.hplan.has { background: #dcf5e3; }
tr td.hplan.sug { background: #ffedd5; }
tr td.hplan.has.sug { background: linear-gradient(180deg, #dcf5e3 50%, #ffedd5 50%); }
tr td.hplan .line-ship { color: #166534; font-weight: 600; font-size: 12px; }
tr td.hplan .line-sug { color: #c2410c; font-weight: 600; font-size: 12px; }
tr td.hplan.urg .line-sug { color: #b91c1c; }
#hist-toggle {
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  margin-right: 8px;
  white-space: nowrap;
}
#hist-toggle:hover { border-color: var(--accent); background: #eff6ff; }
#hist-toggle:disabled {
  color: var(--ink-dim);
  background: #f1f5f9;
  cursor: not-allowed;
}
#hist-toggle:disabled:hover { border-color: #cbd5e1; background: #f1f5f9; }

/* ---------- 补货页参数已保存提示 ---------- */
.page-notice { margin: 10px 18px 0; }

/* ---------- 生产在途页:内容单行,独立横向滚动,不冻结列/不定高 ---------- */
.ship-wrap { box-sizing: border-box; width: 100%; max-width: none; margin: 22px 0; padding: 0 18px; }
.ship-hint { color: var(--ink-dim); margin: 8px 2px; }
.b-blue { background: #dbeafe; color: #1d4ed8; }
.ship-table-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
.ship-table { margin-bottom: 0; width: max-content; min-width: 100%; table-layout: auto; }
.ship-table th, .ship-table td { white-space: nowrap; }
.ship-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.ship-table td.eta { font-weight: 600; color: #15803d; }
/* v1.12 预计发货时间:推算日期早于今天(待配货/待发货已超期未发)标橙提醒 */
.ship-table td.est-ship-late { color: #c2410c; font-weight: 600; }
.ship-table .ship-order, .ord-items .ship-order { min-width: 180px; }
.ship-table .ship-sku, .ord-items .ship-sku { min-width: 150px; }
.ship-table .ship-fba-id, .ord-items .ship-fba-id { min-width: 170px; }
.ship-table .eta-dd-menu { position: fixed; }
#ship-modal { width: calc(100vw - 32px); max-width: calc(100vw - 32px); }
#ship-modal-body { overflow-x: auto; }
#ship-modal .ord-ticket { white-space: nowrap; }
#ship-modal .ord-items { width: max-content; min-width: 100%; table-layout: auto; }
#ship-modal .ord-items th, #ship-modal .ord-items td { white-space: nowrap; }

/* ---------- 主页 ASIN 跳转链接 ---------- */
a.asin-link { color: var(--accent); text-decoration: none; }
a.asin-link:hover { text-decoration: underline; }

/* ---------- 主页(导航页)卡片 ---------- */
.home-wrap { max-width: 1080px; margin: 30px auto; padding: 0 18px; }
.home-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.home-head .brand { font-size: 22px; }
.home-meta { color: var(--ink-dim); }
.home-meta a { color: var(--accent); }
.home-hint { margin: 10px 2px 0; font-size: 12px; color: var(--ink-dim); }
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.home-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.home-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(37, 99, 235, .15); }
.home-card-title { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.home-card-desc { color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; }

.sync-dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  max-width: 480px;
  width: calc(100% - 32px);
  color: var(--ink);
  box-shadow: 0 12px 36px rgba(15, 23, 42, .25);
  /* v1.18:长内容不越视口;滚轮不穿透到背景(触屏/细滚轮) */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sync-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.sync-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.sync-dialog.warning h2 { color: #b45309; }
.sync-dialog.blocked h2 { color: #b91c1c; }
.sync-dialog-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.home-card.disabled { opacity: .6; cursor: not-allowed; background: #f8fafc; }
.home-card.disabled:hover { border-color: var(--line); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }

/* ---------- c2 行内复制按钮 ---------- */
.cp {
  border: none;
  background: transparent;
  cursor: pointer;
  /* v1.18:#64748b 实色(原 #94a3b8×0.6 透明叠白底仅 ~1.6:1,图标不达 3:1) */
  color: #64748b;
  padding: 0 2px;
  margin-left: 4px;
  vertical-align: -1px;
}
.cp:hover { color: #334155; }
.cp-ok { color: #15803d; }

/* 手动同步进度条(v1.23.3):步骤级 N/9,/admin/sync/status 下发 */
.sync-prog {
  display: inline-block; width: 220px; height: 6px; margin: 0 8px;
  background: #e2e8f0; border-radius: 999px; overflow: hidden;
  vertical-align: middle;
}
.sync-prog > i {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: 999px;
  transition: width .3s;
}

/* ---------- 复制结果提示气泡(见 app.js showCopyTip) ---------- */
.copy-tip {
  position: fixed;
  transform: translate(-50%, calc(-100% - 6px));
  background: #15803d;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}
.copy-tip.show { opacity: 1; }
.copy-tip.err { background: #b91c1c; }

/* ---------- 预计/逾期到货弹窗与手动预估(v1.4 T4) ---------- */
tr td.plan .ship-btn {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  cursor: pointer;
  display: block;
}
tr td.plan .ship-btn:hover { text-decoration: underline; }
tr td.plan .ship-btn.ovd, tr td.plan .line-ship.ovd { color: #b91c1c; }
/* AWD 到货标记色(v1.5 W5,紫);逾期红色优先级更高 */
tr td.plan .line-ship.awd, tr td.plan .ship-btn.awd { color: #6d28d9; }
tr td.plan .ship-btn.awd.ovd, tr td.plan .line-ship.awd.ovd { color: #b91c1c; }
/* v1.23.8 在途合并数字块:数字大单位小(对齐需求页 10,048箱 式)+列内数字
   对齐(tabular-nums);格底六色点(紫橙=AWD 两程,绿棕蓝红=单票状态) */
tr td.plan .ship-num .bx { display: block; line-height: 1.15; white-space: nowrap; }
tr td.plan .ship-num .n { font-size: 16px; font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
tr td.plan .ship-num .u { font-size: 11px; font-weight: 600; color: #334155; margin-left: 1px; }
tr td.plan .ship-num .pcs { display: block; font-size: 10.5px; color: #475569; font-style: normal; line-height: 1.25; margin-top: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr td.plan .cell-dots { margin-top: 3px; display: flex; gap: 4px; align-items: center; }
/* 圆点钉在格子框最底部(用户要求"格子的底部";格高由整行撑开,流内排列只
   会紧跟内容,故绝对定位到底边) */
tr td.num.plan { position: relative; }
tr td.plan .cell-dots { position: absolute; left: 6px; bottom: 4px; margin-top: 0; }
tr td.plan .cdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
tr td.plan .cdot.dot-ows { background: #7c3aed; }
tr td.plan .cdot.dot-delivery { background: #ea580c; }
tr td.plan .cdot.dot-done { background: #16a34a; }
tr td.plan .cdot.dot-alloc { background: #92400e; }
tr td.plan .cdot.dot-ship { background: #2563eb; }
tr td.plan .cdot.dot-ovd { background: #dc2626; }
/* 2026-11-16 行级逾期未签收合计红字(指标列「备货计划」标签下方):点击开在途
   弹窗(汇总该行全部逾期未签收票);mc 列本身居中,红字块级另起一行 */
.mc-ovd {
  display: block; margin-top: 2px; padding: 0; border: none; background: none;
  font: inherit; font-size: 10.5px; font-weight: 600; color: #b91c1c;
  cursor: pointer; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.mc-ovd:hover { text-decoration: underline; }
/* 2026-11-16 行高拍板:备货计划行(与预估日均/库存结余三行一组)收紧内边距
   与行距,常态行与另外两行等高;内容特别多的格子仍由内容撑高,不强制截断 */
tr.sub-plan td.plan { padding: 3px 8px; line-height: 1.3; }
tr.sub-plan td.plan .line-man, tr.sub-plan td.plan .line-sug { font-size: 11.5px; }
.awd-badge {
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.arrival-dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  /* v1.23.15 按内容撑宽(用户:完全展示全部内容);窄屏横向滚动不换行压缩 */
  width: max-content;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  color: var(--ink);
  box-shadow: 0 12px 36px rgba(15, 23, 42, .25);
  /* v1.18:手动到货列表等长内容不越视口;滚轮不穿透到背景 */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.arrival-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.arrival-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.ord { border-top: 1px solid var(--line); padding: 10px 0; }
.ord-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ord-sn { font-weight: 700; }
.ord-qty { color: var(--ink-dim); font-size: 12.5px; }
.ovd-badge {
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.ord-sum, .ord-eta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ord-eta .eta-input {
  font: inherit;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--ink);
}
.ord-eta .eta-ro { font-weight: 600; color: #b45309; }
.ord-detail { margin-top: 8px; }
.ord-ticket { font-size: 12.5px; color: var(--ink-dim); margin-bottom: 6px; }
.ord-items { margin-bottom: 0; }
/* v1.6 V3:弹窗免展开的本行明细小表;整票展开后命中本行 SKU 的行标橙 */
.ord-mini { margin: 6px 0 2px; font-size: 12px; }
.ord-items tr.hit td { background: #ffedd5; }
.ord-toggle { padding: 2px 10px; font-size: 12px; }
.ship-table td.eta-man { font-weight: 600; color: #b45309; }
/* v1.7 B7:手动预估「保存」下拉按钮(应用于该产品/整票) */
.eta-dd { position: relative; display: inline-block; }
.eta-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 128px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
  overflow: hidden;
}
.eta-dd-menu[hidden] { display: none; }
.eta-dd-menu button {
  font: inherit;
  text-align: left;
  padding: 7px 12px;
  border: none;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.eta-dd-menu button:hover { background: #eff6ff; color: var(--accent); }
.eta-saved { color: #15803d; font-size: 12px; font-weight: 600; }
/* v1.7 B7:逾期票明细丢失标记(按钮 + 已丢失行灰显、剩余归 0) */
.lost-btn { padding: 1px 10px; font-size: 12px; }
.ord-mini tr.is-lost td { color: #9aa1b2; }
.ord-mini td.ieta { color: #b45309; font-weight: 600; }

/* ---------- 工具栏弹出按钮与面板(v1.5 W4:「筛选」「分组」) ---------- */
.tb-pop { position: relative; }
.tb-btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.tb-btn:hover { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.tb-btn.on { border-color: var(--accent); color: var(--accent); background: #eff6ff; font-weight: 600; }
/* v1.9 R2:警告筛选按钮激活态走警告琥珀色(与行内 .row-warn 同色系) */
.warn-btn.on { border-color: #b45309; color: #b45309; background: #fef3c7; }
.stockout-btn.on { border-color: #b91c1c; color: #b91c1c; background: #fee2e2; }
.tb-btn.open { box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.tb-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}
.tb-panel[hidden] { display: none; }
.tb-panel .fld.chk { color: var(--ink); cursor: pointer; }
.tb-panel input[type="checkbox"] { width: auto; }
/* v1.8 批次4b:权重日均区间(筛选面板内两个小号数字输入) */
.tb-panel .wd-range { display: flex; align-items: center; gap: 6px; color: var(--ink); white-space: nowrap; }
.tb-panel .wd-range input[type="number"] { width: 64px; padding: 3px 6px; }
.tb-panel .wd-range .sep { color: var(--ink-dim); }
.tb-hint { margin: 0; color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
/* v1.7 B2:面板「确定」按钮;有未应用改动时 .dirty 橙色高亮提示 */
.tb-actions { display: flex; justify-content: flex-end; }
.tb-apply { padding: 4px 16px; }
/* v1.18:脏标记底色 #b45309(原 #f59e0b 配白字仅 2.1:1,按钮小字不达 4.5:1) */
.tb-apply.dirty { background: #b45309; box-shadow: 0 0 0 2px rgba(180, 83, 9, .35); }
.tb-apply.dirty:hover { background: #92400e; }
/* v1.7 B3:搜索按钮(放大镜图标) */
.btn-search { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; }
.fld-search select { border-radius: 6px 0 0 6px; border-right: none; }
.fld-search select#search-match { border-radius: 0; }
.fld-search input { border-radius: 0 6px 6px 0; }
#search-q[readonly] { background: #f1f5f9; color: var(--ink-dim); }
.multi-search-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; }
.multi-search-dialog { width: min(560px, 90vw); }
.multi-search-dialog textarea {
  box-sizing: border-box; width: 100%; min-height: 180px; resize: vertical;
  padding: 10px; border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font: inherit; line-height: 1.55;
}
.multi-search-error { color: #b91c1c; white-space: pre-wrap; }
.multi-search-error[hidden] { display: none; }

/* ---------- 全屏加载遮罩(v1.5.1:勾选筛选/分组给即时反馈) ---------- */
.app-mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(255, 255, 255, .55);
  display: flex; align-items: center; justify-content: center;
}
.app-mask[hidden] { display: none; }
.app-mask-box {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 22px; box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
  font-size: 14px; color: var(--ink);
}
.app-mask-spin {
  width: 16px; height: 16px;
  border: 2px solid #cbd5e1; border-top-color: var(--accent);
  border-radius: 50%; animation: app-spin .8s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* ---------- 分组显示:组头行/展开收起(v1.5 W4 起组头只留组名+展开收起) ---------- */
tr.grp-row td { background: #e8eef9; font-weight: 600; }
tr.grp-row.grp-spu td { background: #f2f6fd; }
/* v1.18:组头冻结在表头下方。z 序=4(高于数据行冻结列 3、低于表头 5);
   top 由 reflowFrozen 实测表头高/组头行高写 CSS 变量(默认值为 JS 未跑兜底);
   修复旧硬编码 0/28/56:店铺组头整行被表头盖住、父组头被削顶(浏览器实测) */
tr.grp-row { position: sticky; z-index: 4; }
tr.grp-row.grp-store { top: var(--gt-store, 37px); }
tr.grp-row.grp-parent { top: var(--gt-parent, 72px); }
tr.grp-row.grp-spu { top: var(--gt-spu, 107px); }
.grp-toggle {
  font: inherit;
  font-size: 11.5px;
  padding: 1px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.grp-toggle:hover { border-color: var(--accent); background: #eff6ff; }
.grp-label { margin-left: 8px; }
/* v1.7 B4:组头款名/父ASIN 完整展示不换行(列宽不够时表格横向滚动兜底) */
tr.grp-row td .grp-label { white-space: nowrap; }
tr.grp-spu .grp-label { padding-left: 20px; }
/* v1.6 V3:组头 SKU 去重计数(组名后);#4b5563(ink-dim 在组头 #e8eef9 上 ~4.3:1 不达 4.5) */
.grp-cnt { margin-left: 8px; color: #4b5563; font-weight: 400; font-size: 12px; }
tr.grp-row:hover td { background: #dfe8f8; }

/* ---------- 参数设置:已禁用的大森林渠道行整行置灰(v1.16) ---------- */
tr.row-disabled td { background: #f1f5f9; color: var(--ink-dim); }
tr.row-disabled input, tr.row-disabled select { color: var(--ink-dim); }

/* ---------- v1.18 UI 审查修复(可达性/触屏/动效) ---------- */
/* 跳转链接:键盘 Tab 首站,focus 后左上角显现,跳到表格滚动区 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
/* 读屏专用(工具栏计数异步播报等) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* 预估推导 tooltip(悬停 title + 聚焦浮层双通道,逻辑见 app.js initFcTips) */
.fc-tip {
  position: fixed;
  z-index: 70;
  max-width: 340px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  line-height: 1.6;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
  pointer-events: none;
  white-space: pre-wrap;
}
/* 触屏:去双击缩放延迟与点按高亮(局域网桌面端无感,触屏生效) */
body { -webkit-tap-highlight-color: transparent; }
button, a, select, input, textarea, label { touch-action: manipulation; }
/* 动效可达性:系统减少动态时关停旋转与过渡 */
@media (prefers-reduced-motion: reduce) {
  .app-mask-spin { animation: none; }
  .copy-tip, .nr-toggle::after, .kpi, .demand-cell, .sync-prog > i { transition: none; }
}

/* ---------- v1.21 店铺/国家多选组件(三页统一,零依赖;逻辑见 app.js initMs) ---------- */
/* 结构:.ms(相对定位容器)> .ms-btn(触发钮,仿下拉)+ .ms-panel(浮层,含
   .ms-search 搜索框 / .ms-all 全选行 / .ms-list 可滚动 checkbox 列表 /
   .ms-foot 底部计数+取消+确定)。Esc/外点/取消关闭且不生效,确定才写入
   隐藏域并提交;aria-expanded 同步;选项主名+国家小字(.ms-sub)。 */
.ms { position: relative; display: inline-flex; }
.ms-btn {
  font: inherit;
  color: var(--ink);
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 108px;
  justify-content: space-between;
}
.ms-btn:hover { border-color: var(--accent); }
.ms-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); outline: none; }
.ms-btn[aria-expanded="true"] { border-color: var(--accent); }
.ms-caret { color: var(--ink-dim); font-size: 11px; }
.ms-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 40;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
  width: 260px;
  display: flex;
  flex-direction: column;
}
/* 浮层显隐只靠 hidden 属性;[hidden] 必须压过上面的 display:flex,
   否则浮层常显、点哪里都关不上(2026-11-08 修复 v1.21 回归) */
.ms-panel[hidden] { display: none; }
.ms-search {
  font: inherit;
  margin: 8px 8px 4px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}
.ms-search:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .15); }
.ms-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ms-list {
  list-style: none;
  margin: 0;
  padding: 4px 4px;
  max-height: 220px;
  overflow-y: auto;
}
.ms-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.ms-item label:hover { background: #f1f5f9; }
/* 勾选框保持原生尺寸:外层 .fld 的宽度规则不得渗透进来(2026-11-08) */
.ms-item input[type="checkbox"] { margin: 0; width: auto; flex: none; }
.ms-name { white-space: nowrap; }
/* 国家小字紧跟店名整体左对齐(领星样式);仅筛选此项默认隐藏、行悬停/键盘聚焦时显右 */
.ms-sub { font-size: 11px; color: var(--ink-dim); white-space: nowrap; }
.ms-only {
  margin-left: auto;
  visibility: hidden;
  border: 0;
  background: none;
  padding: 0 2px;
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.ms-item:hover .ms-only,
.ms-item:focus-within .ms-only { visibility: visible; }
.ms-only:hover { text-decoration: underline; }
.ms-empty { padding: 10px; color: var(--ink-dim); font-size: 12px; text-align: center; }
.ms-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.ms-count { flex: 1; font-size: 11.5px; color: var(--ink-dim); }
.ms-foot .btn { padding: 4px 12px; font-size: 12.5px; }

/* ---------- 下单建议/备料单/生产单/发货单共用数据表 ---------- */
.orders-wrap { width: 100%; padding: 0 0 18px; }
.orders-toolbar { position: relative; }
.orders-toolbar .filters { flex: 1; }
.oa-columns { position: relative; margin-left: auto; align-self: center; }
.oa-column-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 45;
  display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 8px 14px;
  min-width: 250px; padding: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.16); }
.oa-column-panel[hidden] { display: none; }
.oa-column-panel label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.orders-actions { display: flex; align-items: center; gap: 8px; padding: 10px 18px; }
.orders-actions > span { margin-left: auto; color: var(--ink-dim); font-size: 12px; }
.orders-error { margin: 0 18px 8px; }
.orders-table-scroll { margin: 0 18px; width: calc(100% - 36px); }
.orders-table input[type="number"] { width: 82px; }
.orders-table input[type="date"] { width: 132px; }
.orders-table input, .orders-table select { font: inherit; padding: 2px 4px;
  border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: var(--ink); }
.orders-table input:focus-visible, .orders-table select:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.15); outline: none; }
.orders-table .oa-invalid { border-color: #dc2626; background: #fef2f2; }
.orders-table td { vertical-align: middle; }

/* ---------- 产品管理(v1.25) ---------- */
/* 筛选行 checkbox 不要 .fld 的 220px 文本框样式 */
.fld-check > input[type="checkbox"] { width: auto; padding: 0; border: none; }
.prod-ops .inline-form { gap: 6px; margin: 2px 0; }
#prod-table .prod-field,
#prod-table select,
#prod-table input[type="number"] {
  font: inherit;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
#prod-table input[type="number"] { width: 84px; }

/* ---------- 产品管理宽表(v1.26) ---------- */
/* 四个直接输入已移出 .prod-ops;所有控件规则限定在 #prod-table 内。 */
#prod-table input[name="parent_asin"] { width: 150px; }
#prod-table input[name="delivery"] { width: 60px; }

/* ---------- 产品管理视口骨架与提示(v1.27) ---------- */
.prod-route {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
.prod-route #app-content,
.prod-route #prod-page {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.prod-route > .sync-banner,
.prod-route #prod-page > .orders-toolbar,
.prod-route #prod-page > .notice,
.prod-route #prod-page > .alert,
.prod-route #prod-page > .hint,
.prod-route #prod-page > .prod-pager {
  flex: none;
}
.prod-route #prod-page > .ship-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
#prod-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
#prod-table th, #prod-table td { white-space: nowrap; }
#prod-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f1f5f9;
}
.prod-ops .inline-form { flex-wrap: nowrap; white-space: nowrap; }
#prod-table .prod-field { white-space: nowrap; }
.prod-ops .btn-muted:disabled,
.prod-ops .btn-muted:disabled:hover {
  background: #94a3b8;
  cursor: not-allowed;
}
.prod-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 80;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}
.prod-toast.success { background: #dcf5e3; color: #166534; border-color: #86efac; }
.prod-toast.error { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.prod-toast:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prod-toast[hidden] { display: none; }

.prod-route .orders-toolbar .filters,
.prod-route .fld-search { min-width: 0; }
.prod-route .fld-search > input,
.prod-route .fld-search > select { min-width: 0; }
.prod-route .fld-search > input { flex: 1 1 auto; max-width: 100%; }

@media (max-width: 900px), (max-height: 640px) {
  .prod-route {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .prod-route #app-content,
  .prod-route #prod-page {
    flex: 1 0 auto;
    overflow: visible;
  }
  .prod-route #prod-page > .ship-table-scroll {
    flex: none;
    height: 60vh;
    min-height: 240px;
    max-height: 480px;
    overflow: auto;
  }
}

.manual-arrival-dialog { width: min(96vw, 1400px); }
.plan-records-table { width: max-content; min-width: 100%; }
.plan-records-table th, .plan-records-table td { white-space: nowrap; }
.plan-records-table input, .plan-records-table select { min-width: 112px; }
.plan-records-table .pr-qty, .plan-records-table .pr-boxes { min-width: 76px; width: 76px; }
.plan-source { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12px; }
.plan-source-auto { color: #1d4ed8; background: #dbeafe; }
.plan-source-adjustment { color: #92400e; background: #fef3c7; }
.plan-source-manual { color: #166534; background: #dcfce7; }
.plan-record-current > td { background: #fff7ed; box-shadow: inset 0 1px #fb923c, inset 0 -1px #fb923c; }

.oa-column-panel .sync-dialog-actions { grid-column: 1 / -1; }
.oa-asin-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; }
.oa-asin-link:hover { text-decoration: underline; }
.production-create-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 20px; }
.production-create-head > div { grid-column: span 4; min-width: 0; }
.production-create-head > div:nth-child(1) { grid-column: span 3; }
.production-create-head > div:nth-child(2) { grid-column: span 2; }
.production-create-head > div:nth-child(3) { grid-column: span 3; }
.production-create-head > div:nth-child(4), .production-create-head > div:nth-child(5) { grid-column: span 2; }
.production-create-head > div:nth-child(n+6) { grid-column: span 3; }
.production-create-head dt { color: var(--ink-dim); font-size: 12px; }
.production-create-head dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.production-create-head input { box-sizing: border-box; width: 100%; font: inherit; }
@media (max-width: 700px) {
  .production-create-head > div, .production-create-head > div:nth-child(n+4) { grid-column: span 6; }
}

.restock-focus > td { background: #fff7ed; box-shadow: inset 0 1px #fb923c, inset 0 -1px #fb923c; }

.manual-arrival-dialog { overscroll-behavior: contain; }
.plan-records-table .r, .orders-table .oa-col-qty, .orders-table .oa-col-boxes { font-variant-numeric: tabular-nums; }


/* ---------- 生产单:关联发货单明细浮层 ---------- */
.po-linked-btn {
  display: inline-block; max-width: 240px; padding: 2px 4px; overflow: hidden;
  border: 0; border-radius: 4px; background: transparent; color: var(--accent);
  font: inherit; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.po-linked-btn:hover { background: #eff6ff; }
.po-linked-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.po-linked-popover {
  max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); padding: 0;
  overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
  box-shadow: 0 8px 28px rgba(15, 23, 42, .18);
}
.po-linked-table { width: max-content; min-width: 100%; margin: 0; }
.po-linked-table th, .po-linked-table td { padding: 8px 12px; white-space: nowrap; }
.po-linked-table .r { text-align: right; font-variant-numeric: tabular-nums; }
@supports (position-area: block-end) {
  .po-linked-popover {
    inset: auto; margin: 4px 0 0; position-area: block-end span-inline-end;
    position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  }
}
