/* TGDYL 销售系统 —— 无外部依赖。配色和物料系统一样（灰蓝），密度优先。<html data-theme="dark"> 切深色 */
:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #e1e5eb;
  --line-2: #ccd3dc;
  --text: #1d2632;
  --muted: #677486;
  --accent: #3b5b86;
  --accent-2: #4a6c99;
  --accent-soft: #eaeff6;
  --brand: #2f6b5a;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --info: #2563eb;
  --info-soft: #e9f0fe;
  --focus: 0 0 0 3px rgba(59, 91, 134, .25);
  --topbar: var(--panel);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --radius: 8px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f141b;
  --panel: #161c25;
  --panel-2: #1b222d;
  --line: #262f3c;
  --line-2: #343f4f;
  --text: #e8ecf1;
  --muted: #a3adbb;
  --accent: #86a6d0;
  --accent-2: #6f90bd;
  --accent-soft: #1d2838;
  --brand: #3f8f78;
  --warn: #fbbf24;
  --warn-soft: #33270f;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --ok: #4ade80;
  --ok-soft: #12301d;
  --info: #93b4ff;
  --info-soft: #18233d;
  --focus: 0 0 0 3px rgba(134, 166, 208, .3);
  --topbar: #141b26;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 6px; }
kbd { font: 11px var(--mono); padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 4px; background: var(--panel-2); color: var(--muted); }

/* ------------------------------------------------------------ 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 48px; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: var(--topbar); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 14px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; }
.tabs { display: flex; gap: 2px; height: 100%; }
.tabs a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.spacer { flex: 1; }
.conn { display: flex; gap: 6px; }
.conn .dot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: default; }
.conn .dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.conn .dot.ok::before { background: var(--ok); }
.conn .dot.bad::before { background: var(--danger); }
.user-menu { display: flex; align-items: center; gap: 6px; position: relative; }
.user-btn { display: flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); cursor: pointer;
  font: inherit; padding: 4px 6px; border-radius: 6px; }
.user-btn:hover { background: var(--panel-2); color: var(--text); }
.user-btn svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.user-pop { position: absolute; top: 34px; right: 50px; min-width: 170px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; z-index: 50; }
.user-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text);
  padding: 6px 8px; border-radius: 5px; cursor: pointer; font: inherit; }
.user-pop button:hover { background: var(--panel-2); }
.user-pop .sec { font-size: 11px; color: var(--muted); padding: 4px 8px 2px; }

.view { padding: 14px 16px 60px; max-width: 1500px; margin: 0 auto; outline: none; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { font-size: 17px; margin: 0; font-weight: 600; }
.page-head h1 .next-no { margin-left: 8px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; cursor: help; }
.page-head h1 .next-no small { font-size: 12px; font-weight: 400; margin-left: 2px; }

/* ------------------------------------------------------------ 控件 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit;
  cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent-2); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0f141b; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.small { height: 26px; padding: 0 8px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .k { font-size: 11px; opacity: .7; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px;
  height: 30px; padding: 0 8px; min-width: 0;
}
textarea { height: auto; padding: 6px 8px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type="checkbox"] { height: auto; width: 15px; height: 15px; accent-color: var(--accent); vertical-align: middle; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
label.field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { color: var(--text); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--muted); padding: 0 10px; height: 28px; font: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; height: 19px; border-radius: 10px;
  font-size: 11px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card + .card { margin-top: 12px; }
.card h2 { font-size: 14px; margin: 0 0 10px; font-weight: 600; }
.card h3 { font-size: 13px; margin: 14px 0 6px; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ 表格 */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { position: sticky; top: 0; background: var(--panel-2); font-weight: 500; color: var(--muted); font-size: 12px;
  white-space: nowrap; z-index: 1; }
table.grid tbody tr:hover td { background: var(--panel-2); }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.void td { color: var(--muted); text-decoration: line-through; }
table.grid tr.sel td { background: var(--accent-soft) !important; }
table.grid tfoot td { font-weight: 600; background: var(--panel-2); }

/* ------------------------------------------------------------ 订单编辑 */
/* 订单头：左边一整栏客户备注，右边这张单的资料（12 格的网格，c3 = 占 3 格，r2 = 占两行）。
   格子不写标题，说明在格子里（placeholder）；系统带出来的格子矮一点，客户、单据备注照常 */
