/* Ledger › Ledgers (#ledger). Colours come from styles.css's tokens, so light and dark both work. */
.ledger-panel { margin-bottom: 16px; }
.ledger-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); align-items: end; margin-bottom: 8px; }
.ledger-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.ledger-form input, .ledger-form select, .ledger-acct-edit input { font: 13px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 36px; width: 100%; box-sizing: border-box; }
.ledger-yearend { display: grid; grid-template-columns: 5rem 1fr; gap: 8px; }
.ledger-back { margin: 0 0 12px; }
.ledger-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.ledger-group th { text-align: left; background: var(--panel-2, var(--panel)); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ledger-acct td, .ledger-acct th { text-align: left; }
.ledger-code { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-archived td { color: var(--muted); }
.ledger-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--ink); }
.ledger-acts { white-space: nowrap; text-align: right; }
.ledger-acct-edit { display: flex; gap: 8px; align-items: center; }
.ledger-add { margin-top: 16px; }
@media (max-width: 640px) { .ledger-yearend { grid-template-columns: 4.5rem 1fr; } }

/* Ledger › Journals (#ledger-journals) */
.lj-toolbar { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.lj-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lj-lock { margin-bottom: 4px; }
.lj-confirm { border-left: 4px solid var(--amber); }
.lj-grid input, .lj-grid select, #lj-form textarea, .lj-confirm input { font: 13px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-height: 34px; width: 100%; box-sizing: border-box; }
.lj-grid input.num, .lj-list .num, .lj-lines .num, .lj-grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
#lj-form textarea { margin-top: 4px; }
#lj-form > label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); margin: 8px 0; }
.lj-mode-opening .lj-desc-col { display: none; }
.lj-totals { font-size: 14px; margin: 8px 0; }
.lj-ok { color: var(--green); font-weight: 600; }
.lj-bad { color: var(--red); font-weight: 600; }
.lj-problems { margin: 4px 0 12px; padding-left: 18px; color: var(--red); font-size: 13px; }
.lj-problems:empty { display: none; }
.lj-row.is-open td { border-bottom-color: transparent; }
.lj-detail td { background: var(--panel-2, var(--panel)); }
.lj-detail-body { padding: 4px 0 8px; }
.lj-lines th, .lj-lines td { text-align: left; }
.lj-lines .num { text-align: right; }
.lj-edited { background: var(--amber-soft); color: var(--amber); }
.lj-history { margin-top: 8px; font-size: 13px; }
.lj-history ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.lj-reason { color: var(--ink-2); }
.lj-changes { margin: 4px 0; padding-left: 18px; color: var(--muted); }
@media (max-width: 640px) { .lj-lines th, .lj-list thead { display: none; } }

/* Ledger › Reports (lr-) */
.lr-controls { align-items: flex-end; }
.lr-check { display: flex; align-items: center; gap: 6px; }
.lr-table td.num, .lr-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lr-table .lr-sec th, .lr-table .lr-sec td { background: var(--panel-2, #f4f6f8); text-transform: none; font-weight: 600; }
.lr-table .lr-total th, .lr-table .lr-total td { border-top: 1px solid var(--line); font-weight: 600; }
.lr-table .lr-grand th, .lr-table .lr-grand td { border-top: 2px solid var(--ink); font-weight: 700; }
#lr-banner { border-left: 4px solid var(--red, #c62828); font-weight: 600; }
#lr-edited { border-left: 4px solid var(--amber); }
@media print { #lr-form, #lr-pick, .page-head p, #lr-banner[hidden] { display: none; } }

/* The Ledger's per-client menu in the left navigation (built by nav.js) */
.nav-client[hidden] { display: none; }
.nav-client .side-back { margin-bottom: 6px; }
.nav-client-name { font-weight: 700; }

/* Ledger › Fixed assets (fa-) */
.fa-table td.num, .fa-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fa-table .fa-gone td { color: var(--muted); }
.fa-table .fa-diff td { color: var(--red, #c62828); font-weight: 600; }
#fa-preview, #fa-d-plan { border-left: 4px solid var(--amber); padding-left: 12px; margin: 12px 0; }
/* Ledger › Sales (ls-) */
.ls-table td.num, .ls-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ls-table .ls-void td { color: var(--muted); text-decoration: line-through; }
.ls-table .ls-overdue td.ls-status { color: var(--red, #c62828); font-weight: 600; }
.ls-table .ls-pays td { background: var(--panel-2, rgba(0,0,0,.03)); font-size: .92em; }
.ls-lines input, .ls-lines select { width: 100%; }
#ls-preview { border-left: 4px solid var(--amber); padding-left: 12px; margin: 12px 0; }
#ls-preview:empty { display: none; }
@media print { #ls-pick, #ls-add-box, #ls-pay-box, .page-head p { display: none; } }
/* Ledger › Purchases (lp-) */
.lp-table td.num, .lp-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp-table .lp-void td { color: var(--muted); text-decoration: line-through; }
.lp-table .lp-overdue td.lp-status { color: var(--red, #c62828); font-weight: 600; }
.lp-table .lp-pays td { background: var(--panel-2, rgba(0,0,0,.03)); font-size: .92em; }
.lp-lines input, .lp-lines select { width: 100%; }
.lp-upload { margin-bottom: 12px; }
#lp-preview, #lp-warnings .lp-warn { border-left: 4px solid var(--amber); padding-left: 12px; margin: 12px 0; }
#lp-preview:empty, #lp-warnings:empty { display: none; }
@media print { #lp-pick, #lp-add-box, #lp-pay-box, .page-head p { display: none; } }
@media print { #fa-pick, #fa-add-box, .page-head p { display: none; } }
