/* 网点财务系统 界面样式
   取意：账页（蓝黑墨水字、淡绿格线、合计双线）、朱红印章（单据状态）、面单数字（DIN 风格数字）。 */

:root {
  --ink: #1b2640;          /* 蓝黑墨水：正文 */
  --ink-2: #4a5672;        /* 次要文字 */
  --ink-3: #8590a6;        /* 说明、占位 */
  --paper: #ffffff;        /* 纸面 */
  --desk: #f1f4f2;         /* 桌面（页面底色，账页的灰绿） */
  --rule: #d6e0da;         /* 账页格线 */
  --rule-2: #e8eeea;       /* 更浅的格线 */
  --wash: #f6f9f7;         /* 行悬停 */
  --brand: #2456c6;        /* 钢笔蓝：主操作、链接 */
  --brand-2: #1b47a8;
  --brand-wash: #eaf0fc;
  --seal: #c23a2b;         /* 朱红印泥：印章、负数、危险操作 */
  --seal-wash: #fbeeec;
  --amber: #9a6410;        /* 待办、提醒 */
  --amber-wash: #fbf3e2;
  --ok: #1e7f4f;
  --ok-wash: #e9f5ee;
  --side: #172038;         /* 侧栏底 */
  --side-ink: #c5cde0;
  --radius: 5px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Hiragino Sans GB", system-ui, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  /* 图表用色（数据可视化调色板，已对白底校验） */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-neg: #d03b3b;
  --track: #e3e9e5;        /* 占比条里“剩下的那一份” */
  --grid: #e1e0d9;
  --axis: #c3c2b7;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.55; color: var(--ink);
  background: var(--desk); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.neg { color: var(--seal); }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ------------------------------------------------------------ 整体布局 */
#app { display: flex; min-height: 100vh; }
.side {
  width: 208px; flex: 0 0 208px; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand b { display: block; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.side-brand span { display: block; font-size: 12px; color: #8f9ab6; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 0 16px; scrollbar-width: thin; scrollbar-color: #33405f transparent; }
.nav-top, .nav-head {
  display: flex; align-items: center; width: 100%; padding: 7px 16px; border: 0; background: none;
  color: var(--side-ink); font-size: 13px; text-align: left; cursor: pointer;
}
.nav-top { text-decoration: none; padding-left: 29px; }       /* 和各组的组名对齐（组名前面有个小箭头） */
.nav-top:hover, .nav-head:hover { color: #fff; text-decoration: none; }
/* 一组菜单的标题行：组名（点了展开/收起）+ “固定”。收着的组名暗一点，展开的那组是白的，一眼知道自己在哪 */
.nav-row { display: flex; align-items: center; }
.nav-head { flex: 1; min-width: 0; padding-right: 6px; color: #a3aec8; }
.nav-head::before { content: ""; flex: 0 0 auto; width: 5px; height: 5px; margin-right: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); opacity: .75; transition: transform .15s; }
.nav-group.closed .nav-head::before { transform: rotate(-45deg); }
.nav-group:not(.closed) .nav-head { color: #fff; }
.nav-group.closed .nav-items { display: none; }
.nav-pin { flex: 0 0 auto; border: 0; background: none; cursor: pointer; font-size: 11px; color: #7c88a6; padding: 4px 12px 4px 4px; opacity: 0; }
.nav-row:hover .nav-pin, .nav-pin:focus-visible, .nav-group.pinned .nav-pin { opacity: 1; }
.nav-pin:hover { color: #fff; }
.nav-group.pinned .nav-pin { color: #d9b55c; }
.nav-section { display: flex; align-items: center; gap: 8px; padding: 14px 16px 3px; font-size: 11px; color: #66728f; letter-spacing: 3px; }
.nav-section::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.nav-mode { display: block; margin: 6px 0 0 auto; border: 0; background: none; cursor: pointer; font-size: 11px; color: #7c88a6; padding: 1px 2px; }
.nav-mode:hover { color: #fff; }
.side.few .side-find { display: none; }          /* 菜单只有一两项的账号（只报销的同事）：用不着搜索和展开开关 */
.side.few .side-nav { padding-top: 12px; }
.nav-badge { margin-left: auto; min-width: 18px; height: 16px; line-height: 16px; padding: 0 5px; border-radius: 8px; background: var(--seal); color: #fff; font-size: 11px; text-align: center; }
.nav-items a {
  display: block; padding: 5px 16px 5px 37px; color: var(--side-ink); font-size: 13px; position: relative;
}
.nav-items a:hover { color: #fff; background: rgba(255,255,255,.04); text-decoration: none; }
.nav-top.active, .nav-items a.active { color: #fff; background: rgba(255,255,255,.07); }
.nav-top.active::before, .nav-items a.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--seal);
}
.nav-top { position: relative; }
.side-foot { padding: 10px 16px; font-size: 12px; color: #7c88a6; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 50px; background: var(--paper); border-bottom: 1px solid var(--rule); display: flex; align-items: center;
  padding: 0 20px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; font-weight: 600; white-space: nowrap; }
.topbar .crumb { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.period {
  display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  background: var(--paper);
}
.period button { border: 0; background: none; padding: 5px 9px; cursor: pointer; color: var(--ink-2); }
.period button:hover { background: var(--wash); color: var(--ink); }
.period input { border: 0; border-radius: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 4px 8px; width: 138px; font-family: var(--font-num); background: transparent; }
.period-label { font-size: 12px; color: var(--ink-3); }
.user-menu { position: relative; }
.user-menu > button { border: 0; background: none; cursor: pointer; padding: 6px 4px; color: var(--ink-2); }
.user-menu > button:hover { color: var(--ink); }
.menu-pop {
  position: absolute; right: 0; top: 34px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(27,38,64,.12); min-width: 140px; padding: 4px 0; z-index: 40;
}
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; cursor: pointer; }
.menu-pop button:hover { background: var(--wash); }
.lock-chip { font-size: 12px; color: var(--amber); background: var(--amber-wash); border-radius: 3px; padding: 2px 8px; white-space: nowrap; }

.content { padding: 18px 20px 40px; flex: 1; min-width: 0; }
.page-hint { color: var(--ink-2); margin: -4px 0 14px; max-width: 78em; }

/* ------------------------------------------------------------ 面板 */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--rule-2); }
.panel-head h3 { font-size: 14px; font-weight: 600; }
.panel-head .sub { color: var(--ink-3); font-size: 12px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 14px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid.c2, .grid.c3 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ 按钮、输入 */
.btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--rule); background: var(--paper);
  border-radius: var(--radius); padding: 5px 12px; cursor: pointer; white-space: nowrap; color: var(--ink); line-height: 1.5;
}
.btn:hover { border-color: #b9c7bf; background: var(--wash); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { color: var(--seal); border-color: #e6c3be; }
.btn.danger:hover { background: var(--seal-wash); }
.btn.link { border: 0; background: none; padding: 2px 4px; color: var(--brand); }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.link.danger { color: var(--seal); }
.btn.small { padding: 2px 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=password], select, textarea {
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 5px 8px; background: var(--paper); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
textarea { resize: vertical; min-height: 56px; width: 100%; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); vertical-align: -2px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.toolbar label { color: var(--ink-2); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.toolbar input[type=text], .toolbar select { height: 30px; }
.toolbar input[type=date], .toolbar input[type=month] { height: 30px; font-family: var(--font-num); }
.toolbar .search { width: 190px; }
.batch-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--brand-wash); border: 1px solid #c9d8f5; border-radius: var(--radius); margin-bottom: 8px; }

/* ------------------------------------------------------------ 账页表格 */
.table-wrap { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; }
table.ledger { border-collapse: collapse; width: 100%; font-size: 13px; }
table.ledger th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-2); padding: 8px 10px; white-space: nowrap;
  border-bottom: 2px solid var(--ink); background: var(--paper); position: sticky; top: 0;
}
table.ledger th.sortable { cursor: pointer; user-select: none; }
table.ledger th.sortable:hover { color: var(--ink); }
table.ledger th .arrow { color: var(--brand); margin-left: 3px; font-size: 10px; }
table.ledger td { padding: 6px 10px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
table.ledger tbody tr:hover td { background: var(--wash); }
table.ledger tbody tr.clickable { cursor: pointer; }
table.ledger td.r, table.ledger th.r { text-align: right; }
table.ledger td.c, table.ledger th.c { text-align: center; }
table.ledger td.nowrap { white-space: nowrap; }
table.ledger td.ops { white-space: nowrap; text-align: right; }
table.ledger td.ops .btn.link { margin-left: 4px; }
table.ledger tfoot td {
  font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); background: var(--paper);
}
table.ledger tr.bold td { font-weight: 600; }
table.ledger tr.sep td { background: var(--desk); font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--rule); }
table.ledger tr.warn td { color: var(--seal); }
table.ledger tr.total td { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
table.ledger td .hint { color: var(--ink-3); cursor: help; margin-left: 4px; font-size: 11px; border: 1px solid var(--rule); border-radius: 50%; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; vertical-align: 1px; }
table.ledger td.indent1 { padding-left: 26px; }
table.ledger td.indent2 { padding-left: 42px; }
.empty { text-align: center; color: var(--ink-3); padding: 34px 10px; }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; font-weight: 600; }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 12px; }
.pager .spacer { flex: 1; }
.pager select { padding: 2px 4px; }
.sumline { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; color: var(--ink-2); font-size: 12px; }
.sumline b { font-family: var(--font-num); font-size: 14px; color: var(--ink); font-weight: 600; margin-left: 4px; }

/* ------------------------------------------------------------ 印章式状态 */
.stamp {
  display: inline-block; border: 1.5px solid currentColor; border-radius: 3px; padding: 0 6px; font-size: 12px;
  line-height: 18px; letter-spacing: 1px; white-space: nowrap; color: var(--ink-3);
}
.stamp.draft { border-style: dashed; color: var(--ink-3); }
.stamp.blue { color: var(--brand); }
.stamp.red { color: var(--seal); }
.stamp.amber { color: var(--amber); }
.stamp.green { color: var(--ok); }
.stamp.gray { color: var(--ink-3); }
.stamp.big {
  font-size: 22px; line-height: 38px; padding: 0 14px; border-width: 3px; letter-spacing: 6px; font-weight: 700;
  transform: rotate(-7deg); box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px currentColor; opacity: .86;
}
.tag { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 3px; background: var(--desk); color: var(--ink-2); white-space: nowrap; line-height: 19px; }
.tag.in { background: var(--ok-wash); color: var(--ok); }
.tag.out { background: var(--amber-wash); color: var(--amber); }
.tag.warn { background: var(--seal-wash); color: var(--seal); }
.tag.blue { background: var(--brand-wash); color: var(--brand-2); }

/* ------------------------------------------------------------ 弹窗、提示 */
.mask { position: fixed; inset: 0; background: rgba(23,32,56,.42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 8px; width: 560px; max-width: 100%; box-shadow: 0 18px 50px rgba(23,32,56,.3); }
.modal.wide { width: 860px; }
.modal.xwide { width: 1080px; }
.modal-head { display: flex; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--rule-2); }
.modal-head h3 { font-size: 15px; font-weight: 600; flex: 1; }
.modal-head button { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 2px 6px; }
.modal-head button:hover { color: var(--ink); }
.modal-body { padding: 16px 18px; max-height: 68vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--rule-2); }
.modal-foot .spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.fld > label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.fld > label .req { color: var(--seal); margin-left: 2px; }
.fld input[type=text], .fld input[type=number], .fld input[type=date], .fld input[type=month], .fld input[type=password], .fld select { width: 100%; height: 32px; }
.fld .help { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.fld.check { display: flex; align-items: center; gap: 6px; padding-top: 20px; }
.fld.check label { margin: 0; font-size: 13px; color: var(--ink); }
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 6px; box-shadow: 0 6px 20px rgba(23,32,56,.25); max-width: 560px; pointer-events: auto; }
.toast.error { background: var(--seal); }
.toast.ok { background: var(--ok); }
.note { background: var(--amber-wash); border: 1px solid #ecd9ae; color: #6d4a0e; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; }
.note.info { background: var(--brand-wash); border-color: #c9d8f5; color: #1e3f8a; }
.note.bad { background: var(--seal-wash); border-color: #efc9c3; color: #8a271c; }
.note.good { background: var(--ok-wash); border-color: #bfe0cd; color: #17603c; }
.note p + p { margin-top: 4px; }
.import-notes { margin: -4px 0 12px; padding: 0 0 0 20px; color: var(--ink-2); line-height: 1.75; max-width: 76em; }
.import-notes li + li { margin-top: 2px; }

/* 可搜索下拉 */
.combo { position: relative; }
.combo input { width: 100%; height: 32px; padding-right: 24px; }
.combo .clear { position: absolute; right: 4px; top: 5px; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.combo-list {
  position: absolute; left: 0; right: 0; top: 34px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(27,38,64,.14); max-height: 240px; overflow-y: auto; z-index: 60;
}
.combo-list div { padding: 5px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-list div:hover, .combo-list div.on { background: var(--brand-wash); }
.combo-list .none { color: var(--ink-3); cursor: default; }
.toolbar .combo { width: 170px; }
.toolbar .combo input { height: 30px; }
.toolbar .combo-list { top: 32px; }

/* ------------------------------------------------------------ 登录：一张面单 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--side); padding: 20px; }
.waybill { width: 380px; max-width: 100%; background: #fff; border-radius: 4px; color: #111; box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden; }
.waybill .wb-top { display: flex; align-items: stretch; border-bottom: 2px solid #111; }
.waybill .wb-top .name { flex: 1; padding: 12px 14px; }
.waybill .wb-top .name b { font-size: 21px; font-weight: 700; letter-spacing: 1px; display: block; }
.waybill .wb-top .name span { font-size: 12px; color: #555; }
.waybill .wb-top .code { background: #111; color: #fff; font-family: var(--font-num); font-size: 26px; font-weight: 700; padding: 0 14px; display: flex; align-items: center; letter-spacing: 1px; }
.waybill .barcode { padding: 12px 14px 4px; border-bottom: 1px dashed #999; }
.waybill .barcode i {
  display: block; height: 46px;
  background: repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 3px, #111 3px 4px, #fff 4px 7px, #111 7px 10px, #fff 10px 11px, #111 11px 12px, #fff 12px 14px, #111 14px 17px, #fff 17px 19px);
}
.waybill .barcode span { display: block; text-align: center; font-family: var(--font-num); letter-spacing: 4px; font-size: 13px; padding: 3px 0 6px; }
.waybill form { padding: 0; margin: 0; }
.waybill .cell { display: flex; border-bottom: 1px solid #111; }
.waybill .cell label { width: 54px; flex: 0 0 54px; background: #111; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; letter-spacing: 2px; }
.waybill .cell input { flex: 1; border: 0; border-radius: 0; padding: 13px 12px; font-size: 15px; min-width: 0; }
.waybill .cell input:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.waybill .go { display: flex; align-items: center; padding: 12px 14px; gap: 10px; }
.waybill .go .msg { flex: 1; font-size: 12px; color: var(--seal); min-height: 18px; }
.waybill .go button { background: #111; color: #fff; border: 0; border-radius: 3px; padding: 9px 26px; font-size: 15px; letter-spacing: 4px; cursor: pointer; }
.waybill .go button:hover { background: var(--brand); }
.waybill .foot { border-top: 1px dashed #999; padding: 8px 14px; font-size: 12px; color: #666; }

/* ------------------------------------------------------------ 工作台 */
.hero-row { display: grid; grid-template-columns: minmax(250px, 1.05fr) 3fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1000px) { .hero-row { grid-template-columns: 1fr; } }
.hero { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; }
.hero .label { color: var(--ink-2); font-size: 13px; }
.hero .value { font-family: var(--font-num); font-size: 48px; line-height: 1.15; font-weight: 600; letter-spacing: -.5px; margin: 2px 0; }
.hero .value small { font-size: 16px; font-weight: 400; color: var(--ink-3); margin-left: 4px; font-family: var(--font); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1250px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { padding: 14px 16px; border-left: 1px solid var(--rule-2); }
.stat:first-child { border-left: 0; }
.stat .label { color: var(--ink-2); font-size: 12px; }
.stat .value { font-family: var(--font-num); font-size: 23px; font-weight: 600; line-height: 1.35; }
.delta { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.delta .up { color: #006300; }
.delta .down { color: var(--seal); }
.kv { display: flex; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule-2); gap: 10px; }
.kv:last-child { border-bottom: 0; }
.kv .k { flex: 1; color: var(--ink-2); min-width: 0; }
.kv .v { font-family: var(--font-num); font-size: 15px; }
.kv.total { border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); font-weight: 600; margin-top: 2px; }
.todo a { display: flex; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule-2); color: var(--ink); gap: 8px; }
.todo a:last-child { border-bottom: 0; }
.todo a:hover { text-decoration: none; color: var(--brand); }
.todo a .n { margin-left: auto; font-family: var(--font-num); font-size: 15px; background: var(--amber-wash); color: var(--amber); border-radius: 10px; padding: 0 9px; }
.steps { counter-reset: st; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.steps > div { border-top: 2px solid var(--ink); padding-top: 10px; }
.steps > div::before { counter-increment: st; content: counter(st); font-family: var(--font-num); font-size: 26px; font-weight: 600; display: block; line-height: 1; margin-bottom: 6px; }
.steps b { display: block; margin-bottom: 2px; }
.steps p { color: var(--ink-2); }

/* ------------------------------------------------------------ 图表 */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-num); font-size: 11px; fill: var(--ink-3); }
.chart .lbl { fill: var(--ink-2); font-family: var(--font); }
.chart .val { fill: var(--ink); font-size: 11.5px; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 5px;
  box-shadow: 0 6px 18px rgba(27,38,64,.14); padding: 6px 10px; font-size: 12px; white-space: nowrap; z-index: 10; display: none;
}
.chart-tip .t { color: var(--ink-3); margin-bottom: 2px; }
.chart-tip .row { display: flex; align-items: center; gap: 6px; }
.chart-tip .row i { width: 12px; height: 2px; display: inline-block; }
.chart-tip .row b { font-family: var(--font-num); font-weight: 600; margin-right: 6px; color: var(--ink); }
.chart-tip .row span { color: var(--ink-2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 1px; }
.legend i.box { height: 10px; width: 10px; border-radius: 2px; }

/* ------------------------------------------------------------ 导入中心 */
.drop {
  border: 2px dashed #b9c7bf; border-radius: 8px; padding: 30px 16px; text-align: center; background: var(--paper); cursor: pointer;
}
.drop.over { border-color: var(--brand); background: var(--brand-wash); }
.drop b { font-size: 15px; display: block; margin-bottom: 4px; }
.drop p { color: var(--ink-2); }
.entry { padding: 12px 14px; border-bottom: 1px solid var(--rule-2); display: flex; gap: 12px; align-items: flex-start; }
.entry:last-child { border-bottom: 0; }
.entry .txt { flex: 1; min-width: 0; }
.entry b { font-size: 13.5px; }
.entry p { color: var(--ink-2); margin-top: 2px; }
.entry .into { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.entry .ops { white-space: nowrap; text-align: right; }
.cand { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 16px; padding: 3px 12px; cursor: pointer; background: var(--paper); margin: 0 6px 6px 0; }
.cand:hover { border-color: var(--brand); }
.cand.on { border-color: var(--brand); background: var(--brand-wash); color: var(--brand-2); font-weight: 600; }
.cand small { color: var(--ink-3); font-weight: 400; font-family: var(--font-num); }
.map-table td { vertical-align: middle; }
.map-table .sample { color: var(--ink-3); font-size: 12px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-table select { width: 100%; max-width: 260px; height: 30px; }
.result-nums { display: flex; gap: 28px; flex-wrap: wrap; margin: 6px 0 12px; }
.result-nums div span { display: block; color: var(--ink-2); font-size: 12px; }
.result-nums div b { font-family: var(--font-num); font-size: 26px; font-weight: 600; }

/* ------------------------------------------------------------ 单据（对账单、结算单） */
.sheet { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 26px 30px 30px; max-width: 980px; position: relative; }
.sheet-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 4px; padding-bottom: 12px; border-bottom: 3px double var(--ink); margin-bottom: 14px; }
.sheet-title small { display: block; font-size: 12px; font-weight: 400; letter-spacing: 1px; color: var(--ink-2); margin-bottom: 2px; }
.sheet .stamp.big { position: absolute; right: 34px; top: 22px; }
.sheet-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 20px; margin-bottom: 14px; }
.sheet-info div span { color: var(--ink-3); margin-right: 6px; }
.sheet h4 { font-size: 13px; margin: 18px 0 6px; font-weight: 600; }
.sheet table.ledger th { position: static; }
.sheet .totals { margin-top: 14px; margin-left: auto; width: 320px; }
.sheet .totals .kv .v { font-size: 16px; }
.sheet .foot-note { margin-top: 18px; color: var(--ink-2); white-space: pre-line; border-top: 1px dashed var(--rule); padding-top: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.actions .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

/* 报价方案编辑 */
.zone { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; background: var(--wash); }
.zone-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.zone-head input[type=text] { height: 30px; width: 180px; }
.zone-head label { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.provs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.provs label { border: 1px solid var(--rule); background: var(--paper); border-radius: 3px; padding: 0 7px; cursor: pointer; font-size: 12px; line-height: 22px; user-select: none; }
.provs label.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.provs label.taken { opacity: .35; }
.provs input { display: none; }
.rules td { padding: 3px 6px 3px 0; }
.rules input, .rules select { height: 28px; width: 96px; }
.rules th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 400; padding: 0 6px 2px 0; }


/* ============================================================ 以下为按功能清单重做界面时新增的部件 */

/* ------------------------------------------------------------ 侧栏：搜索、组内小标题 */
.side-find { padding: 10px 12px 4px; }
.side-find input {
  width: 100%; height: 30px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); background: rgba(255,255,255,.06);
  color: #fff; padding: 4px 9px;
}
.side-find input::placeholder { color: #7c88a6; }
.side-find input:focus { border-color: #6f8fd8; box-shadow: none; background: rgba(255,255,255,.1); }
.nav-sub { padding: 9px 16px 2px 37px; font-size: 11px; color: #6f7c9c; letter-spacing: .5px; }
.side-nav a.miss, .side-nav .nav-group.miss { display: none; }
.side-nav.searching .nav-group.closed .nav-items { display: block; }
.side-nav.searching .nav-sub, .side-nav.searching .nav-section { display: none; }
.menu-btn { display: none; border: 0; background: none; font-size: 18px; cursor: pointer; padding: 4px 6px; color: var(--ink-2); }
.chips { display: inline-flex; gap: 8px; align-items: center; }
.lock-chip:hover { text-decoration: none; filter: brightness(.97); }
.lock-chip.demo { background: var(--brand-wash); color: var(--brand-2); }
.lock-chip.warn { background: var(--seal-wash); color: var(--seal); }
.period-box { display: inline-flex; align-items: center; gap: 8px; }
.period.range { padding: 0 2px; }
.period.range input { border: 0; width: 124px; padding: 4px 4px; }
.period.range i { font-style: normal; color: var(--ink-3); font-size: 12px; padding: 0 2px; }
.period-box.partial .period:not(.range) input { color: var(--ink-3); }
.period-box.away .period { border-color: #d9a520; }
.period-box.idle .period { opacity: .6; }
.period-back { white-space: nowrap; padding: 0 2px; }
.period-label, .user-menu > button { white-space: nowrap; }
@media (max-width: 1400px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar .crumb { display: none; }
  .period input[type=month] { width: 126px; }
  .period.range input { width: 116px; }
}
@media (max-width: 1240px) {
  .period-label { display: none; }
  .topbar { flex-wrap: wrap; height: auto; min-height: 50px; row-gap: 4px; padding-top: 6px; padding-bottom: 6px; }
}
.tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.tabs button { flex: 0 0 auto; }

/* ------------------------------------------------------------ 筛选条 */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 6px; padding: 10px 12px; margin-bottom: 10px;
}
.flt { display: flex; flex-direction: column; gap: 3px; width: 172px; }
.flt.wide { width: auto; }
.flt > span:first-child { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.flt input[type=text], .flt select, .flt .combo input { height: 30px; width: 100%; }
.flt input[type=date], .flt input[type=month] { height: 30px; font-family: var(--font-num); }
.flt .combo-list { top: 32px; min-width: 100%; right: auto; }
.range { display: inline-flex; align-items: center; gap: 6px; }
.range i { font-style: normal; color: var(--ink-3); font-size: 12px; }
.range input[type=date] { width: 132px; }
.range input[type=month] { width: 118px; }
.flt-btns { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.flt-btns .btn { height: 30px; }

/* ------------------------------------------------------------ 表格：冻结列、内部滚动、行内菜单 */
.table-wrap.tall { max-height: calc(100vh - 150px); overflow: auto; }
table.ledger th { z-index: 2; }
table.ledger th.stick, table.ledger td.stick { position: sticky; left: 0; background: var(--paper); z-index: 1; }
table.ledger th.stick { z-index: 3; }
table.ledger tbody tr:hover td.stick { background: var(--wash); }
table.ledger tr.sep td.stick { background: var(--desk); }
table.ledger td.stick::after, table.ledger th.stick::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; border-right: 1px solid var(--rule-2); }
table.ledger td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.ledger.two-head th.grp, .two-head table.ledger th.grp { text-align: center; border-bottom: 1px solid var(--rule); color: var(--ink); }
.two-head table.ledger thead tr:first-child th { border-bottom-width: 1px; }
.two-head table.ledger thead tr:first-child th[rowspan] { border-bottom: 2px solid var(--ink); }
.two-head table.ledger thead tr:last-child th { top: 33px; }
.table-wrap.flat, .flat-wrap > .table-wrap { border: 0; border-radius: 0; }
.more { position: relative; display: inline-block; }
.menu-pop.float { position: fixed; right: auto; top: 0; left: 0; min-width: 150px; z-index: 90; }
.menu-pop button.danger { color: var(--seal); }
.file-count { display: inline-flex; max-width: 180px; overflow: hidden; }

/* ------------------------------------------------------------ 表单里的部件：多选、附件、菜单勾选、明细行 */
.fld.full { grid-column: 1 / -1; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--desk); border: 1px solid var(--rule); border-radius: 3px;
  padding: 0 6px; font-size: 12px; line-height: 20px; margin: 1px 4px 1px 0; white-space: nowrap; max-width: 100%;
}
.chip button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0 1px; font-size: 13px; line-height: 1; }
.chip button:hover { color: var(--seal); }
.chip.file, .chip.file a { color: var(--brand); }
a.chip.file:hover { text-decoration: none; border-color: var(--brand); }
.multi {
  min-height: 32px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 3px 6px; display: flex; flex-wrap: wrap;
  align-items: center; cursor: pointer; background: var(--paper);
}
.multi:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.combo-list .grp { color: var(--ink-3); cursor: default; font-size: 12px; background: var(--wash); }
.combo-list .grp:hover { background: var(--wash); }
.combo-list input[type=checkbox] { pointer-events: none; }
.files { border: 1px dashed #b9c7bf; border-radius: var(--radius); padding: 4px 6px; min-height: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.files.over, .files:focus { outline: none; border-color: var(--brand); background: var(--brand-wash); }
.menu-tree { max-height: 340px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 12px; }
.mt-group { padding: 5px 0; border-bottom: 1px solid var(--rule-2); }
.mt-group:last-child { border-bottom: 0; }
.mt-head { font-weight: 600; }
.mt-items { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 4px 0 0 21px; color: var(--ink-2); }
.lines .table-wrap { overflow: visible; }
table.lines-table th { position: static; }
table.lines-table td { padding: 3px 4px; vertical-align: middle; }
table.lines-table input[type=text], table.lines-table select { width: 100%; height: 28px; min-width: 72px; }
table.lines-table .combo { min-width: 150px; }
table.lines-table .combo input { height: 28px; }
table.lines-table .combo-list { top: 30px; }
table.lines-table tbody tr:hover td { background: none; }
input.num { text-align: right; font-family: var(--font-num); }
.view-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
.view-item { padding: 7px 0; border-bottom: 1px solid var(--rule-2); min-width: 0; }
.view-item.full { grid-column: 1 / -1; }
.view-item > span { display: block; font-size: 12px; color: var(--ink-3); }
.view-item > b { font-weight: 400; word-break: break-all; }
.col-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; }
.steps3 { counter-reset: st; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.steps3 > div { border-top: 2px solid var(--ink); padding-top: 10px; }
.steps3 > div::before { counter-increment: st; content: counter(st); font-family: var(--font-num); font-size: 26px; font-weight: 600; display: block; line-height: 1; margin-bottom: 6px; }
.steps3 b { display: block; margin-bottom: 2px; }
.steps3 p { color: var(--ink-2); margin-bottom: 8px; }

/* ------------------------------------------------------------ 报表内容块 */
.rep-sec { margin-bottom: 14px; }
.rep-title { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.rep-main-title { font-size: 17px; font-weight: 600; text-align: center; letter-spacing: 2px; margin: 4px 0 12px; }
.rep-text p { margin-bottom: 6px; max-width: 82em; color: var(--ink-2); }
.loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); overflow: hidden; }
.tiles .stat { border: 0; box-shadow: 1px 0 0 var(--rule-2), 0 1px 0 var(--rule-2); display: block; color: var(--ink); min-width: 0; }
.tiles a.stat:hover { background: var(--wash); text-decoration: none; }
.tiles .stat .value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles .delta { white-space: normal; }
.checks .check-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
.checks .check-row:last-child { border-bottom: 0; }
.checks .check-row > span:nth-child(2) { flex: 1; }
.checks .check-row a { white-space: nowrap; }
.ck { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.ck.ok { background: var(--ok-wash); color: var(--ok); }
.ck.bad { background: var(--seal); color: #fff; }
.ck.na { background: var(--desk); color: var(--ink-3); }
.formulas > div { padding: 6px 0; border-bottom: 1px dashed var(--rule); line-height: 1.7; }
.formulas > div:last-child { border-bottom: 0; }
.formulas span { color: var(--ink-2); }
.share { padding: 2px 0; }
.share-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.share-head b { font-size: 30px; font-weight: 600; line-height: 1.1; }
.share-head span { color: var(--ink-2); font-size: 12px; }
.share-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--track); }
.share-bar i { display: block; height: 100%; min-width: 2px; }
.share-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.share-legend .box { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.share-legend b { color: var(--ink); font-weight: 600; }
.share-legend em { font-style: normal; color: var(--ink-3); font-family: var(--font-num); }
.legend { flex-wrap: wrap; margin-bottom: 6px; }

/* ------------------------------------------------------------ 首页 */
.home-top { display: grid; grid-template-columns: minmax(300px, 1.1fr) 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1280px) { .home-top { grid-template-columns: 1fr 1fr; } .home-top .hero { grid-column: 1 / -1; } }
@media (max-width: 820px) { .home-top { grid-template-columns: 1fr; } }
.hero { justify-content: flex-start; }
.hero-head { display: flex; align-items: center; gap: 10px; }
.hero-head .spacer, .hero-foot .spacer { flex: 1; }
.hero-head input, .home-card .panel-head input { height: 26px; padding: 2px 6px; font-family: var(--font-num); font-size: 12px; }
.hero .value { white-space: nowrap; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; border-top: 1px dashed var(--rule); margin-top: 12px; padding-top: 9px; font-size: 12px; color: var(--ink-2); }
.hero-foot b { font-size: 14px; font-weight: 600; color: var(--ink); }
.hero-foot b.neg { color: var(--seal); }
.home-card .panel-head { flex-wrap: wrap; row-gap: 6px; }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fig { padding: 12px 14px; border-left: 1px solid var(--rule-2); min-width: 0; color: var(--ink); }
.fig:first-child { border-left: 0; }
.fig .label { color: var(--ink-2); font-size: 12px; }
.fig .value { font-family: var(--font-num); font-size: 21px; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig .delta { white-space: normal; line-height: 1.4; }
.home-share { padding: 2px 14px 14px; }
.home-share .share-head b { font-size: 24px; }
.todo a .go { margin-left: auto; color: var(--brand); font-size: 12px; white-space: nowrap; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.quick a { padding: 7px 0; border-bottom: 1px solid var(--rule-2); color: var(--ink); }
.quick a:hover { color: var(--brand); text-decoration: none; }
.welcome .panel-body { padding: 26px 28px; }
.welcome h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.lead { color: var(--ink-2); max-width: 64em; margin-bottom: 12px; }
.delta .up { color: var(--ok); }

/* ------------------------------------------------------------ 窄面板、行内表单 */
.panel.narrow, .grid.narrow { max-width: 860px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form input { height: 32px; }
.inline-form input[type=text] { flex: 1; min-width: 220px; }
.help-text { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.sample-list { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-group { padding: 6px 14px; background: var(--desk); font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); }
.cand-groups > div { margin-bottom: 2px; }
.cand-group { display: inline-block; width: 88px; color: var(--ink-3); font-size: 12px; }

/* ------------------------------------------------------------ 凭证纸 */
.vsheet { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--ink); border-radius: 0 0 6px 6px; padding: 16px 20px 14px; }
.vs-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: 6px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 3px double var(--ink); }
.vs-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--ink-2); }
.vs-meta .spacer { flex: 1; }
.vs-meta b { color: var(--ink); font-size: 15px; }
.vs-meta input[type=date] { height: 30px; font-family: var(--font-num); margin-left: 4px; }
table.vs-table { table-layout: fixed; }
table.vs-table th { position: static; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); }
table.vs-table td { border: 1px solid var(--rule); vertical-align: middle; }
table.vs-table tbody tr:hover td { background: none; }
table.vs-table tfoot td { border-top: 1px solid var(--ink); }
.vsheet.vs-entry table.vs-table td { padding: 0; }
.vsheet.vs-entry table.vs-table tfoot td { padding: 7px 10px; }
.vsheet.vs-entry table.vs-table tbody input[type=text], .vsheet.vs-entry table.vs-table tbody select {
  width: 100%; height: 34px; border: 0; border-radius: 0; background: transparent; padding: 4px 8px;
}
.vsheet.vs-entry table.vs-table tbody input:focus, .vsheet.vs-entry table.vs-table tbody select:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.vsheet.vs-entry .combo .clear { top: 6px; }
.vsheet.vs-entry .combo-list { top: 35px; min-width: 260px; }
.vsheet.vs-entry td .muted { padding: 0 8px; }
.vs-state { margin-left: 14px; font-size: 12px; padding: 1px 8px; border-radius: 3px; font-weight: 400; }
.vs-state.ok { background: var(--ok-wash); color: var(--ok); }
.vs-state.bad { background: var(--amber-wash); color: var(--amber); }
.vs-foot { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 10px; color: var(--ink-2); font-size: 12px; }

/* ------------------------------------------------------------ 新手指引 */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.guide-nav { border-right: 1px solid var(--rule-2); padding: 8px 0; }
.guide-nav button { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 16px; cursor: pointer; color: var(--ink-2); position: relative; }
.guide-nav button .num { font-size: 15px; color: var(--ink-3); width: 12px; }
.guide-nav button:hover { color: var(--ink); background: var(--wash); }
.guide-nav button.on { color: var(--ink); font-weight: 600; background: var(--wash); }
.guide-nav button.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--seal); }
.guide-body { padding: 20px 26px 26px; min-width: 0; }
.guide-body h2 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.guide-steps { counter-reset: gs; list-style: none; margin: 16px 0 0; padding: 0; max-width: 70em; }
.guide-steps li { counter-increment: gs; position: relative; padding: 0 0 18px 46px; }
.guide-steps li::before { content: counter(gs); position: absolute; left: 0; top: -3px; font-family: var(--font-num); font-size: 24px; font-weight: 600; width: 30px; text-align: right; color: var(--ink); }
.guide-steps li::after { content: ""; position: absolute; left: 37px; top: 4px; bottom: 6px; border-left: 1px solid var(--rule); }
.guide-steps b { display: block; font-size: 14px; margin-bottom: 2px; }
.guide-steps p { color: var(--ink-2); }
.guide-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
@media (max-width: 820px) { .guide { grid-template-columns: 1fr; } .guide-nav { border-right: 0; border-bottom: 1px solid var(--rule-2); } }

/* ------------------------------------------------------------ 小屏幕 */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .18s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .side { transform: none; }
  .menu-btn { display: inline-block; }
  .topbar { padding: 6px 12px; gap: 6px 8px; height: auto; min-height: 50px; flex-wrap: wrap; }
  .chips { flex-wrap: wrap; }
  .period input { width: 120px; }
  .period.range input { width: 116px; }
  table.ledger th.ops, table.ledger td.ops { position: static; box-shadow: none; }
  .topbar .crumb, .period-label { display: none; }
  .content { padding: 12px 12px 32px; }
  .form-grid, .view-grid, .col-pick, .steps3, .figs, .quick { grid-template-columns: 1fr; }
  .fig { border-left: 0; border-top: 1px solid var(--rule-2); }
  .fig:first-child { border-top: 0; }
  .flt { width: calc(50% - 6px); }
  .flt.wide { width: 100%; }
  .flt-btns { margin-left: 0; }
  .mask { padding: 2vh 8px 8px; }
}

@media print {
  body { background: #fff; }
  .side, .topbar, .actions, .tabs, .toasts, .no-print, .filters, .toolbar, .pager, .batch-bar, .page-hint { display: none !important; }
  .content { padding: 0; }
  .sheet { border: 0; max-width: none; padding: 0; }
  .table-wrap, .table-wrap.tall { max-height: none; overflow: visible; border: 0; }
  table.ledger th.stick, table.ledger td.stick { position: static; }
  .panel { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.side-foot span { display: block; color: #5f6b8a; margin-top: 1px; }

/* 首页三张卡片里的小部件 */
.card-links { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 10px; }
.card-links .btn.link { padding-left: 0; }
.hero { display: flex; flex-direction: column; }
.hero-foot { display: block; margin-top: auto; padding-top: 6px; }
.hero-foot .kv .v, .home-card .kv .v { font-size: 16px; }
.kv.warn .v { color: var(--seal); }
.kv-gap { height: 6px; }
.home-card .panel-body { padding-top: 8px; }
.home-card .help-text { margin-top: 6px; }

/* 操作列贴在表格右边，横向滚动时一直看得到 */
table.ledger th.ops, table.ledger td.ops { position: sticky; right: 0; background: var(--paper); box-shadow: -1px 0 0 var(--rule-2); }
table.ledger th.ops { z-index: 3; text-align: right; }
table.ledger tbody tr:hover td.ops { background: var(--wash); }

/* ------------------------------------------------------------ 客户门户（单独的页面） */
.portal-wrap { max-width: 920px; margin: 0 auto; padding: 18px 16px 40px; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.portal-head b { display: block; font-size: 17px; font-weight: 600; }
.portal-head span { color: var(--ink-3); font-size: 12px; }
.portal-sum { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin-bottom: 16px; }
.portal-sum .hero { border-right: 1px solid var(--rule-2); }
.portal-sum .hero .value.zero { color: var(--ink-3); }
.portal-kv { padding: 12px 18px; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 640px) {
  .portal-sum { grid-template-columns: 1fr; }
  .portal-sum .hero { border-right: 0; border-bottom: 1px solid var(--rule-2); }
  .portal-sum .hero .value { font-size: 38px; }
  .modal-body .grid.c2 { grid-template-columns: 1fr; }
}
.long-msg p { line-height: 1.75; }
.long-msg p + p { margin-top: 6px; }
.grid.lone { max-width: 760px; }

/* ---- 工资计算、考核登记 */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--rule); background: var(--paper); border-radius: 4px; padding: 5px 12px; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: baseline; font: inherit; }
.seg button:hover { border-color: #b9c7bf; color: var(--ink); }
.seg button b { font-family: var(--font-num); font-weight: 600; color: var(--ink); }
.seg button small { color: var(--ink-3); }
.seg button.on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.seg button:focus-visible, .grid-input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
table.ledger td.cell-edit { cursor: pointer; }
table.ledger td.cell-edit:hover { background: var(--brand-wash); }
table.ledger td.manual { box-shadow: inset 3px 0 0 #d9a520; }
table.ledger td.info { color: var(--ink-2); }
table.ledger td.strong { font-weight: 600; }
table.ledger.pay-sheet td, table.ledger.kpi-grid td { white-space: nowrap; }
table.ledger.kpi-grid th { white-space: normal; min-width: 96px; }
.grid-input { width: 84px; height: 26px; text-align: right; font-family: var(--font-num); padding: 0 6px; }
.grid-input.dirty { border-color: #d9a520; background: var(--amber-wash); }
.grid-input::placeholder { color: var(--ink-3); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 18px; }
.rule-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-2); }
.rule-grid label input { height: 30px; font-size: 13px; }
.rule-grid label small { color: var(--ink-3); line-height: 1.5; }
.progress { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .4s; }
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }

/* ---------------------------------------------------------------- 考勤格子：一天一格，出勤是常态所以淡，异常才显眼 */
table.ledger.att-grid th.day, table.ledger.att-grid td.day { padding: 0; width: 26px; min-width: 26px; max-width: 26px; text-align: center; }
table.ledger.att-grid th.day { font-family: var(--font-num); line-height: 1.15; padding: 3px 0; }
table.ledger.att-grid th small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); }
table.ledger.att-grid th small.wk { color: var(--seal); }
table.ledger.att-grid th small.feeds { color: var(--ok); }
table.ledger.att-grid td.day { height: 30px; line-height: 29px; vertical-align: middle; cursor: pointer; position: relative; user-select: none; font-size: 13px; border-left: 1px solid var(--rule-2); }
table.ledger.att-grid td { vertical-align: middle; }
table.ledger.att-grid th.r small { text-align: right; }
table.ledger.att-grid td.day:hover { outline: 2px solid var(--brand); outline-offset: -2px; }
table.ledger.att-grid.flat td.day { cursor: default; }
table.ledger.att-grid.flat td.day:hover { outline: 0; }
.day.ok { color: #9aa6b8; }
.day.ok.alt { color: var(--ink-2); }
.day.rest { color: var(--ink-3); background: var(--desk); }
.day.warn { color: var(--amber); background: var(--amber-wash); font-weight: 600; }
.day.bad { color: var(--seal); background: var(--seal-wash); font-weight: 600; }
.day.info { color: var(--brand-2); background: var(--brand-wash); }
.day.cover { color: #0f6e63; background: #e3f4f1; font-weight: 600; }
.day.other { color: var(--ink-2); }
td.day.wk:not(.warn):not(.bad):not(.cover):not(.info):not(.rest) { background: #fafbfa; }
td.day.edited::after, i.day.edited::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #d9a520 transparent transparent; }
td.day.pending { box-shadow: inset 0 0 0 2px #d9a520; }
.att-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.att-brush { border: 1px solid var(--rule); background: var(--paper); border-radius: 4px; padding: 3px 9px 3px 4px; cursor: pointer; font: inherit; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; min-height: 30px; }
.att-brush:hover { border-color: #b9c7bf; color: var(--ink); }
.att-brush.on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.att-brush:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.att-brush i.day, .att-legend i.day { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 3px; font-style: normal; font-size: 13px; position: relative; border: 1px solid var(--rule-2); }
.att-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); }
.att-legend span { display: inline-flex; gap: 6px; align-items: center; }
.grid-input.att-sum { width: 52px; }

/* ---------------------------------------------------------------- 客户档案 */
.prof-head { display: flex; gap: 16px; align-items: flex-start; }
.prof-head > div:first-child { flex: 1; min-width: 0; }
.prof-name { font-size: 20px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prof-reason { margin-top: 8px; padding: 6px 10px; background: var(--wash); border-left: 3px solid var(--rule); border-radius: 2px; max-width: 70em; }
.prof-reason.bad { background: var(--seal-wash); border-left-color: var(--seal); color: #8a271c; }
.prof-reason .muted { margin-left: 8px; }
.prof-actions { display: flex; gap: 8px; }
.prof-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.prof-tags .chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; padding: 0 2px; color: var(--ink-3); font-size: 14px; line-height: 1; }
.prof-tags .chip button:hover { color: var(--seal); }
.prof-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 14px; }
.prof-grid .panel + .panel { margin-top: 14px; }
@media (max-width: 1180px) { .prof-grid { grid-template-columns: minmax(0, 1fr); } }
.quote-table th, .quote-table td { padding: 3px 4px; }
.quote-table input { width: 100%; height: 28px; border: 1px solid transparent; background: transparent; padding: 0 6px; font: inherit; color: inherit; border-radius: 3px; }
.quote-table input:hover:not(:disabled), .quote-table input:focus { border-color: var(--rule); background: var(--paper); outline: none; }
.quote-table input:focus { border-color: var(--brand); }
.quote-table th input { font-weight: 600; }
.quote-table .q-zone { min-width: 110px; }
.quote-table .q-price { min-width: 64px; text-align: right; font-family: var(--font-num); }
.quote-table .q-note { min-width: 120px; }
.q-memo { width: 100%; margin-top: 8px; }
td.note-content { min-width: 180px; white-space: normal; word-break: break-word; }

/* ------------------------------------------------------------ 报销申请与审批 */
/* 路条：一张报销单要过的几道——提交、每一步审批、抄送、打款。办完的盖红戳，正在等的是琥珀色，没到的是虚线 */
.rb-flow { padding: 10px 14px 12px; margin-bottom: 12px; }
.rb-flow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.rb-flow-head .spacer { flex: 1; }
.rb-route { display: flex; flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
.rb-node { display: flex; gap: 7px; align-items: flex-start; min-width: 0; max-width: 230px; padding: 3px 0; }
.rb-node b { display: block; font-weight: 600; white-space: nowrap; }
.rb-node b i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--brand); border: 1px solid #c9d8f5; border-radius: 3px; padding: 0 4px; margin-left: 6px; }
.rb-node small { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.45; overflow-wrap: anywhere; }
.rb-node small.rb-note { color: var(--ink-2); }
.rb-node.cc b { font-weight: 400; color: var(--ink-2); }
.rb-dot { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px dashed #b9c4be; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; color: var(--ink-3); }
.rb-node.done .rb-dot { border: 1.5px solid var(--seal); color: var(--seal); font-weight: 700; }
.rb-node.now .rb-dot { border: 1.5px solid #d9a520; background: var(--amber-wash); box-shadow: 0 0 0 3px rgba(217,165,32,.18); }
.rb-node.now b { color: var(--amber); }
.rb-node.no .rb-dot { border: 1.5px solid var(--ink-3); background: var(--desk); color: var(--ink-2); }
.rb-node.todo b, .rb-node.skip b { color: var(--ink-3); font-weight: 400; }
.rb-arrow { flex: 0 0 30px; height: 24px; position: relative; }
.rb-arrow::before { content: ""; position: absolute; left: 6px; right: 9px; top: 12px; border-top: 1px solid #b9c4be; }
.rb-arrow::after { content: ""; position: absolute; right: 8px; top: 9px; width: 6px; height: 6px; border-top: 1px solid #98a59e; border-right: 1px solid #98a59e; transform: rotate(45deg); }
.rb-count { display: inline-block; margin-left: 6px; min-width: 18px; height: 16px; line-height: 16px; padding: 0 5px; border-radius: 8px; background: var(--seal); color: #fff; font-size: 11px; font-weight: 400; text-align: center; vertical-align: 1px; }
.rb-clip { display: inline-block; max-width: 30em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rb-tag { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--ink-3); border: 1px solid var(--rule); border-radius: 3px; padding: 0 5px; }
.rb-tag.warn { color: var(--amber); border-color: #ecd9ae; background: var(--amber-wash); }
.rb-warn { color: var(--amber); }
table.ledger tr.rb-void td { color: var(--ink-3); }
/* 我要报销：左边凭证，右边报销单 */
.rb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.rb-drop { border: 1.5px dashed #b0bfb7; border-radius: 6px; padding: 22px 16px; text-align: center; cursor: pointer; background: var(--wash); }
.rb-drop:hover, .rb-drop.over, .rb-drop:focus-visible { border-color: var(--brand); background: var(--brand-wash); outline: none; }
.rb-drop b { display: block; font-size: 15px; font-weight: 600; color: var(--brand-2); }
.rb-drop span { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.rb-recs { margin-top: 10px; }
.rb-rec { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--rule-2); }
.rb-rec:last-child { border-bottom: 0; }
.rb-thumb { flex: 0 0 56px; width: 56px; height: 56px; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--desk); display: flex; align-items: center; justify-content: center; }
.rb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-thumb.pdf { font-family: var(--font-num); font-size: 12px; color: var(--ink-3); }
.rb-rec-main { flex: 1; min-width: 0; line-height: 1.6; }
.rb-rec-name { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-rec-main .chip { margin-left: 6px; }
.rb-x { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 2px 6px; }
.rb-x:hover { color: var(--seal); }
.rb-submit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.rb-submit .btn.primary { padding: 7px 22px; font-size: 14px; }
.rb-submit .muted { flex: 1; min-width: 14em; font-size: 12px; }
.fld .help.rb-warn { color: var(--amber); }
/* 详情弹窗 */
.rb-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.rb-top > div:first-child { flex: 1; min-width: 0; }
.rb-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; font-weight: 600; }
.rb-who .muted { font-size: 13px; font-weight: 400; }
.rb-amount { font-size: 26px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.rb-detail > .rb-route { padding: 10px 12px; background: var(--wash); border: 1px solid var(--rule-2); border-radius: 6px; }
.rb-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; align-items: start; }
.rb-kv { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
.rb-kv > span { flex: 0 0 5em; color: var(--ink-3); font-size: 12px; padding-top: 1px; }
.rb-kv > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rb-edit { padding: 10px 12px 12px; margin-bottom: 4px; border: 1px solid #c9d8f5; border-radius: 6px; background: #f7f9fe; }
.rb-edit > .muted { font-size: 12px; margin-bottom: 8px; }
.rb-logs > div { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; padding: 2px 0; }
.rb-logs b { font-weight: 600; }
.rb-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rb-imgs a:not(.chip) { display: block; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--desk); aspect-ratio: 3 / 4; }
.rb-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-imgs a:not(.chip):only-child { aspect-ratio: auto; max-height: 460px; }
.rb-imgs a:not(.chip):only-child img { object-fit: contain; max-height: 460px; }
@media (max-width: 640px) {
  /* 手机上：这个页面不按时间筛的时候，顶栏的“查看时间”收起来；用得着的页面让它折行，别把页面撑宽 */
  .period-box.idle { display: none; }
  .period-box { flex-wrap: wrap; row-gap: 4px; max-width: 100%; }
  .modal-foot { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .rb-grid, .rb-cols { grid-template-columns: minmax(0, 1fr); }
  .rb-arrow { flex-basis: 20px; }
  .rb-amount { font-size: 22px; }
  .rb-drop { padding: 26px 12px; }
  .rb-submit .btn.primary { width: 100%; padding: 10px; }
}

/* ------------------------------------------------------------ 总部原始数据：自动识别上传 */
.auto-outlet { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.auto-list { margin-top: 12px; }
.auto-card { padding: 12px 14px; margin-bottom: 10px; }
.auto-card p { margin-top: 5px; }
.auto-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auto-top b { font-size: 14px; overflow-wrap: anywhere; }
.auto-opts { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.auto-opts label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; }
.auto-opts select { max-width: 100%; }
.auto-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.auto-pick .combo { width: 320px; max-width: 100%; }
.auto-btns { display: flex; gap: 8px; margin-top: 10px; }
.auto-all { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
