/* Finance uses the workspace's theme tokens. Printed statements keep a white document. */
@media screen {
  .finance-workspace { min-width: 0; }
  .finance-tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .finance-tabs button { flex: 0 0 auto; padding: 13px 18px; background: transparent; color: var(--muted); border-radius: 9px 9px 0 0; border-bottom: 3px solid transparent; font-weight: 650; }
  .finance-tabs button.active { color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, transparent); border-bottom-color: var(--teal); }
  .finance-filter-card { margin-bottom: 18px; padding: 19px; }
  .finance-presets { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 17px; }
  .finance-presets button { color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
  .finance-presets button.active { color: var(--teal); border-color: var(--teal); background: color-mix(in srgb, var(--teal) 7%, transparent); font-weight: 700; }
  .finance-filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
  .finance-filters .field { flex: 1 1 130px; min-width: 110px; margin: 0; }
  .finance-filters .finance-wide-filter { flex: 1.3 1 180px; }
  .finance-filters input, .finance-filters select { min-width: 0; width: 100%; margin-bottom: 0; }
  .finance-filters .btn { min-height: 40px; margin-bottom: 0; }
  .finance-error { color: #bd3434; font-size: 12px; margin: 12px 0 0; line-height: 1.6; }
  .finance-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
  .finance-kpi { display: flex; flex-direction: column; gap: 12px; padding: 19px; min-width: 0; }
  .finance-kpi > span { color: var(--muted); font-size: 12px; font-weight: 550; }
  .finance-kpi > strong { color: var(--ink); font-size: clamp(19px, 1.75vw, 28px); letter-spacing: -.6px; line-height: 1.4; overflow-wrap: anywhere; }
  .finance-kpi small { color: var(--muted); font-size: 11px; line-height: 1.55; }
  .finance-kpi strong small { font-weight: 500; letter-spacing: 0; }
  .finance-kpi.primary { border-top: 3px solid var(--teal); }
  .finance-kpi.primary > strong { color: var(--teal); }
  .finance-explanation { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 16px 0 20px; }
  .finance-explanation p { margin: 0 0 10px; }
  .finance-check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 12px; cursor: pointer; }
  .finance-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--teal); }
  .finance-margin { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 20px; margin-bottom: 20px; }
  .finance-margin > div:first-child { flex: 1 1 250px; }
  .finance-margin h2 { font-size: 14px; margin: 0 0 8px; }
  .finance-margin p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.7; }
  .finance-margin > div:not(:first-child) { display: flex; flex-direction: column; gap: 9px; }
  .finance-margin > div > span { color: var(--muted); font-size: 11px; }
  .finance-margin > div > b { font-size: 18px; }
  .finance-margin-note { flex: 1 1 100%; padding-top: 12px; border-top: 1px solid var(--line); }
  .finance-analysis-table, .finance-ledger { margin-bottom: 20px; overflow: hidden; }
  .finance-analysis-table table td:not(:first-child), .finance-analysis-table table th:not(:first-child), .finance-numeric { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .finance-analysis-table table { min-width: 590px; }
  .finance-ledger table { min-width: 970px; }
  .finance-ledger td { vertical-align: top; }
  .finance-ledger td:first-child { min-width: 120px; }
  .finance-ledger td:nth-child(2) { min-width: 160px; max-width: 240px; overflow-wrap: anywhere; }
  .finance-ledger td:nth-child(3), .finance-ledger td:last-child { min-width: 130px; max-width: 210px; overflow-wrap: anywhere; }
  .finance-workspace td small { display: block; color: var(--muted); line-height: 1.6; font-size: 10px; margin-top: 4px; }
  .finance-workspace td.finance-numeric small, .finance-analysis-table td:not(:first-child) small { display: inline; }
  .finance-ledger tfoot { font-weight: 700; background: color-mix(in srgb, var(--teal) 5%, transparent); }
  .finance-ledger .finance-reconciled { background: color-mix(in srgb, var(--teal) 3%, transparent); }
  .finance-point-button { background: color-mix(in srgb, var(--teal) 7%, transparent); color: var(--teal); border: 1px solid color-mix(in srgb, var(--teal) 24%, transparent); border-radius: 7px; font-size: 11px; padding: 7px 10px; }
  .finance-pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
  .finance-pagination .btn { padding: 7px 11px; font-size: 11px; }
  .finance-data-notice { line-height: 1.75; margin: 18px 0; font-size: 12px; }
  .finance-data-notice p { margin: 6px 0; }
  .finance-data-notice ul { margin: 7px 0; padding-inline-start: 18px; }
  .finance-reconcile-review { background: color-mix(in srgb, var(--teal) 6%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 17px; margin-bottom: 16px; }
  .finance-reconcile-review > span { color: var(--muted); font-size: 12px; }
  .finance-reconcile-review h3 { margin: 9px 0; color: var(--ink); }
  .finance-reconcile-review p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
  @media (max-width: 1100px) { .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 560px) { .finance-kpis { gap: 9px; } .finance-kpi { padding: 14px; gap: 8px; } .finance-kpi > strong { font-size: 19px; } .finance-filter-card { padding: 14px; } .finance-tabs button { padding: 12px 10px; font-size: 12px; } .finance-filters .field { flex: 1 1 130px; } .finance-filters .btn { width: 100%; } .finance-pagination { flex-wrap: wrap; padding: 12px; } }
}
.finance-statement-print { color: #1e293b; background: #fff; }
.finance-statement-print .document-reference h1 { font-size: 18px; line-height: 1.5; }
.finance-statement-print .document-reference { min-width: 210px; }
.finance-statement-print table { width: 100%; border-collapse: collapse; font-size: 9px; }
.finance-statement-print .document-lines { table-layout: fixed; }
.finance-statement-print .document-lines th:nth-child(1) { width: 13%; }
.finance-statement-print .document-lines th:nth-child(2) { width: 22%; }
.finance-statement-print .document-lines th:nth-child(3) { width: 17%; }
.finance-statement-print .document-lines th:nth-child(4), .finance-statement-print .document-lines th:nth-child(5), .finance-statement-print .document-lines th:nth-child(6), .finance-statement-print .document-lines th:nth-child(7) { width: 12%; }
.finance-statement-print .document-lines th:nth-child(-n+3), .finance-statement-print .document-lines td:nth-child(-n+3), .finance-statement-print .document-lines th:last-child, .finance-statement-print .document-lines td:last-child { text-align: start; }
.finance-statement-print th, .finance-statement-print td { padding: 8px 5px; text-align: start; overflow-wrap: anywhere; }
.finance-statement-print small { display: block; color: #64748b; line-height: 1.5; font-size: 8px; }
.finance-statement-print td.finance-numeric { white-space: nowrap; text-align: end; }
.finance-statement-print td.finance-numeric small { display: inline; }
.finance-statement-print .badge { background: #e9f3ef; color: #275d48; border-radius: 3px; padding: 2px 4px; font-size: 8px; }
.finance-print-purpose, .finance-print-equation { font-size: 10px; line-height: 1.8; color: #475569; }
.finance-print-balances { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; border-block: 1px solid #dbe2ea; padding: 13px 0; margin: 15px 0; font-size: 9px; }
.finance-print-balances span { display: flex; flex-direction: column; gap: 5px; }
.finance-print-balances b { font-size: 12px; }
.finance-print-balances b small { display: inline; }
.finance-statement-print .notice { border: 1px solid #e2c785; background: #fff; color: #72571f; padding: 10px; margin: 15px 0; font-size: 9px; line-height: 1.6; }
.finance-statement-print .finance-data-notice p small { display: inline; }
@media print { .finance-statement-print { font-family: "Fatoura Inter", "Fatoura Arabic", sans-serif; } .finance-statement-print thead { display: table-header-group; } .finance-statement-print tr { break-inside: avoid; } .finance-statement-print .document-heading { break-inside: avoid; } .finance-statement-print .finance-data-notice { display: block !important; } }
