/* 全站样式：只用本地资源，不内联（CSP 不允许内联样式）。
   版式参照答题系统后台：大圆角白卡片、淡描边、深色粗标题、灰蓝正文、更浅的辅助信息、右侧大号指标。 */
:root {
  --brand: #2c5ed7;
  --brand-soft: #edf3ff;
  --text: #233047;
  --muted: #66758b;
  --line: #e2e8f1;
  --text-2: #4a5468;
  --muted-2: #78859a;
  --line-strong: #d7deea;
  --surface: #ffffff;
  --table-stripe: #f1f2f4;
  --page: #f3f6fb;
  --nav: #172a48;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --success: #067647;
  --success-soft: #e7f6ec;
  --warning: #b54708;
  --warning-soft: #fff4e5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(31, 52, 88, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.4; margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid #b8ccfa; outline-offset: 2px; }
[hidden] { display: none !important; }

/* 按钮与表单 */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500; line-height: 1.4; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.button:hover { border-color: #bccbe0; background: #f8faff; }
.button:disabled { opacity: .55; cursor: default; }
.button-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(36, 89, 224, .65); }
.button-primary:hover { background: #214fc2; border-color: #214fc2; }
.button-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button-danger:hover { background: #b42318; border-color: #b42318; }
.button-small { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.button-text { border: 0; background: none; color: var(--brand); padding: 5px 6px; min-height: 32px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; min-width: 0; }
.field > span { font-size: 13px; color: #47566c; font-weight: 500; }
.field input[type="text"], .field input[type="search"], .field input[type="datetime-local"], .field select, .field textarea, .toolbar select, .toolbar input {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; color: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus, .toolbar select:focus, .toolbar input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .toolbar input::placeholder { color: #909caf; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.check-group { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; max-height: 220px; overflow: auto; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 8px; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

/* 登录页 */
.login-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(ellipse at 50% 0, #e6eeff, transparent 65%), var(--page); }
.login-page .login-shell { flex: 1; min-height: 0; }
.public-landing .login-card { background: transparent; border: 0; box-shadow: none; text-align: center; }
.public-landing .login-card header { justify-content: center; margin: 0; }
.public-landing .brand-mark { display: none; }
.public-landing .login-card h1 { font-size: 30px; }
.login-page .site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 16px 20px; }
.login-page .site-footer a { color: inherit; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid rgba(226, 232, 241, .85); border-radius: 20px; box-shadow: 0 12px 48px rgba(31, 52, 88, .08); padding: 32px; }
.login-card header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 600; }
.login-card h1 { font-size: 20px; }
.login-card .org { color: var(--muted); font-size: 13px; }
.login-status { min-height: 24px; margin: 8px 0 22px; color: var(--muted); line-height: 1.8; overflow-wrap: anywhere; }
.login-status.error { color: var(--danger); }
.demo-users { display: grid; gap: 8px; margin-top: 8px; }
.demo-user { display: flex; justify-content: space-between; gap: 12px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.demo-user:hover { border-color: var(--brand); }
.demo-user small { color: var(--muted); }
.demo-apps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.demo-apps a { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; color: var(--text); }
.demo-apps a.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 应用外壳 */
.app-header { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-height: 68px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-title { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 17px; font-weight: 600; }
.app-title .brand-mark { width: 34px; height: 34px; font-size: 14px; }
.app-history { display: flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 10px; background: var(--page); }
.app-history .button { width: 48px; min-width: 48px; height: 44px; padding: 6px; border: 0; box-shadow: none; color: #526b8a; background: transparent; }
.app-history .button:hover:not(:disabled) { background: #e6efff; color: var(--brand); }
.app-history .button svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-user { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; font-size: 13px; color: var(--muted); }
.app-user strong { color: var(--text); font-weight: 500; }
.app-user .role { padding: 3px 9px; border-radius: 6px; background: var(--page); font-size: 12px; }
.app-body { display: grid; grid-template-columns: 204px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.app-nav { padding: 24px 14px; background: var(--nav); position: sticky; top: var(--app-header-height, 68px); align-self: start; height: calc(100vh - var(--app-header-height, 68px)); overflow-y: auto; }
.app-nav a { display: block; padding: 11px 16px; border-radius: 8px; color: #c9d5e8; text-decoration: none; margin-bottom: 5px; font-size: 14px; transition: background-color .15s, color .15s; }
.app-nav a:hover { background: #233b5f; color: #fff; }
.app-nav a.active { background: #2b4e81; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #76a7ff; }
.app-nav .nav-group { margin: 22px 16px 9px; font-size: 11px; font-weight: 500; color: #95a9c5; letter-spacing: .06em; }
.app-nav .nav-group:first-child { margin-top: 0; }
.app-main { padding: 30px 32px 40px; min-width: 0; width: 100%; max-width: 1680px; margin: 0 auto; }
.demo-banner { margin-bottom: 16px; padding: 8px 12px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-size: 13px; }
.view-switcher { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.view-switcher > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.view-switcher select { min-height: 34px; max-width: 160px; padding: 5px 28px 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8faff; color: var(--text); font-size: 13px; cursor: pointer; }
.view-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 20px; padding: 12px 16px; border: 1px solid #d8e4fa; border-radius: 10px; background: var(--brand-soft); color: #526682; font-size: 12px; }
.view-notice strong { color: #284f95; font-size: 13px; font-weight: 600; }
.view-notice .button { margin-left: auto; }

/* 页面内容 */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head h1 { font-size: 24px; letter-spacing: -.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-head p { max-width: 880px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar select, .toolbar input { width: auto; min-width: 140px; max-width: 100%; }
.toolbar input[type="search"] { flex: 1 1 180px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 17px; margin-bottom: 10px; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { border-color: #c9ced8; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.section-title { font-size: 16px; margin: 26px 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; padding: 9px 16px; border: 1px solid #c7d7f3; border-radius: 10px; background: var(--surface); color: #234faa; font-size: 15px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.back:hover { border-color: var(--brand); background: var(--brand-soft); }
.unit-accounts-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.unit-accounts-toggle[aria-expanded="true"] { color: var(--brand); border-color: #c7d7f3; background: var(--brand-soft); }
.unit-accounts-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.unit-balance-year { min-height: 40px; max-width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.units-table > .unit-settings > .unit-summary > td { padding-top: 20px; padding-bottom: 20px; }
.units-table > .unit-settings > .unit-summary > td:first-child { width: 34%; overflow-wrap: anywhere; }
.units-table > .unit-settings > .unit-summary > .unit-actions { width: 1%; }
.unit-settings .actions { margin-top: 0; }
.unit-fillers { max-width: 240px; overflow-wrap: anywhere; }
.units-table > .unit-settings > .unit-summary > .unit-fillers { padding-top: 8px; padding-bottom: 8px; }
.unit-filler-names { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.unit-kind-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.unit-kind-choice { min-width: 0; padding: 20px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.unit-kind-choice:hover { border-color: #9db5ef; background: #f7f9ff; }
.unit-kind-choice > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.unit-kind-choice strong { font-size: 18px; overflow-wrap: anywhere; }
.unit-kind-choice b { flex: none; font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.unit-kind-choice small { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; }
.unit-kind-choice[aria-current="page"] { border-color: var(--brand); background: #edf3ff; box-shadow: inset 0 3px 0 var(--brand); }
.unit-kind-choice[aria-current="page"] strong, .unit-kind-choice[aria-current="page"] b { color: var(--brand); }
.unit-kind-choice:focus-visible { outline: 3px solid #94b7ff; outline-offset: 3px; }
@media (max-width: 600px) {
  .unit-kind-navigation { gap: 10px; }
  .unit-kind-choice { padding: 14px 12px; }
  .unit-kind-choice > span { align-items: flex-start; gap: 8px; }
  .unit-kind-choice strong { font-size: 16px; }
  .unit-kind-choice b { font-size: 23px; }
}
.unit-actions > .actions { flex-wrap: nowrap; }
.units-table > .unit-settings > .unit-account-details > td { padding: 0 18px 18px; background: #f8faff; border-bottom: 1px solid var(--line); }
.units-table > .unit-settings:last-child > .unit-account-details > td,
.units-table > .unit-settings:last-child > .unit-summary:has(+ [hidden]) > td { border-bottom: 0; }
.unit-accounts-panel { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.unit-accounts-panel .card-title { gap: 12px; margin: 0 0 16px; padding: 0; border: 0; }
.unit-accounts-panel h3 { font-size: 15px; overflow-wrap: anywhere; }
.unit-accounts-panel > .hint { margin-top: 14px; }
#units-section > .card-title, #business-units-section > .card-title { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.bank-account-number { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#statement-list { overflow-wrap: anywhere; }
.bank-month-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin-top: 20px; }
.bank-computed { display: block; min-height: 42px; padding: 9px 12px; border-radius: 8px; background: var(--page); font-weight: 600; font-variant-numeric: tabular-nums; }
.bank-proof-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.bank-proof { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-decoration: none; overflow-wrap: anywhere; }
.bank-proof img { width: 100%; height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--page); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.8; background: var(--page); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state p { max-width: 560px; margin: 10px auto; }
.error-state p { color: var(--danger); }
.loading { padding: 32px; text-align: center; color: var(--muted); }

/* 表格：窄屏时变成卡片 */
:where(.table, .entry-grid, .report) > tbody > tr { --table-row-bg: var(--surface); }
:where(.table, .entry-grid, .report) > tbody > tr:nth-child(even of :not([hidden])) { --table-row-bg: var(--table-stripe); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; line-height: 1.6; }
.table th { background: #f8faff; color: #52627a; font-weight: 500; font-size: 12px; white-space: nowrap; }
.table > tbody > tr > td, .table > tbody > tr > th { background: var(--table-row-bg); }
/* 单位表每个单位独立一个 tbody，按单位分组交替；展开的账户表自己交替。 */
.units-table > tbody.unit-settings:nth-of-type(even) > .unit-summary { --table-row-bg: var(--table-stripe); }
.table tr:last-child td { border-bottom: 0; }
.more { display: flex; justify-content: center; margin: 14px 0; }

/* 弹窗与提示 */
dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 16px; padding: 0; color: var(--text); box-shadow: 0 24px 72px rgba(16, 30, 55, .2); }
dialog::backdrop { background: rgba(18, 32, 56, .4); }
.dialog-form { padding: 26px; }
.dialog-form h2 { font-size: 20px; margin-bottom: 22px; }
.dialog-body { max-height: 60vh; max-height: 60dvh; overflow: auto; padding: 3px 4px; margin: 0 -4px; overscroll-behavior: contain; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
#toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: 10px; background: #1f2633; color: #fff; box-shadow: var(--shadow); }
.toast-error { background: var(--danger); }
.site-footer { text-align: center; font-size: 12px; padding: 12px; color: var(--muted); }
.site-footer a { color: var(--muted); }

@media (max-width: 760px) {
  .app-header { min-height: 58px; padding: 12px 16px; gap: 10px 12px; }
  .app-title { gap: 8px; font-size: 16px; }
  .app-title .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .app-history { gap: 0; padding: 0; margin-left: auto; }
  .app-history .button { width: 44px; min-width: 44px; min-height: 44px; padding: 7px; }
  .app-user { gap: 8px; margin-left: auto; }
  .app-user .role { display: none; }
  .view-switcher { gap: 5px; }
  .view-switcher > span { display: none; }
  .view-switcher select { min-height: 36px; max-width: 150px; font-size: 16px; }
  .view-notice { padding: 11px 12px; margin-bottom: 18px; gap: 5px 10px; }
  .view-notice > span { flex: 1 1 220px; }
  .app-body { display: block; }
  .app-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border: 0; scrollbar-width: thin; scrollbar-color: #657c9f transparent; position: static; height: auto; }
  .app-nav a { flex-shrink: 0; padding: 9px 14px; font-size: 13px; white-space: nowrap; margin: 0; }
  .app-nav a.active { box-shadow: none; background: #315b95; }
  .app-nav .nav-group { display: none; }
  .app-main { padding: 22px 16px max(28px, env(safe-area-inset-bottom)); }
  .bank-month-fields { grid-template-columns: 1fr; }
  .page-head { gap: 14px; margin-bottom: 18px; }
  .page-head > div:first-child { flex-basis: 100%; }
  .page-head h1 { font-size: 21px; }
  .page-head p { margin-top: 6px; font-size: 12px; line-height: 1.75; }
  .toolbar { gap: 10px; padding: 12px; margin-bottom: 16px; }
  .toolbar select, .toolbar input { flex: 1 1 130px; min-width: 0; }
  .toolbar input[type="search"] { flex-basis: 100%; }
  .button { min-height: 44px; padding: 9px 14px; }
  .button-small { min-height: 38px; padding: 6px 11px; font-size: 14px; }
  .button-text { min-height: 34px; padding: 6px; }
  .card { padding: 18px; }
  .card h2 { font-size: 16px; }
  .login-card { padding: 28px 24px; }
  .login-status { font-size: 14px; }
  .field input[type], .field select, .field textarea { font-size: 16px; }
  .table { border: 0; background: transparent; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 0; margin-bottom: 12px; background: var(--surface); }
  .table td { border: 0; padding: 5px 16px; overflow-wrap: anywhere; }
  .table td[data-label] { position: relative; padding-left: 100px; min-height: 32px; }
  .table td[data-label]::before { content: attr(data-label); position: absolute; left: 16px; top: 6px; width: 72px; color: var(--muted); font-size: 12px; font-weight: 400; text-align: left; }
  .table td.cell-num { text-align: left !important; }
  .table .cell-actions { white-space: normal; }
  .table .cell-actions .button { margin: 2px 2px 2px 0; }
  .table td.empty-cell { padding: 26px 16px !important; }
  .dialog-form { padding: 22px 18px; }
  .dialog-form h2 { font-size: 19px; margin-bottom: 18px; }
  .dialog-actions .button { flex: 1; }
}
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.toolbar a { text-decoration: none; }
.app-main:focus { outline: none; }
@media (max-width: 760px) { .table td[data-label]:empty { display: none; } }
@media (max-width: 1100px) {
  .unit-actions > .actions { flex-wrap: wrap; }
  .units-table > .unit-settings > .unit-summary > .unit-actions { width: 270px; }
}
@media (max-width: 760px) {
  .units-table > .unit-settings { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .units-table > .unit-settings > tr { border: 0; margin: 0; }
  .units-table > .unit-settings > .unit-summary > td { padding-top: 5px; padding-bottom: 5px; }
  .units-table > .unit-settings > .unit-summary > td:first-child,
  .units-table > .unit-settings > .unit-summary > .unit-actions { width: 100%; }
  .units-table > .unit-settings > .unit-summary > .unit-actions { padding-left: 16px; }
  .unit-fillers { max-width: none; }
  .unit-summary > .unit-actions::before { display: none; }
  .units-table > .unit-settings > .unit-account-details { padding: 0; }
  .units-table > .unit-settings > .unit-account-details > td { padding: 10px; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
  .unit-accounts-panel { padding: 12px; }
}

/* 直接登记：固定列、可横向滚动的表格，窄屏也保持列与输入位置一致。 */
.entry-grid-wrap { width: 100%; max-width: 100%; max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overscroll-behavior: contain; }
.entry-grid { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.entry-grid th, .entry-grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px 6px; vertical-align: top; text-align: left; min-width: 155px; }
.entry-grid th { position: sticky; top: 0; z-index: 3; background: #edf3ff; padding: 4px 7px; font-weight: 600; line-height: 1.3; white-space: nowrap; color: #263e66; }
.entry-grid tbody td { background: var(--table-row-bg); }
.entry-grid th:first-child, .entry-grid td:first-child { min-width: 48px; width: 48px; text-align: center; position: sticky; left: 0; background: var(--table-row-bg, #f5f8fe); z-index: 2; font-variant-numeric: tabular-nums; }
.entry-grid th:first-child { z-index: 4; background: #f5f8fe; }
.entry-grid th:last-child, .entry-grid td:last-child { min-width: 175px; border-right: 0; }
.entry-grid [data-column="unit_id"], .entry-grid [data-column="analysis_unit_id"] { min-width: 200px; }
.entry-grid [data-column="book_subject"] { min-width: 180px; }
.entry-grid [data-column="summary"], .entry-grid [data-column="remark"] { min-width: 285px; }
.entry-grid [data-column="account_id"] { min-width: 265px; }
.entry-grid [data-column="bank_name"] { min-width: 380px; }
.entry-grid [data-column="subject"] { min-width: 190px; }
.entry-grid [data-column="entry_date"] { min-width: 165px; }
.entry-grid [data-column="amount"], .entry-grid [data-column="income"], .entry-grid [data-column="expense"], .entry-grid [data-column="balance"], .entry-grid [data-column="running_balance"] { min-width: 135px; }
.entry-grid td[data-column="running_balance"] { text-align:right; font-variant-numeric:tabular-nums; }
.entry-grid input, .entry-grid select, .entry-grid textarea { display: block; width: 100%; min-width: 0; height: 26px; min-height: 26px; padding: 2px 5px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--text); font: inherit; line-height: 20px; }
.entry-grid input[type="date"] { min-width: 140px; }
.entry-grid input[inputmode="decimal"] { text-align: right; font-variant-numeric: tabular-nums; }
.entry-grid textarea { resize: vertical; }
.entry-grid textarea.grid-remark { height: 26px; min-height: 26px; resize: none; overflow: auto; white-space: pre-wrap; }
.entry-grid input:hover, .entry-grid select:hover, .entry-grid textarea:hover { border-color: #d2ddf0; }
.entry-grid input:focus, .entry-grid select:focus, .entry-grid textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; background: #fff; }
.entry-grid input[aria-invalid="true"] { border-color: var(--danger); background: #fff7f6; }
.entry-grid td.grid-cell-selected { background-color: #e8efff; box-shadow: inset 0 0 0 1px #88a8f0; }
.entry-grid td.grid-cell-anchor { box-shadow: inset 0 0 0 2px var(--brand); }
.entry-grid td.grid-cell-selected input:not(:focus), .entry-grid td.grid-cell-selected select { background-color: transparent; }
.entry-grid .grid-negative-amount, .entry-grid .grid-negative-amount input { color: var(--danger); }
.grid-amount-hint { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.grid-shortcuts { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.grid-choice { display: flex; align-items: stretch; min-width: 0; }
.balance-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 16px; margin: 20px 0; }
.balance-summary > div { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.balance-summary span, .balance-summary small { color: var(--muted); }
.balance-summary strong { font-size: 26px; overflow-wrap: anywhere; }
.entry-grid .grid-choice input { flex: 1; width: 0; }
.entry-grid .grid-choice select { flex: 0 0 32px; width: 32px; padding: 0; cursor: pointer; }
.entry-grid .grid-cell-error { background: #fff2f1; }
.entry-grid .grid-cell-error input, .entry-grid .grid-cell-error select { border-color: #df8b87; }
.entry-grid .grid-row-dirty td:first-child { background: #fff6df; color: #936012; }
.entry-grid .grid-row-invalid td:first-child { background: #fff0ee; color: #b42318; }
.entry-grid .grid-row-warning td:first-child { background: #fff5df; color: #946011; }
.entry-grid .grid-row-saved td:first-child { color: #167349; }
.grid-row-status { display: block; max-width: 260px; padding: 2px 0; line-height: 1.5; font-size: 12px; color: var(--muted); white-space: normal; }
.grid-row-invalid .grid-row-status { color: #b42318; }
.grid-row-warning .grid-row-status { color: #946011; }
.grid-readonly-hint { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.entry-grid small.grid-cell-error { display: block; max-width: 285px; padding: 3px 4px; color: #b42318; font-size: 12px; line-height: 1.5; }
.entry-grid .grid-cell-error small, .entry-grid .grid-cell-error .field-error { display: block; color: #b42318; font-size: 12px; line-height: 1.5; max-width: 285px; }
.entry-grid.grid-preview td { padding: 10px 12px; vertical-align: middle; }
.grid-preview .grid-readonly-hint, .entry-grid td:first-child .grid-readonly-hint { display: none; }
.grid-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 0; }
.grid-row-menu { position: fixed; z-index: 1000; min-width: 180px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 28px rgba(23, 42, 72, .18); }
.grid-row-menu button { display: block; width: 100%; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.grid-row-menu button:hover, .grid-row-menu button:focus-visible { background: var(--brand-soft); outline: 2px solid var(--brand); outline-offset: -2px; }
.grid-row-menu button:disabled { color: var(--muted-2); cursor: default; background: transparent; outline: none; }
.entry-task-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.grid-notice { padding: 12px 16px; margin: 12px 0; border: 1px solid #dce5f5; border-radius: 10px; background: #f5f8fe; font-size: 13px; line-height: 1.65; }
@media (max-width: 760px) {
  .entry-grid-wrap { max-height: 65vh; }
  .entry-grid input, .entry-grid select, .entry-grid textarea { font-size: 16px; min-height: 42px; }
  .grid-actions .button { min-height: 42px; }
}

/* ---------- 报表统计 ---------- */
.form-error { white-space: pre-line; }
dialog.dialog-wide { width: min(880px, calc(100vw - 32px)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.form-grid .field { align-content: start; }
.field input[type="date"], .field input[type="number"] {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 11px; border: 1px solid #d6dfeb; border-radius: 8px; font: inherit; color: inherit; background: #fff;
}
.field .field-error { color: var(--danger); font-size: 13px; }
.field.invalid input, .field.invalid select { border-color: var(--danger); background: var(--danger-soft); }
.field.warned input, .field.warned select { border-color: var(--warning); background: var(--warning-soft); }
.field.warned .field-error { color: var(--warning); }
.head-actions { margin-top: 0; align-items: center; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 4px; word-break: break-word; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.num.neg { color: var(--danger); }
.num.zero { color: #98a2b3; }
.cell-num { text-align: right !important; }
.cell-actions { white-space: nowrap; }
.danger-text { color: var(--danger); }
.empty-cell { text-align: center !important; color: var(--muted); padding: 28px 12px !important; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.notice { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-bottom: 18px; line-height: 1.7; }
.notice p { margin: 6px 0 0; }
.notice .actions { margin-top: 10px; }
.notice-error { background: var(--danger-soft); border-color: #f4c7c3; }
.notice-warning { background: var(--warning-soft); border-color: #f5d7b0; }
.notice-success { background: var(--success-soft); border-color: #b7e2c4; }
.issues .row-error td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.issues .row-warning td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; flex-shrink: 0; }
.segmented a { display: inline-flex; align-items: center; justify-content: center; padding: 8px 18px; min-height: 40px; color: var(--text); text-decoration: none; }
.segmented a.active { background: var(--brand); color: #fff; }
.empty-state h2 { color: var(--text); font-size: 18px; margin-bottom: 8px; }

/* 钉钉通讯录：筛选与成员列表 */
.directory-panel .page-head { margin-bottom: 18px; }
.directory-panel .page-head h2 { margin-bottom: 0; }
.directory-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 14px; }
.directory-toolbar .field { margin-bottom: 0; }
.directory-toolbar > .button { min-height: 40px; }
.directory-status { min-height: 22px; margin: 16px 0 0; overflow-wrap: anywhere; }
.directory-warning { margin: 12px 0; padding: 10px 12px; border: 1px solid #f5d7b0; border-radius: 8px; color: var(--warning); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.directory-list { margin-top: 14px; }
.directory-person { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.directory-person:first-child { border-top: 1px solid var(--line); }
.directory-person-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.directory-person-info strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.5; }
.directory-person-info .hint { margin-top: 4px; font-size: 12px; }
.directory-person > .button { flex-shrink: 0; }
.directory-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* 汇总表：表头和前两列固定，单元格可点开看明细 */
.report-section-title { margin: 24px 0 8px; font-size: 20px; }
.report-filters label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.report-filters input[type="date"] { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); color: var(--text); font: inherit; }
.report-filters select { max-width: min(100%, 380px); }
.report-cash-details { margin-top: 24px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.report-cash-details > summary { cursor: pointer; font-size: 16px; font-weight: 600; }
.report-cash-details > summary span { display: inline-block; margin-left: 10px; color: var(--muted); font-size: 13px; font-weight: 400; }
.report-cash-details[open] > summary { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.report-wrap { overflow: auto; max-height: calc(100vh - 260px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; overscroll-behavior-x: contain; }
.report { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.report th, .report td { border-bottom: 1px solid var(--line); border-right: 1px solid #eef1f6; padding: 9px 12px; background: var(--table-row-bg, var(--surface)); }
.report thead th { position: sticky; top: 0; z-index: 2; background: #edf2fa; color: #52627a; font-weight: 500; text-align: center; height: 40px; white-space: nowrap; }
.report thead tr.second th { top: 40px; }
.report .sticky { position: sticky; z-index: 1; text-align: left; }
.report thead .sticky { z-index: 3; }
.report .c1 { left: 0; min-width: 64px; width: 64px; color: var(--muted); font-weight: 400; }
.report .c2 { left: 64px; min-width: 220px; font-weight: 400; box-shadow: 1px 0 0 var(--line); }
.report td.cell-num { min-width: 112px; }
.report tr.line-group th, .report tr.line-calc th, .report tr.line-group td, .report tr.line-calc td { font-weight: 600; }
.report tr.depth-0 th, .report tr.depth-0 td { background: #edf5e8; }
.report tr.line-calc th, .report tr.line-calc td { background: #e9f0fb; }
.report tr.line-audit th, .report tr.line-audit td { background: #fafbfc; }
.report .cell-audit { text-align: center; white-space: nowrap; }
.report .indent { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.report .indent-1 { padding-left: 14px; }
.report .indent-2 { padding-left: 28px; }
.report .indent-3 { padding-left: 42px; }
.report .indent-4 { padding-left: 56px; }
.toggle { border: 0; background: none; color: var(--brand); cursor: pointer; width: 20px; min-height: 24px; flex-shrink: 0; padding: 0; font: inherit; }
.toggle-space { display: inline-block; width: 18px; }
.cell-link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; color: inherit; }
.cell-link:hover .num, .cell-link:focus-visible .num { text-decoration: underline; color: var(--brand); }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field input[type="date"], .field input[type="number"] { font-size: 16px; }
  .head-actions { width: 100%; }
  .head-actions .button-primary { flex: 1; }
  .directory-toolbar { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .directory-toolbar > .button { width: 100%; min-height: 42px; }
  .directory-person { gap: 12px; padding: 14px 0; }
  .directory-person > .button { min-height: 38px; }
  .report-wrap { max-height: none; }
  .report-filters label { flex: 1 1 230px; justify-content: space-between; }
  .report-filters select { min-width: 0; width: 100%; }
  .report-cash-details { padding: 16px; }
  .report-cash-details > summary span { display: block; margin: 8px 0 0; }
  .report .c1 { display: none; }
  .report .c2 { left: 0; min-width: 164px; width: 164px; max-width: 164px; }
  .report .indent { white-space: normal; line-height: 1.5; }
  .report th, .report td { padding: 9px; }
  .report .indent-1 { padding-left: 8px; }
  .report .indent-2 { padding-left: 16px; }
  .report .indent-3 { padding-left: 24px; }
  .report .indent-4 { padding-left: 32px; }
  .table-wrap { overflow-x: visible; }
}

/* ---------- 卡片列表：序号块 + 标题 / 正文 / 辅助信息 + 右侧大号指标 ---------- */
.card-title { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px;
  margin: -2px -24px 2px; padding: 0 24px 16px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.card-title > div { min-width: 0; }
.card-title h2 { font-size: 18px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-title > a { font-size: 14px; font-weight: 500; text-decoration: none; }
.card-title .item-meta { margin-top: 6px; font-weight: 400; }
.card-title .head-actions { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list:last-child .list-item:last-child { padding-bottom: 4px; }
.index-chip { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.is-done .index-chip { background: var(--success-soft); color: var(--success); }
.is-done .item-title { color: var(--muted); }
.item-main { min-width: 0; }
.item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 16px; font-weight: 600; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.item-title a { color: inherit; text-decoration: none; }
.item-title a:hover { color: var(--brand); }
.item-body { margin-top: 6px; color: var(--text-2); line-height: 1.75; word-break: break-word; }
.item-body.num { white-space: normal; word-break: break-all; }
.item-meta { margin-top: 8px; color: var(--muted-2); font-size: 13px; overflow-wrap: anywhere; }
.item-meta b { color: var(--text-2); font-weight: 600; }
.item-note { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 14px; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.item-side { align-self: center; }
.item-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.metric { min-width: 72px; text-align: right; }
.metric strong { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric strong small { font-size: 15px; font-weight: 600; color: var(--muted-2); }
.metric > span { display: block; margin-top: 6px; color: var(--muted-2); font-size: 13px; white-space: nowrap; }
.metric-money strong { font-size: 19px; }
.metric-brand strong { color: var(--brand); }
.metric-success strong { color: var(--success); }
.metric-danger strong { color: var(--danger); }
.metric-warning strong { color: var(--warning); }
.stats-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 30px; margin: 0 0 18px; }
.stat b { font-size: 26px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat b small { font-size: 15px; font-weight: 600; color: var(--muted-2); }
.stat > span { margin-left: 6px; color: var(--muted); font-size: 14px; }
.stat-brand b { color: var(--brand); }
.stat-success b { color: var(--success); }
.stat-danger b { color: var(--danger); }
.stat-warning b { color: var(--warning); }
.stats-compact { gap: 8px 22px; margin: 14px 0 4px; }
.stats-compact .stat b { font-size: 20px; }
.empty-inline { margin: 0; padding: 22px 0 12px; text-align: center; color: var(--muted); }
progress.bar { width: 110px; height: 8px; margin-right: 10px; vertical-align: middle; accent-color: var(--brand); }
.progress-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 16px; align-items: start; }
.home-grid > div { min-width: 0; }

/* 仪表盘：两种汇总口径与独立的上一期间填报提醒。 */
.dashboard-reminders, .dashboard-reports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dashboard-reminders { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-reports > div { min-width: 0; }
.dashboard-reminder { --reminder-color: var(--text); display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 22px 26px; text-align: left; font: inherit; color: var(--text); cursor: pointer; border-top: 3px solid var(--line); background: var(--surface); }
.dashboard-reminder:hover { border-color: #b6c2d4; background: #fafbfe; }
.dashboard-reminder-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 600; }
.dashboard-reminder-title > span { color: var(--muted); font-size: 22px; }
.dashboard-reminder-value { display: flex; align-items: baseline; gap: 9px; margin-top: 20px; white-space: nowrap; }
.dashboard-reminder-value strong { color: var(--reminder-color); font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.dashboard-reminder-value > span { color: var(--muted); font-size: 14px; }
.dashboard-reminder-status { display: block; margin: 10px 0 18px; color: var(--reminder-color); font-size: clamp(17px, 1.45vw, 21px); font-weight: 600; line-height: 1.4; }
.dashboard-reminder small { display: block; margin-top: 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.dashboard-reminder[data-severity="warning"] { --reminder-color: #8a560d; border-top-color: #e3ab5e; }
.dashboard-reminder[data-severity="warning"]:hover { border-color: #e3ab5e; background: #fffdf8; }
.dashboard-reminder[data-severity="danger"] { --reminder-color: var(--danger); border-top-color: var(--danger); }
.dashboard-reminder[data-severity="danger"]:hover { border-color: #e8a9a4; background: #fffafa; }
.dashboard-reminder-note { margin: 12px 0 28px; }
.dashboard-section-head, .dashboard-card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dashboard-section-head { margin: 0 0 18px; flex-wrap: wrap; }
.dashboard-section-head h2 { font-size: 19px; margin: 0 0 4px; }
.dashboard-section-head .hint { margin: 0; }
.dashboard-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.dashboard-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.dashboard-filters input { width: 100%; min-width: 0; min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; color: var(--text); background: var(--surface); }
.dashboard-filters .button { min-height: 44px; }
.dashboard-filters select { width: auto; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: var(--surface); }
.dashboard-report { margin: 0; padding: 26px; }
.dashboard-card-head h2 { margin: 3px 0 0; font-size: 21px; }
.dashboard-eyebrow { color: var(--muted); font-size: 12px; }
.dashboard-expand { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 10px; border-color: var(--line); background: var(--page); box-shadow: none; }
.dashboard-expand svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-chart-caption { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; color: var(--muted); font-size: 12px; }
.dashboard-chart-link { display: block; color: inherit; text-decoration: none; border-radius: 8px; }
.dashboard-chart-link:hover { background: #f8faff; }
.dashboard-chart { display: grid; gap: 24px; padding: 26px 0; }
.dashboard-metric > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.dashboard-metric span { font-size: 13px; color: var(--muted); }
.dashboard-metric strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-metric svg { display: block; width: 100%; height: 14px; }
.chart-track { fill: #f1f4f9; }
.chart-income { fill: #5268dd; }
.chart-expense { fill: #78a8c9; }
.chart-surplus { fill: #40a48f; }
.chart-negative { fill: #c76a6a; }
.chart-zero { stroke: #6a7b91; stroke-width: 2; }
.dashboard-report-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.dashboard-report-foot > div { display: grid; gap: 4px; }
.dashboard-report-foot span { color: var(--muted); font-size: 12px; }
.dashboard-report-foot strong { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-report-foot a { font-size: 13px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.dashboard-chart-large .dashboard-chart { gap: 32px; padding: 18px 0 28px; }
.dashboard-chart-large .dashboard-metric strong { font-size: 30px; }
.dashboard-chart-large .dashboard-metric span { font-size: 16px; }
.dashboard-chart-large .dashboard-metric svg { height: 22px; }
.dashboard-unit { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.dashboard-unit:last-child { border-bottom: 0; }
.dashboard-start-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.dashboard-start-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dashboard-start-row:last-child { border-bottom: 0; }
.dashboard-start-name { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.dashboard-start-action { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; min-height: 40px; white-space: nowrap; color: var(--brand); background: var(--brand-soft); border-color: transparent; box-shadow: none; text-decoration: none; }
.dashboard-start-action:hover { border-color: var(--brand); }
.dashboard-unit > div { min-width: 0; overflow-wrap: anywhere; }
.dashboard-unit > a { flex-shrink: 0; }
.dashboard-unit p, .dashboard-unit ul { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.dashboard-unit ul { padding-left: 18px; }
.dashboard-unit small { display: block; margin-top: 8px; color: var(--warning); }
.dashboard-unit .dashboard-no-filler { color: var(--warning); font-weight: 600; }
.reporting-gap-month { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.reporting-gap-month .button { margin-top: 8px; }
.ledger-day-history { margin: 14px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
.ledger-day-history summary { cursor: pointer; font-weight: 600; }
.ledger-day-history ul { margin: 10px 0 0; padding: 0; list-style: none; }
.ledger-day-history li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.proof-compression-preview { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.proof-compression-preview img { display: block; max-width: none; }
@media (max-width: 980px) {
  .dashboard-reminders, .dashboard-reports { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 760px) {
  .dashboard-report, .dashboard-reminder { padding: 20px; }
  .dashboard-reminder-note { margin-bottom: 24px; }
  .dashboard-unit { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .dashboard-card-head h2 { font-size: 20px; }
  .dashboard-filters { width: 100%; }
  .dashboard-filters label { flex: 1 1 130px; }
  .dashboard-filters select { flex: 1; min-width: 0; }
  .dashboard-chart-large .dashboard-metric strong { font-size: 24px; }
}
.setup-card .list-item { grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; }
.setup-card .item-side { grid-column: 2; justify-self: start; }
.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.quick-link { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.quick-link:hover { border-color: var(--brand); }
.quick-link strong { font-weight: 600; }
.quick-link span { color: var(--muted-2); font-size: 13px; }

@media (max-width: 760px) {
  .card-title { margin: -2px -18px 2px; padding: 0 18px 14px; }
  .list-item { grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 12px; padding: 18px 0; }
  .index-chip { width: 32px; height: 32px; }
  .metric { min-width: 0; max-width: 34vw; }
  .metric > span { white-space: normal; }
  .metric strong { font-size: 22px; }
  .metric-money strong { font-size: 17px; }
  .metric-money { grid-column: 2 / -1; max-width: 100%; margin-top: 12px; text-align: left; }
  .metric-money strong, .metric-money .num { white-space: normal; overflow-wrap: anywhere; }
  .item-actions .button { flex: 1 1 auto; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-row { gap: 10px 22px; }
}


@media (prefers-reduced-motion: reduce) {
  .button, .app-nav a { transition: none; }
}

@media (max-width: 480px) {
  .app-user { flex-basis: 100%; }
  .app-user strong { margin-right: auto; overflow: hidden; text-overflow: ellipsis; max-width: 120px; white-space: nowrap; }
  .view-switcher select { max-width: 144px; }
  .view-notice .button { margin-left: 0; }
}

/* 当前打开登记表的临时列宽；独立列固定宽度，剩余空间由原滚动容器承接。 */
.entry-grid.grid-resizable { table-layout: fixed; min-width: 0; }
.entry-grid.grid-resizable th, .entry-grid.grid-resizable td { min-width: 0; width: auto; overflow-wrap: anywhere; }
.entry-grid.grid-resizable th { overflow: hidden; text-overflow: ellipsis; }
.entry-grid.grid-resizable input[type="date"] { min-width: 0; }
.entry-grid .grid-column-resizer { position: absolute; top: 0; right: 0; bottom: 0; width: 10px; cursor: col-resize; touch-action: none; user-select: none; }
.entry-grid .grid-column-resizer::after { content: ""; position: absolute; top: 8px; bottom: 8px; right: 1px; width: 2px; background: var(--line); }
.entry-grid .grid-column-resizer:hover::after, .entry-grid .grid-column-resizer:focus-visible::after { background: var(--brand); }
.entry-grid .grid-column-resizer:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.entry-grid.grid-column-resizing, .entry-grid.grid-column-resizing * { cursor: col-resize !important; user-select: none; }

/* 共用账务科目：保持父子缩进，银行明细只呈现当前所选单位。 */
.accounting-toolbar label { font-size: 13px; color: var(--muted); }
.accounting-toolbar select { max-width: 340px; }
.accounting-tree { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.accounting-tree-head, .accounting-tree-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px 190px; align-items: center; gap: 16px; padding: 13px 18px; }
.accounting-tree-head { color: var(--muted); font-size: 12px; background: #f8faff; }
.accounting-tree-row { border-top: 1px solid var(--line); }
.accounting-tree-row[hidden] { display: none; }
.accounting-tree-root { background: #f8faff; }
.accounting-tree-name { display: flex; align-items: flex-start; gap: 10px; padding-left: calc(var(--subject-depth) * 24px); min-width: 0; }
.accounting-tree-name > div { min-width: 0; }
.accounting-tree-name strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.accounting-tree-root .accounting-tree-name strong { font-weight: 600; }
.accounting-tree-name small { display: block; font-size: 12px; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.accounting-level { flex-shrink: 0; padding: 1px 6px; border-radius: 4px; background: var(--page); color: var(--muted); font-size: 12px; }
.accounting-tree-mode { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.accounting-tree-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.accounting-tree-actions .button { margin: 0; }
.accounting-tree-toggle, .accounting-tree-toggle-space { flex: 0 0 24px; width: 24px; height: 26px; }
.accounting-tree-toggle { border: 0; border-radius: 4px; background: transparent; color: var(--brand); cursor: pointer; padding: 0; font-size: 20px; line-height: 26px; }
.accounting-tree-toggle:hover, .accounting-tree-toggle:focus-visible { background: var(--brand-soft); }
.accounting-unavailable { color: var(--muted) !important; background: #f3f4f6 !important; border-color: var(--line) !important; cursor: help !important; }
.accounting-child-manager { margin-bottom: 20px; scroll-margin-top: 100px; }
.accounting-child-manager[hidden] { display: none; }
.accounting-direct-children { margin-top: 16px; }
.accounting-direct-children .accounting-tree-row { grid-template-columns: minmax(0, 1fr) auto; }
.accounting-direct-children strong { overflow-wrap: anywhere; }
.ledger-month-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 18px 20px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-soft); }
.ledger-month-copy { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.ledger-month-copy strong { font-size: 16px; }
.ledger-month-copy p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ledger-month-copy small { display: block; margin-top: 8px; color: var(--muted); }
.ledger-month-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.journal-month-status .ledger-month-actions { min-width: 0; max-width: 100%; margin-left: auto; }
.journal-pagination { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 100%; min-width: 0; margin: 0; text-align: right; }
.journal-pagination[hidden], .journal-pagination [hidden] { display: none; }
.journal-pagination .hint { max-width: 100%; overflow-wrap: anywhere; }
.journal-pagination .button { max-width: 100%; white-space: normal; font-weight: 700; }
.ledger-month-notice { flex-basis: 100%; }
.ledger-month-notice:empty { display: none; }
.reporting-gap-accounts summary { cursor: pointer; font-size: 13px; color: var(--brand); }
@media (max-width: 760px) {
  .accounting-toolbar select { max-width: 100%; flex-basis: 100%; }
  .accounting-tree-head { display: none; }
  .accounting-tree-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 12px; }
  .accounting-tree-name { padding-left: calc(var(--subject-depth) * 12px); }
  .accounting-tree-mode { padding-left: calc(var(--subject-depth) * 12px + 42px); }
  .accounting-tree-actions { justify-content: flex-start; padding-left: calc(var(--subject-depth) * 12px + 42px); }
  .accounting-direct-children .accounting-tree-row { grid-template-columns: minmax(0, 1fr); }
  .accounting-direct-children .accounting-tree-actions { padding-left: 0; }
}
/* 主体下固定十二个月，窄屏仍保留清楚的月份卡片。 */
.fill-month-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.fill-month-grid .quick-link { min-height:94px; box-sizing:border-box; }
.fill-month-disabled { opacity:.55; background:#f3f4f6; cursor:default; }
.opening-gate { max-width:760px; }
.opening-gate form { max-width:420px; display:grid; gap:16px; margin-top:20px; }
.account-period-balances { display:flex; flex-wrap:wrap; gap:12px 28px; margin:12px 0; }
.account-period-balances span { white-space:nowrap; }
@media(max-width:650px) { .fill-month-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } }

/* 审批红点、两表共用的8月31日期末余额卡片、审批详情（2026-11 补丁） */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; vertical-align: middle; }
.nav-badge[hidden] { display: none; }
.account-baseline .baseline-amount { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-baseline .baseline-requests { margin-top: 12px; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .detail-list { grid-template-columns: 1fr; } .detail-list dt { margin-top: 6px; } }
/* 表格候选关键词推荐弹层：固定定位，避免被表格横向滚动区域裁掉 */
.choice-suggest { position: fixed; z-index: 1000; overflow-y: auto; padding: 4px; border: 1px solid var(--line-strong, #d7deea); border-radius: 10px; background: var(--surface, #fff); box-shadow: 0 10px 28px rgba(15, 30, 60, .16); font-size: 14px; }
.choice-suggest[hidden] { display: none; }
.choice-suggest-option { padding: 8px 10px; border-radius: 7px; cursor: pointer; line-height: 1.45; overflow-wrap: anywhere; }
.choice-suggest-option small { display: block; color: var(--muted); font-size: 12px; }
.choice-suggest-option mark { background: #fff0b3; color: inherit; padding: 0 1px; border-radius: 3px; }
.choice-suggest-option:hover, .choice-suggest-option.active { background: var(--brand-soft, #eef3ff); color: var(--brand); }
.choice-suggest-empty, .choice-suggest-more { padding: 8px 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .choice-suggest { font-size: 16px; } .choice-suggest-option { min-height: 40px; padding: 10px 12px; } }
/* 填报入口：列表关键词筛选、批量导出勾选与时间区间面板 */
.list-filter { max-width: 260px; min-height: 38px; }
.export-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.export-checks .check { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.export-checks .check input { margin-top: 4px; flex: none; }
.export-checks small { color: var(--muted); }
.page-head > [data-batch-export] { margin-left: auto; }
.batch-export-dialog .export-checks { max-height: 32vh; max-height: 32dvh; overflow: auto; padding: 4px; overscroll-behavior: contain; }
.export-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.export-range { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.export-range .export-months, .export-range .export-days { display: flex; flex-wrap: wrap; gap: 12px; }
.export-range .export-months[hidden], .export-range .export-days[hidden] { display: none; }
@media (max-width: 640px) { .list-filter { max-width: none; width: 100%; } .export-range, .export-range .export-months, .export-range .export-days { flex-direction: column; align-items: stretch; } }
/* 人员范围：列表保持紧凑，完整单位与账户明细放在弹窗中。 */
.people-table td { vertical-align: top; }
.people-table [data-fill-scope], .people-table td[data-label="管理单位"] { max-width: 330px; overflow-wrap: anywhere; }
.people-table #fill-scope-display { max-width: 135px; font: inherit; color: inherit; }
.people-scope-lines { display: grid; gap: 4px; line-height: 1.5; }
.people-scope-summary { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.people-scope-detail { display: grid; gap: 14px; line-height: 1.65; overflow-wrap: anywhere; max-height: 60vh; overflow: auto; }
.people-scope-picker .check-group { max-height: 230px; overflow: auto; padding: 8px 4px; overscroll-behavior: contain; }
.people-precise-toggle { margin-top: 18px; font-weight: 600; }
.people-account-picker [data-account-options] { max-height: 320px; overflow: auto; padding: 4px; overscroll-behavior: contain; }
.people-account-group { min-width: 0; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.people-account-group legend { max-width: 100%; padding: 0 4px; font-weight: 600; overflow-wrap: anywhere; }
.people-account-group .check { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; overflow-wrap: anywhere; }
.people-account-group input { flex: none; margin-top: 4px; }
@media (max-width: 640px) { .people-table [data-fill-scope], .people-table td[data-label="管理单位"] { max-width: none; } .people-account-group { padding: 8px; } }
/* 区域多选同时用于单位导航和经营汇总，空区域是可选择的实际分组。 */
.region-filter { display: flex; flex-direction: column; gap: 6px; min-width: 180px; max-width: 320px; font-size: 14px; }
.region-filter > span { color: var(--muted); }
.region-filter details { position: relative; }
.region-filter summary { padding: 10px 12px; min-height: 40px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; overflow-wrap: anywhere; }
.region-options { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: max(260px, 100%); max-width: min(340px, calc(100vw - 48px)); padding: 12px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px #17233c22; }
.region-options [role="group"] { max-height: 280px; overflow: auto; margin-top: 8px; }
.region-options .check { display: flex; flex-direction: row; flex: initial; align-items: flex-start; gap: 8px; padding: 7px 2px; overflow-wrap: anywhere; }
.region-options .check input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; padding: 0; margin-top: 4px; }
.region-options small { color: var(--muted); }
.unit-list-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.journal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.journal-form-grid label, .journal-allocation label { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.journal-form-wide { grid-column: 1 / -1; }
.journal-sheet { min-width: 0; }
.journal-grid-toolbar { align-items: center; }
.journal-stage + .journal-stage { margin-top: 28px; padding-top: 22px; border-top: 2px solid var(--line); }
.journal-month { max-width: 240px; margin-bottom: 12px; }
.journal-grid { width: max-content; }
.journal-grid td { padding: 2px 6px; }
.journal-grid input:disabled, .journal-grid select:disabled { color: var(--muted); background: #f2f4f7; }
.journal-grid [data-column="actual_matter"] { min-width: 285px; }
.journal-grid [data-column="check"] { min-width: 300px; }
.journal-grid [data-column^="business_unit_"] { min-width: 200px; }
.journal-grid [data-column^="category_"] { min-width: 190px; }
.journal-grid [data-row-status] { display: block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journal-grid [data-row-check] { display: block; white-space: nowrap; line-height: 26px; }
.journal-grid details { max-width: 320px; white-space: normal; }
.journal-allocation { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(120px, 1.4fr) minmax(90px, 1fr) auto; align-items: end; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.journal-allocation select, .journal-allocation input { width: 100%; min-width: 0; }
@media (max-width: 640px) { .journal-form-grid, .journal-allocation { grid-template-columns: 1fr; } .journal-form-wide { grid-column: auto; } }
@media (max-width: 640px) { .region-filter { width: 100%; max-width: none; min-width: 0; } .unit-list-filters { width: 100%; } .region-options { width: 100%; max-width: 100%; } }
/* Keep the original text editor and keyboard path, with a bounded native calendar. */
.journal-date-cell { position: relative; }
.journal-date-cell > input[data-field] { padding-right: 30px; }
.journal-date-cell > input[data-journal-calendar] { position: absolute; right: 0; top: 0; width: 28px; min-width: 28px; padding: 0; color: transparent; background: transparent; cursor: pointer; }
.journal-date-cell > input[data-journal-calendar]::-webkit-datetime-edit { display: none; }
.journal-date-cell > input[data-journal-calendar]::-webkit-calendar-picker-indicator { margin: 0; padding: 5px; cursor: pointer; }
/* Independent dashboard cash views; do not alter journal editors or calendars. */
.funds-dashboard-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 22px 0 10px; }
.funds-dashboard-card { display: block; color: inherit; text-decoration: none; border-top: 3px solid #2563eb; }
.funds-dashboard-card:nth-child(2) { border-top-color: #0d9488; }
.funds-dashboard-card:nth-child(3) { border-top-color: #d97706; }
.funds-dashboard-card h2 { display: flex; justify-content: space-between; gap: 12px; font-size: 20px; }
.funds-dashboard-card p { line-height: 1.6; }
.funds-dashboard-card small { color: var(--muted); line-height: 1.6; }
.funds-dashboard-card:hover, .funds-dashboard-card:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.funds-view-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 20px 0; }
.funds-view-filters > label { display: flex; flex-direction: column; gap: 6px; min-width: 145px; max-width: 320px; }
.funds-view-filters input, .funds-view-filters select { min-height: 38px; max-width: 100%; }
.funds-view-filters [hidden] { display: none; }
.funds-view-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.funds-view-metrics .card { display: flex; flex-direction: column; gap: 10px; }
.funds-view-metrics strong { font-size: clamp(19px, 2vw, 28px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.funds-view-metrics small, .funds-view-metrics span { color: var(--muted); }
.funds-validation { margin-bottom: 18px; }
.funds-validation > div { display: grid; grid-template-columns: 1fr 1fr minmax(110px, .5fr); gap: 16px; }
.funds-validation strong { display: block; font-size: 22px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.funds-validation[data-funds-validation="different"] { border-color: #dc2626; }
.funds-view-table { min-width: 680px; width: 100%; }
.funds-view-scroll { max-width: 100%; min-width: 0; overflow-x: auto; }
.funds-view-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.funds-view-table small { display: block; color: var(--muted); white-space: normal; max-width: 260px; }
.funds-view-account { overflow-wrap: anywhere; min-width: 200px; }
.funds-view-active { background: #eff6ff; }
.funds-view-pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 16px; }
.funds-tree-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.funds-tree-toggle::before { content: '▶'; flex: 0 0 14px; color: var(--brand); font-size: 12px; }
.funds-tree-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.funds-tree-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.funds-tree-unit > td { font-weight: 600; }
.funds-tree-account > td:first-child { padding-left: 32px; }
.assign-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-bottom: 8px; }
.assign-toolbar label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.assign-table td:first-child, .assign-table th:first-child { width: 36px; }
.assign-table td small, .assign-person-table td small { display: inline; color: var(--muted); }
.assign-field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; min-width: 0; }
.assign-field legend { padding: 0 6px; font-weight: 600; }
.assign-search { width: 100%; margin-bottom: 8px; }
.assign-people { max-height: 220px; overflow-y: auto; }
.assign-people small { margin-left: 6px; color: var(--muted); }
.assign-preview ul { margin: 6px 0 12px; padding-left: 20px; max-height: 200px; overflow-y: auto; }
.assign-preview h3 { margin: 12px 0 4px; font-size: 15px; }
.assign-person-table .check { margin: 0; }
.account-duty { display: grid; gap: 2px; font-size: 13px; min-width: 180px; }
.account-duty small { color: var(--muted); }
.funds-view-date { margin-top: 24px; }
.funds-view-distribution { display: flex; align-items: center; justify-content: center; gap: 36px; padding: 16px 0; }
.funds-view-pie { width: 230px; height: 230px; border-radius: 50%; flex: 0 0 230px; box-shadow: inset 0 0 0 1px #ffffff60; }
.funds-view-distribution ul { list-style: none; margin: 0; padding: 0; max-width: 540px; width: 100%; max-height: 340px; overflow: auto; }
.funds-view-distribution li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; }
.funds-view-distribution i { width: 12px; height: 12px; border-radius: 3px; }
.funds-view-distribution [data-balance-name] { overflow-wrap: anywhere; }
.funds-legend-values { display: flex; flex-direction: column; gap: 3px; text-align: right; font-variant-numeric: tabular-nums; }
.funds-legend-values [data-balance-percent] { color: var(--muted); font-size: 12px; font-weight: 500; }
.funds-export-scope { overflow-wrap: anywhere; }
.funds-export-scope p { margin: 6px 0; }
.funds-swatch-0 { background: #2563eb; }
.funds-swatch-1 { background: #0d9488; }
.funds-swatch-2 { background: #7c3aed; }
.funds-swatch-3 { background: #d97706; }
.funds-swatch-4 { background: #dc2626; }
.funds-swatch-5 { background: #0891b2; }
.funds-swatch-6 { background: #4f46e5; }
.funds-swatch-7 { background: #65a30d; }
.funds-comparison-node { min-width: 0; border-bottom: 1px solid var(--line); padding: 12px 0; }
.funds-comparison-node > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.funds-comparison-node > summary::-webkit-details-marker { display: none; }
.funds-comparison-node > summary::before { content: '▶'; flex: 0 0 14px; color: var(--brand); font-size: 12px; }
.funds-comparison-node[open] > summary::before { transform: rotate(90deg); }
.funds-comparison-node[open] > summary { margin-bottom: 12px; }
.funds-comparison-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.funds-comparison-flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
.funds-comparison-node > summary b { white-space: nowrap; }
.funds-comparison-children { min-width: 0; padding-left: 16px; border-left: 2px solid var(--line); }
@media (max-width: 950px) { .funds-dashboard-cards { grid-template-columns: 1fr; } .funds-view-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .funds-view-filters > label { flex: 1 1 45%; min-width: 0; } .funds-view-filters .region-filter { flex-basis: 100%; } .funds-validation > div { grid-template-columns: 1fr; } .funds-view-distribution { flex-direction: column; gap: 20px; } .funds-view-pie { width: 190px; height: 190px; flex-basis: 190px; } .funds-view-pager { gap: 8px; font-size: 13px; } .funds-comparison-node > summary { align-items: start; } .funds-comparison-children { padding-left: 10px; } .funds-comparison-flags { max-width: 112px; } }
@media (max-width: 640px) {
  .funds-view-table { display: table; }
  .funds-view-table thead { display: table-header-group; }
  .funds-view-table tbody { display: table-row-group; width: auto; }
  .funds-view-table tr { display: table-row; width: auto; border: 0; border-radius: 0; margin: 0; padding: 0; }
  .funds-view-table th, .funds-view-table td { display: table-cell; width: auto; padding: 10px 12px; }
}
