/* GLC 电子核算单 — layout: a navy top bar, then a paper sheet that mirrors the printed 核算单
   (black-ruled boxes, a red number stamp, 楷体 signatures). One light theme on purpose: it is a paper form.
   System fonts only, so it looks right in China with no internet. */
:root {
  --page: #eceff2;
  --surface: #ffffff;
  --ink: #16191d;
  --ink-2: #49515a;
  --muted: #737c86;
  --line: #d3d9df;
  --rule: #23282e;
  --bar: #16324f;
  --bar-ink: #f1f5f9;
  --bar-ink-2: #a9bccd;
  --accent: #1d4f7a;
  --go: #1f6b3a;
  --warn: #a8321e;
  --stamp: #b42a22;
  --sales: #f1f6fc;
  --ops: #fbf7ee;
  --focus: #2f6fdd;
  --flash-ok: #e8f4ec;
  --flash-err: #fbeaea;
  --hover: #f4f6f8;
  --demo: #c8221b;
  --demo-ink: #ffffff;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-sign: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "AR PL UKai CN", serif;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.55 var(--font); }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
code { font-family: var(--font-num); font-size: 12.5px; background: var(--hover); padding: 1px 5px; border-radius: 3px; }
.muted { color: var(--muted); }
.num, .no, td.num { font-variant-numeric: tabular-nums; }
.neg { color: var(--warn); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- demo mode only: the red switcher ---------- */
.demo-bar { background: var(--demo); color: var(--demo-ink); border-bottom: 3px solid #8f1410; }
.demo-in { max-width: 1440px; margin: 0 auto; padding: 7px 20px; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.demo-tag { background: var(--demo-ink); color: var(--demo); padding: 1px 9px; border-radius: 3px; font-size: 13px; letter-spacing: .12em; }
.demo-ver { font-size: 13px; font-variant-numeric: tabular-nums; }
.demo-note { font-size: 13px; }
.demo-users { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.demo-users button { font: inherit; font-size: 13px; color: var(--demo-ink); background: transparent; border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px; padding: 2px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
.demo-users button small { font-size: 11.5px; opacity: .85; }
.demo-users button:hover { background: rgba(255,255,255,.16); }
.demo-users button[aria-current] { background: var(--demo-ink); color: var(--demo); border-color: var(--demo-ink); font-weight: 700; cursor: default; }
.demo-users button[aria-current] small { opacity: 1; }
.demo-users button:focus-visible { outline: 2px solid var(--demo-ink); outline-offset: 2px; }
.bare .demo-bar + .login { min-height: calc(100vh - 50px); }
.demo-print { color: var(--demo); }

/* ---------- top bar ---------- */
.top { background: var(--bar); color: var(--bar-ink); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px; min-height: 52px; flex-wrap: wrap; }
.top-in.wide { max-width: 1440px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--bar-ink); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 1.5px solid var(--bar-ink); border-radius: 3px; font-weight: 700; font-size: 15px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .04em; }
.brand-co { color: var(--bar-ink-2); font-size: 12px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--bar-ink-2); text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 14px; }
.nav a:hover { color: var(--bar-ink); background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: var(--bar-ink); background: rgba(255,255,255,.14); font-weight: 600; }
.me { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.me-name { font-weight: 600; }
.me-roles { color: var(--bar-ink-2); }
.me a, .me .linkish { color: var(--bar-ink-2); }
.me form { margin: 0; }

/* ---------- page ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
.wrap.wide { max-width: 1440px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.crumbs { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; margin-bottom: 18px; }
.panel.narrow { max-width: 560px; }
.panel h1 { margin-bottom: 10px; }
.panel h2 { margin-bottom: 12px; }
.panel p { max-width: 70ch; }
.flash { padding: 10px 14px; border-radius: 5px; margin: 0 0 14px; font-weight: 500; }
.flash-ok { background: var(--flash-ok); color: var(--go); border: 1px solid #b9dcc5; }
.flash-err { background: var(--flash-err); color: var(--warn); border: 1px solid #ecc1bb; }
.flash-warn { background: #fff8e6; color: #6b4d00; border: 1px solid #f0d99a; }
.note-warn { background: #fff8e6; border: 1px solid #f0d99a; color: #6b4d00; padding: 9px 12px; border-radius: 5px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; padding: 28px; text-align: center; color: var(--muted); }
.scroll { overflow-x: auto; }
.tag { display: inline-block; font-size: 11.5px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-2); background: var(--hover); vertical-align: 1px; }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid rgba(47,111,221,.25); outline-offset: 0; }
input[readonly] { background: var(--hover); color: var(--muted); }
input.bad { border-color: var(--warn); background: #fff4f2; }
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.stack { display: grid; gap: 14px; }
.stack input, .stack select { font-size: 15px; padding: 8px 10px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 5px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; list-style: none; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #163f62; }
.btn-go { background: var(--go); border-color: var(--go); color: #fff; }
.btn-go:hover { background: #18552e; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-quiet { background: transparent; }
.btn-small { padding: 3px 9px; font-size: 13px; }
.btn.pulse { box-shadow: 0 0 0 3px rgba(29,79,122,.25); }
.linkish { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.small { font-size: 12px; }
.inline { display: inline; margin: 0; }
details.act { position: relative; display: inline-block; }
details.act > summary::-webkit-details-marker { display: none; }
details.act > summary::marker { content: ""; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px; box-shadow: 0 10px 30px rgba(22,25,29,.16); display: grid; gap: 10px; }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- lists ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 8px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab-n { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--hover); color: var(--ink-2); font-size: 12px; text-align: center; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.filters .grow { flex: 1 1 240px; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table.list th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: #f7f8fa; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list th.num, table.list td.num { text-align: right; }
table.list tr.is-todo td { background: #f5f9ff; }
table.list tr.is-todo .no { font-weight: 700; }
table.list tr.is-void td { color: var(--muted); }
table.list tr.is-void .no { text-decoration: line-through; }
.no { font-family: var(--font-num); font-size: 13px; }
td.open { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 7px; border-radius: 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-draft { color: #5b6470; border-color: #c9cfd6; background: #f3f5f7; }
.st-review { color: #1d58b3; border-color: #b9cdee; background: #eef4fd; }
.st-approved { color: #8a5a00; border-color: #e6cf98; background: #fff7e3; }
.st-booked { color: #1f6b3a; border-color: #b7dcc3; background: #ecf7f0; }
.st-void { color: #a8321e; border-color: #ebc1ba; background: #fcefed; }

/* ---------- the 核算单 ---------- */
.actbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--page); padding: 10px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.actbar-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actbar-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.next { color: var(--ink-2); }
.returned { background: #fff3ef; border: 1px solid #f0c7bd; color: var(--warn); padding: 9px 12px; border-radius: 5px; margin: 0 0 12px; }

.sheet { background: var(--surface); border: 1px solid var(--rule); padding: 22px 26px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(22,25,29,.06); max-width: 1320px; margin: 0 auto; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--rule); }
.sheet-co { display: grid; gap: 4px; font-weight: 600; }
.secret { justify-self: start; font-size: 12px; font-weight: 600; border: 1px solid var(--rule); padding: 0 6px; letter-spacing: .1em; }
.sheet-title { font-size: 30px; font-weight: 700; letter-spacing: 0; display: flex; align-items: center; }
.sheet-title i { display: inline-block; width: .7em; }
.stamp { justify-self: end; display: grid; gap: 0; border: 2px solid var(--stamp); color: var(--stamp); padding: 4px 12px 5px; transform: rotate(-1deg); text-align: center; }
.stamp span { font-size: 11.5px; letter-spacing: .12em; }
.stamp b { font-family: var(--font-num); font-size: 19px; letter-spacing: .04em; }
.meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--rule); border-top: none; }
.meta > div { padding: 7px 10px; border-right: 1px solid var(--rule); display: grid; gap: 2px; min-width: 0; }
.meta > div:last-child { border-right: none; }
.meta span { font-size: 12px; color: var(--muted); }
.meta b { font-weight: 600; overflow-wrap: anywhere; }
.meta input { padding: 3px 6px; }

.box { border: 1.5px solid var(--rule); border-radius: 0; padding: 12px 14px 14px; margin-top: 14px; min-width: 0; }
.box legend { font-size: 15px; padding: 0 8px; display: flex; align-items: center; gap: 8px; }
.box .who { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 3px; }
.box-sales { background: var(--sales); }
.box-sales .who { background: #dbe8f7; color: #1d4f7a; }
.box-ops { background: var(--ops); }
.box-ops .who { background: #f1e5c8; color: #6b4d00; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 14px; }
.fld { display: grid; gap: 3px; min-width: 0; }
.fld span { font-size: 12px; color: var(--ink-2); }
.fld b { font-weight: 500; border-bottom: 1px solid var(--line); padding: 3px 0; min-height: 26px; overflow-wrap: anywhere; }
.fld input { width: 100%; background: #fff; }

table.lines { width: 100%; border-collapse: collapse; min-width: 980px; background: #fff; }
table.lines th { font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: left; padding: 6px 5px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.lines td { padding: 4px 5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.lines th.num, table.lines td.num { text-align: right; }
table.lines input, table.lines select { width: 100%; padding: 5px 6px; font-size: 13.5px; }
table.lines input.num { text-align: right; font-variant-numeric: tabular-nums; }
table.lines tfoot td { border-bottom: none; border-top: 1px solid var(--rule); font-weight: 700; padding-top: 7px; }
table.lines tr.is-settled td { background: #f6faf7; }
.c-item { width: 14%; } .c-cur { width: 76px; } .c-amt { width: 112px; } .c-rate { width: 82px; } .c-cny { width: 112px; }
.c-party { width: 13%; } .c-inv { width: 104px; } .c-adv { width: 64px; } .c-settle { width: 196px; } .c-rm { width: 34px; }
td.cny { color: var(--ink-2); }
.empty-row { color: var(--muted); text-align: center; padding: 14px; }
.rm { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; }
.rm:hover { color: var(--warn); border-color: var(--warn); }
.add-row { margin-top: 8px; }
.paid { color: var(--go); font-weight: 600; font-size: 12.5px; margin-right: 6px; white-space: nowrap; }
.unpaid { color: var(--muted); font-size: 12.5px; }
.settle-do { display: inline-flex; gap: 5px; align-items: center; }
.settle-do input[type=date] { width: 128px; padding: 3px 5px; font-size: 12.5px; }

.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 2fr; border: 1.5px solid var(--rule); margin-top: 14px; }
.totals > div { padding: 8px 12px; border-right: 1px solid var(--rule); display: grid; gap: 2px; min-width: 0; }
.totals > div:last-child { border-right: none; }
.totals span { font-size: 12px; color: var(--muted); }
.totals b { font-size: 19px; font-variant-numeric: tabular-nums; }
.totals .daxie b { font-size: 16px; font-family: var(--font-sign); letter-spacing: .03em; overflow-wrap: anywhere; }
.remark { margin-top: 12px; display: grid; gap: 4px; }
.remark span { font-size: 12px; color: var(--muted); }
.remark p { margin: 0; border-bottom: 1px solid var(--line); min-height: 24px; }

.sigs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 16px; border: 1.5px solid var(--rule); }
.sig { display: grid; grid-template-rows: auto 1fr auto; gap: 2px; padding: 7px 10px; min-height: 86px; border-right: 1px solid var(--rule); min-width: 0; }
.sig:last-child { border-right: none; }
.sig-role { font-size: 12px; color: var(--muted); }
.sig-name { font-family: var(--font-sign); font-size: 22px; color: var(--ink); align-self: center; }
.sig-at { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sig-note { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.sig.current { background: #eef4fd; box-shadow: inset 0 0 0 2px #7aa6e6; }
.sig.current .sig-name { font-family: var(--font); font-size: 13px; color: #1d58b3; font-weight: 600; }
.sig-go { display: grid; gap: 2px; justify-items: start; width: 100%; padding: 2px 0; border: 0; background: none; font: inherit; color: inherit;
  text-align: left; cursor: pointer; }
.sig-go span { text-decoration: underline; text-underline-offset: 3px; }
.sig-go small { font-size: 11.5px; font-weight: 400; }
.sig-go:hover span, .sig-go:focus-visible span { text-decoration-thickness: 2px; }
.sig-foot { display: flex; align-items: flex-start; gap: 14px; }
.sig-caption { margin: 6px 0 0; flex: 1; font-size: 12px; color: var(--muted); text-align: right; }
/* Finance's 审核, hanging under the 业务经办人 box like the signature at the bottom right of the paper form. */
.fin-check { flex: 0 0 20%; display: grid; grid-template-rows: auto 1fr auto; gap: 2px; padding: 6px 10px; min-height: 66px;
  border: 1.5px solid var(--rule); border-top: none; min-width: 0; }
.fin-check .sig-name { font-size: 20px; }
.meta .handoff .sig-expect { font-size: 12px; }
.pop-note { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

.history { max-width: 1320px; margin: 22px auto 0; }
.history h2 { margin-bottom: 8px; }
ol.trail, ol.events { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
ol.trail li, ol.events li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 7px 10px; }
.when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
ol.trail li.d-return { border-color: #ecc1ba; background: #fff6f4; }
ol.trail q { color: var(--ink-2); }
.round { font-size: 12px; color: var(--muted); }
details.log { margin-top: 14px; }
details.log summary { cursor: pointer; color: var(--ink-2); padding: 6px 0; }

/* ---------- new form, 核销, admin ---------- */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 12px; background: #fff; color: var(--ink); cursor: pointer; }
.pick:has(input:checked) { border-color: var(--accent); background: #eef4fb; box-shadow: inset 0 0 0 1px var(--accent); }
.code-preview { margin: 0; color: var(--ink-2); }
.code-preview b { font-family: var(--font-num); color: var(--ink); }
.summary { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; color: var(--ink-2); }
.summary b { font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.group { margin-bottom: 18px; }
.group h2 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.g-total { font-variant-numeric: tabular-nums; }
.g-total small { color: var(--muted); font-weight: 400; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; color: var(--ink); font-size: 13px; }
.user-edit { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; }
.w-name { width: 120px; }
.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.grid-form .wide-cell { grid-column: 1 / -1; }

/* ---------- 应收应付: ageing ---------- */
.ages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin: 4px 0 18px; }
.age { padding: 10px 14px; border-right: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.age:last-child { border-right: none; }
.age span { font-size: 12.5px; color: var(--muted); }
.age b { font-size: 19px; font-variant-numeric: tabular-nums; }
.age-bad b { color: var(--warn); }
.age-total { background: #f7f8fa; }

/* ---------- 汇总 ---------- */
.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 2px 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; display: grid; gap: 2px; min-width: 0; }
.card span { font-size: 12.5px; color: var(--muted); }
.card b { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
table.matrix caption { caption-side: top; text-align: left; padding: 0 0 8px; color: var(--ink-2); font-size: 13px; }
table.matrix th[scope=row] { font-weight: 600; white-space: nowrap; }
table.matrix td a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
table.matrix td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
table.matrix tr.total th, table.matrix tr.total td { background: #f7f8fa; font-weight: 700; border-top: 1.5px solid var(--rule); }
td.strong { font-weight: 700; }
.sig-expect { font-style: normal; font-family: var(--font); font-size: 12.5px; color: var(--muted); }

/* ---------- login ---------- */
body.bare { background: var(--page); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--rule); padding: 30px 28px; box-shadow: 0 10px 40px rgba(22,25,29,.1); }
.login-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--stamp); color: var(--stamp); font-size: 24px; font-weight: 700; transform: rotate(-2deg); margin-bottom: 14px; }
.login-card h1 { font-size: 24px; }
.login-co { margin: 4px 0 18px; color: var(--muted); }
.login-note { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.login-ver { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- print view ---------- */
.print-wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.print-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.print-foot { font-size: 12px; color: var(--muted); text-align: right; margin: 8px 0 0; }

@media (max-width: 900px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta > div { border-bottom: 1px solid var(--rule); }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totals .daxie { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
  .sheet-head { grid-template-columns: 1fr; text-align: left; }
  .stamp { justify-self: start; }
  .grid-form { grid-template-columns: 1fr; }
  .me { margin-left: 0; }
}
@media (max-width: 760px) {
  .ages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .age { border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .actbar-acts { width: 100%; }
  details.act { position: static; }
  .pop { left: 16px; right: 16px; width: auto; }
}
@media (max-width: 560px) {
  .sigs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sig { border-bottom: 1px solid var(--rule); }
  .fin-check { flex-basis: 34%; }
  .sheet { padding: 14px 12px; }
}

@media print {
  @page { size: A4 portrait; margin: 9mm; }
  body, body.bare { background: #fff; font-size: 11.5px; }
  .demo-bar, .top, .actbar, .crumbs, .history, .no-print, .flash, .add-row, .rm, .settle-do, .c-rm, .print-bar { display: none !important; }
  .print-wrap { padding: 0; max-width: none; }
  .sheet { box-shadow: none; border: 1px solid #000; max-width: none; padding: 6mm 6mm 4mm; }
  table.lines { min-width: 0; }
  .box-sales, .box-ops, .sig.current, table.lines tr.is-settled td { background: none; box-shadow: none; }
  .sig-go small { display: none; }
  .sig-go span { text-decoration: none; }
  .scroll { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- 核算单管理规定: 备注标记, 情况说明, 调整/报废申请, 跟踪 ---------- */
.rate-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.tag-adj { border-color: #b9cdee; background: #eef4fd; color: #1d58b3; }
.tag-warn { border-color: #ebc1ba; background: #fcefed; color: var(--warn); }
.flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; }
.flags > span { font-size: 12px; color: var(--muted); }
.flags .tag { font-weight: 600; }
.explain { margin-top: 12px; display: grid; gap: 4px; }
.explain label { display: grid; gap: 4px; }
.explain .lbl { font-size: 12px; color: var(--muted); }
.explain textarea { width: 100%; font: inherit; padding: 6px 8px; background: #fff; resize: vertical; }
.explain p { margin: 0; border-bottom: 1px solid var(--line); min-height: 24px; overflow-wrap: anywhere; }
.explain.warn { background: #fff8e6; border: 1px solid #f0d99a; padding: 8px 10px; }
.need { color: #6b4d00; font-weight: 600; font-size: 13px; }
.pending, .remade { margin: 0 0 10px; padding: 8px 12px; border-radius: 5px; }
.pending { background: #eef4fd; border: 1px solid #b9cdee; color: #17427f; }
.remade { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.publish { margin: 0 0 12px; }

.requests { max-width: 1320px; margin: 22px auto 0; display: grid; gap: 12px; }
.req { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: grid; gap: 10px; }
.req.req-pending { border-color: #b9cdee; box-shadow: inset 3px 0 0 #7aa6e6; }
.req header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.req h3 { font-size: 15px; }
.req-st-pending { color: #1d58b3; border-color: #b9cdee; background: #eef4fd; }
.req-st-approved { color: #1f6b3a; border-color: #b7dcc3; background: #ecf7f0; }
.req-st-rejected { color: #a8321e; border-color: #ebc1ba; background: #fcefed; }
.req-st-cancelled { color: #5b6470; border-color: #c9cfd6; background: #f3f5f7; }
.req-reason { margin: 0; }
.req-sigs { margin-top: 0; }
.req-sigs.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.req-sigs.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.req-sigs.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.req-sigs .sig { min-height: 74px; }
.req-sigs .sig-name { font-size: 19px; }
.req-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.req-ok { display: inline-flex; gap: 6px; align-items: center; }
.req-ok input { width: 220px; padding: 6px 8px; }
table.list.adj td input, table.list.adj td select { width: 100%; padding: 5px 6px; font-size: 13.5px; }
table.list.adj td input.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list.adj td.sub { font-size: 12.5px; color: var(--muted); background: #f7f8fa; }
table.list.adj input.bad { border-color: var(--warn); background: #fff6f4; }
.adj-form { max-width: 1320px; }
.adj-form textarea { font: inherit; padding: 6px 8px; width: 100%; resize: vertical; }
.adj-form label { display: grid; gap: 4px; }
.adj-profit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1.5px solid var(--rule); background: var(--surface); }
.adj-profit > div { padding: 8px 12px; border-right: 1px solid var(--rule); display: grid; gap: 2px; min-width: 0; }
.adj-profit > div:last-child { border-right: none; }
.adj-profit span, .adj-profit small { font-size: 12px; color: var(--muted); }
.adj-profit b { font-size: 19px; font-variant-numeric: tabular-nums; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
table.list.track td { font-size: 13px; }
table.list.narrow-table { width: auto; min-width: 360px; }
.track-page h2, .scroll > h2 { margin: 16px 0 8px; }
@media (max-width: 760px) {
  .req-sigs.n5, .req-sigs.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adj-profit { grid-template-columns: 1fr; }
  .adj-profit > div { border-right: none; border-bottom: 1px solid var(--rule); }
}
@media print {
  .requests .req-acts { display: none !important; }
}

/* ---------- 李总, Nov 13: extra info rows, possible duplicate costs, filters ---------- */
.info-read { margin-top: 9px; }
.info-edit { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
table.info { width: 100%; border-collapse: collapse; }
table.info:empty, table.info tbody:empty { display: none; }
table.info td { padding: 3px 5px 3px 0; }
table.info td:first-child { width: 22%; }
table.info td:last-child { width: 34px; }
table.info input { width: 100%; padding: 5px 6px; font-size: 13.5px; background: #fff; }
.dup-note { display: block; margin: 2px 0 4px; font-size: 12px; line-height: 1.4; color: #6b4d00; background: #fff8e6; border: 1px solid #f0d99a; border-radius: 3px; padding: 2px 6px; }
.note-filter { margin: 0 0 10px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); }
.ages.ages-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* v4 (Nov 21): notes both sides write, 代垫 reminder, a plain 操作's view, departments */
.hidden { display: none !important; }
.shared-notes { margin-top: 12px; display: grid; gap: 8px; padding: 8px 10px; border: 1px dashed var(--line); }
.shared-notes .sn-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
.shared-notes .sn-text { display: grid; gap: 4px; flex: 1 1 260px; font-size: 12px; color: var(--muted); }
.shared-notes .sn-text input { font: inherit; font-size: 14px; color: inherit; padding: 5px 8px; width: 100%; }
.shared-notes.read { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-style: solid; }
.shared-notes .need, .need { color: var(--warn); font-style: normal; }
.advance-note { margin: 8px 0 0; padding: 6px 10px; background: #fff8e6; border: 1px solid #f0d99a; font-size: 13px; }
.no-money { margin: 12px 0; padding: 10px; border: 1px dashed var(--line); text-align: center; }
.users .depts { border-left: 1px solid var(--line); padding-left: 8px; }

/* The desktop icon download (src/desktop.js), on the login and 改密码 pages */
.app-hint { display: grid; gap: 6px; margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.app-hint .btn { justify-self: start; }

/* 备份: the office PC's nightly fetch (status, the one-time key) */
.note-ok { background: var(--flash-ok); border: 1px solid #b9dcc5; color: var(--go); padding: 9px 12px; border-radius: 5px; }
.panel h2 + p, .panel p + p { margin-top: 8px; }
.panel h2 { margin-top: 22px; }
.panel .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.key-box { margin: 14px 0 0; padding: 12px 14px; border: 1px solid #f0d99a; background: #fffdf5; border-radius: 6px; display: grid; gap: 6px; }
.key-box p { margin: 0; }
code.key { display: inline-block; font-size: 14px; padding: 4px 8px; background: #fff; border: 1px solid var(--line); border-radius: 4px; word-break: break-all; user-select: all; }
