/* =========================================================
   Accounting pages (general ledger, statements, payables,
   operating bank, period close) — shared by accounting-*.html
   ========================================================= */

/* Filter bar (toolbar controls — not configurable lookup lists) */
.acc-filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.acc-filters > label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.acc-filters input:not([type=checkbox]), .acc-filters select { height: 36px; border: 1px solid #D6D0C0; border-radius: 8px; padding: 0 10px; font: inherit; font-weight: 400; background: var(--card); color: var(--ink); min-width: 140px; }
.acc-filters .grow { flex: 1; }
.acc-filters .grow input { width: 100%; }
.acc-filters label.inline { flex-direction: row; align-items: center; gap: 6px; height: 36px; font-weight: 500; }
.acc-filters label.inline input { width: 16px; height: 16px; accent-color: var(--navy); }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid #D6D0C0; border-radius: 8px; overflow: hidden; height: 36px; }
.seg button { border: none; background: var(--card); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 14px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--navy); color: #fff; }

/* Amounts */
.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--red); }
.nowrap { white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #FBF9F3; }
.tbl tr.inactive td { color: var(--muted); }
.tbl tr.warnrow td { background: #FFFBF1; }
.tbl tr.badrow td { background: #FDF3F0; }
.tbl tr.mutedrow td { color: var(--muted); }
.tbl tr.type-h td { background: #F6F4EE; font-weight: 700; font-family: var(--serif); font-size: 14.5px; }
.tbl td.indent { padding-left: 34px; }
.tbl-empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }

/* Financial statement tables */
.stmt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 20px 8px; }
.stmt-head h2 { font-size: 22px; }
.stmt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.stmt th { text-align: right; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #FBFAF6; white-space: nowrap; }
.stmt th:first-child { text-align: left; }
.stmt td { padding: 7px 14px; border-bottom: 1px solid var(--line-2); }
.stmt td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stmt tr.sec td { font-family: var(--serif); font-weight: 600; font-size: 15px; padding-top: 16px; border-bottom: 1px solid var(--line); }
.stmt tr.grp td { font-weight: 600; color: var(--ink-2); padding-top: 10px; }
.stmt tr.acct td:first-child { padding-left: 30px; }
.stmt tr.sub td { font-weight: 700; border-top: 1px solid var(--line); background: #FBFAF6; }
.stmt tr.tot td { font-weight: 700; font-family: var(--serif); font-size: 15px; border-top: 2px solid var(--ink-2); border-bottom: 3px double var(--ink-2); background: #F6F4EE; }
.stmt tr.zero { display: none; }
.stmt.show-zero tr.zero { display: table-row; }
.stmt .fig { background: none; border: none; padding: 0; font: inherit; color: var(--navy); cursor: pointer; font-variant-numeric: tabular-nums; }
.stmt .fig:hover { text-decoration: underline; }
.stmt .code { color: var(--muted); margin-right: 6px; }
.stmt-notes { margin: 8px 20px 20px; padding: 0 0 0 18px; color: var(--muted); font-size: 12.5px; }
.stmt-wrap { overflow-x: auto; }
.trend th, .trend td { font-size: 12.5px; padding-left: 8px; padding-right: 8px; }

/* Side drawer (journal detail, account drill-down) */
.acc-scrim { position: fixed; inset: 0; background: rgba(20,28,40,.35); z-index: 110; display: none; }
.acc-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 720px; max-width: 100%; background: var(--card); z-index: 111; box-shadow: -12px 0 40px rgba(20,28,40,.2); display: none; flex-direction: column; }
.acc-open .acc-scrim { display: block; }
.acc-open .acc-drawer { display: flex; }
.acc-dh { padding: 20px 24px 14px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.acc-db { padding: 18px 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.acc-df { padding: 14px 24px; border-top: 1px solid var(--line-2); background: #FBFAF6; display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.acc-db .kv { grid-template-columns: 120px 1fr; }
.acc-db code { font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.acc-hint { font-size: 12.5px; color: var(--muted); margin-right: auto; max-width: 440px; }

/* Journal entry grid (manual journal, opening balances, bill lines) */
.je-tbl td { padding: 6px 8px; }
.je-tbl input, .je-tbl select { height: 36px; border: 1px solid #D6D0C0; border-radius: 7px; padding: 0 8px; font: inherit; width: 100%; background: var(--card); }
.je-tbl input.num { text-align: right; }
.je-tbl .field { gap: 0; }
.je-tbl .field label { display: none; }
.je-bal { font-size: 13px; font-weight: 600; }
.je-bal.ok { color: var(--green); }
.je-bal.bad { color: var(--red); }

/* KPI tiles row */
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi .value.sm { font-size: 26px; }

/* Reconciliation two-column */
.recon2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.recon2 h3 { margin-bottom: 8px; }
.recon2 .r { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.recon2 .r span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.recon2 .r.total { font-weight: 700; border-top: 2px solid var(--ink-2); border-bottom: none; }
.recon2 .items { padding: 4px 0 4px 14px; font-size: 12.5px; color: var(--muted); }
.recon2 .items .r { border-bottom: none; padding: 3px 0; font-size: 12.5px; }
.recon-result { margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-weight: 700; display: flex; justify-content: space-between; }
.recon-result.ok { background: var(--green-bg); color: var(--green); }
.recon-result.bad { background: var(--red-bg); color: var(--red); }

/* Checklist */
.check-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.check-item:last-child { border-bottom: none; }
.check-item .t { font-weight: 600; }
.check-item .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Month list */
.months .tbl tr.sel td { background: var(--navy-t); }
.months .tbl tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--navy); }

.lock-note { font-size: 12.5px; color: var(--muted); }
.src-tbl td:first-child { white-space: nowrap; font-weight: 600; }
.tag.trust { background: #E7EFE3; color: #2F5A1E; }
.tag.sys { background: var(--navy-t); color: var(--navy); }
.split-sum { font-size: 13px; font-weight: 600; }
details.acc-more > summary { cursor: pointer; font-weight: 600; color: var(--navy); list-style: none; }
details.acc-more > summary::-webkit-details-marker { display: none; }
details.acc-more[open] > summary { margin-bottom: 12px; }
@media print { .sidebar, .topbar, .acc-filters, .tabs, .page-header .actions, .mock-fab { display: none !important; } }
