.ledger-heading { display: flex; align-items: baseline; gap: 9px; padding: 18px 10px 8px; }
.ledger-heading h2 { font-size: 16px; }
.ledger-heading span, .ledger-postings .cell-note { color: var(--muted); font-size: 12px; }
.ledger-postings { width: 100%; min-width: 470px; font-size: 13px; }
.ledger-postings th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.ledger-postings td { padding: 10px; }
.ledger-postings .cell-note { display: block; }
.ledger-merchant { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0; color: var(--ink); font-weight:600; text-decoration: none; }
.ledger-merchant:hover { text-decoration: underline; }
.ledger-postings .is-selected { background: var(--accent-wash); }
.ledger-postings .is-selected td:first-child { box-shadow: inset 3px 0 var(--accent); }
.ledger-workspace:has(.inbox-ledger:only-child) { grid-template-columns: 1fr; }
.ledger-compact-date { display: none; }
@media (max-width: 760px) {
  .ledger-postings { min-width: 0; }
  .ledger-compact-date { display: inline; }
  .ledger-postings th:nth-child(2), .ledger-postings td:nth-child(2) { display: none; }
  .ledger-postings td { padding: 10px 4px; }
  .ledger-postings .money { white-space: nowrap; }
}

/* One tab style everywhere, as TONIFY's menu tabs: ink text and a 2px accent underline. */
:is(.book-tabs, .hr-tabs) { display: flex; gap: 20px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
:is(.book-tabs a, .hr-tabs button) { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: -1px; padding: 0 2px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .15s var(--ease); }
:is(.book-tabs a, .hr-tabs button):hover { color: var(--ink); }
:is(.book-tabs a[aria-current], .hr-tabs button[aria-current="page"]) { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.book-total { margin-left: auto; font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ledger-merchant small { margin-inline-start: 6px; font-weight: 500; color: var(--accent-strong); }
.booked-balances dd a { color: inherit; text-decoration: none; }
.booked-balances dd a:hover { color: var(--accent-strong); }
.booked-balances dd small { display: inline-block; color: var(--accent-strong); font-size: 12px; }
@media (max-width: 760px) {
  .ledger-postings td:first-child { overflow-wrap: anywhere; }
  .ledger-compact-date { display: block; color: var(--muted); font-size: 12px; }
}

.book-month { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.book-month input { margin: 0; width: auto; }
/* Summary figures are TONIFY's dashboard cards: apart by 12px, label over figure, and the figure that matters
   takes the accent as its colour. */
.book-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; margin: 0 0 16px; }
.book-kpis > div { min-width: 0; min-height: 108px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.book-kpis dt { color: var(--ink-2); font-weight: 400; font-size: 13px; line-height: 20px; }
.book-kpis dd { margin: 8px 0 0; font-size: 30px; line-height: 36px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.book-kpis > div:last-child dd { color: var(--accent-ink); }
.panel-body > .book-kpis { margin-bottom: 0; }
.book-comparison { margin-bottom: 20px; overflow: hidden; }
.part-table th:not(:first-child), .part-table td { text-align: right; font-variant-numeric: tabular-nums; }
.part-table tbody th { background: transparent; }
.part-table tbody a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); text-decoration: none; font-size: 14px; }
.part-table .part-selected { background: var(--accent-wash); }
.part-net { font-weight:600; }
.part-net.negative { color: var(--danger); }
.book-detail { overflow: hidden; }
.part-entries { min-width: 580px; }
.part-entries .cell-note { max-width: 44ch; }
.book-dialog { width: min(550px,calc(100% - 24px)); max-height: 88dvh; overflow: auto; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--float); color: var(--ink); }
.book-dialog::backdrop { background: rgba(23,23,23,.35); }
.book-dialog header, .book-rules li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.book-dialog header { margin-bottom: 18px; }
.book-dialog .form-actions { justify-content: flex-end; }
.book-rules { padding: 0; list-style: none; }
.book-rules li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.book-rules li:last-child { border-bottom: 0; }
.part-catalogue-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.part-catalogue-head p, .part-catalogue-list p { margin: 0; color: var(--muted); font-size: 12px; }
.part-catalogue-edit { border-block: 1px solid var(--line); padding-block: 16px; }
.part-catalogue-edit h3 { margin-bottom: 12px; }
.part-catalogue-list { margin: 0; }
.part-catalogue-list li { padding-inline: 8px; }
.book-rules.part-catalogue-list li { flex-wrap: nowrap; }
.part-catalogue-list li.is-editing { background: var(--accent-wash); }
.part-catalogue-list li > div:first-child { flex: 1 1 0; min-width: 0; }
.part-catalogue-name, .part-catalogue-actions { display: flex; align-items: center; gap: 6px; }
.part-catalogue-name { flex-wrap: wrap; margin-bottom: 4px; overflow-wrap: anywhere; }
.part-catalogue-name .is-ended { color: var(--muted); }
.part-catalogue-actions { margin-left: auto; flex-shrink: 0; }
.part-catalogue-actions .button { color: var(--accent); }
.book-calculated { align-self: end; padding: 12px; background: var(--accent-wash); border-radius: 8px; font-weight: 600; }
@media (max-width: 600px) {
  .book-kpis { gap: 8px; }
  .book-kpis > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 0; padding: 12px 16px; }
  .book-kpis dd { margin: 0; font-size: 20px; line-height: 28px; }
  .part-table td, .part-table th { padding: 6px; }
  .book-rules li { flex-wrap: wrap; }
}

.book-foot { padding: 12px 20px; font-size: 12px; background: var(--canvas); }
.part-trend { min-width: 620px; }
.part-trend tbody td a { color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
.part-trend tbody td a:hover { text-decoration: underline; }
.part-table .negative, .part-table td.negative a { color: var(--danger); }
@media (max-width: 600px) {
  .part-entries { min-width: 0; }
  .part-entries thead { display: none; }
  .part-entries tbody { display: block; }
  .part-entries tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; padding: 14px; border-top: 1px solid var(--line); }
  .part-entries td, .part-entries td:first-child, .part-entries td:last-child { padding: 0; border: 0; }
  .part-entries td:nth-child(1) { color: var(--muted); grid-column: 1; }
  .part-entries td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .part-entries td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  .part-entries td:nth-child(4) { grid-column: 2; grid-row: 2; }
  .part-entries td:nth-child(5) { grid-column: 1/-1; justify-self: end; }
}

.book-loss { display: block; color: var(--danger); font-size: 12px; font-weight: 500; white-space: normal; }

.book-outstanding { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; min-height: 44px; padding: 10px 16px; margin-bottom: 16px; background: var(--warning-wash); border: 1px solid var(--line); border-radius: 8px; color: var(--warning); text-decoration: none; }
.book-outstanding span { font-size: 13px; }
.book-breakdown { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 18px; padding-inline: 4px; }
.book-breakdown div { display: flex; gap: 8px; align-items: baseline; }
.book-breakdown dt { color: var(--muted); font-size: 13px; }
.book-breakdown dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

details.expand.legacy-picker { padding-inline: 18px; }
.legacy-picker summary { min-height: 32px; align-content: center; }
@media (max-width: 600px) {
  .legacy-totals th, .legacy-totals td { padding: 8px 2px; font-size: 12px; }
  .legacy-totals th:first-child { white-space: normal; }
}

.refund-transfer fieldset { grid-column:1/-1; }
.refund-transfer legend { margin-bottom:8px; font-weight:600; }
.staff-form .refund-choice,.staff-form .refund-all { display:flex; align-items:center; gap:12px; min-height:44px; padding:7px 0; }
.refund-choice { border-top:1px solid var(--line); }
.refund-choice strong { margin-left:auto; white-space:nowrap; }
.refund-choice input,.refund-all input { margin:0; }
.refund-total { text-align:right; color:var(--ink); font-weight:600; }

/* Account balances are summary cards, as TONIFY's dashboard cards: label, figure, one quiet line. */
.finance-accounts {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:12px}
.finance-accounts article {min-height:108px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.finance-accounts h3 {margin:0;color:var(--ink-2);font-size:13px;line-height:20px;font-weight:400}
.finance-accounts strong,.finance-accounts small {display:block}
.finance-accounts strong {margin-top:4px;font-size:30px;line-height:36px;font-weight:500;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.finance-accounts small {margin-top:4px;color:var(--muted);font-size:12px;line-height:16px;font-variant-numeric:tabular-nums}
.finance-rates {margin:1rem 0}.finance-rates label,.finance-rates button,[data-bank-status] {margin:.5rem}
.ledger-group th { height: 32px; padding-block: 0; background: var(--canvas); color: var(--muted); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--line-soft); }
.annual-table tr.is-quiet :is(th, td) { color: var(--muted); }
.annual-table tr.is-quiet th a { color: var(--muted); font-weight: 500; }
.annual-table tr.is-current :is(th, td) { background: rgba(138, 93, 71, .05); }
.annual-table tr.is-current th { box-shadow: inset 3px 0 var(--accent); }
.status-tile small { transition: color .15s var(--ease); }
a.status-tile:hover small { color: var(--accent-ink); }

.part-table :is(th, td) { height: 44px; padding-block: 0; }
.part-table tbody td { font-weight: 400; }