.order-head2 { display: grid; grid-template-columns: minmax(260px, 1fr) 2.7fr; gap: 8px 16px; }
.cust-note { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cust-note-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.cust-note textarea { flex: 1; min-height: 110px; resize: vertical; }
.note-state { font-size: 11px; color: var(--muted); }
.order-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px 10px; align-content: start; }
.order-head .c3 { grid-column: span 3; }
.order-head .c4 { grid-column: span 4; }
.order-head .c6 { grid-column: span 6; }
.order-head .c9 { grid-column: span 9; }
.order-head .c12 { grid-column: 1 / -1; }
.order-head .r2 { grid-row: span 2; }
.order-head .ff { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.order-head .ff > input, .order-head .ff > textarea { width: 100%; height: 26px; padding: 0 7px; }
.order-head .ff > textarea { height: auto; padding: 3px 7px; resize: none; }
.order-head .ff > .cust-input { height: 30px; padding: 0 8px; font-size: 14px; font-weight: 600; }
.order-head .ff.tall > textarea { padding: 5px 8px; resize: vertical; }
.head-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; min-height: 18px; font-size: 12px; color: var(--muted); }
.price-co { font-size: 12px; }
.lines-wrap { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
/* 栏宽定死（<colgroup>），备注分剩下的；窗口太窄时整页横向滚动，不压扁数字栏 */
table.lines { width: 100%; min-width: 1120px; table-layout: fixed; border-collapse: collapse; background: var(--panel); }
table.lines th { background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: 12px; padding: 5px 4px;
  border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; position: sticky; top: 48px; z-index: 2; }
/* 数字一律离格子右边 10px：输入框（4 + 边框 1 + 内边距 5）、显示的数字、表头、合计都对齐到这条线 */
table.lines th.num { text-align: right; padding-right: 10px; }
table.lines th.drag { cursor: grab; user-select: none; }
/* 栏之间的竖线 */
table.lines th + th, table.lines td + td { border-left: 1px solid var(--line); }
/* 调宽度的把手：标题右边缘里面 8px 宽的一条，鼠标移上去变蓝。
   不能伸出格子：后面那格标题（sticky，z-index 一样）会盖住伸出去的部分 */
table.lines .col-grip { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; z-index: 3; }
table.lines .col-grip::after { content: ""; position: absolute; right: 1px; top: 20%; height: 60%; width: 2px; border-radius: 1px; background: transparent; }
table.lines th:hover .col-grip::after { background: var(--line-2); }
table.lines .col-grip:hover::after { background: var(--accent); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
table.lines th.dragging { opacity: .45; }
table.lines th.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
table.lines th.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
table.lines td { border-bottom: 1px solid var(--line); padding: 3px 4px; vertical-align: top; }
table.lines td.seq { color: var(--muted); text-align: center; padding-top: 8px; font-size: 12px; }
table.lines tfoot td { border-bottom: 0; padding-top: 7px; padding-bottom: 7px; background: var(--panel-2); font-size: 12.5px; }
table.lines tfoot td.tot { text-align: right; padding-right: 10px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lines tfoot td.c-model { padding-left: 10px; }
table.lines input { width: 100%; height: 28px; border-color: transparent; background: transparent; padding: 0 5px; }
/* 备注：换行显示全部内容，框跟着字变高（field-sizing；不支持的浏览器 app.js 里量高度） */
table.lines textarea.note { display: block; width: 100%; min-height: 28px; height: auto; padding: 4px 5px; line-height: 18px;
  border-color: transparent; background: transparent; resize: none; overflow: hidden; field-sizing: content;
  white-space: pre-wrap; overflow-wrap: anywhere; }
table.lines input:hover, table.lines textarea.note:hover { border-color: var(--line-2); }
table.lines input:focus, table.lines textarea.note:focus { background: var(--panel); border-color: var(--accent); }
table.lines input.model { font-family: var(--mono); font-size: 12.5px; }
table.lines input.n { text-align: right; font-variant-numeric: tabular-nums; }
table.lines tr.shipped td { background: var(--ok-soft); }
table.lines .sub { font-size: 11px; color: var(--muted); padding: 0 5px; line-height: 1.3; font-family: var(--mono); }
table.lines .sub.prod { color: var(--warn); }
.pcell { font-size: 12.5px; padding: 6px 5px 0; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcell.r { text-align: right; padding-right: 3px; }   /* + .use 自己的 3px + 格子 4px = 10px */
.pcell .use { cursor: pointer; border-radius: 4px; padding: 0 3px; }
.pcell .use:hover { background: var(--accent-soft); color: var(--accent); }
.pcell .why { color: var(--muted); font-size: 11px; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* 上次价格：价格靠右对齐在固定宽度里，日期小字跟在后面，不换行 */
.pcell.last { display: flex; align-items: baseline; gap: 5px; padding-left: 0; }
.pcell.last .lp { display: inline-block; min-width: 62px; text-align: right; }
.pcell.last .d { font-size: 10.5px; color: var(--muted); }
table.lines .sub.note-hint { font-family: inherit; color: var(--warn); }
input.price-diff { background: var(--warn-soft) !important; }
input.price-last { box-shadow: inset 3px 0 0 var(--info); }
input.price-manual { box-shadow: inset 3px 0 0 var(--warn); }
input.price-excel, input.price-paste { box-shadow: inset 3px 0 0 var(--muted); }
.amount { padding: 6px 6px 0 0; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.rowdel { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 5px; }
.rowdel:hover { color: var(--danger); background: var(--danger-soft); }
.order-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; }
.order-foot .totals { font-size: 14px; }
.order-foot .totals b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 3px; border: 1px solid var(--line-2); }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); z-index: 5;
  margin: 0 -16px; padding: 8px 16px; }

/* 下拉联想 */
.ac { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: 7px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16); max-height: 320px; overflow: auto; min-width: 280px; padding: 3px; }
.ac .opt { padding: 5px 8px; border-radius: 5px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.ac .opt.on, .ac .opt:hover { background: var(--accent-soft); }
.ac .opt .m { font-family: var(--mono); font-size: 12.5px; }
.ac .opt .s { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ac .opt .mine { color: var(--ok); }
.ac .head { font-size: 11px; color: var(--muted); padding: 3px 8px; }

/* ------------------------------------------------------------ 弹框、提示 */
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 27, .45); z-index: 100; display: flex;
  align-items: flex-start; justify-content: center; padding: 60px 16px; overflow: auto; }
.modal { background: var(--panel); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 560px; max-width: 100%; }
.modal.wide { width: 980px; }
.modal header { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; display: flex; align-items: center; }
.modal header .x { margin-left: auto; }
.modal .body { padding: 14px 16px; }
.modal footer { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.issue { padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; white-space: pre-wrap; font-size: 13px; }
.issue.warn { background: var(--warn-soft); color: var(--text); border-left: 3px solid var(--warn); }
.issue.error { background: var(--danger-soft); border-left: 3px solid var(--danger); }
.issue.info { background: var(--info-soft); border-left: 3px solid var(--info); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--text); color: var(--panel); padding: 8px 14px; border-radius: 7px; box-shadow: 0 6px 18px rgba(0,0,0,.2);
  max-width: 460px; white-space: pre-wrap; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.paste-preview { max-height: 300px; overflow: auto; margin-top: 8px; }
.xl-grid { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.xl-grid table { border-collapse: collapse; font-size: 12px; }
.xl-grid td, .xl-grid th { border: 1px solid var(--line); padding: 2px 6px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.xl-grid th { background: var(--panel-2); position: sticky; top: 0; }
.xl-grid tr.head td { background: var(--info-soft); font-weight: 600; }
.xl-grid tr.skip td { color: var(--muted); }
.xl-grid td.c-model { background: var(--accent-soft); }
.xl-grid td.c-qty, .xl-grid td.c-price { background: var(--ok-soft); }

/* 仓库：整页不滚（铺满窗口、不限宽），左边挑单、右边这张单，各自有滚动条 */
.view.fill { max-width: none; height: calc(100vh - 48px); display: flex; flex-direction: column; padding-bottom: 12px; }
.view.fill > * { flex: none; }
.view.fill > .wh-layout { flex: 1; min-height: 0; }
.wh-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 12px; }
.wh-side { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.wh-filter { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.wh-filter label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.wh-filter select { height: 26px; padding: 0 4px; }
.wh-filter .wh-range.off { color: var(--muted); }
.wh-list { flex: 1; min-height: 0; overflow-y: auto; }
.wh-group { position: sticky; top: 0; z-index: 1; padding: 4px 10px; font-size: 12px; color: var(--muted);
  background: var(--panel-2); border-bottom: 1px solid var(--line); }
.wh-more { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.wh-list .item { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.wh-list .item:hover { background: var(--panel-2); }
.wh-list .item.on { background: var(--accent-soft); }
.wh-list .item .t { display: flex; gap: 8px; align-items: center; }
.wh-list .item .rmk { font-size: 12px; color: var(--warn); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wh-detail { min-height: 0; overflow: auto; }
.wh-detail table.lines th { top: 0; }          /* 表头钉在右边这块的顶上 */
.wh-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.wh-title h2 { margin: 0; font-size: 16px; }
/* 只读的订单头：底色灰一点；单据备注有字时黄底、跟着字变高 */
.order-head.ro input, .order-head.ro textarea { background: var(--panel-2); border-color: var(--line); }
.order-head.ro .r2 > textarea { flex: 1; min-height: 0; }
.order-head.ro .tall > textarea { resize: none; field-sizing: content; min-height: 46px; }
.order-head.ro .tall > textarea.has-text { background: var(--warn-soft); border-color: transparent; }
/* 仓库的行：字，不是输入框（和输入框里的字对齐） */
table.lines .cv { padding: 5px 5px; line-height: 18px; overflow-wrap: anywhere; }
table.lines .cv.n { text-align: right; padding-right: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lines .cv.qty { font-size: 14px; font-weight: 600; }
table.lines .cv.note { white-space: pre-wrap; }
table.lines td.c-ship { text-align: center; }
table.lines td.c-ship input[type="checkbox"] { width: 17px; height: 17px; margin: 5px 0 0; cursor: pointer; }
table.lines td.c-ship input[type="checkbox"]:disabled { cursor: default; }
.big-model { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }

/* 账号 */
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }

/* 登录 */
.login-page { display: grid; place-items: center; min-height: 100%; }
.login-card { width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.login-card label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.login-card input { height: 34px; color: var(--text); font-size: 14px; }
.login-card .btn { height: 36px; margin-top: 6px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 6px; }
.login-error { background: var(--danger-soft); color: var(--danger); padding: 7px 10px; border-radius: 6px; font-size: 12.5px; }

.cut-table td.len { font-variant-numeric: tabular-nums; font-weight: 600; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 客户列表：一家几个地址就几行字，格子顶端对齐 */
table.cust-list td { vertical-align: top; }
table.cust-list td.addr div + div { margin-top: 2px; }
/* 客户的联系人 / 电话 / 地址表格（像 Excel：格子里直接改） */
.cgrid-title { margin-top: 6px; }
.cgrid-wrap { border: 1px solid var(--line); border-radius: var(--radius); max-height: 46vh; overflow: auto; }
table.cgrid { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--panel); }
table.cgrid th { background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: 12px; padding: 5px 4px;
  border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.cgrid th + th, table.cgrid td + td { border-left: 1px solid var(--line); }
table.cgrid td { border-bottom: 1px solid var(--line); padding: 2px 3px; }
table.cgrid td.seq { color: var(--muted); text-align: center; font-size: 12px; }
table.cgrid .c-def { text-align: center; }
table.cgrid input:not([type="checkbox"]) { width: 100%; height: 28px; border-color: transparent; background: transparent; padding: 0 5px; }
table.cgrid input:not([type="checkbox"]):hover { border-color: var(--line-2); }
table.cgrid input:not([type="checkbox"]):focus { background: var(--panel); border-color: var(--accent); }
/* 录单：地址格左下角「选地址」（这家客户资料里的地址，带出默认联系人、电话）。像一个小链接，鼠标移上去才有底色；
   宽度跟着「选地址（N 个）」这几个字走（下拉框默认按最长的选项定宽，箭头会跑到很右边） */
.addr-box { position: relative; }
.order-head .addr-box > textarea { flex: 1; min-height: 0; padding: 3px 7px 20px; }
.addr-box .addr-pick { position: absolute; left: 3px; bottom: 3px; height: 18px; padding: 0 2px 0 4px; font-size: 12px;
  field-sizing: content; width: auto; max-width: 10em; border: 0; border-radius: 4px; background: transparent;
  color: var(--accent); cursor: pointer; }
.addr-box .addr-pick:hover, .addr-box .addr-pick:focus { background: var(--accent-soft); box-shadow: none; }

@media (max-width: 900px) {
  .order-head2 { grid-template-columns: 1fr; }
  .order-head { grid-template-columns: 1fr 1fr; }
  .wh-layout, .split { grid-template-columns: 1fr; }
  .view.fill { height: auto; display: block; }
  .wh-list { max-height: 45vh; }
  .wh-detail { overflow: visible; margin-top: 12px; }
  .wh-detail table.lines th { top: 48px; }
  .tabs a { padding: 0 8px; }
  .conn { display: none; }
}
