/* ============ 费用结算系统 - 全局样式 ============ */
:root {
  --ink-strong: #12201e;
  --ink: #263634;
  --ink-soft: #5c6f6c;
  --ink-faint: #8fa3a0;
  --brand: #0d3b39;
  --brand-deep: #082b29;
  --brand-soft: #e3efec;
  --accent: #e08a2e;
  --accent-soft: #fbeedb;
  --bg: #f2f5f4;
  --panel: #ffffff;
  --line: #e2e9e7;
  --ok: #1c7c54;
  --ok-soft: #e4f3ec;
  --warn: #b7791f;
  --warn-soft: #fdf3dc;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(13, 59, 57, 0.08), 0 6px 20px rgba(13, 59, 57, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
body.modal-open { overflow: hidden; }

.app-shell { display: flex; min-height: 100vh; }

/* ============ 侧栏 ============ */
.sidebar {
  width: 236px; flex: 0 0 236px;
  background: linear-gradient(180deg, #0d3b39 0%, #0a322f 100%);
  color: #dce9e6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; color: #fff; font-size: 16px; letter-spacing: 0.5px; }
.brand span { display: block; color: #9fc0bb; font-size: 12px; margin-top: 1px; }

.nav-list { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-group-title {
  display: block; font-size: 11px; letter-spacing: 1.2px;
  color: #7fa39d; padding: 0 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: #c6d9d5; font-size: 13.5px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  text-align: left; margin: 1px 0; transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ============ 工作区 ============ */
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.page-heading p { margin: 0; font-size: 12px; color: var(--ink-faint); }
.page-heading h1 { margin: 0; font-size: 18px; color: var(--ink-strong); }
.icon-button {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.icon-button:hover { background: var(--brand-soft); }
.mobile-menu { display: none; }
.content { padding: 22px 24px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ============ 概览 ============ */
.hero-panel {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: linear-gradient(120deg, #0d3b39, #15534f);
  color: #fff; border-radius: var(--radius); padding: 22px 26px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.hero-panel .eyebrow { color: #8fc4ba; font-size: 12px; letter-spacing: 1px; }
.hero-panel h2 { margin: 6px 0 4px; font-size: 22px; }
.hero-panel p { margin: 0; color: #c3ddd8; font-size: 13px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .button { background: var(--accent); color: #fff; border: 0; }
.hero-actions .button:hover { background: #cb7c20; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.metric-card > span { font-size: 12.5px; color: var(--ink-soft); }
.metric-card strong { display: block; font-size: 24px; color: var(--ink-strong); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.metric-card small { color: var(--ink-faint); }
.metric-card.accent { background: var(--brand); border-color: var(--brand); color: #fff; }
.metric-card.accent > span { color: #9fc0bb; }
.metric-card.accent strong { color: #fff; }
.metric-card.accent small { color: #9fc0bb; }

.dashboard-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.eyebrow { font-size: 11.5px; letter-spacing: 1px; color: var(--ink-faint); text-transform: uppercase; display: block; }
.panel-heading h3 { margin: 4px 0 0; font-size: 16px; color: var(--ink-strong); }
.status-chip { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.status-chip.muted { background: #eef1f0; color: var(--ink-soft); }
.status-chip.success { background: var(--ok-soft); color: var(--ok); }
.status-chip.warn { background: var(--warn-soft); color: var(--warn); }
.status-chip.danger { background: var(--danger-soft); color: var(--danger); }

.process-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.process-list li:last-child { border-bottom: 0; }
.step-number {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.process-list li.done .step-number { background: var(--ok); color: #fff; }
.process-list strong { display: block; font-size: 13.5px; color: var(--ink-strong); }
.process-list small { color: var(--ink-soft); }
.process-list .nav-icon { margin-left: auto; color: var(--ink-faint); }
.empty-visual { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.empty-visual .nav-icon { width: 22px; height: 22px; }

/* ============ 按钮 ============ */
.button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button .nav-icon { width: 15px; height: 15px; }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--brand-deep); }
.button-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.button-secondary:hover:not(:disabled) { background: var(--brand-soft); }
.button-quiet { background: none; color: var(--ink); border-color: var(--line); }
.button-quiet:hover:not(:disabled) { background: var(--brand-soft); }
.button-danger-quiet { background: none; color: var(--danger); border-color: #f0c4bd; }
.button-danger-quiet:hover:not(:disabled) { background: var(--danger-soft); }
.button-small { padding: 5px 10px; font-size: 12px; }
.button-block { width: 100%; justify-content: center; }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field > span { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 13.5px; font-family: inherit; color: var(--ink-strong); background: #fff;
  width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,59,57,0.12);
}
.form-field input[readonly] { background: #f4f7f6; color: var(--ink-soft); }
.form-hint { font-size: 12px; color: var(--ink-faint); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.checkbox-card {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px;
  background: #fff; transition: border-color 0.15s, background 0.15s;
}
.checkbox-card:hover { border-color: var(--brand); }
.checkbox-card input { accent-color: var(--brand); }
.checkbox-card.checked { background: var(--brand-soft); border-color: var(--brand); }

/* ============ 月份多选 chips ============ */
.month-chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 36px; }
.month-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 12.5px;
  background: #fff; transition: border-color 0.15s, background 0.15s;
}
.month-chip:hover { border-color: var(--brand); }
.month-chip input { accent-color: var(--brand); margin: 0; }
.month-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ============ 工具栏 / 筛选 ============ */
.section-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-toolbar h2 { margin: 4px 0 0; font-size: 20px; color: var(--ink-strong); }
.section-toolbar p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.filter-bar {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.filter-bar .form-field { min-width: 150px; }

/* ============ 表格 ============ */
.table-wrap { overflow: auto; max-height: 66vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table th { background: #f7faf9; color: var(--ink-soft); font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 1; }
/* 冻结前 3 列（序号/身份证号/姓名）：横向滚动时保持固定 */
table.data-table.freeze-3 thead th:nth-child(-n+3),
table.data-table.freeze-3 tbody td:nth-child(-n+3) { position: sticky; left: 0; z-index: 2; background: var(--panel); }
table.data-table.freeze-3 thead th:nth-child(-n+3) { z-index: 3; background: #f7faf9; top: 0; }
table.data-table.freeze-3 thead th:nth-child(1), table.data-table.freeze-3 tbody td:nth-child(1) { min-width: 56px; max-width: 56px; }
table.data-table.freeze-3 thead th:nth-child(2), table.data-table.freeze-3 tbody td:nth-child(2) { left: 56px; min-width: 170px; max-width: 170px; }
table.data-table.freeze-3 thead th:nth-child(3), table.data-table.freeze-3 tbody td:nth-child(3) { left: 226px; min-width: 96px; max-width: 96px; }
table.data-table.freeze-3 tbody tr:hover td:nth-child(-n+3) { background: #f8fbfa; }
.data-table td.l, .data-table th.l { text-align: left; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfa; }
.data-table tfoot td { background: #f2f7f5; font-weight: 700; color: var(--ink-strong); border-top: 2px solid var(--brand); }
.data-table .num { font-variant-numeric: tabular-nums; }
.row-warn { background: var(--warn-soft); }
.row-danger { background: var(--danger-soft); }

/* ============ 客户卡片 ============ */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; }
.client-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.client-card-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.client-avatar {
  width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: 0 0 auto;
}
.client-card-top strong { display: block; font-size: 15px; color: var(--ink-strong); }
.client-card-top span { font-size: 12px; color: var(--ink-faint); }
.client-card dl { margin: 14px 0 0; display: grid; gap: 6px; }
.client-card dl > div { display: flex; justify-content: space-between; font-size: 12.5px; }
.client-card dt { color: var(--ink-soft); }
.client-card dd { margin: 0; color: var(--ink-strong); font-weight: 500; text-align: right; }
.client-details { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 6px; }
.client-details p { margin: 0; font-size: 12.5px; display: flex; justify-content: space-between; gap: 10px; }
.client-details p span { color: var(--ink-soft); }
.client-card-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ============ 数据中心 ============ */
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.import-card { border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; text-align: center; }
.import-card h3 { margin: 8px 0 2px; font-size: 15px; color: var(--ink-strong); }
.import-card p { margin: 0 0 12px; font-size: 12.5px; color: var(--ink-soft); }
.import-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto; }
.import-icon .nav-icon { width: 20px; height: 20px; }
.import-card input[type="file"] { display: none; }
.import-card label.upload-label { cursor: pointer; }

.batch-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px;
}
.batch-item .batch-kind {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.kind-payroll { background: #3a7ca5; }
.kind-social { background: #1c7c54; }
.kind-fund { background: #b7791f; }
.batch-item .batch-meta { flex: 1; min-width: 0; }
.batch-item .batch-meta strong { display: block; font-size: 13.5px; color: var(--ink-strong); }
.batch-item .batch-meta span { font-size: 12px; color: var(--ink-faint); }
.batch-status { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

/* ============ 通知书/单据 ============ */
.notice-doc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 20px; box-shadow: var(--shadow); }
.notice-doc h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: 6px; text-align: center; color: var(--ink-strong); }
.notice-doc .notice-sub { text-align: center; color: var(--ink-soft); font-size: 12.5px; margin-bottom: 12px; }
.notice-doc .notice-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 10px; flex-wrap: wrap; }
.notice-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.notice-total-card { background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; }
.notice-total-card span { display: block; font-size: 11.5px; color: var(--ink-soft); }
.notice-total-card strong { font-size: 17px; color: var(--brand); font-variant-numeric: tabular-nums; }
.notice-total-card.highlight { background: var(--accent-soft); }
.notice-total-card.highlight strong { color: #9a6418; }
/* 付款通知书 / 归档详情表格：深青表头白字、合计与说明行浅黄 */
.notice-doc table.data-table thead th { background: var(--brand); color: #fff; font-weight: 700; }
.notice-doc table.data-table.freeze-3 thead th:nth-child(-n+3) { background: var(--brand); color: #fff; }
.notice-doc table.data-table tfoot td { background: #fdf6e3; }
.notice-doc .notice-footnote { margin-top: 10px; font-size: 12px; color: var(--ink-soft); background: #fdf6e3; border: 1px solid #ecd9a8; border-radius: 8px; padding: 8px 12px; }
/* 汇总报表：深青表头、浅黄合计行 */
table.data-table.report-table thead th { background: var(--brand); color: #fff; font-weight: 700; }
table.data-table.report-table tfoot td { background: #fdf6e3; }

/* ============ 计算器 ============ */
.calculator-feature { margin-bottom: 16px; }
.calculator-feature-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.calculator-feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.calculator-feature-icon .nav-icon { width: 22px; height: 22px; }
.calculator-feature-heading h3 { margin: 0; font-size: 17px; color: var(--ink-strong); }
.calculator-feature-heading p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.calculator-columns { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .calculator-columns { grid-template-columns: 1fr; } }
.calculator-input-panel { display: grid; gap: 14px; }
.calculator-input-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.calculator-result-area {
  background: #f7faf9; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
}
.calculator-result-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.calculator-result-total span { color: var(--ink-soft); font-size: 13px; }
.calculator-result-total strong { font-size: 26px; color: var(--brand); font-variant-numeric: tabular-nums; }
.calculator-result-total small { display: block; color: var(--ink-faint); font-size: 12px; }
.calculator-formula-line { font-size: 13px; color: var(--ink-soft); background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-variant-numeric: tabular-nums; }
.calculator-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.calculator-result-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.calculator-result-card span { display: block; font-size: 11.5px; color: var(--ink-soft); }
.calculator-result-card strong { font-size: 17px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.calculator-result-card small { color: var(--ink-faint); font-size: 11.5px; }
.calculator-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calculator-actions span { font-size: 12px; color: var(--ink-faint); }
.calculator-rules { background: #f7faf9; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.calculator-rules h4 { margin: 2px 0 8px; font-size: 14px; color: var(--ink-strong); }
.calculator-rules ul { margin: 0 0 10px; padding-left: 18px; }
.calculator-rules li { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; }
.calculator-example { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-soft); }
.calculator-example strong { color: var(--ink-strong); }
.inline-alert { display: flex; gap: 8px; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.inline-alert.info { background: var(--brand-soft); color: var(--brand); }
.inline-alert.warn { background: var(--warn-soft); color: var(--warn); }
.inline-alert .nav-icon { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.inline-alert p { margin: 0; }

/* ============ 图表 ============ */
.chart-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.chart-wrap h3 { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-strong); }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .empty-visual { margin: 0 auto 12px; }
.empty-state strong { display: block; font-size: 15px; color: var(--ink-strong); margin-bottom: 4px; }
.empty-state p { margin: 0 0 14px; font-size: 13px; }

/* ============ Toast ============ */
.toast-region { position: fixed; top: 16px; right: 16px; z-index: 100; display: grid; gap: 8px; }
.toast {
  background: var(--ink-strong); color: #fff; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); max-width: 360px;
  display: flex; gap: 8px; align-items: flex-start; animation: toast-in 0.2s ease;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.toast.warn { background: #a06a12; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============ 弹窗 ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,32,30,0.5); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal {
  background: var(--panel); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 22px 24px;
}
.modal.wide { max-width: 860px; }
.modal h3 { margin: 0 0 14px; font-size: 17px; color: var(--ink-strong); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-close { float: right; }
.preview-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; }
.preview-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.preview-list table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.preview-list th, .preview-list td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.preview-list th { position: sticky; top: 0; background: #f2f7f5; z-index: 1; }

/* ============ 打印 ============ */
#print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area {
    display: block !important; position: absolute; left: 0; top: 0; width: 100%;
    font-size: 12px; color: #000;
  }
  #print-area h2 { text-align: center; letter-spacing: 4px; margin: 0 0 6px; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area th, #print-area td { border: 1px solid #000; padding: 4px 6px; font-size: 11px; text-align: right; }
  #print-area th.l, #print-area td.l { text-align: left; }
  #print-area th { background: #eee !important; -webkit-print-color-adjust: exact; }
  .print-meta { display: flex; justify-content: space-between; margin: 8px 0; }
  .print-foot { margin-top: 14px; display: flex; justify-content: space-between; }
}

/* ============ 归档列表（结算单） ============ */
.archive-list { display: flex; flex-direction: column; gap: 10px; }
.archive-batch { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.archive-batch label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); cursor: pointer; user-select: none; }
.archive-sel-count { font-size: 13px; color: var(--ink-soft); }
.archive-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.archive-check { display: grid; place-items: center; padding: 0 6px; cursor: pointer; }
.archive-check input, .archive-check-all input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.archive-item:has(.archive-check input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.archive-row {
  display: grid; grid-template-columns: 34px 118px 1.1fr 2.2fr 84px 130px 22px; gap: 10px; align-items: center;
  width: 100%; padding: 13px 16px; border: 0; background: transparent; cursor: pointer; text-align: left;
  font-size: 13.5px; color: var(--ink); transition: background 0.15s;
}
.archive-row:hover { background: var(--brand-soft); }
.archive-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-date { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.archive-unit { font-weight: 600; color: var(--ink-strong); }
.archive-name { color: var(--ink); }
.archive-count { color: var(--ink-soft); text-align: right; }
.archive-total { font-weight: 700; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.archive-caret { display: grid; place-items: center; color: var(--ink-faint); transition: transform 0.18s; }
.archive-item.open .archive-caret { transform: rotate(180deg); }
.archive-detail { border-top: 1px solid var(--line); padding: 16px; background: #fafcfb; }
.archive-detail .table-wrap { max-height: 52vh; }
.archive-actions { display: flex; gap: 10px; margin-top: 14px; }
@media (max-width: 860px) {
  .archive-row { grid-template-columns: 34px 96px 1fr 22px; }
  .archive-name { grid-column: 3; grid-row: 2; }
  .archive-count, .archive-total { display: none; }
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .content { padding: 16px; }
}
