:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface-subtle: #f1f1ef;
  --panel: #ffffff;
  --line: #dededb;
  --line-strong: #c8c8c4;
  --border: var(--line);
  --text: #202123;
  --muted: #6b6b68;
  --accent: #1f7a55;
  --accent-dark: #176344;
  --accent-soft: #e8f3ed;
  --warning: #b86215;
  --amber: var(--warning);
  --navy: var(--text);
  --navy-soft: #373937;
  --danger: #b42318;
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --control-height: 36px;
  --control-height-sm: 32px;
  --control-height-mobile: 44px;
  --control-height-xs: 28px;
  --badge-height: 24px;
  --badge-height-lg: 28px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.35; }
a { color: var(--accent); text-decoration: none; }
.app-main, .guest-main { width: min(1480px, calc(100% - 32px)); margin: 12px auto 24px; min-width: 0; }
.topbar { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; position: sticky; top: 0; z-index: 30; }
.brand { font-weight: 800; font-size: 17px; letter-spacing: 0; color: var(--navy); white-space: nowrap; }
.user { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--muted); }
.user a { white-space: nowrap; }
.ledger-switcher, .ledger-current { margin-left: auto; }
.ledger-switcher + .user, .ledger-current + .user, .ledger-attention + .user { margin-left: 0; }
.ledger-switcher { display: flex; align-items: center; gap: 7px; }
.ledger-switcher label { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.ledger-switcher select { width: min(220px, 24vw); min-height: 34px; padding: 5px 30px 5px 9px; color: var(--navy); background: #fff; font-size: 13px; font-weight: 700; }
.ledger-current { display: grid; line-height: 1.15; }
.ledger-current small { font-size: 10px; }
.ledger-current strong { max-width: 220px; overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user span { display: grid; color: var(--navy); font-weight: 700; line-height: 1.2; }
.user-role { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.ledger-attention { flex: 0 0 auto; color: var(--text); }
.topbar .ledger-attention__toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ledger-attention__toggle strong { display: inline-block; width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.ledger-attention__panel { position: absolute; top: calc(100% + 4px); right: 8px; width: min(640px, calc(100vw - 16px)); max-height: calc(100dvh - var(--app-header-height, 160px) - 12px); overflow: auto; overscroll-behavior: contain; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 5px 16px #20382d26; }
.ledger-attention__heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ledger-attention__status { margin: 6px 0; color: var(--muted); }
.ledger-attention__rows { min-width: 0; display: grid; }
.ledger-attention__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.ledger-attention__ledger { overflow-wrap: anywhere; font-weight: 700; }
.ledger-attention__ledger small { margin-left: 5px; color: var(--accent-dark); font-size: var(--ui-font-small, 12px); }
.ledger-attention__count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-attention__count strong { color: var(--accent-dark); }
.ledger-attention__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; grid-column: 1 / -1; }
.ledger-attention__actions form { margin: 0; }
.ledger-attention__actions button { white-space: nowrap; }
.ledger-attention :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media screen {
  .topbar ~ .app-shell { min-height: calc(100dvh - var(--app-header-height, 48px)); }
  .topbar ~ .app-shell :is(.sidebar, .nav-scrim) { top: var(--app-header-height, 48px); height: calc(100dvh - var(--app-header-height, 48px)); }
}
@media screen and (max-width: 1100px) {
  .topbar:has(.ledger-attention) { flex-wrap: wrap; padding-block: 5px; }
}
@media screen and (max-width: 820px) {
  .topbar:has(.ledger-attention) { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .topbar:has(.ledger-attention) .nav-open { grid-area: 1 / 1; }
  .topbar:has(.ledger-attention) .brand { grid-area: 1 / 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar:has(.ledger-attention) .ledger-attention { grid-area: 1 / 3; }
  .topbar:has(.ledger-attention) .ledger-switcher { grid-area: 2 / 1 / 3 / 3; min-width: 0; margin: 0; }
  .topbar:has(.ledger-attention) .user { grid-area: 2 / 3; justify-content: flex-end; }
  .ledger-attention__row { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger-attention__ledger { grid-column: 1 / -1; }
}
@media print { .ledger-attention { display: none; } }
.app-shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: calc(100vh - 48px); }
.sidebar { position: sticky; top: 48px; align-self: start; height: calc(100vh - 48px); overflow-y: auto; padding: 8px 7px; background: var(--surface-subtle); border-right: 1px solid var(--line); }
.sidebar-nav { display: grid; gap: 3px; }
.nav-group { border-radius: var(--radius); }
.nav-group.active { background: transparent; }
.nav-group-toggle { width: 100%; min-height: 32px; display: flex; justify-content: space-between; padding: 6px 8px; color: var(--muted); background: transparent; border: 0; font-size: 12px; font-weight: 800; text-align: left; }
.nav-group-toggle:hover { color: var(--text); background: #fff; }
.nav-group-toggle i { width: 8px; height: 8px; margin: 5px 3px 0 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .16s ease; }
.nav-group-badge { display: none; }
.nav-group.collapsed .nav-group-badge { display: inline-flex; }
.nav-group.collapsed .nav-group-toggle i { transform: rotate(-45deg); }
.nav-group.collapsed .nav-children { display: none; }
.nav-children { display: grid; gap: 1px; padding: 0 0 5px; }
.nav-link { min-height: 30px; padding: 5px 9px 5px 22px; color: var(--text); border-radius: 4px; }
.nav-link:hover { color: var(--accent-dark); background: #fff; }
.nav-link.active { color: var(--accent-dark); background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
.nav-open { display: none; width: 40px; min-height: 40px; padding: 8px; gap: 4px; flex-direction: column; background: #fff; border-color: var(--line); }
.nav-open span { display: block; width: 19px; height: 2px; background: var(--navy); }
.nav-scrim { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 3px 0 0; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.toolbar-form { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(150px, 1fr) auto; gap: 8px; align-items: end; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-grid .full-span { grid-column: 1 / -1; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.detail-grid div { min-width: 0; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.inline-form { display: flex; align-items: center; gap: 6px; min-width: 220px; }
.inline-form input { min-width: 110px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (max-width: 900px) {
  .toolbar-form, .form-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .toolbar-form, .form-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full-span { grid-column: auto; }
  .inline-form { min-width: 180px; }
}
.dashboard-ledger-scope { margin: -6px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.company-ledger-switcher { display: grid; gap: 5px; min-width: min(100%, 260px); }
.company-ledger-switcher label { color: var(--muted); font-size: 12px; font-weight: 700; }
.company-ledger-switcher select { width: 100%; min-height: 38px; }
h1, h2 { margin: 0 0 8px; }
h1 { font-size: 21px; letter-spacing: 0; color: var(--navy); }
h2 { font-size: 16px; }
.panel, .login-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; box-shadow: none; }
.login-panel { max-width: 420px; margin: 80px auto; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.receipt-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; border-top: 2px solid var(--line-strong); }
.stat strong { display: block; font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 22px; color: var(--navy); }
.stat span, small, .hint, .empty { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: middle; }
th { background: var(--surface-subtle); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
tbody tr:hover td { background: var(--accent-soft); }
.table-wrap { width: 100%; overflow-x: auto; }
.frozen-data-table > tbody > tr > th:first-child { width: 132px; }
.frozen-data-table.nested { min-width: 360px; border: 1px solid var(--line); }
.frozen-data-table.nested th, .frozen-data-table.nested td { padding: 7px 8px; }
.frozen-data-table.nested tr:last-child > th, .frozen-data-table.nested tr:last-child > td { border-bottom: 0; }
.frozen-data-list { margin: 0; padding-left: 18px; }
.frozen-data-table .muted { color: var(--muted); }
.form { display: grid; gap: 12px; }
.form.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.full { grid-column: 1 / -1; }
input, select, textarea, button, .button { min-height: var(--control-height); border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 10px; font: inherit; }
textarea { min-height: 92px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; font-weight: 600; }
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.secondary, .button.secondary, .secondary-action { background: var(--panel); color: var(--text); border-color: var(--line-strong); }
button.secondary:hover, .button.secondary:hover, .secondary-action:hover { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); }
.button.ghost { background: transparent; color: var(--text); border-color: transparent; }
.button.ghost:hover { background: var(--surface-subtle); color: var(--accent-dark); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger:hover { background: #8f1c14; border-color: #8f1c14; }
.button.link { background: transparent; border-color: transparent; color: var(--accent); min-height: auto; padding: 0; }
.button.link:hover { background: transparent; color: var(--accent-dark); }

/* 弹窗宽度阶梯与页脚按钮顺序（第 4 批统一采用；未加类的弹窗保持自身宽度） */
dialog { max-width: calc(100% - 32px); }
dialog.dialog-sm { width: min(480px, calc(100% - 32px)); }
dialog.dialog-md { width: min(720px, calc(100% - 32px)); }
dialog.dialog-lg { width: min(960px, calc(100% - 32px)); }
dialog .actions { justify-content: flex-end; }

/* 全站页签统一：方框按钮，选中点亮绿色，未选中灰色 */
/* 全站明细表统一：表内可编辑控件同高、数字右对齐、单元格垂直居中 */
:is(.app-main, dialog) .table-scroll table td,
:is(.app-main, dialog) .table-scroll table th { vertical-align: middle; }
:is(.app-main, dialog) .table-scroll table input:not([type="checkbox"]):not([type="radio"]),
:is(.app-main, dialog) .table-scroll table select,
:is(.app-main, dialog) .table-scroll table textarea { min-height: var(--control-height-sm); }
:is(.app-main, dialog) .table-scroll table input[type="number"] { text-align: right; }

/* 表格内操作按钮统一单行、不收缩，避免图标+文字被挤成两行 */
:is(.app-main, dialog) table td button,
:is(.app-main, dialog) table td > .button {
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
}

/* 同一单元格内的多个表单/按钮并排一行（如履约节点处理列） */
.node-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.node-actions form { margin: 0; }
.node-actions .inline { flex-wrap: nowrap; }
.node-actions input[name="实际金额"] { width: 110px; }
.node-actions input[name="处理备注"] { width: 150px; }

/* 上线页：授权岗位勾选（勾选框与岗位名同一行，三列排布） */
.rollout-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
}
.rollout-role-grid label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
}
.rollout-role-grid label input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}
.rollout-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 820px) { .rollout-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rollout-role-grid { grid-template-columns: 1fr; } }
:is(.app-main, dialog) :is(nav, div, ul)[class*="-tabs"]:not(.production-source-tabs):not(.aftersales-tabs) > a:not(.button),
:is(.app-main, dialog) .tabs > a:not(.button),
:is(.app-main, dialog) .bom-status-filters > a:not(.button),
:is(.app-main, dialog) .bom-type-filters > a:not(.button) {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--control-height-sm);
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
:is(.app-main, dialog) :is(nav, div, ul)[class*="-tabs"]:not(.production-source-tabs):not(.aftersales-tabs) > a:not(.button):hover,
:is(.app-main, dialog) .tabs > a:not(.button):hover,
:is(.app-main, dialog) .bom-status-filters > a:not(.button):hover,
:is(.app-main, dialog) .bom-type-filters > a:not(.button):hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}
:is(.app-main, dialog) :is(nav, div, ul)[class*="-tabs"]:not(.production-source-tabs):not(.aftersales-tabs) > a[aria-current="page"],
:is(.app-main, dialog) :is(nav, div, ul)[class*="-tabs"]:not(.production-source-tabs):not(.aftersales-tabs) > a.active,
:is(.app-main, dialog) :is(nav, div, ul)[class*="-tabs"]:not(.production-source-tabs):not(.aftersales-tabs) > a[aria-selected="true"],
:is(.app-main, dialog) .tabs > a[aria-current="page"],
:is(.app-main, dialog) .tabs > a.active,
:is(.app-main, dialog) .bom-status-filters > a[aria-current="page"],
:is(.app-main, dialog) .bom-type-filters > a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.danger, .danger-btn, .danger-button { color: var(--danger); background: var(--panel); border-color: #e1a39c; }
button.danger:hover, .danger-btn:hover, .danger-button:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
[data-selection-group] :is([aria-current="page"], [aria-current="true"], [aria-selected="true"], .active) { color: #fff; background: var(--accent); border-color: var(--accent); }
[data-selection-group] :is([aria-current="page"], [aria-current="true"], [aria-selected="true"], .active):hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
[data-selection-group] :is(button:disabled, [aria-disabled="true"]) { color: #fff; background: var(--danger); border-color: var(--danger); cursor: not-allowed; opacity: 1; pointer-events: none; }
.bom-type-filters[data-selection-group] :is([aria-current="page"], [aria-current="true"]) span { color: #fff; background: rgba(255, 255, 255, .18); }
button.text-action, .text-action { min-height: auto; padding: 3px 4px; color: var(--accent-dark); background: transparent; border-color: transparent; }
button.text-action:hover, .text-action:hover { color: var(--accent-dark); background: var(--accent-soft); border-color: transparent; }
.action-link,
.actions > a:not(.button),
.version-actions > a:not(.button),
.template-actions > a:not(.button),
.rule-actions > a:not(.button),
table td:last-child > a:not(.button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.action-link:hover,
.actions > a:not(.button):hover,
.version-actions > a:not(.button):hover,
.template-actions > a:not(.button):hover,
.rule-actions > a:not(.button):hover,
table td:last-child > a:not(.button):hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.actions, .inline, .filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions { gap: 12px; }
.page-head > :first-child { flex: 0 0 66.6667%; min-width: 0; }
.page-head > .actions { flex: 1 1 auto; justify-content: flex-start; gap: 60px; margin: 0; }
@media (max-width: 820px) {
  .page-head > :first-child { flex: 1 1 auto; }
  .page-head > .actions { gap: 12px; }
}
.filters { background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 8px; }
.filters input { min-width: 260px; }
/* 统一：筛选栏与表单栅格的字段间距，覆盖各页面单独写死的小间距 */
.app-main :is(.filters, [class*="-filters"], [class*="-form"], .form-grid, .grid) { gap: 12px; }
.material-editor { display: grid; gap: 8px; }
.material-editor .panel { margin: 0; }
.material-editor .form.wide { row-gap: 6px; }
.material-editor-head { align-items: flex-start; margin: 0; }
.material-photo-field { grid-column: 1 / -1; }
.material-photo-history { display: grid; gap: 7px; }
.material-photo-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.material-photo-row small { display: block; color: var(--muted); }
.product-suppliers { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.product-suppliers h3 { margin: 0 0 6px; }
.supplier-picker { display: grid; gap: 6px; max-width: 620px; }
.supplier-picker__choices { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); background: var(--panel); }
.supplier-picker__choices > label { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; align-items: center; min-height: 34px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.supplier-picker__choices > label:last-child { border-bottom: 0; }
.supplier-picker__choices > label[hidden], [data-supplier-row][hidden] { display: none; }
.supplier-cell { min-width: 160px; }
.supplier-cell label { display: flex; flex-direction: row; align-items: center; gap: 7px; }
.supplier-cell input[type="checkbox"], .supplier-cell input[type="radio"] { width: auto; }
.supplier-table input[type="text"] { min-width: 120px; }
.material-editor-actions { position: sticky; bottom: 0; z-index: 10; padding: 8px 0 0; background: var(--panel); border-top: 1px solid var(--line); }
.detail { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.performance-nodes-panel > .section-head { margin-bottom: 10px; }
.performance-nodes-panel > .section-head h2 { margin-bottom: 2px; }
.node-dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(32,33,35,.22);
}
.node-dialog:not([open]) { display: none; }
.node-dialog::backdrop { background: rgba(32,33,35,.36); }
.node-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.node-dialog__header h3 { margin: 0; font-size: 16px; }
.node-dialog__close { width: 32px; min-height: 32px; padding: 0; color: var(--muted); background: transparent; border-color: transparent; font-size: 22px; line-height: 1; }
.node-dialog__close:hover { color: var(--text); background: var(--surface-subtle); border-color: var(--line); }
.node-dialog__form { padding: 14px; }
.node-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.flash { margin-bottom: 12px; padding: 9px 11px; color: #75420e; background: #fff7ed; border: 1px solid #efd2b3; border-left: 3px solid var(--warning); border-radius: 4px; }
.navigation-update-notice {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: block;
  width: fit-content;
  margin: 0 auto 10px;
  padding: 7px 12px;
  color: #17684c;
  background: #eaf7f1;
  border: 1px solid #9fd6c3;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}
.navigation-update-notice[hidden] { display: none; }
.unread { background: #fff8e8; }
.section-head, .cost-line-head, .cost-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head p { margin: -6px 0 10px; }
.kicker { display: block; margin-bottom: 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; border-radius: 4px; padding: 3px 8px; color: var(--muted); background: var(--surface-subtle); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-未完成 { background: #fef0ed; color: #b42318; }
.status-部分完成 { background: #fff7dc; color: #8a6116; }
.status-已完成 { background: #eaf7f1; color: #17684c; }
.audit-note { padding: 10px 12px; border-left: 3px solid #c58a22; background: #fff9e9; }
.cost-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.compact-form { display: grid; grid-template-columns: 1.5fr 110px 150px 130px auto; gap: 6px; margin-top: 8px; }
.compact-form.supplier-settlement-form { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.supplier-settlement-form > .table-scroll, .supplier-settlement-form > button { grid-column: 1 / -1; }
.supplier-settlement-form > button { justify-self: start; align-self: start; }
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-weight: 700;
  text-decoration: none;
}
.tab:hover { color: var(--accent-dark); }
.tab.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}
.cost-profit-stats { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.forecast-material-table { min-width: 1180px; }
.forecast-line-form {
  display: grid;
  grid-template-columns: 100px 145px minmax(170px, 1fr) auto;
  align-items: end;
  gap: 6px;
  min-width: 520px;
}
.forecast-line-form label { margin: 0; }
.forecast-line-form button { min-height: 34px; }
@media (max-width: 900px) {
  .cost-profit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; }
}
.signature-archive-table { min-width: 1320px; }
.signature-archive-table th:nth-child(1), .signature-archive-table td:nth-child(1) { min-width: 150px; }
.signature-archive-table th:nth-child(2), .signature-archive-table td:nth-child(2) { min-width: 110px; }
.signature-archive-table th:nth-child(3), .signature-archive-table td:nth-child(3) { min-width: 80px; }
.signature-archive-table th:nth-child(4), .signature-archive-table td:nth-child(4),
.signature-archive-table th:nth-child(5), .signature-archive-table td:nth-child(5) { min-width: 100px; }
.signature-archive-table th:nth-child(6), .signature-archive-table td:nth-child(6),
.signature-archive-table th:nth-child(7), .signature-archive-table td:nth-child(7) { min-width: 180px; }
.required-mark { color: var(--danger); font-size: 12px; font-weight: 800; white-space: nowrap; }
.signature-requirement { display: inline-flex; align-items: center; min-height: 24px; margin: 0 4px 5px 0; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.signature-requirement.ready { color: #17684c; background: #eaf7f1; }
.signature-requirement.missing { color: #9b2c24; background: #fcecea; }
.signature-processing { min-width: 460px; }
.signature-upload-form { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafb; }
.signature-upload-form input[type="file"] { min-width: 0; width: 100%; }
.signature-upload-form button { white-space: normal; }
.fulfillment-line-panel { display: grid; gap: 12px; }
.fulfillment-line-panel[hidden] { display: none; }
.fulfillment-line-switcher { display: grid; gap: 10px; }
.fulfillment-line-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.fulfillment-line-buttons button { display: grid; gap: 3px; min-width: 0; padding: 9px 11px; color: var(--navy); text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.fulfillment-line-buttons button.active { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.fulfillment-line-buttons span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fulfillment-line-buttons small { color: var(--muted); }
.fulfillment-line-head { margin: 0; }
.fulfillment-line-head h2, .fulfillment-cost-head h3 { margin: 0 0 3px; }
.fulfillment-line-head .hint, .fulfillment-cost-head .hint { margin: 0; }
.fulfillment-form { gap: 14px; }
.fulfillment-required-grid, .fulfillment-optional-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.fulfillment-optional-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.required-mark { margin-left: 3px; color: var(--danger); }
.fulfillment-evidence-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.fulfillment-evidence-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-subtle); }
.fulfillment-evidence-item > a { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.fulfillment-evidence-item img { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 4px; object-fit: cover; background: #fff; }
.fulfillment-evidence-item span { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.fulfillment-evidence-item button { min-height: 32px; padding: 5px 8px; }
.fulfillment-cost-editor { display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.fulfillment-cost-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fulfillment-expense-list { display: grid; gap: 7px; }
.fulfillment-expense-row { display: grid; grid-template-columns: minmax(150px, 1.25fr) minmax(110px, .75fr) minmax(135px, .8fr) minmax(130px, .8fr) auto; gap: 8px; align-items: end; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.fulfillment-expense-actions { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.fulfillment-expense-actions .status { white-space: nowrap; }
.fulfillment-submit-row { display: flex; justify-content: flex-end; }
.fulfillment-submit-row button { min-width: 128px; }
.signature-review-form { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 7px; background: #fff; }
.signature-review-form label { display: grid; gap: 5px; color: var(--navy); font-size: 12px; font-weight: 800; }
.signature-review-form input { min-width: 0; width: 100%; }
.signature-review-comment, .signature-review-actions, .signature-review-form .warning-hint, .signature-review-form > .signature-blocker { grid-column: 1 / -1; }
.signature-review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.signature-action-state { display: grid; gap: 4px; padding: 10px 12px; border-left: 3px solid #d5a346; background: #fff8e2; }
.signature-action-state p, .signature-blocker { margin: 0; color: #704a0b; font-size: 12px; }
.signature-action-state button[disabled], .signature-review-form button[disabled] { color: #748190; background: #e5e9ed; border-color: #c5cdd5; cursor: not-allowed; opacity: 1; }
td small { display: block; margin-top: 3px; }
.table-scroll { width: 100%; overflow-x: auto; }
.table-scroll table { min-width: 760px; }
.result-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.user-admin-layout { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 12px; align-items: start; }
.user-create-panel { position: sticky; top: 80px; border-top: 4px solid var(--accent); }
.user-create-panel .section-head { align-items: flex-start; }
.user-create-panel .section-head h2, .user-list-heading h2 { margin-bottom: 4px; }
.user-create-form { gap: 8px; }
.user-role-fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.user-role-fieldset legend { padding: 0 6px; color: var(--navy); font-weight: 800; }
.user-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.user-role-option { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 10px; color: #405066; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fb; cursor: pointer; }
.user-role-option:has(input:checked) { color: var(--navy); border-color: #9eabb9; background: #edf2f6; box-shadow: inset 3px 0 var(--accent); }
.user-role-option input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: 0 0 16px; accent-color: var(--accent); }
.user-list-heading { display: flex; align-items: flex-start; justify-content: space-between; margin: 0 0 10px; padding: 2px 2px 0; }
.user-card-list { display: grid; gap: 8px; }
.user-card { overflow: hidden; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: #fff; box-shadow: none; }
.user-card-summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 12px 8px; }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--accent); border-radius: 5px; font: 800 16px Bahnschrift, "Microsoft YaHei UI", sans-serif; }
.user-identity { display: grid; min-width: 0; line-height: 1.35; }
.user-identity strong { color: var(--navy); font-size: 16px; }
.user-identity span { overflow: hidden; color: #405066; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { margin-top: 2px; }
.user-state { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.user-state-启用 { color: #17684c; background: #eaf7f1; }
.user-state-禁用 { color: #9b2c24; background: #fcecea; }
.user-role-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 10px 58px; }
.user-role-tags span { padding: 3px 8px; color: #4b5d70; background: #edf1f5; border-radius: 999px; font-size: 12px; font-weight: 700; }
.user-role-tags .user-role-empty { color: var(--muted); background: transparent; border: 1px dashed var(--line); }
.user-management-details { border-top: 1px solid var(--line); }
.user-management-details summary { padding: 10px 16px; color: var(--navy); background: #f7f9fb; cursor: pointer; font-size: 13px; font-weight: 800; list-style-position: inside; }
.user-management-details[open] summary { color: var(--accent-dark); background: var(--accent-soft); }
.user-management-body { display: grid; gap: 10px; padding: 12px; }
.user-role-form { display: grid; gap: 8px; }
.user-operation-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-operation-head div, .user-status-action div { display: grid; }
.user-operation-head small, .user-status-action small { margin-top: 2px; }
.user-secondary-actions { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.user-password-form label { color: var(--navy); font-weight: 700; }
.user-password-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; }
.user-password-row .secondary-action { color: var(--navy); background: #fff; border-color: #93a1b1; }
.user-password-row .secondary-action:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.user-status-action { display: flex; align-items: end; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafb; }
.user-status-action form { margin: 0; }
.user-status-action button { min-width: 88px; white-space: nowrap; }
.cost-overview { display: grid; grid-template-columns: minmax(240px, .8fr) 2fr; align-items: center; gap: 12px; margin-bottom: 8px; padding: 10px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.cost-overview h2 { margin-bottom: 4px; color: var(--text); }
.cost-overview p { margin: 0; color: var(--muted); font-size: 13px; }
.cost-overview .kicker { color: var(--accent); }
.reconcile-rail { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.reconcile-rail::before { content: ""; position: absolute; top: 10px; left: 16.6%; right: 16.6%; height: 2px; background: var(--line-strong); }
.rail-step { position: relative; display: grid; justify-items: center; gap: 2px; color: var(--text); z-index: 1; }
.rail-step:hover { color: var(--accent-dark); }
.rail-dot { width: 20px; height: 20px; border: 5px solid #fff; border-radius: 50%; background: #8e9892; box-shadow: 0 0 0 2px #8e9892; }
.rail-step.done .rail-dot { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.rail-step.working .rail-dot { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.rail-step strong { font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 22px; line-height: 1.1; }
.rail-step small { color: var(--muted); }
.cost-summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin-bottom: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cost-summary-strip a { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; color: var(--text); border-right: 1px solid var(--line); }
.cost-summary-strip a:last-child { border: 0; }
.cost-summary-strip a:hover { background: #f5faf8; }
.cost-summary-strip strong { font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 22px; color: var(--text); }
.cost-filters { align-items: end; }
.cost-filters label:first-child { flex: 1; }
.cost-filters label:first-child input { width: 100%; }
.entry-form { display: grid; grid-template-columns: 1.6fr .7fr .8fr 1fr auto; gap: 8px; align-items: end; padding: 12px; margin: 12px 0; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.cost-batch-editor { display: grid; gap: 8px; padding: 12px; margin: 12px 0; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.cost-batch-heading, .cost-batch-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cost-batch-heading p { margin: 3px 0 0; }
.cost-batch-total { min-width: 150px; padding: 8px 12px; text-align: right; color: #17684c; background: var(--accent-soft); border: 1px solid #b9ddca; border-radius: 5px; }
.cost-batch-total span { display: block; color: var(--muted); font-size: 12px; }
.cost-batch-total strong { display: block; font: 700 20px Bahnschrift, "Segoe UI", sans-serif; }
.cost-batch-labels, .cost-batch-row { display: grid; grid-template-columns: 44px minmax(180px,1.4fr) minmax(110px,.7fr) minmax(145px,.85fr) minmax(130px,1fr) auto; gap: 8px; align-items: end; }
.cost-batch-labels { padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cost-batch-row { padding: 10px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.cost-batch-row > strong { align-self: center; text-align: center; color: var(--navy); }
.cost-batch-row label { min-width: 0; }
.cost-batch-row label > span { display: none; }
.cost-batch-row input, .cost-batch-row select { min-width: 0; width: 100%; }
.cost-batch-row button { white-space: nowrap; }
.cost-batch-actions { justify-content: flex-end; padding-top: 2px; }
.accounting-track { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; max-width: 520px; margin: 18px 0 20px; }
.accounting-track::before { content: ""; position: absolute; top: 7px; left: 8px; right: 8px; height: 2px; background: var(--line); }
.track-step { position: relative; display: grid; gap: 6px; color: var(--muted); font-size: 12px; z-index: 1; }
.track-step i { width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: #aeb8c3; box-shadow: 0 0 0 2px #aeb8c3; }
.track-step.complete i { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.track-step.current i { background: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.track-step.complete, .track-step.current { color: var(--text); font-weight: 700; }
.live-total { min-width: 180px; padding: 10px 12px; text-align: right; color: #17684c; background: var(--accent-soft); border: 1px solid #b9ddca; border-radius: 5px; }
.live-total small { display: block; color: var(--muted); }
.live-total strong { display: block; font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 24px; }
.line-total { white-space: nowrap; font-weight: 700; color: var(--navy); }
input[readonly] { color: var(--navy); background: #edf2f4; font-weight: 700; }
.affair-overview { display: grid; grid-template-columns: minmax(220px,.75fr) 2fr; align-items: center; gap: 12px; margin-bottom: 8px; padding: 10px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.affair-overview h2 { margin-bottom: 4px; color: var(--text); }
.affair-overview p { margin: 0; color: var(--muted); font-size: 13px; }
.affair-overview .kicker { color: var(--accent); }
.affair-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.affair-summary a { display: grid; justify-items: center; padding: 8px 12px; color: var(--text); border-left: 1px solid var(--line); }
.affair-summary strong { font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 22px; }
.affair-summary span { color: var(--muted); font-size: 12px; }
.affair-status-已逾期 { background: #fef0ed; color: var(--danger); }
.affair-status-待处理 { background: #fff7dc; color: #8a6116; }
.affair-status-未到提醒期 { background: #eef2f6; color: #536273; }
.affair-status-已完成 { background: #eaf7f1; color: #17684c; }
.affair-complete input { min-width: 150px; }
.document-rail { display: grid; grid-template-columns: repeat(4, 1fr); margin: 8px 0 22px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8fafb; }
.document-step { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 58px; padding: 10px 16px; border-right: 1px solid var(--line); color: var(--muted); }
.document-step:last-child { border-right: 0; }
.document-step b { font: 700 19px/1 Bahnschrift, "Segoe UI", sans-serif; color: #9ba7b4; }
.document-step span { font-weight: 700; }
.document-step.done { color: #6b3b08; background: #fff6e9; }
.document-step.done b { color: var(--accent); }
.version-table table { min-width: 900px; }
.version-table th:first-child, .version-table td:first-child { width: 72px; font: 700 17px Bahnschrift, "Segoe UI", sans-serif; color: var(--navy); }
.version-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.native-document-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.native-document-content-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.native-document-submit { display: flex; margin: 0 0 0 auto; }
.compact-action, .compact-link { min-height: 32px; padding: 5px 9px; border-radius: 5px; font-size: 13px; }
.compact-link { display: inline-flex; align-items: center; border: 1px solid #d4ad77; background: #fff8ed; }
.secondary-action { color: var(--navy); background: #fff; border-color: #9daab7; }
.secondary-action:hover { color: #fff; }
.approval-action { background: var(--accent); border-color: var(--accent); }
.text-action { font-weight: 700; }
.office-bridge { padding: 16px; border-top: 3px solid var(--accent); }
.bridge-route { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; margin: 8px 0 10px; padding: 10px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.bridge-route div { display: grid; justify-items: center; gap: 7px; }
.bridge-route i { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); font: normal 800 13px Bahnschrift, sans-serif; letter-spacing: 0; }
.bridge-route span { color: var(--muted); font-size: 13px; }
.bridge-route b { color: var(--line-strong); font-size: 20px; }
.bridge-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bridge-status small { color: var(--muted); }
.bridge-status p { margin: 4px 0 0; font-weight: 700; }
.bridge-help { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--amber); background: #fff8e8; }
.reconciliation-note { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; padding: 10px 12px; border-left: 3px solid var(--amber); background: #fff8e8; }
.reconciliation-note strong { color: #7b5112; }
.reconciliation-table table { min-width: 980px; }
.reconciliation-table pre { max-width: 330px; margin: 0; white-space: pre-wrap; word-break: break-word; font: 12px/1.55 "Cascadia Mono", Consolas, monospace; }
.reconciliation-table td:nth-child(4) { font-weight: 700; white-space: nowrap; }
.reconciliation-table select, .reconciliation-table input { width: 100%; margin-bottom: 6px; }
.reconciliation-submit { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.reconciliation-submit span { color: var(--muted); font-size: 13px; }
.contract-stage { display: grid; grid-template-columns: minmax(230px, .7fr) 2fr; align-items: center; gap: 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); }
.stage-summary { display: grid; gap: 4px; }
.stage-summary strong { font: 700 26px/1.2 Bahnschrift, "Segoe UI", sans-serif; }
.stage-summary small { color: var(--muted); }
.stage-action { width: fit-content; margin-top: 8px; padding: 6px 10px; color: #fff; background: var(--accent); border-radius: 5px; font-size: 12px; font-weight: 800; }
.stage-action:hover { color: #fff; background: var(--accent); }
.stage-track { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.stage-track::before { content: ""; position: absolute; top: 8px; left: 8px; right: 8px; height: 2px; background: var(--line-strong); }
.stage-node { position: relative; display: grid; gap: 7px; color: var(--muted); font-size: 12px; z-index: 1; }
.stage-node i { width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: #89948e; box-shadow: 0 0 0 2px #89948e; }
.stage-node.complete i { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.stage-node.current { color: var(--text); font-weight: 700; }
.stage-node.current i { background: var(--warning); box-shadow: 0 0 0 3px var(--warning); }
.detail-nav { display: flex; gap: 4px; overflow-x: auto; margin: -2px 0 10px; padding: 4px; background: #e7ebe8; border-radius: 6px; }
.detail-nav a { flex: 0 0 auto; padding: 7px 13px; color: #405066; border-radius: 5px; font-size: 13px; font-weight: 700; }
.detail-nav a:hover { color: var(--navy); background: #fff; }
.current-document { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; margin-bottom: 8px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.current-document h3 { margin: 3px 0 6px; font-size: 22px; }
.current-document .kicker { color: var(--accent); }
.current-document small { color: var(--muted); }
.current-document-meta { display: grid; gap: 4px; }
.current-document-meta p { margin: 0; color: var(--muted); }
.current-document-meta .status { width: fit-content; margin-top: 6px; }
.current-document-next { display: grid; justify-items: end; gap: 9px; }
.document-primary { min-width: 150px; color: #fff; background: var(--accent); border-color: var(--accent); }
.document-more { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.document-more summary { color: var(--text); cursor: pointer; font-weight: 700; }
.document-more .version-actions { margin-top: 10px; }
.source-builder { padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: #fbfdfb; }
.source-builder h3 { margin: 0 0 4px; color: var(--navy); }
.source-form { display: grid; gap: 8px; }
.source-form fieldset { margin: 0; padding: 0; border: 0; }
.source-form legend { margin-bottom: 8px; color: var(--navy); font-weight: 800; }
.source-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.source-choice { display: flex; align-items: flex-start; gap: 9px; padding: 12px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.source-choice input { min-height: 0; margin-top: 3px; }
.source-choice span { display: grid; gap: 3px; }
.source-select-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.version-history summary { cursor: pointer; color: var(--navy); font-weight: 800; }
.version-history .version-table { margin-top: 12px; }
.full-document-preview { margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #eef2f5; }
.full-document-preview .section-head { padding: 14px 16px; margin: 0; background: #fff; border-bottom: 1px solid var(--line); }
.full-document-preview h3 { margin: 0 0 3px; }
.full-document-preview iframe { display: block; width: 100%; min-height: 720px; border: 0; background: #dfe5ea; }
.document-preview-resizer { width: 100%; height: 420px; min-height: 260px; max-height: 80vh; overflow: hidden; resize: vertical; background: #dfe5ea; }
.full-document-preview .document-preview-resizer > iframe { width: 100%; height: 100%; min-height: 0; }
.preview-empty { display: grid; justify-items: center; gap: 6px; padding: 52px 20px; color: var(--muted); text-align: center; }
.preview-empty strong { color: var(--navy); }
.contract-body-editor:focus { box-shadow: inset 0 0 0 3px rgba(31,122,85,.12); }
.contract-body-editor h1, .contract-body-editor h2, .contract-body-editor h3 { color: #111; }
.contract-body-editor table { margin: 12px 0; }
.contract-body-editor td, .contract-body-editor th { border: 1px solid #444; }
.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: #f5f7f9; border-top: 1px solid var(--line); }
.rule-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr); gap: 12px; align-items: start; }
.rule-layout.rule-layout-single { grid-template-columns: minmax(0, 1fr); }
.rule-builder { border-top: 4px solid var(--accent); }
.rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.rule-fields-primary { grid-template-columns: 1.4fr 1fr .8fr; }
.rule-section { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafb; }
.rule-section legend { padding: 0 7px; color: var(--navy); font-weight: 800; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.choice-row label { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; color: var(--text); border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; }
.choice-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-row input[type="radio"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: 0 0 16px; accent-color: var(--accent); }
.rule-version-list { display: grid; gap: 10px; }
.rule-version { padding: 10px; border: 1px solid var(--line); border-left: 3px solid #9aa8b7; border-radius: 7px; }
.rule-version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rule-version-head strong, .rule-version-head small { display: block; }
.rule-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin: 13px 0; }
.rule-summary div { padding: 8px; background: #f1f4f6; border-radius: 5px; }
.rule-summary dt { color: var(--muted); font-size: 11px; }
.rule-summary dd { margin: 2px 0 0; color: var(--navy); font-weight: 800; }
.rule-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.rule-actions button { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.status-rule-已生效, .status-rule-启用 { color: #17684c; background: #eaf7f1; }
.status-rule-待审核 { color: #8a6116; background: #fff7dc; }
.status-rule-待生效 { color: #265d88; background: #eaf3fb; }
.status-rule-草稿 { color: #405066; background: #edf1f5; }
.status-rule-已停用, .status-rule-停用 { color: #7b3230; background: #fbeceb; }
.cost-category-form { display: grid; grid-template-columns: minmax(220px, 1.5fr) 1fr 110px auto; align-items: end; gap: 8px; margin: 10px 0; padding: 10px; background: #f5f8fa; border: 1px solid var(--line); border-radius: 7px; }
.template-upload { border-top: 4px solid var(--accent); }
.recognition-risk { max-width: 330px; color: var(--muted); font-size: 13px; }
.recognition-status-待确认 { color: #7b4d0c; background: #fff1d5; }
.recognition-status-已确认 { color: #17684c; background: #eaf7f1; }
.recognition-status-失败, .recognition-status-已拒绝 { color: var(--danger); background: #fef0ed; }
.recognition-status-识别中 { color: #225b86; background: #e8f3fb; }
.recognition-head { display: grid; grid-template-columns: minmax(280px, 1fr) 1.3fr; gap: 12px; align-items: center; margin-bottom: 8px; padding: 10px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.recognition-head strong { display: block; font: 700 24px/1.1 Bahnschrift, "Segoe UI", sans-serif; color: var(--accent); }
.recognition-head p { margin: 8px 0 0; color: var(--muted); }
.recognition-head .kicker { color: var(--accent); }
.recognition-head dl { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.recognition-head dl div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recognition-head dl div:nth-child(2n) { border-right: 0; }
.recognition-head dl div:nth-last-child(-n+2) { border-bottom: 0; }
.recognition-head dt { color: var(--muted); font-size: 11px; }
.recognition-head dd { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 700; white-space: nowrap; }
.recognition-actions { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 10px; align-items: center; }
.recognition-actions h2 { margin-bottom: 3px; }
.recognition-confirm { color: #281604; background: #efb765; border-color: #efb765; }
.recognition-reject { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.recognition-ledger { display: grid; grid-template-columns: minmax(0,1fr) 48px minmax(0,1fr); align-items: stretch; margin-bottom: 10px; }
.recognition-ledger article { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(19,34,56,.035); }
.recognition-ledger-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #edf1f5; border-bottom: 1px solid var(--line); }
.recognition-ledger-head > span { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--navy); border-radius: 50%; font-weight: 800; }
.recognition-ledger-head h2 { margin: 0; }
.recognition-ledger-head small { display: block; }
.recognition-ledger table th { width: 46%; background: #fff; }
.recognition-ledger table tr:last-child th, .recognition-ledger table tr:last-child td { border-bottom: 0; }
.recognition-ledger table td { color: var(--navy); font: 700 16px Bahnschrift, "Segoe UI", sans-serif; }
.recognition-arrow { display: grid; place-items: center; color: var(--accent); font: 800 28px Bahnschrift, sans-serif; }
.recognition-previews { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.recognition-previews article { display: grid; gap: 8px; min-width: 0; }
.recognition-previews iframe { width: 100%; min-height: 640px; border: 1px solid var(--line); border-radius: 6px; background: #e8edf1; }
.recognition-report summary { color: var(--navy); cursor: pointer; font-weight: 800; }
.recognition-report pre { max-height: 520px; overflow: auto; margin: 14px 0 0; padding: 14px; color: #dbe6ef; background: #132237; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font: 12px/1.55 "Cascadia Mono", Consolas, monospace; }
:focus-visible { outline: 3px solid rgba(31,122,85,.32); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (max-width: 820px) {
  .grid.two, .stats, .form.wide { grid-template-columns: 1fr; }
  .fulfillment-required-grid, .fulfillment-optional-grid { grid-template-columns: 1fr; }
  .fulfillment-line-head, .fulfillment-cost-head { align-items: flex-start; flex-direction: column; }
  .fulfillment-cost-head button, .fulfillment-submit-row button { width: 100%; }
  .fulfillment-expense-row { grid-template-columns: 1fr; }
  .fulfillment-expense-actions { justify-content: space-between; }
  .topbar { min-height: 52px; gap: 10px; padding: 6px 12px; }
  input, select, textarea, button, .button, .nav-group-toggle, .nav-link { min-height: var(--control-height-mobile); }
  .brand { font-size: 16px; }
  .user span, .user a:first-of-type { display: none; }
  .user { gap: 8px; }
  .ledger-switcher label, .ledger-current small { display: none; }
  .ledger-switcher select { width: min(38vw, 160px); }
  .ledger-current strong { max-width: 32vw; }
  .app-shell { display: block; min-height: calc(100vh - 52px); }
  .nav-open { display: inline-flex; }
  .sidebar { position: fixed; inset: 52px auto 0 0; width: min(82vw, 290px); height: auto; z-index: 40; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 28px rgba(32,33,35,.12); }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 52px 0 0; width: 100%; height: auto; min-height: 0; padding: 0; z-index: 35; border: 0; border-radius: 0; background: rgba(32,33,35,.3); }
  .sidebar-open .nav-scrim { display: block; }
  nav, .actions { flex-wrap: wrap; }
  table { font-size: 13px; }
  .cost-line-head, .cost-actions { align-items: flex-start; flex-direction: column; }
  .performance-nodes-panel > .section-head { align-items: flex-start; }
  .node-dialog__actions button { flex: 1; }
  .compact-form { grid-template-columns: 1fr; }
  .compact-form.supplier-settlement-form { grid-template-columns: 1fr; }
  .app-main, .guest-main { width: min(100% - 24px, 1360px); margin-top: 18px; }
  .cost-overview { grid-template-columns: 1fr; gap: 20px; }
  .affair-overview { grid-template-columns: 1fr; gap: 18px; }
  .affair-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .affair-summary a { border-bottom: 1px solid rgba(255,255,255,.18); }
  .cost-summary-strip { grid-template-columns: 1fr; }
  .cost-summary-strip a { border-right: 0; border-bottom: 1px solid var(--line); }
  .entry-form { grid-template-columns: 1fr; }
  .cost-batch-heading, .cost-batch-actions { align-items: stretch; flex-direction: column; }
  .cost-batch-total { width: 100%; }
  .cost-batch-labels { display: none; }
  .cost-batch-row { grid-template-columns: 36px 1fr; align-items: center; }
  .cost-batch-row label, .cost-batch-row button { grid-column: 2; }
  .cost-batch-row label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
  .cost-batch-row > strong { grid-row: 1 / span 5; align-self: start; padding-top: 28px; }
  .cost-batch-actions button { width: 100%; }
  .document-rail { grid-template-columns: repeat(2, 1fr); }
  .document-step:nth-child(2) { border-right: 0; }
  .document-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .native-document-content-actions, .native-document-submit { width: 100%; }
  .native-document-submit { margin-left: 0; }
  .native-document-submit button { width: 100%; }
  .bridge-route { gap: 8px; padding: 18px 10px; }
  .bridge-route i { width: 48px; height: 48px; }
  .bridge-status, .reconciliation-submit { align-items: stretch; flex-direction: column; }
  .reconciliation-note { grid-template-columns: 1fr; gap: 6px; }
  .contract-stage { grid-template-columns: 1fr; gap: 20px; }
  .stage-node span { font-size: 11px; }
  .current-document, .rule-layout, .recognition-head, .recognition-actions { grid-template-columns: 1fr; }
  .recognition-head dl { grid-template-columns: 1fr; }
  .recognition-head dl div { border-right: 0; border-bottom: 1px solid #41556b !important; }
  .recognition-head dl div:last-child { border-bottom: 0 !important; }
  .recognition-ledger { grid-template-columns: 1fr; gap: 8px; }
  .recognition-arrow { transform: rotate(90deg); }
  .recognition-previews, .recognition-reject { grid-template-columns: 1fr; }
  .recognition-previews iframe { min-height: 480px; }
  .current-document-next { justify-items: stretch; }
  .source-options, .source-select-row, .rule-fields, .rule-fields-primary, .cost-category-form { grid-template-columns: 1fr; }
  .full-document-preview iframe { min-height: 520px; }
  .editor-actions { align-items: stretch; flex-direction: column; }
}
.template-progress {
  border-left: 4px solid var(--accent, #c46b16);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e9ee;
  box-shadow: inset 0 1px 2px rgba(15, 36, 56, .12);
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c46b16, #e8a447);
  transition: width .35s ease;
}

.progress-stage {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .75rem;
  color: #526171;
}

.template-stage-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(58px, 1fr));
  position: relative;
  gap: 0;
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
}

.template-stage-strip::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 3%;
  right: 3%;
  height: 1px;
  background: #cbd4de;
}

.template-stage-strip li {
  display: grid;
  justify-items: center;
  gap: 6px;
  position: relative;
  color: #7a8795;
  font-size: 10px;
  text-align: center;
  z-index: 1;
}

.template-stage-strip i {
  width: 15px;
  height: 15px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #aab4bf;
  box-shadow: 0 0 0 1px #aab4bf;
}

.template-stage-strip li.complete i {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.template-stage-strip li.current i {
  background: #efb765;
  box-shadow: 0 0 0 2px #efb765;
}

.template-stage-strip li.complete,
.template-stage-strip li.current {
  color: var(--navy);
  font-weight: 700;
}

.template-ledger table {
  min-width: 1120px;
}

.template-ledger tbody tr td:first-child {
  border-left: 3px solid transparent;
}

.template-ledger tbody tr.template-active td:first-child {
  border-left-color: #278062;
}

.template-ledger tbody tr.template-inactive {
  background: #fafbfc;
}

.template-name-cell strong,
.template-name-cell small {
  display: block;
}

.status-template-已验证,
.status-template-启用 {
  color: #17684c;
  background: #eaf7f1;
}

.status-template-待验证,
.status-template-待准备占位符 {
  color: #8a6116;
  background: #fff7dc;
}

.status-template-验证失败,
.status-template-失败 {
  color: var(--danger);
  background: #fef0ed;
}

.template-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.row-action-menu {
  position: relative;
}

.row-action-menu > summary {
  min-height: 32px;
  padding: 5px 9px;
  color: var(--navy);
  background: #fff;
  border: 1px solid #93a1b1;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.row-action-menu > summary::-webkit-details-marker {
  display: none;
}

.row-action-menu[open] > div {
  display: grid;
  gap: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  min-width: 150px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 12px 28px rgba(19, 34, 56, .16);
  z-index: 12;
}

.row-action-menu[open] a {
  padding: 6px 8px;
  color: var(--navy);
  font-weight: 700;
}

.row-action-menu form,
.row-action-menu button {
  width: 100%;
}

.recycle-pending td:first-child {
  border-left: 3px solid var(--accent);
}

.recycle-resolved {
  opacity: .72;
}

@media (max-width: 820px) {
  .template-stage-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 4px;
  }

  .template-stage-strip::before {
    display: none;
  }
}
.ledger-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 14px;
  padding: 4px;
  background: #e8edf1;
  border: 1px solid #c5d0d9;
  border-radius: 7px;
}

.ledger-tabs a {
  flex: 0 0 auto;
  padding: 9px 15px;
  color: #44566a;
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
}

.ledger-tabs a:hover,
.ledger-tabs a.active {
  color: #fff;
  background: #172b40;
}

.contract-ledger-table table {
  min-width: 1080px;
}

.contract-ledger-table th:nth-child(2),
.contract-ledger-table td:nth-child(2) {
  min-width: 128px;
  white-space: nowrap;
}

.ledger-row-actions {
  min-width: 72px;
}

.ledger-delete-form {
  margin: 0;
}

.ledger-void-action { position: relative; }
.ledger-void-action > summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; }
.ledger-void-action > summary::-webkit-details-marker { display: none; }
.ledger-void-action form { display: grid; gap: 8px; width: 230px; margin-top: 8px; padding: 10px; border: 1px solid #e1a39c; background: #fff8f7; }
.ledger-void-action label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.ledger-void-action input { min-width: 0; }
.ledger-void-action p { margin: 0; font-size: 12px; line-height: 1.5; }
.ledger-void-actions { display: flex; justify-content: flex-end; gap: 8px; }

.workflow-actions form {
  margin: 0;
}

.workflow-actions button,
.workflow-actions .button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.workflow-locked-status {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.workflow-card-list {
  display: grid;
  gap: 8px;
}

.workflow-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
}

.workflow-card-head,
.workflow-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}

.workflow-card-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 17px;
}

.workflow-card-head .eyebrow {
  margin-bottom: 3px;
}

.workflow-card-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-card-statuses .status-启用 {
  color: #17684c;
  background: #eaf7f1;
}

.workflow-card-statuses .status-停用 {
  color: #9b2c24;
  background: #fcecea;
}

.workflow-stage-summary {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #edf1f4;
  border-bottom: 1px solid #edf1f4;
  background: #f8fafb;
}

.workflow-stage-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workflow-stage-summary strong {
  min-width: 0;
  color: #405066;
  overflow-wrap: anywhere;
}

.workflow-card-foot {
  align-items: flex-start;
}

.workflow-card-foot > small {
  flex: 0 0 auto;
  margin-top: 7px;
}

.workflow-card-foot .workflow-actions {
  justify-content: flex-end;
  min-width: 0;
}

.workflow-card .workflow-locked-status,
.workflow-card .workflow-actions .hint {
  white-space: normal;
}

.workflow-form .checkbox-row {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 38px;
}

.workflow-form .checkbox-row input,
.workflow-choice input {
  width: 17px;
  height: 17px;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}

.workflow-node-editor {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.workflow-node-list {
  display: grid;
  gap: 10px;
}

.workflow-node-row {
  display: grid;
  grid-template-columns: 58px 116px minmax(150px,.8fr) minmax(150px,.8fr) minmax(210px,1.2fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #fff;
}

.workflow-node-row.disabled-node {
  border-left-color: #aeb8c3;
  background: #f3f5f7;
  opacity: .78;
}

.workflow-node-row > strong {
  grid-row: 1 / span 2;
  align-self: start;
  padding-top: 29px;
  color: var(--navy);
}

.workflow-node-enabled {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 7px;
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

.workflow-node-trigger {
  grid-column: 3;
}

.workflow-node-mode {
  grid-column: 4;
}

.workflow-node-assignee {
  grid-column: 5;
}

.workflow-node-enabled input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}

.workflow-node-order {
  grid-column: 6;
  display: flex;
  align-self: end;
  gap: 6px;
}

.workflow-node-order button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.approval-submit-form {
  display: grid;
  gap: 10px;
}

.workflow-choice-list {
  display: grid;
  gap: 8px;
}

.workflow-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.workflow-choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 105, 12, .14);
}

.workflow-choice > span {
  display: grid;
  gap: 5px;
}

.workflow-choice strong {
  display: flex;
  gap: 8px;
  align-items: center;
}

.workflow-choice em {
  padding: 2px 7px;
  color: #17684c;
  border-radius: 999px;
  background: #eaf7f1;
  font-size: 12px;
  font-style: normal;
}

.workflow-choice small {
  color: var(--muted);
  font-size: 14px;
}

.workflow-choice b {
  color: var(--danger);
  font-size: 13px;
}

.workflow-choice.unavailable {
  background: #f5f7f8;
  cursor: not-allowed;
  opacity: .78;
}

.approval-submit-warning {
  padding: 12px 14px;
  color: #704a0b;
  border: 1px solid #eed08b;
  border-radius: 7px;
  background: #fff8e2;
}

.sales-ownership-form {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(320px, 640px) auto;
  gap: 14px;
  align-items: end;
  justify-content: start;
}

.sales-collaborator-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sales-collaborator-fieldset {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sales-collaborator-grid {
  flex: 1 1 320px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.sales-collaborator-option {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.sales-collaborator-option:has(input:checked) {
  border-color: var(--navy);
  background: #edf4fb;
}

.sales-collaborator-option:has(input:disabled) {
  color: var(--muted);
  background: #f2f4f6;
}

.sales-collaborator-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.sales-selection-summary {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .sales-ownership-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 980px) {
  .user-admin-layout {
    grid-template-columns: 1fr;
  }

  .user-create-panel {
    position: static;
  }

  .user-secondary-actions {
    grid-template-columns: 1fr;
  }

  .workflow-node-row {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
  }

  .workflow-node-row > label,
  .workflow-node-order {
    grid-column: 2;
    grid-row: auto;
  }

  .workflow-node-row > strong {
    grid-row: 1 / span 6;
    align-self: start;
    padding-top: 28px;
  }

  .workflow-node-order {
    flex-wrap: wrap;
  }

  .workflow-card-foot {
    display: grid;
  }

  .workflow-card-foot .workflow-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .workflow-page-head,
  .workflow-node-editor .section-head {
    display: grid;
    justify-content: stretch;
    align-items: start;
  }

  .workflow-page-head > .button,
  .workflow-page-head > .actions,
  .workflow-node-editor .section-head > button {
    width: max-content;
    max-width: 100%;
    justify-self: start;
    white-space: nowrap;
  }

  .workflow-card-head,
  .workflow-card-foot {
    display: grid;
  }

  .workflow-stage-summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .table-scroll .workflow-ledger {
    min-width: 0;
  }

  .workflow-ledger,
  .workflow-ledger tbody,
  .workflow-ledger tr,
  .workflow-ledger td {
    display: block;
    width: 100%;
  }

  .workflow-ledger thead {
    display: none;
  }

  .workflow-ledger tr {
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .workflow-ledger td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #edf1f4;
  }

  .workflow-ledger td:last-child {
    border-bottom: 0;
  }

  .workflow-ledger td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .workflow-ledger .workflow-actions {
    align-items: flex-start;
  }

  .workflow-ledger .empty {
    display: block;
  }

  .workflow-ledger .empty::before {
    content: none;
  }

  .user-role-grid,
  .user-password-row {
    grid-template-columns: 1fr;
  }

  .user-card-summary {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .user-avatar {
    width: 38px;
    height: 38px;
  }

  .user-state {
    grid-column: 2;
    justify-self: start;
  }

  .user-role-tags {
    padding-left: 66px;
  }

  .user-operation-head,
  .user-status-action {
    align-items: stretch;
    flex-direction: column;
  }
}

.permission-role-picker {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}

.permission-role-picker label {
  min-width: 15rem;
}

.permission-matrix th,
.permission-matrix td {
  text-align: center;
  vertical-align: middle;
}

.permission-matrix tbody th {
  text-align: left;
  white-space: nowrap;
}

.permission-check {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.permission-check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--navy);
}

.permission-check input:disabled {
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-badge {
  min-width: 1.45rem;
  margin-left: auto;
  padding: .08rem .38rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.25rem;
  text-align: center;
}

a.stat {
  display: block;
  color: inherit;
  transition: transform .14s ease, box-shadow .14s ease;
}

a.stat:hover {
  transform: translateY(-2px);
  border-color: #aab6c2;
  box-shadow: 0 7px 18px rgba(19, 34, 56, .1);
}

.active-filter {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
  padding: .7rem .85rem;
  border-left: 3px solid var(--accent);
  background: #fff7ed;
  color: #75420e;
}
@media (max-width: 360px) {
  .topbar { gap: 6px; padding-inline: 8px; }
  .brand { display: none; }
  .ledger-switcher select { width: min(48vw, 145px); }
  .ledger-current strong { max-width: 45vw; }
  .user { margin-left: 0; }
}

.ledger-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) auto;
  align-items: end;
  gap: 12px;
}

.user-ledger-access {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.user-ledger-access td {
  vertical-align: top;
}

.user-ledger-access td > small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.ledger-role-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 5px 10px;
  min-width: 250px;
}

.ledger-role-options label,
.cross-ledger-permission-form label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.cross-ledger-permission-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.finance-consolidated-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
}

.finance-consolidated-filters label {
  display: grid;
  gap: 6px;
}

@media (max-width: 760px) {

  .ledger-create-form {
    grid-template-columns: 1fr;
  }

  .ledger-role-options {
    grid-template-columns: 1fr;
    min-width: 150px;
  }

  .cross-ledger-permission-form {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-consolidated-filters {
    grid-template-columns: 1fr;
  }
}

.error-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(32, 33, 35, .36);
}

.error-modal-overlay::backdrop { background: transparent; }

.error-modal {
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--danger);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(32, 33, 35, .2);
}

.error-modal__title {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 18px;
  line-height: 1.3;
}

.error-modal__message {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.error-modal__actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.error-modal__confirm {
  min-width: 88px;
}

.error-modal__close { display: none !important; }

@media (max-width: 480px) {
  .error-modal-overlay {
    padding: 12px;
  }

  .error-modal {
    max-height: calc(100dvh - 24px);
    padding: 16px;
  }

  .error-modal__confirm {
    min-width: 112px;
  }
}

.workbench-head { align-items: flex-end; }
.workbench-head p { margin: 0; color: var(--muted); }
.view-tabs, .scope-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.view-tabs a, .scope-tabs a { min-height: 32px; padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 700; }
.view-tabs a.active, .scope-tabs a.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.scope-tabs { margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.overview-filters { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 9px 10px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.overview-filters label { min-width: 148px; }
.overview-stats { grid-template-columns: repeat(7, minmax(108px, 1fr)); }
.overview-stats .stat { min-height: 76px; padding: 9px 10px; border-top-width: 2px; }
.overview-stats .stat strong { font-size: 20px; }
.overview-band { padding: 11px 12px; }
.overview-band .section-head { min-height: 32px; }
.overview-band .section-head h2 { margin: 0; }
.alert-summary { grid-template-columns: repeat(6, minmax(108px, 1fr)); }
.alert-stat { min-width: 0; color: inherit; text-decoration: none; }
.alert-stat:hover { background: var(--accent-soft); border-top-color: var(--accent); }
.alert-stat.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.alert-stat.active strong, .alert-stat.active span { color: #fff; }
.alert-ledger { padding-top: 4px; border-top: 2px solid var(--line-strong); }
.alert-ledger-head { min-height: 34px; }
.alert-ledger-head > div { display: flex; align-items: center; gap: 8px; }
.alert-ledger-head h2 { margin: 0; }
.alert-filters { margin-bottom: 6px; }
.alert-type-tabs { overflow-x: auto; flex-wrap: nowrap; }
.alert-type-tabs a { flex: 0 0 auto; }
.alert-ledger-table td:nth-child(3) { min-width: 240px; }
.row-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 170px; }
.row-actions form { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.row-actions button, .inline-assignment select { min-height: 30px; padding: 4px 8px; white-space: nowrap; }
.secondary-action { color: var(--text); background: #fff; border-color: var(--line-strong); }
.secondary-action:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.inline-assignment select { max-width: 116px; }

@media (min-width: 821px) {
  .table-inline-actions { white-space: nowrap; }
  .table-inline-actions > form,
  .table-scroll td[data-label="操作"] > form {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
  }
  .table-scroll td.row-actions,
  .table-scroll td.actions {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 0;
  }
  .table-inline-actions > form + form,
  .table-inline-actions > a + form,
  .table-inline-actions > form + a { margin-left: 5px; }
  .table-scroll input[type="number"][name*="数量"],
  .production-action-row input[type="number"][name*="数量"] {
    inline-size: 108px;
    min-inline-size: 108px;
    max-inline-size: 108px;
  }
}

@media (max-width: 1040px) {
  .overview-stats { grid-template-columns: repeat(4, minmax(108px, 1fr)); }
  .alert-summary { grid-template-columns: repeat(3, minmax(108px, 1fr)); }
}

@media (max-width: 680px) {
  .workbench-head { align-items: stretch; flex-direction: column; }
  .overview-filters { align-items: stretch; }
  .overview-filters label, .overview-filters button { width: 100%; }
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alert-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stats .stat { min-width: 0; }
  .row-actions { min-width: 210px; }
}

.finance-page-head .hint { margin: 0; }
.finance-filter-band { margin-bottom: 10px; padding: 9px 10px; background: var(--surface-subtle); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.finance-consolidated-filters { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(132px, .8fr)) minmax(140px, .8fr) minmax(180px, 1.3fr) minmax(132px, .75fr) minmax(96px, .55fr) auto; gap: 7px; align-items: end; }
.finance-consolidated-filters label { min-width: 0; }
.finance-consolidated-filters input, .finance-consolidated-filters select { width: 100%; min-width: 0; }
.finance-filter-actions { display: flex; gap: 5px; align-items: center; }
.finance-filter-actions > * { min-height: 34px; white-space: nowrap; }
.finance-kpi-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-bottom: 12px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--panel); }
.finance-kpi-grid-money { grid-template-columns: repeat(9, minmax(0, 1fr)); margin-bottom: 0; }
.finance-kpi-grid-volume { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.finance-kpi { min-width: 0; min-height: 82px; padding: 9px 10px; color: var(--text); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; }
.finance-kpi:hover { background: #f5faf7; }
.finance-kpi:focus-visible { position: relative; outline: 2px solid var(--accent); outline-offset: -3px; }
.finance-kpi span, .finance-kpi small { display: block; overflow-wrap: anywhere; }
.finance-kpi span { color: var(--muted); font-size: 11px; font-weight: 700; }
.finance-kpi strong { display: block; margin: 3px 0 2px; color: var(--text); font: 700 16px/1.2 Bahnschrift, "Segoe UI", sans-serif; overflow-wrap: anywhere; white-space: normal; }
.finance-kpi small { font-size: 10px; line-height: 1.3; }
.finance-kpi-balance { box-shadow: inset 0 2px #3d6f92; }
.finance-kpi-alert { box-shadow: inset 0 2px var(--warning); }
.finance-quality { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 8px 10px; color: #70400d; background: #fff8e8; border-left: 3px solid var(--warning); }
.finance-quality h2 { margin: 0; font-size: 13px; }
.finance-quality p { margin: 2px 0 0; }
.finance-quality small { max-width: 620px; color: #765224; text-align: right; }
.finance-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-bottom: 16px; }
.finance-chart-panel { min-width: 0; padding-top: 9px; border-top: 2px solid var(--line-strong); }
.finance-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 30px; }
.finance-section-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.finance-section-head h2 { margin: 0; font-size: 15px; }
.finance-section-head span { color: var(--muted); font-size: 11px; text-align: right; }
.finance-chart-drill, .finance-sort-link, .finance-contract-link { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.finance-chart-drill { flex: 0 0 auto; font-size: 11px; }
.finance-chart-drill:hover, .finance-sort-link:hover, .finance-contract-link:hover { text-decoration: underline; }
.finance-chart-canvas { display: block; }
.finance-chart-frame { width: 100%; min-height: 210px; aspect-ratio: 8 / 3; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.finance-chart-svg { display: block; width: 100%; height: 100%; min-height: 210px; }
.finance-chart-gridline { stroke: #e5e5e1; stroke-width: 1; }
.finance-chart-zero-axis { stroke: #777d79; stroke-width: 1.25; stroke-dasharray: 3 3; }
.finance-chart-point { cursor: pointer; }
.finance-chart-point:hover rect, .finance-chart-point:hover circle { opacity: .82; }
.finance-chart-point:focus { outline: none; }
.finance-chart-point:focus rect, .finance-chart-point:focus circle { stroke: #15573f; stroke-width: 3; }
.finance-chart-axis { fill: #676b69; font: 11px "Microsoft YaHei UI", sans-serif; }
.finance-chart-label { fill: #343735; font: 11px "Microsoft YaHei UI", sans-serif; }
.finance-chart-value { fill: #565a57; font: 10px Bahnschrift, "Segoe UI", sans-serif; }
.finance-chart-zero { display: grid; place-items: center; min-height: 210px; margin: 0; color: var(--muted); }
.finance-chart-table { margin-top: 5px; }
.finance-chart-table summary { width: fit-content; color: var(--accent-dark); cursor: pointer; font-size: 11px; font-weight: 700; }
.finance-chart-table table { min-width: 640px; margin-top: 5px; font-size: 11px; }
.finance-metric-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 34px; margin: 3px 0 5px; border: 1px solid var(--line); }
.finance-metric-switch button { min-width: 0; min-height: 32px; padding: 4px 6px; color: var(--muted); background: #fff; border: 0; border-right: 1px solid var(--line); border-radius: 0; font-size: 11px; white-space: normal; }
.finance-metric-switch button:last-child { border-right: 0; }
.finance-metric-switch button[aria-checked="true"] { color: #15573f; background: #eaf5ef; box-shadow: inset 0 -2px var(--accent); }
.finance-metric-switch button:focus-visible { position: relative; outline: 2px solid var(--accent); outline-offset: -3px; }
.finance-dimensions { padding-top: 9px; border-top: 2px solid var(--line-strong); }
.finance-tabs { display: flex; min-height: 39px; margin-top: 7px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.finance-tabs button { flex: 0 0 auto; min-width: 94px; min-height: 38px; padding: 7px 12px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.finance-tabs button[aria-selected="true"] { color: var(--accent-dark); background: var(--accent-soft); border-bottom-color: var(--accent); }
.finance-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.finance-tab-panel { min-height: 180px; padding-top: 8px; }
.finance-tab-panel table { min-width: 940px; }
.finance-tab-panel td > strong, .finance-tab-panel td > small { display: block; }
.finance-contract-link strong, .finance-contract-link small { display: block; }
.finance-contract-link small { color: var(--muted); font-weight: 400; }
.finance-sort-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.finance-tab-panel form { margin: 0; }
.finance-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); }
.finance-pagination div { display: flex; gap: 5px; }
.finance-pagination button { min-height: 30px; padding: 4px 9px; }

@media (max-width: 1600px) {
  .finance-consolidated-filters { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
}

@media (max-width: 1240px) {
  .finance-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .finance-page-head { align-items: stretch; flex-direction: column; }
  .finance-page-head .button { width: 100%; }
  .finance-filter-band { padding: 9px 0; }
  .finance-consolidated-filters { grid-template-columns: 1fr; }
  .finance-filter-actions > * { flex: 1; }
  .finance-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-kpi { min-height: 86px; }
  .finance-kpi strong { font-size: 16px; }
  .finance-quality { align-items: flex-start; flex-direction: column; gap: 5px; }
  .finance-quality small { text-align: left; }
  .finance-chart-grid { grid-template-columns: 1fr; }
  .finance-chart-frame, .finance-chart-svg { min-height: 190px; }
  .finance-section-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .finance-section-head span { text-align: left; }
  .finance-tabs button { min-width: 86px; }
  .finance-pagination { align-items: stretch; flex-direction: column; }
  .finance-pagination div, .finance-pagination button { width: 100%; }
}
.module-statistics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.module-statistic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--border, #d8dee4);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.module-statistic:hover,
.module-statistic:focus-visible {
  border-color: var(--accent, #167653);
  background: var(--accent-soft, #edf7f2);
}

.module-statistic.active {
  border-color: var(--accent, #167653);
  background: var(--accent-soft, #edf7f2);
  box-shadow: inset 3px 0 0 var(--accent, #167653);
}

.module-statistic span {
  color: var(--muted, #59636e);
  font-size: 13px;
}

.module-statistic strong {
  color: var(--ink, #172b3f);
  font-size: 20px;
}

.text-combobox { position: relative; min-width: 0; max-width: 100%; }
.text-combobox > [data-text-combobox] { width: 100%; min-width: 0; }
.text-combobox__menu { position: absolute; z-index: 40; top: calc(100% + 2px); left: 0; width: 100%; max-width: 100%; max-height: 220px; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 8px 20px rgba(24, 36, 31, .12); }
.text-combobox__option { display: block; width: 100%; min-width: 0; min-height: 32px; padding: 6px 9px; box-sizing: border-box; overflow-wrap: anywhere; color: var(--text); background: var(--panel); border-bottom: 1px solid var(--line); cursor: pointer; }
.text-combobox__option:hover,
.text-combobox__option[aria-selected="true"] { background: var(--accent-soft); }
.text-combobox__option:focus-visible { position: relative; outline: 2px solid var(--accent); outline-offset: -2px; }
.text-combobox__new-hint { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--accent-dark); }
.select-combobox { position: relative; width: 100%; min-width: 0; }
.select-combobox__source { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.select-combobox__input { width: 100%; min-width: 0; padding-right: 26px; }
.select-combobox__input::-webkit-search-cancel-button { cursor: pointer; }
.select-combobox__menu { position: fixed; z-index: 45; min-width: 0; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 8px 20px rgba(24, 36, 31, .12); }
.select-combobox__option, .select-combobox__empty { min-height: 32px; padding: 6px 9px; box-sizing: border-box; overflow-wrap: anywhere; color: var(--text); background: var(--panel); border-bottom: 1px solid var(--line); }
.select-combobox__option { cursor: pointer; }
.select-combobox__option input[type="checkbox"] { width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: -3px; }
.select-combobox__menu--material .select-combobox__option { display: flex; align-items: center; white-space: nowrap; }
.select-combobox__menu--material .select-combobox__option input[type="checkbox"] { flex: 0 0 16px; }
.select-combobox__menu--material .select-combobox__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-combobox__option:hover, .select-combobox__option.is-active, .select-combobox__option[aria-selected="true"] { background: var(--accent-soft); }
.select-combobox__empty { color: var(--muted); }
.select-combobox__multi-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 9px; background: var(--panel); border-top: 1px solid var(--line-strong); }
.select-combobox__multi-footer span { color: var(--muted); white-space: nowrap; }
.select-combobox__multi-footer .button { margin: 0; white-space: nowrap; }

@media (max-width: 640px) {
  .module-statistics {
    grid-template-columns: 1fr;
  }
}

.workflow-status {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  padding: 7px 10px;
  overflow: hidden;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow-status__steps,
.workflow-status__summary,
.workflow-status__steps ol {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.workflow-status__steps ol {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.workflow-status__step {
  min-width: 0;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-subtle);
  border-left: 2px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.workflow-status__step.is-completed {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.workflow-status__step.is-current {
  color: #fff;
  background: var(--accent);
  border-left-color: var(--accent-dark);
}

.workflow-status__step.is-exception {
  color: var(--danger);
  background: #fef0ed;
  border-left-color: var(--danger);
}

.workflow-status__step.is-cancelled {
  color: var(--muted);
  text-decoration: line-through;
}

.workflow-status__business-state {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.workflow-status__summary {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.workflow-status__summary > span,
.workflow-status__summary > a,
.workflow-status__summary > small {
  min-width: 0;
}

.workflow-status__summary strong {
  color: var(--text);
}

.workflow-status__summary > a {
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
}

.workflow-status__summary > small {
  color: var(--warning);
}

.workflow-status > details {
  font-size: 12px;
}

.workflow-status > details > summary {
  width: max-content;
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
}

.workflow-status > details ol {
  display: grid;
  gap: 3px;
  margin: 5px 0 0;
  padding-left: 20px;
}

.workflow-status > details li {
  display: flex;
  min-width: 0;
  gap: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.workflow-status > details li span {
  color: var(--text);
}

.workflow-status > details li small {
  margin-left: auto;
  white-space: nowrap;
}

.workflow-tracker-filters {
  min-width: 0;
  flex: 1 1 620px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workflow-tracker-filters input,
.workflow-tracker-filters select {
  width: 130px;
  min-width: 0;
}

.workflow-list-summary {
  min-width: 0;
  margin: 0 0 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.workflow-list-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}

.workflow-list-summary__head h2 {
  margin: 0;
  font-size: 14px;
}

.workflow-list-summary__head a {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.workflow-list-summary table {
  min-width: 760px;
  margin: 0;
}

.workflow-list-summary th,
.workflow-list-summary td {
  padding-top: 5px;
  padding-bottom: 5px;
}

.workflow-list-summary td strong,
.workflow-list-summary td small {
  display: block;
  max-width: 360px;
  overflow-wrap: anywhere;
}

.workflow-list-summary td small {
  margin-top: 2px;
  color: var(--muted);
}

.workflow-list-summary__empty {
  margin: 0;
  padding: 8px 10px;
}

@media (max-width: 720px) {
  .compact-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-status__steps,
  .workflow-status__summary,
  .workflow-status__steps ol {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .workflow-status__business-state,
  .workflow-status__summary > a {
    margin-left: 0;
  }

  .workflow-status > details li {
    flex-wrap: wrap;
  }

  .workflow-status > details li small {
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }

  .workflow-tracker-filters {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    width: 100%;
  }

  .workflow-tracker-filters input,
  .workflow-tracker-filters select {
    width: 100%;
  }

  .workflow-tracker-filters button {
    grid-column: 2;
    justify-self: start;
  }
}

/* Sidebar labels share the global theme and do not introduce nested toggles. */
.sidebar .nav-subheading{padding:10px 10px 3px;color:var(--muted);font-size:11px;line-height:16px;font-weight:600;}

/* Contract workflow modules summarize read-only source facts; arrows do not block parallel work. */
.workflow-status--contract .workflow-contract-stages { flex-wrap:wrap; gap:20px; overflow:visible; }
.workflow-status--contract .workflow-contract-stage { position:relative; min-width:0; list-style:none; color:var(--muted); background:var(--surface-subtle); border:1px solid var(--line); border-radius:4px; }
.workflow-status--contract .workflow-contract-stage + .workflow-contract-stage::before { content:"→"; position:absolute; right:calc(100% + 5px); top:50%; transform:translateY(-50%); color:var(--muted); }
.workflow-status--contract .workflow-contract-stage :is(a,.workflow-contract-stage__content) { display:inline-flex; align-items:center; gap:8px; min-height:28px; padding:0 9px; color:inherit; overflow-wrap:anywhere; }
.workflow-status--contract .workflow-contract-stage.is-incomplete { color:#922d2d; background:#fff0ee; border-color:#d69388; }
.workflow-status--contract .workflow-contract-stage.is-completed { color:#20583e; background:#e6f3e9; border-color:#91b99c; }
.workflow-status--contract .workflow-contract-stage.is-cancelled { color:var(--muted); background:var(--surface-subtle); }
.workflow-status--contract .workflow-contract-stage.is-empty { padding:4px 8px; }
.workflow-status--contract .workflow-contract-stage a:focus-visible { outline:2px solid var(--focus-ring,var(--accent)); outline-offset:3px; }
@media (max-width:820px) {
  .workflow-status--contract .workflow-contract-stages { gap:18px; }
  .workflow-status--contract .workflow-contract-stage :is(a,.workflow-contract-stage__content) { min-height:44px; }
}
