﻿/* ============================================================
   预算填报系统 · 样式
   ============================================================ */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e8ef;
  --line-2: #eef2f7;
  --bg: #f4f6fa;
  --card: #ffffff;
  --brand: #1d4ed8;
  --brand-dk: #1e3a8a;
  --brand-lt: #eff4ff;
  --green: #047857;
  --green-lt: #ecfdf5;
  --amber: #b45309;
  --amber-lt: #fffbeb;
  --red: #b91c1c;
  --red-lt: #fef2f2;
  --gray: #64748b;
  --gray-lt: #f1f5f9;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --radius: 12px;
  --cjk: "仿宋", "FangSong", "STFangsong", "仿宋_GB2312", "FangSong_GB2312", serif;
  --num: "Times New Roman", Times, var(--cjk);
  --mono: "Times New Roman", Times, var(--cjk);
  --font-main: "Times New Roman", "仿宋", "FangSong", "STFangsong", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .01em; }
p { margin: 0; }

/* ============================== 登录 ============================== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 12% -10%, #dbe6ff 0%, rgba(219, 230, 255, 0) 60%),
    radial-gradient(900px 500px at 100% 0%, #e3f5f0 0%, rgba(227, 245, 240, 0) 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 404px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 34px 26px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .04);
}

.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.brand h1 { font-size: 20px; }
.brand p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.logo {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, #2a4fbf, #1e3a8a);
  color: #fff; font-weight: 700; font-size: 21px;
  box-shadow: 0 4px 12px rgba(30, 58, 138, .28);
}
.logo.sm { width: 34px; height: 34px; font-size: 16px; border-radius: 9px; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  font-weight: 600; margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fcfdff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.7; }
.hint.error { color: var(--red); font-weight: 600; }

/* ============================== 按钮 ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, .22);
}
.btn.primary:hover { background: #1a44c0; border-color: #1a44c0; }
.btn.danger { color: var(--red); border-color: #f3c9c9; background: #fff; }
.btn.danger:hover { background: var(--red-lt); border-color: #eba9a9; }
.btn.warn { color: var(--amber); border-color: #f0dcb4; background: #fff; }
.btn.warn:hover { background: var(--amber-lt); }
.btn.ok { color: var(--green); border-color: #bfe6d5; background: #fff; }
.btn.ok:hover { background: var(--green-lt); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-lt); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; padding: 11px; font-size: 14.5px; margin-top: 6px; }
.btn[data-act]:hover { cursor: pointer; }

/* ============================== 顶栏 ============================== */
.topbar {
  height: 58px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand-sm { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-text { min-width: 0; }
.company { font-size: 14px; font-weight: 700; line-height: 1.25; }
.sys { font-size: 12px; color: var(--muted); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--ink-2); font-weight: 600; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  background: var(--gray-lt); color: var(--gray);
  border: 1px solid transparent;
}
.pill.open { background: var(--green-lt); color: var(--green); border-color: #bbf7d0; }
.pill.open::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 1.8s infinite; }
.pill.paused { background: var(--amber-lt); color: var(--amber); border-color: #fde68a; }
.pill.closed { background: var(--gray-lt); color: var(--gray); border-color: #e2e8f0; }
.pill.draft { background: #eff6ff; color: #1e40af; border-color: #dbeafe; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(1.35); }
}

/* ============================== 选项卡 ============================== */
.tabs {
  display: flex; gap: 2px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 58px; z-index: 39;
  overflow-x: auto;
}
.tab {
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ============================== 页面 ============================== */
main { padding: 22px 24px 60px; max-width: 1480px; margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 1080px; margin: 0 auto; width: 100%; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.card-head h2 { font-size: 15.5px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 0; }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ============================== 提示条 ============================== */
.banner {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff;
  font-size: 13.5px;
}
.banner .ico {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--gray); margin-top: 1px;
}
.banner strong { font-weight: 700; }
.banner .txt { color: var(--ink-2); }
.banner.editable { background: var(--green-lt); border-color: #bbf7d0; }
.banner.editable .ico { background: var(--green); }
.banner.paused, .banner.locked { background: var(--amber-lt); border-color: #fde68a; }
.banner.paused .ico, .banner.locked .ico { background: var(--amber); }
.banner.closed, .banner.draft { background: var(--gray-lt); border-color: #e2e8f0; }
.banner.submitted { background: var(--brand-lt); border-color: #dbeafe; }
.banner.submitted .ico { background: var(--brand); }
.banner.error { background: var(--red-lt); border-color: #fecaca; }
.banner.error .ico { background: var(--red); }

/* ============================== KPI ============================== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 17px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .value {
  font-size: 26px; font-weight: 700; line-height: 1.25; margin-top: 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.kpi .value .unit { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.accent { background: linear-gradient(160deg, #1d4ed8, #1e3a8a); border-color: #1e3a8a; }
.kpi.accent .label, .kpi.accent .foot { color: #c7d8ff; }
.kpi.accent .value { color: #fff; }
.kpi.accent .unit { color: #c7d8ff; }

/* ============================== 表格 ============================== */
.table-wrap { overflow: auto; max-height: 68vh; }
.table-wrap.tall { max-height: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.grid thead th {
  background: #f8fafc; font-size: 12.5px; color: var(--ink-2); font-weight: 700;
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.grid tbody tr:hover { background: #fafcff; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tfoot td {
  background: #f8fafc; font-weight: 700; border-top: 2px solid var(--line);
  border-bottom: none;
}
table.grid td.mono { font-family: var(--mono); font-size: 13.8px; }
table.grid .acc-code { color: var(--muted); font-family: var(--mono); font-size: 11.5px; margin-right: 7px; }
table.grid tr.total-row td { background: #f8fafc; font-weight: 700; }

/* 分支填报输入 */
.branch-grid { border-collapse: separate; border-spacing: 0; }
.branch-grid th { padding: 9px 10px; }
.branch-grid td { padding: 5px 8px; vertical-align: middle; }
.branch-grid td.acc { font-weight: 600; padding-left: 14px; white-space: nowrap; }
.branch-grid input.num {
  width: 100%; min-width: 96px; padding: 7px 9px;
  border: 1px solid transparent; border-radius: 7px;
  background: #f8fafc; text-align: right;
  font-family: var(--mono); font-size: 14.5px; color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.branch-grid input.num:hover:not(:disabled) { border-color: #cbd5e1; background: #fff; }
.branch-grid input.num:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.branch-grid input.num::placeholder { color: #cbd5e1; }
.branch-grid input.num:disabled { color: var(--muted); background: #f1f5f9; cursor: not-allowed; }
.branch-grid input.num.changed { border-color: #fcd34d; background: #fffdf5; }
.branch-grid .row-total {
  font-family: var(--mono); font-weight: 700; color: var(--ink);
  white-space: nowrap; padding-right: 14px;
}

/* ============================== 进度 / 条形图 ============================== */
.progress {
  height: 8px; border-radius: 999px; background: #e8eef7; overflow: hidden; min-width: 90px;
}
.progress > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8); transition: width .5s ease; }
.progress.ok > i { background: linear-gradient(90deg, #34d399, #059669); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 132px 1fr 108px; gap: 12px; align-items: center; }
.bar-row .name { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 18px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #60a5fa, #1d4ed8);
  transition: width .5s ease; min-width: 2px;
}
.bar-row .val { text-align: right; font-family: var(--mono); font-size: 13.8px; font-variant-numeric: tabular-nums; }

/* ============================== 徽标 ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--gray-lt); color: var(--gray); white-space: nowrap;
}
.badge.green { background: var(--green-lt); color: var(--green); }
.badge.blue { background: var(--brand-lt); color: var(--brand); }
.badge.amber { background: var(--amber-lt); color: var(--amber); }
.badge.red { background: var(--red-lt); color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { background: var(--green); animation: pulse 1.8s infinite; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ============================== 实时指示 ============================== */
.live-ind {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--green); font-weight: 600;
  background: var(--green-lt); border: 1px solid #bbf7d0;
  padding: 3px 10px; border-radius: 999px;
}

/* ============================== 双栏 ============================== */
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: stretch; }
.cols > .card { display: flex; flex-direction: column; }
.cols > .card > .card-body { flex: 1; }
@media (max-width: 1080px) { .cols { grid-template-columns: 1fr; } }

/* ============================== 模态 ============================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .42);
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-panel {
  background: #fff; border-radius: 16px; width: min(1400px, 96vw);
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .28);
  animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-panel.narrow { width: min(440px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 13px 20px; border-top: 1px solid var(--line-2); background: #fbfcfe;
  border-radius: 0 0 16px 16px;
}
.x {
  border: none; background: none; font-size: 20px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.x:hover { background: var(--gray-lt); color: var(--ink); }

/* ============================== Toast ============================== */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; z-index: 200;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .3);
  max-width: min(560px, 90vw); text-align: center;
  animation: rise .18s ease-out;
}
.toast.error { background: #b91c1c; }
.toast.ok { background: #047857; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ============================== 表单（弹窗内） ============================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.fld label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13.5px; background: #fcfdff; color: var(--ink);
}
.fld input:focus, .fld select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}
.fld .tip { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============================== 空状态 ============================== */
.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* 页脚信息 */
.footnote { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0 0; }

/* 打印 */
@media print {
  .topbar, .tabs, .toolbar, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ============================== 阶段切换 / 月度表 ============================== */
.seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; background: #fff;
}
.seg-btn {
  border: none; background: none; padding: 5px 12px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.seg-btn:hover { background: var(--gray-lt); color: var(--ink); }
.seg-btn.on { background: var(--brand); color: #fff; }

.diff-cell.bad { color: var(--red); font-weight: 700; }
.annual-cell { color: var(--muted); }

.branch-grid.monthly { min-width: 1260px; }
.branch-grid.monthly input.num { min-width: 56px; padding: 7px 5px; font-size: 12.5px; }
.branch-grid.monthly th, .branch-grid.monthly td { padding-left: 4px; padding-right: 4px; }
.branch-grid.monthly td.acc { padding-left: 12px; }

.branch-grid th:first-child, .branch-grid td.acc {
  position: sticky; left: 0; z-index: 3; background: #fff;
}
.branch-grid thead th:first-child { background: #f8fafc; z-index: 4; }
.branch-grid tfoot td:first-child { background: #f8fafc; }

/* 总览：机构名不换行 + 科目汇总双栏 */
.org-col, .org-cell { white-space: nowrap; min-width: 116px; }
.bars.two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 34px; }
@media (max-width: 980px) { .bars.two { grid-template-columns: 1fr; } }

/* 完成度条不要拉满整格 */
table.grid .progress { max-width: 150px; }


/* 月度表：年度数做参照底色，最后一列留出内边距 */
.branch-grid td.annual-cell { background: #f8fafc; }
.branch-grid.monthly th:last-child, .branch-grid.monthly td:last-child { padding-right: 14px; }

/* 弹窗里的明细表：科目列不换行 */
.modal-body table.grid th:first-child,
.modal-body table.grid td:first-child { white-space: nowrap; }
/* ============================== 损益表填报 ============================== */
.branch-grid tr.sum-row td { background: #f7f9fc; font-weight: 700; }
.branch-grid tr.sum-row td.acc { background: #f7f9fc; }
.branch-grid tr.sum-row td.acc .acc-code { color: #94a3b8; }
.branch-grid tr.group-start td { border-top: 1px solid #dbe3ee; }
.branch-grid tr.detail-row td.acc { padding-left: 18px; }
.branch-grid td.total-cell { font-variant-numeric: tabular-nums; color: var(--ink); }
.branch-grid tfoot td { font-weight: 700; }

/* 月度 12 列 + 合计/审定/差额：保证不挤压 */
.branch-grid.monthly { min-width: 1460px; }
.branch-grid.monthly th:nth-last-child(-n+3),
.branch-grid.monthly td:nth-last-child(-n+3) { min-width: 88px; white-space: nowrap; }
.branch-grid.monthly td:last-child { padding-right: 14px; }

/* 月度表收紧：单位是元，数字长，靠小字号换宽度 */
.branch-grid.monthly { min-width: 1230px; }
.branch-grid.monthly input.num { font-size: 11.5px; min-width: 54px; padding: 6px 4px; }
.branch-grid.monthly td.acc { min-width: 150px; max-width: 170px; }
.branch-grid.monthly th:nth-last-child(-n+2),
.branch-grid.monthly td:nth-last-child(-n+2) { min-width: 96px; white-space: nowrap; }

.branch-grid.monthly td.acc { min-width: 146px; max-width: 160px; }
.branch-grid.monthly input.num { padding: 6px 2px; font-size: 11px; }



/* 条线页签 */
.tabs-inline {
  display: flex; gap: 6px; padding: 2px 20px 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-2); background: #fff;
}
.gtab {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; font-family: inherit;
}
.gtab:hover { background: var(--gray-lt); }
.gtab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.gtab .dotf {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; margin-left: 6px; vertical-align: middle;
}
.gtab.on .dotf { background: #bbf7d0; }

.branch-grid:not(.monthly) th:last-child,
.branch-grid:not(.monthly) td:last-child { width: 300px; }


/* 面包屑 / 下钻 */
.crumb-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  border-bottom: 1px solid var(--line-2); background: #fbfcfe; flex-wrap: wrap;
}
.crumb-cur { font-weight: 700; font-size: 13px; }
.crumb-trail { font-size: 13px; color: var(--ink-2); }
.drill-mark { color: var(--brand); font-weight: 700; margin-left: 4px; }
.branch-grid tr.drillable:hover td { background: #eff4ff; }
.branch-grid tr.drillable:hover td.acc { background: #eff4ff; }
.branch-grid tr.lv1 td { background: #eef2f8; font-weight: 700; }
.branch-grid tr.lv1 td.acc { background: #eef2f8; }


/* 单位设置 */
.unit-row { display: flex; gap: 8px; flex-wrap: wrap; }
.unit-opt {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff;
}
.unit-opt input { accent-color: var(--brand); }
.unit-opt.on { border-color: var(--brand); background: var(--brand-lt); color: var(--brand); }

.err-list { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.9; color: var(--red); max-height: 40vh; overflow: auto; }


/* Excel 式页签 */
.crumb-bar {
  display: flex; align-items: flex-end; gap: 6px; padding: 10px 20px 0;
  border-bottom: 2px solid var(--brand); background: #f7f9fd; overflow-x: auto;
}
.stab {
  padding: 7px 14px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0; background: #eef2f8; color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  white-space: nowrap; margin-bottom: -2px;
}
.stab:hover { background: #e3eaf6; }
.stab.on { background: #fff; color: var(--brand); border-color: var(--brand); }
.stab .dotf {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; margin-left: 6px; vertical-align: middle;
}

/* 输入开关 */
.switch {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #f1f4f9;
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.switch .knob {
  width: 18px; height: 18px; border-radius: 50%; background: #c7d0de;
  transition: all .15s; margin-left: 2px;
}
.switch.on { background: #e7f7ee; border-color: #9fd9b6; color: #11693c; }
.switch.on .knob { background: #22c55e; margin-left: 14px; }
.switch[disabled] { opacity: .65; cursor: default; }
.switch-summary { padding: 10px 20px 4px; font-size: 12.5px; color: var(--ink-2); }
.cell-name { font-weight: 600; font-size: 13px; }
.cell-code { font-size: 11.5px; color: var(--muted); margin-top: 2px; }


/* 筛选条 */
.filter-bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  border-bottom: 1px solid var(--line-2); background: #fbfcfe; flex-wrap: wrap;
}
.filter-bar input.flt {
  width: 220px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: 12.5px; outline: none;
}
.filter-bar input.flt:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,56,100,.08); }
.filter-bar .flt-chk {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; font-weight: 600;
}
.filter-bar .flt-chk input { accent-color: var(--brand); }
.filter-bar .flt-count { margin-left: auto; }


/* 筛选条 */
.filter-bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  border-bottom: 1px solid var(--line-2); background: #fbfcfe; flex-wrap: wrap;
}
.filter-bar input.flt {
  width: 220px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: 12.5px; outline: none;
}
.filter-bar input.flt:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,56,100,.08); }
.filter-bar .flt-chk {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; font-weight: 600;
}
.filter-bar .flt-chk input { accent-color: var(--brand); }
.filter-bar .flt-count { margin-left: auto; }


/* 未填项（极淡黄，只提示不打扰） */
.branch-grid input.num.empty-mark {
  background: #FFFDF2; border-color: #F5EDD6;
}
.branch-grid input.num.empty-mark::placeholder { color: #C9B98A; }
.mark-hint {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: #8A6D1F; background: #FFFDF2; border: 1px solid #F5EDD6;
  border-radius: 8px; padding: 4px 10px;
}


/* 单元格三态：白=未处理 绿=已填 黄=提交检查时仍空 */
.branch-grid input.num { background: #fff; border-color: #E4EAF2; }
.branch-grid input.num.filled { background: #F1FBF4; border-color: #CFEBD9; }
.branch-grid input.num.empty-mark { background: #FFF9E6; border-color: #F3DFA0; }
.branch-grid input.num.filled:focus { border-color: #22c55e; }
.branch-grid input.num.empty-mark:focus { border-color: #D9A93A; }

/* 分组折叠头 */
.branch-grid tr.grp td {
  background: #F3F6FB; font-weight: 700; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; user-select: none; border-top: 1px solid var(--line);
}
.branch-grid tr.grp:hover td { background: #E9EFF9; }
.branch-grid tr.grp .caret { display: inline-block; width: 14px; color: var(--brand); }
.branch-grid tr.grp .gsum { float: right; font-variant-numeric: tabular-nums; color: var(--ink); }


/* 视图切换 */
.view-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.view-seg button {
  padding: 6px 14px; border: none; background: #fff; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.view-seg button + button { border-left: 1px solid var(--line); }
.view-seg button.on { background: var(--brand); color: #fff; }
.view-seg button:hover:not(.on) { background: var(--gray-lt); }


/* 返回汇总表 */
.stab.back {
  background: #fff; color: var(--brand); border-color: var(--brand);
  font-weight: 700; margin-right: 6px;
}
.stab.back:hover { background: var(--brand-lt); }
.drill-mark { color: var(--brand); font-weight: 600; font-size: 11.5px; margin-left: 6px; }

/* 轮次分布条 */
.ver-bar-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.ver-bar-lab { width: 150px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ver-bar-track { flex: 1; height: 14px; background: #eef2f8; border-radius: 7px; overflow: hidden; }
.ver-bar-fill { height: 100%; background: linear-gradient(90deg, #2a4f9e, #4b7bec); border-radius: 7px; }
.ver-bar-num { width: 130px; text-align: right; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.branch-grid tr.sel td, table.grid tr.sel td { background: #eef4ff; }


/* ============================================================
   预算看板 · 简洁商务
   ============================================================ */
.dash .card {
  border: 1px solid #eef1f6;
  box-shadow: none;
  border-radius: 10px;
  padding: 14px 16px 12px;
}
.dash .card h3 { font-size: 14px; font-weight: 700; letter-spacing: .03em; color: #1e3a8a; }
.dash .filter-bar {
  background: #fff; border: 1px solid #eef1f6; border-radius: 10px;
  padding: 10px 14px; box-shadow: none;
}
.dash .flt {
  border: 1px solid #e4e9f2; border-radius: 7px; background: #fff;
  font-size: 13px; padding: 5px 8px; color: #344054;
}
.dash .chip-b {
  display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px;
  border: 1px solid #e4e9f2; color: #98a2b3; background: #fff; cursor: pointer;
}
.dash .chip-b.on { background: #eef3fb; border-color: #cfdbef; color: #1e3a8a; font-weight: 700; }
.dash table.grid th {
  background: #fafbfd; color: #667085; font-weight: 700; font-size: 12.5px;
  border-bottom: 1px solid #eef1f6;
}
.dash table.grid td { border-bottom: 1px solid #f4f6fa; font-size: 13.5px; }
.dash table.grid tr.sum-row td { background: #fbfcfe; }
.dash .dash-handle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 22px; margin-top: 8px; color: #b0b8c6; font-size: 11px;
  border-top: 1px dashed #e8ecf4; cursor: ns-resize; user-select: none;
}
.dash .dash-handle:hover { color: #1e3a8a; }

/* 填写页右侧：参照实际数列 */
table.grid th.act-col {
  background: #f7f9fd; color: #667085; border-left: 1px solid #e7ecf5;
  font-weight: 700;
}
table.grid td.act-col {
  background: #fafbfe; color: #475467; border-left: 1px solid #eef2f8;
}
table.grid tr.sum-row td.act-col { background: #f4f7fc; color: #1e3a8a; font-weight: 700; }
table.grid td.act-col.muted { color: #b9c0cc; }

/* 禁止编制 / 口径提示 */
table.grid input.num.locked,
table.grid input.num:disabled.title-locked { background: #f3f4f6; color: #9aa3b2; cursor: not-allowed; }
.lock-mark { font-size: 11px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }
.tip-mark { font-size: 11px; color: #1d4ed8; background: #eff4ff; border: 1px solid #c7d7fb;
  border-radius: 8px; padding: 0 6px; margin-left: 6px; cursor: help; white-space: nowrap; }

/* 月度分解：冻结与差异行 */
table.grid tr.frozen-row td { background: #f5f6f8 !important; }
table.grid tr.frozen-row input.num { background: #eceef2; color: #98a2b3; }
table.grid tr.row-bad > td { background: #fff1f0; }
table.grid tr.row-bad > td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
table.grid tr.row-bad .diff-cell.bad { color: #b91c1c; font-weight: 700; }

/* 费用附表 */
.annex-cell { background: #f7f9fd; cursor: pointer; white-space: nowrap; }
.annex-cell:hover { background: #eef3fb; }
.chip-annex { display: inline-block; font-size: 11px; padding: 1px 7px; margin-right: 8px;
  border-radius: 9px; background: #e6edfb; color: #1e3a8a; }
.annex-grid td.idx, .annex-grid td.ops { text-align: center; color: #8b93a3; }
.annex-grid td.calc-cell { background: #f1f3f7; color: #48566d; font-variant-numeric: tabular-nums; }
.annex-grid .sum-row td { background: #f8fafd; font-weight: 700; }
.annex-grid .unit { font-weight: 400; color: #8b93a3; }
.annex-grid select { width: 100%; border: 1px solid #e2e9f5; border-radius: 6px;
  padding: 3px 4px; font-family: inherit; font-size: 12px; background: #fff; }
.annex-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.annex-acc { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip-b { font-size: 11.5px; background: #f4f7fc; border: 1px solid #e2e9f5; border-radius: 6px;
  padding: 2px 8px; color: #3b4a63; }
.annex-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.annex-card { border: 1px solid #e8ecf4; border-radius: 10px; padding: 12px 14px; background: #fff; }
.annex-card .ac-head { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; }
.annex-card .ac-ops { display: flex; gap: 8px; margin-top: 10px; }
.mini { font-size: 11.5px; border: 1px solid #e2e9f5; background: #fff; border-radius: 6px;
  padding: 2px 8px; cursor: pointer; color: #48566d; }
.mini.danger { color: #b91c1c; border-color: #f3d6d6; }

.annex-grid thead th:first-child, .annex-grid tbody td:first-child {
  position: sticky; left: 0; background: #fff; z-index: 2;
}
.annex-grid thead th:first-child { background: var(--head, #f4f7fc); }
.modal-body { overflow: auto; }
