/* ============================================================
   广告门店订单流转看板 · 样式（简化版）
   ============================================================ */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --line: #e5e8ee;
  --text: #1b2330;
  --text2: #5f6b7d;
  --text3: #98a2b3;
  --pri: #2f6bff;
  --pri-weak: #eef3ff;
  --navy: #0f1726;
  --navy2: #182337;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.muted { color: var(--text2); }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 布局骨架 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex: none; background: var(--navy); color: #cfd6e2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.brand span { display: block; font-size: 11px; color: #8b96a8; margin-top: 2px; }
.nav { padding: 10px 10px 16px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  color: #cfd6e2; font-size: 13px; margin-bottom: 2px;
}
.nav a:hover { background: var(--navy2); color: #fff; }
.nav a.active { background: var(--pri); color: #fff; }
.nav .nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.me { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px; }
.me-name { color: #fff; font-weight: 600; font-size: 13px; }
.me-roles { font-size: 11px; color: #8b96a8; margin: 2px 0 8px; }
.workbench-switch { width: 100%; margin: 0 0 8px; padding: 5px 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(255,255,255,.08); color: #dbeafe; font: inherit; font-size: 11px; }
.workbench-switch option { color: #172033; background: #fff; }
.workbench-label { margin: 0 0 8px; color: #aab6c9; font-size: 11px; }
.me button {
  width: 100%; padding: 6px; border: 1px solid rgba(255,255,255,.2); background: transparent;
  color: #cfd6e2; border-radius: 7px; cursor: pointer; font-size: 12px;
}
.me button:hover { background: var(--navy2); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0  22px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 15px; font-weight: 600; }
.topbar .tb-right { display: flex; gap: 16px; align-items: center; }
.topbar .tb-date { color: var(--text3); font-size: 12px; }
.topbar .tb-save { color: var(--ok); font-size: 12px; }
.topbar .tb-save::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; }
.view { padding: 18px 22px 40px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 12.5px; white-space: nowrap;
}
.btn:hover { border-color: #c8d0dd; background: #f7f9fc; }
.btn-primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn-primary:hover { background: #245ae0; border-color: #245ae0; }
.btn-danger { color: var(--bad); border-color: #f3c2c2; }
.btn-danger:hover { background: #fdf2f2; border-color: #e5a3a3; }
/* 实心红：不可恢复的最终确认用，别和抽屉里的描边危险按钮混在一起 */
.btn-danger-solid { background: #c62828; border-color: #c62828; color: #fff; }
.btn-danger-solid:hover { background: #ad2222; border-color: #ad2222; color: #fff; }
.btn-sm { padding: 3px 9px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

input[type="text"], input[type="date"], input[type="number"], input[type="tel"], select, textarea {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
  font-family: inherit; background: var(--surface); color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--pri); cursor: pointer; }
label { cursor: pointer; }

.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.tag-紧急 { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; }
.tag-返工 { color: #b54708; background: #fffaeb; border: 1px solid #fedf89; }
.tag-暂停 { color: #475467; background: #f2f4f7; border: 1px solid #e4e7ec; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.panel-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px;
}
.panel-hd .sub { font-weight: 400; font-size: 12px; color: var(--text3); }
.panel-bd { padding: 14px 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 18px; }
.info-item .k { font-size: 11.5px; color: var(--text3); margin-bottom: 2px; }
.info-item .v { font-size: 13px; font-weight: 500; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--text2); font-weight: 500;
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafbfd; }
.empty { padding: 30px; text-align: center; color: var(--text3); font-size: 12.5px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-card { width: 460px; background: var(--surface); border-radius: 16px; padding: 34px 34px 28px; }
.login-card h1 { font-size: 19px; font-weight: 600; }
.login-card .tip { color: var(--text2); font-size: 12.5px; margin: 6px 0 20px; }
.user-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.user-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; text-align: center; cursor: pointer; transition: all .12s; }
.user-card:hover { border-color: var(--pri); background: var(--pri-weak); }
.user-card .n { font-weight: 600; font-size: 13px; }
.user-card .r { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ---------- 状态选项卡（主视图） ---------- */
.page-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.page-hd .t { font-size: 16px; font-weight: 600; }
.page-hd .s { font-size: 12px; color: var(--text3); margin-top: 2px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: -6px -6px 10px; }
/* 状态选项卡：每个状态一整块纯色，白字；件数为 0 的转浅灰避免抢眼 */
.tab-card {
  flex: 1 1 76px; min-width: 76px; max-width: 132px; background: var(--sc, #5f6b7d);
  border: none; border-radius: 9px;
  padding: 8px 9px 9px; cursor: pointer; text-align: left; color: #fff;
  box-shadow: 0 1px 2px rgba(15,23,38,.16);
  transition: box-shadow .15s, transform .15s, filter .15s;
}
.tab-card:hover { filter: brightness(1.07); box-shadow: 0 4px 14px rgba(15,23,38,.22); transform: translateY(-2px); }
.tab-card .n { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; color: #fff; }
.tab-card .l { font-size: 11.5px; color: rgba(255,255,255,.9); margin-top: 1px; white-space: nowrap; }
.tab-card.zero { background: #e7ebf1; color: var(--text3); box-shadow: none; }
.tab-card.zero .n { color: #9aa4b2; }
.tab-card.zero .l { color: #9aa4b2; }
.tab-card.zero:hover { filter: none; box-shadow: 0 2px 8px rgba(15,23,38,.08); }
/* 数量为 0 的卡片选中时同样直接填充当前环节色，避免额外描边。 */
.tab-card.zero.active {
  background: var(--sc, #5f6b7d);
  color: #fff;
  box-shadow: none;
  border-color: transparent;
}
.tab-card.zero.active .n, .tab-card.zero.active .l { color: #fff; }
/* 选中：仅填充当前环节色。 */
.tab-card.active {
  background: var(--sc, #5f6b7d);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}
.tab-card.active:hover { transform: none; }
.tab-card.warn { background: #dc2626; }
/* 已取消：灰底深字，明确是归档终止态 */
.tab-card.cancel { background: #cbd2da; }
.tab-card.cancel .n, .tab-card.cancel .l { color: #4a525d; }
/* 已取消被选中时也使用该状态色填充，避免被普通灰底规则覆盖。 */
.tab-card.cancel.active { background: var(--sc, #9ca3af); color: #fff; box-shadow: none; }
.tab-card.cancel.active .n, .tab-card.cancel.active .l { color: #fff; }

/* ---------- 筛选栏 ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
}
.filters .search { width: 246px; }
.filters .sep { color: var(--text3); font-size: 12px; }

/* ---------- 订单表格 ---------- */
.table-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.oid { font-weight: 600; white-space: nowrap; }
.content-cell { max-width: 220px; }
/* 剩余时间文字色：越短越急 */
.time-ok { color: var(--ok); font-weight: 600; }
.time-warn { color: var(--warn); font-weight: 600; }
.time-bad { color: var(--bad); font-weight: 600; }
.time-pause { color: var(--text2); font-weight: 600; }
.time-over { color: #991b1b; font-weight: 800; }
.time-critical { color: #dc2626; font-weight: 800; }
.time-urgent { color: #c2410c; font-weight: 700; }
.time-soon { color: #a16207; font-weight: 600; }
.time-safe { color: #15803d; font-weight: 600; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line); background: #fafbfc;
}
.pager select { padding: 4px 8px; font-size: 12px; }
.pg-btn {
  min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--text);
}
.pg-btn:hover:not([disabled]) { border-color: var(--pri); color: var(--pri); }
.pg-btn.active { background: var(--pri); border-color: var(--pri); color: #fff; }
.pg-btn[disabled] { opacity: .4; cursor: not-allowed; }
.pg-dot { padding: 0 2px; color: var(--text3); font-size: 12px; }

/* ---------- 我的任务卡片 ---------- */
.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; }
.task-card .tc-cust { font-size: 17px; font-weight: 800; color: var(--text); }
.task-card .tc-oid { font-size: 12px; color: var(--text2); font-weight: 600; }
.task-card .tc-yxy { color: var(--text3); font-weight: 400; margin-left: 4px; }
.task-card .tc-bd { font-size: 12.5px; color: var(--text); display: grid; gap: 4px; padding: 12px 15px; }
.task-card .tc-ft { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 15px 14px; }
.task-card .tc-ft .btn { font-size: 13px; padding: 7px 14px; }
.task-card .tc-note { padding-top: 5px; border-top: 1px solid #edf0f4; color: var(--text2); font-size: 11.5px; line-height: 1.45; }
.task-card.is-urgent { border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626 inset; }

/* 管理员首页用轻量流程导航替代大块磁贴，保留筛选而降低顶部占高。 */
.board-stage-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; margin: 0 0 8px; padding-bottom: 2px; }
.board-stage-nav button { flex: 0 0 auto; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text2); cursor: pointer; font: inherit; font-size: 12px; }
.board-stage-nav button:hover { border-color: #9db8f8; color: var(--pri); }
.board-stage-nav button.active { border-color: var(--pri); background: var(--pri); color: #fff; }
/* 卡片顶部整条彩色带：状态 + 要做什么 + 完成后交给谁 */
.tc-band {
  display: flex; align-items: center; gap: 12px;
  background: var(--sc); color: #fff; padding: 11px 15px;
}
.tc-band-main { flex: 1 1 auto; min-width: 0; }
.tc-band .tc-yxy-top { margin-bottom: 6px; }
.tc-band .tc-state-name { font-size: 17px; font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.tc-band .tc-sub { margin-top: 5px; }
.tc-band .tc-sub .sub-status { background: rgba(255,255,255,.9); }
.tc-band .tc-task { font-size: 12px; color: rgba(255,255,255,.9); margin-top: 3px; line-height: 1.4; }
.tc-band-side { text-align: right; flex: none; }
.tc-band .tc-sla { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.22); }
.tc-band .tc-sla.over { background: #fff; color: #b42318; }
.tc-band .tc-sla.near { background: #fff; color: #b54708; }
.tc-band .tc-next { font-size: 11.5px; color: rgba(255,255,255,.9); margin-top: 4px; }
.tc-band .tc-next b { color: #fff; }
.tc-band .ug { background: #fff; color: #dc2626; }

/* ---------- 详情顶部状态条：紧凑 ERP 风格 ---------- */
.stage-banner {
  display: flex; align-items: center; gap: 20px; min-height: 96px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  /* 整块以当前订单状态色轻度着色，保持 ERP 界面的克制感。 */
  background: color-mix(in srgb, var(--sc) 9%, #fff);
  padding: 16px 20px; margin-bottom: 14px; box-shadow: none;
}
.stage-banner .sb-info { min-width: 0; }
.stage-banner .sb-state { flex: 0 0 126px; }
.stage-banner .sb-handler { flex: 0 0 100px; }
.stage-banner .sb-main { flex: 1 1 220px; }
.stage-banner .sb-next { flex: 0 1 170px; }
.stage-banner .sb-k { font-size: 12px; color: var(--text2); margin-bottom: 6px; line-height: 1.2; }
.stage-banner .sb-name { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.35; }
.stage-banner .sb-sub { margin-top: 5px; }
.stage-banner .sb-sub .sub-status { font-size: 10.5px; }
.stage-banner .sb-sub-select { max-width: 130px; padding: 3px 22px 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.stage-banner .sb-value { font-size: 13px; color: var(--text2); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-banner .sb-task { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-banner .sb-meta { font-size: 12px; color: var(--text2); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-banner .sb-btn { flex: 0 0 auto; height: 36px; min-height: 36px; padding: 0 14px; border-radius: 6px; white-space: nowrap; box-shadow: none; }
.stage-banner .sb-btn.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.stage-banner .sb-btn.btn-primary:hover { background: #2f6fda; border-color: #2f6fda; box-shadow: none; }
@media (max-width: 760px) {
  .stage-banner { align-items: flex-start; gap: 14px 18px; min-height: 0; padding: 16px; flex-wrap: wrap; }
  .stage-banner .sb-state, .stage-banner .sb-handler, .stage-banner .sb-next { flex: 1 1 120px; }
  .stage-banner .sb-main { flex-basis: 100%; }
  .stage-banner .sb-btn { margin-left: auto; }
}

/* ---------- 订单主表：整块区域上色 ---------- */
.tbl-orders { table-layout: fixed; width: 100%; min-width: 1100px; }
.tbl-orders th { padding: 10px 9px; font-size: 11.5px; font-weight: 600; color: var(--text3); letter-spacing: .3px; background: #f7f9fc; }
.tbl-orders td { padding: 10px 9px; border-bottom: 2px solid #fff; vertical-align: middle; }
/* 整行铺该状态的浅色底 */
.tbl-orders tr.row td { background: #f8fafc; background: color-mix(in srgb, var(--sc) 9%, #fff); }
.tbl-orders tr.row { cursor: pointer; }
.tbl-orders tr.row:hover td { background: color-mix(in srgb, var(--sc) 17%, #fff); }

.tbl-orders .c-id .yxy-chip { font-size: 10px; padding: 3px 5px; letter-spacing: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tbl-orders td.c-id { padding-right: 4px; }
/* 时间在上（大）、日期在下（小）：一眼先看到"几点"，日期退成背景信息 */
.tbl-orders .c-created { white-space: nowrap; }
.tbl-orders .c-created .ct-t { display: block; font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.tbl-orders .c-created .ct-d { display: block; font-size: 10px; color: var(--text3); line-height: 1.25; font-variant-numeric: tabular-nums; }
.tbl-orders .c-contact { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-orders .c-owner { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 云玺印单号：绿色独立标注，所有位置置顶显示；点击复制 */
.yxy-chip {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  background: #e8f8ee; color: #0b7a3b; border: 1px solid #b7e6c9;
  font-size: 12.5px; font-weight: 800; letter-spacing: .3px; white-space: nowrap;
  /* 原来用 cursor: copy，多数系统上只是个带小加号的箭头，看着不像能点；手型最直观 */
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, box-shadow .2s ease, transform .14s ease;
}
.yxy-chip:hover {
  background: #cdeedb; border-color: #3fae7c;
  box-shadow: inset 0 0 0 1px rgba(63, 174, 124, .35), 0 0 0 3px rgba(60, 190, 130, .18), 0 6px 14px -10px rgba(9, 110, 55, .55);
}
.yxy-chip:active { transform: translateY(1px) scale(.99); }
.yxy-chip:focus-visible { outline: 2px solid #56c08d; outline-offset: 2px; }
.yxy-chip .cp-ico {
  margin-left: 4px; opacity: .55; vertical-align: -1px;
  transition: opacity .16s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.yxy-chip:hover .cp-ico { opacity: 1; transform: scale(1.18); }
.yxy-chip.empty { background: #f4f6f9; color: var(--text3); border-color: #e4e7ec; font-weight: 600; cursor: default; }
.yxy-chip.empty:hover { background: #f4f6f9; border-color: #e4e7ec; box-shadow: none; }
.yxy-chip.on-color { background: #fff; color: #0b7a3b; border-color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.yxy-chip.on-color:hover { background: #fff; border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .4), 0 6px 14px -10px rgba(0, 0, 0, .35); }
.tbl-orders .c-cust .cust { font-size: 14px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; line-height: 1.35; }
.tbl-orders .c-cust .items { font-size: 11px; color: var(--text2); margin-top: 3px; line-height: 1.35; white-space: normal; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tbl-orders th:nth-child(3), .tbl-orders th:nth-child(4), .tbl-orders th:nth-child(5), .tbl-orders th:nth-child(6),
.tbl-orders .c-substatus, .tbl-orders .c-payment, .tbl-orders .c-invoice, .tbl-orders .c-delivery { text-align: center; white-space: normal; }
.list-biz { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; padding: 3px 5px; border: 1px solid transparent; border-radius: 5px; overflow: visible; text-overflow: clip; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; }
.list-inline-select { width: 100%; max-width: 100%; min-height: 27px; padding: 3px 17px 3px 4px; border-radius: 5px; font-size: 11px; font-weight: 600; text-align: center; cursor: pointer; }
.list-inline-select.pay-none { color: #9a5b00; background: #fff7df; border-color: #ffe4a3; }
.list-inline-select.pay-part { color: #175cd3; background: #e8f0ff; border-color: #cbdcff; }
.list-inline-select.pay-done { color: #087443; background: #e5f7ec; border-color: #bfe9d0; }
.list-inline-select.inv-none { color: #667085; background: #f2f4f7; border-color: #e4e7ec; }
.list-inline-select.inv-wait { color: #9a5b00; background: #fff7df; border-color: #ffe4a3; }
.list-inline-select.inv-done { color: #087443; background: #e5f7ec; border-color: #bfe9d0; }
.list-biz.delivery-pickup, .list-inline-select.delivery-pickup { color: #475467; background: #f4f7fb; border-color: #dfe7f3; }
.list-biz.delivery-express, .list-inline-select.delivery-express { color: #175cd3; background: #e8f0ff; border-color: #cbdcff; }
.list-biz.delivery-runner, .list-inline-select.delivery-runner { color: #7a3e9d; background: #f4e8fb; border-color: #e4c9f4; }
.pay-none { color: #9a5b00; background: #fff7df; border-color: #ffe4a3; }
.pay-part { color: #175cd3; background: #e8f0ff; border-color: #cbdcff; }
.pay-done { color: #087443; background: #e5f7ec; border-color: #bfe9d0; }
.inv-none { color: #667085; background: #f2f4f7; border-color: #e4e7ec; }
.inv-wait { color: #9a5b00; background: #fff7df; border-color: #ffe4a3; }
.inv-done { color: #087443; background: #e5f7ec; border-color: #bfe9d0; }

.tbl-orders .c-dl .due-h { display: flex; flex-direction: column; gap: 0; line-height: 1.02; white-space: nowrap; }
.tbl-orders .c-dl .due-t { font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.tbl-orders .c-dl .due-d { font-size: 10.5px; font-weight: 700; color: var(--text2); font-variant-numeric: tabular-nums; }
.tbl-orders .c-dl .due-pill { margin-top: 4px; }
.tbl-orders .c-dl .pill { font-size: 11px; padding: 3px 7px; }
.tbl-orders .c-act .btn-row { flex-wrap: nowrap; gap: 3px; }
.tbl-orders td.c-act { padding-left: 12px; padding-right: 16px; }
/* 任务卡里的交期时间点（时间优先） */
.tc-bd .tcv { font-size: 13px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.tbl-orders .c-act .btn-sm { padding: 3px 5px; font-size: 11px; white-space: nowrap; background: rgba(255,255,255,.9); }
/* 状态整格彩色面板：填满整格，白字 */
.tbl-orders td.c-st { padding: 0; }
.st-panel {
  min-height: 70px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  background: var(--sc); color: #fff; height: 100%;
}
.st-panel .st-name { font-size: 13.5px; font-weight: 800; letter-spacing: .3px; line-height: 1.25; word-break: keep-all; }
.st-sub { line-height: 1; }
.sub-status {
  display: inline-flex; align-items: center; max-width: 100%; padding: 2px 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; line-height: 1.25; white-space: nowrap;
}
.sub-gray { color: #475467; background: #f2f4f7; }
.sub-orange { color: #9a5b00; background: #fff0cf; }
.sub-green { color: #087443; background: #d9f3e4; }
.sub-cyan { color: #087a8c; background: #d8f5f8; }
.sub-blue { color: #175cd3; background: #dbeafe; }
.sub-purple { color: #6941c6; background: #eee7ff; }
.sub-indigo { color: #3e4ab8; background: #e2e5ff; }
.sub-amber { color: #8a4b00; background: #fff4cc; }
.sub-teal { color: #087468; background: #d8f3ee; }
.sub-violet { color: #6f3db3; background: #efe3ff; }
.sub-slate { color: #475467; background: #e9eef5; }
.st-biz { display: flex; flex-wrap: wrap; gap: 2px 7px; font-size: 10px; line-height: 1.35; color: rgba(255,255,255,.92); }
.st-biz span { white-space: nowrap; }
.st-panel.is-off { background: #e9edf3; color: var(--text3); }

/* 详情备注紧跟订单状态条，单独成行，避免淹没在状态或通用提示中。 */
.detail-order-note { display: flex; align-items: flex-start; gap: 10px; margin: -4px 0 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--sc) 30%, #dfe5ed); border-left: 3px solid var(--sc); border-radius: 6px; background: color-mix(in srgb, var(--sc) 6%, #fff); }
.detail-order-note span { flex: 0 0 auto; color: var(--text2); font-size: 12px; font-weight: 600; }
.detail-order-note b { color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.45; word-break: break-word; }
.detail-items-panel { margin-bottom: 10px; }
.detail-flow { margin: 0 0 10px; padding: 8px 12px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.detail-section-title { margin-bottom: 3px; color: var(--text2); font-size: 12px; font-weight: 600; }
.detail-flow .steps { margin: 0; padding: 4px 0 0; }
.detail-business-folds { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0 0 10px; }
.detail-business-folds .business-fold { margin: 0; min-width: 0; }
.detail-business-folds .more-info { min-width: 0; margin: 0; }
.detail-business-folds .business-fold summary, .detail-business-folds .more-info summary { min-height: 34px; padding: 0 9px; font-size: 12px; }
.detail-business-folds .business-fold-bd { padding: 10px; }
.delivery-final-readonly { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; }
.delivery-final-readonly span { display: block; margin-bottom: 2px; color: var(--text3); font-size: 11px; }
.delivery-final-readonly b { display: block; color: var(--text); font-size: 12px; font-weight: 500; word-break: break-word; }
.delivery-final-readonly > div:nth-last-of-type(1) { grid-column: 1 / -1; }

/* 订单详情：业务资料按需展开，默认不占用阅读流程的垂直空间。 */
.business-folds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.business-fold { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.business-fold summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 0 12px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; }
.business-fold summary::-webkit-details-marker { display: none; }
.business-fold summary::before { content: '›'; color: var(--text3); font-size: 18px; transform: rotate(0deg); transition: transform .15s ease; }
.business-fold[open] summary::before { transform: rotate(90deg); }
.business-fold summary > span { margin-right: auto; }
.business-fold summary em { color: var(--text3); font-size: 11px; font-style: normal; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-fold-bd { border-top: 1px solid var(--line); padding: 12px; font-size: 12px; }
.business-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.business-info-grid > div { min-width: 0; }
.business-info-grid span { display: block; margin-bottom: 3px; color: var(--text3); font-size: 11px; }
.business-info-grid b { display: block; font-size: 12px; font-weight: 500; word-break: break-word; }
.business-info-grid .business-wide { grid-column: 1 / -1; }
@media (max-width: 880px) { .business-folds { grid-template-columns: 1fr; } }
/* 倒计时 */
.pill { display: inline-block; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 800; white-space: nowrap; }
/* 倒计时药丸：五档紧急度，越短越红、越宽裕越绿 */
.pill-bad { background: #dc2626; color: #fff; }
.pill-warn { background: #f59e0b; color: #fff; }
.pill-ok { background: #fff; color: #15803d; border: 1px solid #cdebd8; }
.pill-over { background: #991b1b; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.pill-critical { background: #dc2626; color: #fff; }
.pill-urgent { background: #ea580c; color: #fff; }
.pill-soon { background: #fde9c8; color: #92400e; }
.pill-safe { background: #e8f8ee; color: #0b7a3b; border: 1px solid #c6ebd5; }
.pill-pause { background: #fff; color: #475467; border: 1px solid #dfe3e9; }
/* 倒计时颜色图例 */
.rem-legend {
  display: inline-flex; align-items: center; gap: 3px; margin-left: auto;
  font-size: 11px; color: var(--text3); white-space: nowrap;
}
.rem-legend i {
  width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 8px;
}
.rem-legend i.over { background: #991b1b; margin-left: 0; }
.rem-legend i.critical { background: #dc2626; }
.rem-legend i.urgent { background: #ea580c; }
.rem-legend i.soon { background: #f0c078; }
.rem-legend i.safe { background: #7ed3a0; }
.tbl-orders .c-dash { color: var(--text3); font-size: 15px; }
/* 紧急：整行红框高亮 + 红色胶囊 */
.ug {
  display: inline-block; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .5px;
  flex: none; white-space: nowrap;
}
/* 紧急：整行换成浅红底（状态色仍保留在右侧彩色面板里） */
.tbl-orders tr.row-urgent td { background: #fff1ef; background-image: none; }
.tbl-orders tr.row-urgent:hover td { background: #ffe7e3; }
.tbl-orders tr.row-urgent .c-cust .cust { color: #9f1c1c; }
.tag-紧急 { font-weight: 700; }

/* ---------- 审批横幅 ---------- */
.appr-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fffaeb;
  border: 1px solid #fedf89; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 12.5px;
}

/* ---------- 抽屉（订单详情） ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,38,.4); z-index: 90; display: none; }
.drawer-mask.show { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 600px; max-width: 96vw; background: var(--surface);
  z-index: 95; transform: translateX(102%); transition: transform .18s ease; display: flex; flex-direction: column;
  box-shadow: -6px 0 24px rgba(15,23,38,.12);
}
.drawer.show { transform: none; }
.drawer-hd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-hd .oid { font-size: 15px; }
.drawer-hd .x { margin-left: auto; border: none; background: none; font-size: 18px; color: var(--text3); cursor: pointer; padding: 2px 8px; }
.drawer-hd .x:hover { color: var(--text); }
.drawer-bd { padding: 16px 18px 30px; overflow-y: auto; flex: 1; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; margin: 16px 0 18px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; font-size: 11.5px; color: var(--text3); }
.step .dot {
  width: 24px; height: 24px; border-radius: 50%; background: #eef1f5; color: #98a2b3;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; border: 1px solid var(--line);
}
.step::after { content: ""; position: absolute; top: 12px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: #e5e8ee; }
.step:last-child::after { display: none; }
.step.done { color: var(--ok); }
.step.done .dot { background: var(--ok); color: #fff; border-color: var(--ok); }
.step.done::after { background: var(--ok); }
.step.cur { color: var(--pri); font-weight: 600; }
.step.cur .dot { background: var(--pri); color: #fff; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-weak); }
.step.cancel { color: var(--text3); }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 12px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -16px; top: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--pri); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
.tl-item .t { font-size: 11.5px; color: var(--text3); }
.tl-item .c { font-size: 12.5px; }
.tl-item .c b { font-weight: 600; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,38,.45); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal { background: var(--surface); border-radius: 14px; width: 520px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { width: 640px; }
.modal-hd { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.modal-bd { padding: 16px 18px; overflow-y: auto; }
.modal-ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.assign-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.assign-row:hover { background: #f7f9fc; }
.assign-row .n { font-weight: 500; }
.toast {
  /* 居中显示：水平垂直都在视口正中，不再贴底 */
  position: fixed; left: 50%; top: 50%; bottom: auto;
  transform: translate(-50%, calc(-50% + 12px)) scale(.96);
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--navy); color: #fff; padding: 10px 16px 10px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.45; box-shadow: 0 12px 30px rgba(15,23,38,.28);
  opacity: 0; pointer-events: none; z-index: 200; max-width: min(560px, 86vw);
  /* 缓冲轻缓：先快后慢再微微回弹，进出都不生硬 */
  transition: opacity .26s ease, transform .58s cubic-bezier(.16, 1.1, .3, 1);
  will-change: opacity, transform;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast .ts-ico { flex: 0 0 17px; width: 17px; height: 17px; margin-top: 1px; }
.toast .ts-ico svg { width: 100%; height: 100%; display: block; }
.toast .ts-msg { flex: 1; min-width: 0; word-break: break-word; }
/* 成功：深底 + 绿勾 */
.toast-ok { background: #14324b; }
.toast-ok .ts-ico { color: #48d18a; }
/* 失败：深红底 + 白叉，停留更久，原因要看清 */
.toast-err { background: #99201d; box-shadow: 0 12px 30px rgba(153,32,29,.34); }
.toast-err .ts-ico { color: #ffe2e0; }
/* 提醒：琥珀底（如“已取消，未改动”） */
.toast-warn { background: #8a5309; }
.toast-warn .ts-ico { color: #ffe6b8; }
/* 弹窗打开时提示位置不变：始终在视口正中，不再跳去顶部 */

/* ---------- 气泡确认（删除等危险操作） ---------- */
.pop {
  position: fixed; z-index: 320; width: 246px; max-width: calc(100vw - 20px);
  background: #fff; border: 1px solid #e3e8f0; border-radius: 10px;
  box-shadow: 0 16px 40px rgba(15,23,38,.22), 0 2px 6px rgba(15,23,38,.08);
  padding: 11px 12px 10px; animation: popIn .13s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop::before {
  content: ''; position: absolute; top: -5px; left: 50%; margin-left: -5px;
  width: 9px; height: 9px; background: #fff; border-left: 1px solid #e3e8f0; border-top: 1px solid #e3e8f0;
  transform: rotate(45deg);
}
.pop.is-up::before { top: auto; bottom: -5px; transform: rotate(225deg); }
.pop-hd { display: flex; align-items: flex-start; gap: 6px; }
.pop-hd .pop-ic { flex: 0 0 15px; width: 15px; height: 15px; color: var(--bad); margin-top: 1px; }
.pop-hd .pop-ic svg { width: 100%; height: 100%; display: block; }
.pop-hd b { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.35; }
.pop-desc { font-size: 11.5px; color: var(--text2); line-height: 1.5; margin: 5px 0 0 21px; }
.pop-ft { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.pop-ft .btn-sm { padding: 4px 11px; font-size: 12px; }

/* ---------- 删除订单：二次确认弹窗 ---------- */
.del-warn {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 10px;
  background: #fdeced; border: 1px solid #f7c9c9;
}
.del-warn .dw-ic { flex: 0 0 16px; width: 16px; height: 16px; color: #c62828; margin-top: 1px; }
.del-warn .dw-ic svg { width: 100%; height: 100%; display: block; }
.del-warn b { font-size: 13px; color: #a51f1f; display: block; }
.del-warn .tiny { color: #8c3a3a; margin-top: 2px; line-height: 1.5; }
.del-sum {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px;
  margin-top: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
}
.del-sum .info-item .k { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.del-sum .info-item .v { font-size: 13px; font-weight: 600; }
.del-note {
  margin-top: 12px; font-size: 12px; line-height: 1.6; color: #8a5309;
  background: #fff8ec; border: 1px solid #f2ddb5; border-radius: 9px; padding: 10px 12px;
}
.del-note b { color: #7a4707; }

/* ---------- 统计 ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--text2); }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--text2); }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row .l { width: 92px; flex: none; font-size: 12.5px; text-align: right; color: var(--text2); }
.bar-row .track { flex: 1; height: 16px; background: #eef1f5; border-radius: 5px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 5px; }
.bar-row .val { width: 76px; flex: none; font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; }
.field .k { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.field input, .field select { width: 100%; }
/* 复选框不要被上面的 100% 宽度撑成输入框 */
.field input[type="checkbox"] { width: 15px; height: 15px; padding: 0; margin: 0; border: none; flex: none; }
.field .chk-line { display: flex; align-items: center; gap: 8px; height: 34px; font-size: 13px; color: var(--text); cursor: pointer; }
.field .chk-line.urgent-on { color: var(--bad); font-weight: 600; }
.req { color: var(--bad); font-weight: 700; }

/* ---------- 流程分派（开单时设定每一步给谁） ---------- */
.sub-hd { margin: 18px 0 8px; font-weight: 700; font-size: 13.5px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sub-hd .tiny { font-weight: 400; }
.flow-box { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.flow-row { display: grid; grid-template-columns: 132px 210px 1fr; align-items: center; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.flow-row:last-child { border-bottom: none; }
.flow-row:nth-child(odd) { background: #fbfcfe; }
.flow-row .fr-stage { display: flex; align-items: baseline; gap: 6px; }
.flow-row .fr-stage b { font-size: 13px; }
.flow-row .fr-stage span { font-size: 11px; color: var(--text3); }
.flow-row .fr-task { font-size: 11.5px; color: var(--text2); }
.flow-row select { width: 100%; }
@media (max-width: 720px) {
  .flow-row { grid-template-columns: 1fr; gap: 4px; }
}
/* 开单页的流程分派：默认收起，只给一行岗位+人名，点“调整”才展开 7 行 */
.flow-fold { border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; overflow: hidden; }
.ff-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: wrap; }
.ff-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.ff-chip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: #fff; border: 1px solid #dde4ee; font-size: 11.5px; line-height: 1.5;
}
.ff-chip i { font-style: normal; font-size: 10px; color: var(--text3); letter-spacing: .2px; }
.ff-chip b { font-weight: 700; color: var(--text); }
.ff-chip.is-empty { background: #f2f5f9; border-style: dashed; }
.ff-chip.is-empty b { color: var(--text3); font-weight: 500; }
.ff-btn { flex: 0 0 auto; }
.flow-fold .flow-box { border: none; border-top: 1px solid var(--line); border-radius: 0; background: #fff; }
.flow-fold .flow-box[hidden] { display: none; }
.flow-fold .flow-row { grid-template-columns: 168px minmax(0, 1fr); padding: 6px 12px; }
.flow-fold .flow-row:nth-child(odd) { background: #fafcfe; }
.item-edit-row { display: grid; grid-template-columns: 1.3fr 1.5fr 64px 88px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-edit-row input, .item-edit-row select { width: 100%; }
.role-chip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 12px; }
.assigned-role-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 220px; }
.role-chip-static { color: var(--text2); background: #f7f9fc; }
.role-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.role-editor-option { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.role-editor-option:has(input:checked) { border-color: var(--pri); background: var(--pri-weak); color: var(--pri); }

/* ---------- 打印 ---------- */
#print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { display: block !important; position: absolute; left: 0; top: 0; width: 100%; padding: 26px; }
  .print-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; }
  .print-sub { text-align: center; color: #555; font-size: 12px; margin-bottom: 18px; }
  .print-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
  .print-table th, .print-table td { border: 1px solid #333; padding: 7px 9px; font-size: 12px; text-align: left; }
  .print-sign { display: flex; justify-content: space-between; margin-top: 42px; font-size: 13px; }
}

/* ---------- 订单看板 ---------- */
.board-filters { gap: 8px; row-gap: 8px; }
.board-filters .btn-sm { padding: 6px 12px; }
.board-filters .sep { color: var(--text3); font-size: 12px; margin-left: 2px; }
.board-filters select { flex: none; }
.board-filters .search { flex: 1 1 180px; width: auto; min-width: 140px; }
.board-total { flex: none; margin-left: auto; color: var(--text3); font-size: 12px; }

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.bcol {
  flex: none; width: clamp(272px, 26vw, 300px); background: #eef1f6; border-radius: 10px;
  display: flex; flex-direction: column; max-height: 68vh; overflow: hidden;
}
.bcol-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; background: #e3e7ee; color: var(--text);
}
.bcol-hd[style] { background: var(--sc); color: #fff; }
.bcol-name { font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.bcol-n {
  font-size: 12px; font-weight: 800; min-width: 22px; text-align: center;
  background: rgba(255,255,255,.35); border-radius: 999px; padding: 1px 7px;
}
.bcol-hd:not([style]) .bcol-n { background: #fff; color: var(--text2); }
.bcol-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overflow-x: hidden; }
.bcol-empty { text-align: center; color: var(--text3); font-size: 12px; padding: 16px 0; }

/* 卡片形态 */
.kcard {
  background: #fff; border: 1px solid #e4e8ee; border-radius: 8px; padding: 9px 10px; cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s; min-width: 0;
}
.kcard:hover { box-shadow: 0 3px 10px rgba(15,23,38,.12); transform: translateY(-1px); border-color: #c8d0dd; }
.kcard.is-urgent { border-color: #dc2626; background: #fff7f6; }
.kc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: nowrap; }
.kc-top .yxy-chip { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-top .pill { padding: 2px 8px; font-size: 11.5px; border-radius: 6px; flex: none; }
.kc-cust {
  font-size: 14px; font-weight: 800; color: var(--text); margin-top: 6px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap; word-break: break-all;
}
.kc-items {
  font-size: 11.5px; color: var(--text2); margin-top: 3px; line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-all;
}
.kc-st { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-width: 0; }
.kc-stname {
  flex: none; font-size: 11px; font-weight: 800; color: #fff; background: var(--sc);
  padding: 2px 7px; border-radius: 5px; letter-spacing: .3px;
}
.kc-task {
  font-size: 11px; color: var(--text2); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
  margin-top: 7px; padding-top: 6px; border-top: 1px dashed #eef1f5; font-size: 11.5px; color: var(--text2);
}
.kc-owner { font-weight: 700; color: var(--text); }
/* 交期也是"时间优先"：小时加粗在前，日期退成小字（Round 39） */
.kc-due { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.kc-due .kd-l { font-size: 10px; color: var(--text3); }
.kc-due b { font-size: 12.5px; font-weight: 800; color: var(--text); letter-spacing: .2px; }
.kc-due .kd-s { font-size: 10px; color: var(--text3); }

/* 清单形态：复用订单表的行，去掉操作列；分组标题行跨整行 */
.tbl-boardlist { table-layout: fixed; }
.tbl-boardlist .st-panel { min-height: 50px; padding: 8px 11px; }
.tbl-boardlist .st-panel .st-name { font-size: 13.5px; }
.tbl-boardlist .c-owner { font-size: 11px; }
.tbl-boardlist .c-contact { font-size: 11.5px; }
.bgrp td { background: #eef2f8; padding: 7px 12px !important; }
.bgrp[style] td { background: color-mix(in srgb, var(--sc) 13%, #fff); }
.bgrp-name { font-size: 12.5px; font-weight: 800; color: var(--text); letter-spacing: .3px; }
.bgrp[style] .bgrp-name { color: var(--sc); }
.bgrp-n {
  margin-left: 8px; font-size: 11px; font-weight: 800; color: #fff;
  background: var(--sc, #8a93a3); border-radius: 999px; padding: 1px 7px;
}
.bgrp-empty { text-align: center; color: var(--text3); font-size: 12px; padding: 14px 0 !important; }

/* 磁贴形态（按分组分段，自适应网格） */
.bgrid-wrap { display: flex; flex-direction: column; gap: 18px; }
.bgroup-hd {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px;
  background: #e3e7ee; color: var(--text); margin-bottom: 10px; width: fit-content; min-width: 140px;
}
.bgroup-hd[style] { background: var(--sc); color: #fff; }
.bgroup-hd .bcol-n { background: rgba(255,255,255,.35); }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 10px; }

.yxy-chip.sm { font-size: 10.5px; padding: 2px 6px; letter-spacing: 0; }
.pill-off { background: #f2f4f7; color: var(--text3); font-weight: 600; }

/* ---------- 主题切换 ---------- */
:root[data-theme="dark"] {
  --bg: #0f141c;
  --surface: #18212c;
  --line: #2d3a4a;
  --text: #e8eef7;
  --text2: #b5c0cf;
  --text3: #8b99aa;
  --pri-weak: #20365f;
  --navy: #0a1018;
  --navy2: #1d2a3a;
}
:root[data-theme="dark"] body { color-scheme: dark; }
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .table-box,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .drawer,
:root[data-theme="dark"] .business-fold,
:root[data-theme="dark"] .detail-flow,
:root[data-theme="dark"] .role-editor-option,
:root[data-theme="dark"] .kcard { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .tbl th,
:root[data-theme="dark"] .tbl-orders th,
:root[data-theme="dark"] .pager,
:root[data-theme="dark"] .delivery-final-readonly,
:root[data-theme="dark"] .flow-fold,
:root[data-theme="dark"] .flow-fold .flow-box,
:root[data-theme="dark"] .flow-row:nth-child(odd),
:root[data-theme="dark"] .assign-row:hover { background: #202b38; }
:root[data-theme="dark"] .tbl tbody tr:hover td { background: #223040; }
:root[data-theme="dark"] .board-stage-nav button { background: var(--surface); color: var(--text2); }
:root[data-theme="dark"] .board-stage-nav button:hover,
:root[data-theme="dark"] .btn:hover { background: #243345; border-color: #52647a; }
:root[data-theme="dark"] .btn { color: var(--text); }
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover { color: #fff; background: var(--pri); border-color: var(--pri); }
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="tel"],
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: #121a24; color: var(--text); border-color: #3a4a5d; }
:root[data-theme="dark"] .tbl-orders tr.row td { background: color-mix(in srgb, var(--sc) 12%, var(--surface)); }
:root[data-theme="dark"] .tbl-orders tr.row:hover td { background: color-mix(in srgb, var(--sc) 22%, var(--surface)); }
:root[data-theme="dark"] .detail-order-note { background: color-mix(in srgb, var(--sc) 12%, var(--surface)); }
:root[data-theme="dark"] .bcol-body { background: #121a24; }
:root[data-theme="dark"] .bcol-hd:not([style]) .bcol-n,
:root[data-theme="dark"] .bgroup-hd .bcol-n { background: #2b3949; color: var(--text2); }
:root[data-theme="dark"] .bcard,
:root[data-theme="dark"] .kcard { border-color: var(--line); }
:root[data-theme="dark"] .theme-toggle { border-color: #53657a; background: #202d3d; }
:root[data-theme="dark"] .login-wrap,
:root[data-theme="dark"] body.auth-mode { background: var(--navy); }
:root[data-theme="dark"] .login-card { background: var(--surface); color: var(--text); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { border: none; padding: 10px 14px; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; }
  .me { border: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
  .me button { width: auto; padding: 4px 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}

/* ---------- 可悬停的时间锚点（Round 37） ----------
   所有时间都挂了 data-tip；这里给一点点虚线下划，让人知道可以停上去看
   注意：不用透明度很低的蓝色，深色卡（交期榜 / 看板蓝底）上会看不见 —— 用 currentColor 混透明 */
.tt { cursor: help; }
.tt[data-tip] {
  text-decoration: underline dotted;
  text-decoration-color: rgba(128, 128, 128, .35);
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.tt[data-tip]:hover {
  text-decoration-color: rgba(47, 107, 255, .55);
  text-decoration-color: color-mix(in srgb, currentColor 65%, transparent);
}
/* 数字格里下划线不跟着数字错位 */
td.tt[data-tip] { text-underline-offset: 2px; }
