@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=Michroma&display=swap');
:root[data-theme="dark"]{color-scheme:dark;--ink:#e6ece9;--muted:#9da9a5;--line:#2e3c37;--green:#6bc4a2;--green-dark:#83d2b2;--mint:#1e3930;--bg:#111a17;--white:#19231f;--red:#e18479;--shadow:0 14px 40px #0006} :root[data-theme="dark"] body,:root[data-theme="dark"] .sidebar,:root[data-theme="dark"] .main,:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .card,:root[data-theme="dark"] .business-switch,:root[data-theme="dark"] .button.secondary,:root[data-theme="dark"] .icon-button,:root[data-theme="dark"] .modal,:root[data-theme="dark"] .business-menu,:root[data-theme="dark"] .business-option,:root[data-theme="dark"] .filter-select,:root[data-theme="dark"] .period-select,:root[data-theme="dark"] .field input,:root[data-theme="dark"] .field select,:root[data-theme="dark"] .field textarea,:root[data-theme="dark"] .search{background:#19231f;color:var(--ink)}:root[data-theme="dark"] body{background:#111a17}:root[data-theme="dark"] .sidebar,:root[data-theme="dark"] .topbar{border-color:var(--line)}:root[data-theme="dark"] .nav-item{color:#a7b2ad}:root[data-theme="dark"] .nav-item:hover,:root[data-theme="dark"] .business-option:hover{background:#22312b}:root[data-theme="dark"] .nav-item.active,:root[data-theme="dark"] .business-option.selected{background:#1e3930;color:#8ad5b7}:root[data-theme="dark"] .nav-item.active i{color:#8ad5b7}:root[data-theme="dark"] .brand{color:#a2e2c6}:root[data-theme="dark"] .brand-mark{background:#218768}:root[data-theme="dark"] .metric-icon{background:#243a31;color:#81c7aa}:root[data-theme="dark"] .metric-icon.blue{background:#273241;color:#9cb5e2}:root[data-theme="dark"] .metric-icon.orange{background:#3a3026;color:#e0ad71}:root[data-theme="dark"] .metric-icon.purple{background:#332b3d;color:#baa5db}:root[data-theme="dark"] .cash-card{background:#20352c}:root[data-theme="dark"] .cash-card .panel-title,:root[data-theme="dark"] .cash-total{color:#a2dfc2}:root[data-theme="dark"] .cash-row{border-color:#354b40;color:#a5b9ae}:root[data-theme="dark"] .cash-row b{color:#d4e5dc}:root[data-theme="dark"] .table td,:root[data-theme="dark"] .journal-row,:root[data-theme="dark"] .account-row{border-color:#2b3934}:root[data-theme="dark"] .table td:first-child{color:#e0e8e3}:root[data-theme="dark"] .table th,:root[data-theme="dark"] .axis-label{color:#8a9992;fill:#8a9992}:root[data-theme="dark"] .gridline{stroke:#2a3933}:root[data-theme="dark"] .account-row[style*="background"]{background:#203a30!important;color:#a2dfc2!important}:root[data-theme="dark"] .pill{background:#243d33;color:#8bd3b5}:root[data-theme="dark"] .pill.pending{background:#3c3327;color:#e6ba7c}:root[data-theme="dark"] .pill.overdue{background:#3d2b2a;color:#e2968c}:root[data-theme="dark"] .field input,:root[data-theme="dark"] .field select,:root[data-theme="dark"] .field textarea{border-color:var(--line)}:root[data-theme="dark"] .toast{background:#e4f1ea;color:#19352a}:root[data-theme="dark"] .modal-backdrop{background:#0009}:root[data-theme="dark"] .business-icon{background:#2b394a;color:#a9bee9}
:root{--ink:#1d2939;--muted:#8993a4;--line:#e9edf1;--green:#16745d;--green-dark:#0f5948;--mint:#e8f5f0;--bg:#f8faf9;--white:#fff;--red:#cf655d;--shadow:0 14px 40px #182b2412}*{box-sizing:border-box}body{margin:0;background:#fff;color:var(--ink);font:14px 'DM Sans',sans-serif}.app{display:flex;min-height:100vh}.sidebar{width:248px;flex:0 0 248px;border-right:1px solid var(--line);padding:24px 15px 16px;display:flex;flex-direction:column;background:#fff}.brand{height:44px;display:flex;align-items:center;gap:10px;padding:0 13px;font:800 20px Manrope,sans-serif;letter-spacing:-.8px;color:#183c31}.brand-mark{height:27px;width:27px;border-radius:9px;background:#18765d;color:#fff;display:grid;place-items:center;font:800 15px Manrope;box-shadow:inset 0 -3px 0 #0d5b48}.business-switch{border:1px solid var(--line);border-radius:10px;background:white;margin:20px 3px 28px;padding:10px;display:flex;align-items:center;text-align:left;gap:10px;color:var(--ink);cursor:pointer}.business-icon{width:33px;height:33px;border-radius:8px;background:#edf3ff;color:#6177a4;display:grid;place-items:center;font-weight:700}.business-switch b,.profile b{display:block;font-size:12px;font-weight:600}.business-switch small,.profile small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.chevron{margin-left:auto;color:#98a1ae}.side-label{font-size:10px;font-weight:700;letter-spacing:1px;color:#a2aab5;padding:0 13px 9px}.nav-item{width:100%;border:0;background:transparent;height:40px;border-radius:8px;display:flex;align-items:center;gap:12px;padding:0 13px;color:#667181;font:500 13px 'DM Sans';cursor:pointer;text-align:left;margin-bottom:3px}.nav-item i{font-style:normal;font-size:16px;width:17px;text-align:center;color:#84909f}.nav-item:hover{background:#f6f8f7;color:var(--ink)}.nav-item.active{background:var(--mint);color:var(--green);font-weight:600}.nav-item.active i{color:var(--green)}.nav-count{margin-left:auto;background:#fff;border:1px solid #e8ecea;color:#69746f;padding:2px 7px;border-radius:10px;font-size:10px}.reports-label{margin-top:24px}.sidebar-bottom{margin-top:auto}.profile{border-top:1px solid var(--line);margin-top:13px;padding:16px 4px 0;display:flex;align-items:center;gap:10px}.avatar{border-radius:50%;width:33px;height:33px;background:#f2e7df;color:#755947;font-size:11px;font-weight:700;display:grid;place-items:center}.dots{margin-left:auto;color:#9aa3ad;letter-spacing:2px}.main{min-width:0;flex:1}.topbar{height:68px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 48px}.breadcrumbs{font-size:12px;color:#9aa2ad}.breadcrumbs span{padding:0 10px;color:#cad0d6}.breadcrumbs b{font-weight:500;color:#596576}.top-actions{display:flex;align-items:center;gap:18px}.icon-button{height:31px;width:31px;border:1px solid var(--line);border-radius:8px;background:white;color:#748091;font-size:14px;cursor:pointer}.notification{font-size:18px}.small-avatar{width:30px;height:30px}.content{max-width:1240px;margin:auto;padding:39px 48px 60px}.page-heading{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:31px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1px;color:#9aa4ad}.page-heading h1{font:700 25px Manrope,sans-serif;letter-spacing:-.7px;margin:10px 0 6px}.wave{color:#e4b85c;font-size:18px}.page-heading p{margin:0;color:#8b95a2;font-size:13px}.heading-actions{display:flex;gap:9px}.button{height:37px;padding:0 14px;border-radius:8px;font:600 12px 'DM Sans';cursor:pointer}.button.primary{background:var(--green);color:white;border:1px solid var(--green)}.button.primary:hover{background:var(--green-dark)}.button.secondary{background:white;color:#5e6b7b;border:1px solid var(--line)}.button.secondary:hover{background:#f8faf9}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.card{border:1px solid var(--line);border-radius:10px;background:#fff}.metric{padding:17px 18px 15px;min-height:119px}.metric-label{color:#778392;font-size:11px;display:flex;justify-content:space-between;align-items:center}.metric-icon{height:27px;width:27px;border-radius:7px;display:grid;place-items:center;background:#eef6f2;color:#438872;font-size:14px}.metric-icon.blue{background:#eef2fb;color:#7186b1}.metric-icon.orange{background:#fbf2e8;color:#c58a4e}.metric-icon.purple{background:#f3eff9;color:#9380b7}.metric-value{font:700 21px Manrope,sans-serif;margin:9px 0 5px;letter-spacing:-.5px}.metric-foot{font-size:10px;color:#9aa3ad}.positive{color:#258c67;font-weight:600}.negative{color:#c76f64;font-weight:600}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(260px,.9fr);gap:15px;margin-top:17px}.panel{padding:18px 20px}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:19px}.panel-title{font:700 13px Manrope,sans-serif}.panel-subtitle{color:#97a0ab;font-size:10px;margin-top:4px}.text-link{border:0;background:none;color:var(--green);font:600 11px 'DM Sans';cursor:pointer}.period-select{border:1px solid var(--line);background:#fff;border-radius:6px;padding:6px 9px;color:#687486;font:11px 'DM Sans'}.chart-legend{font-size:10px;color:#84909d;display:flex;gap:15px;margin-top:-5px;margin-bottom:10px}.legend-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#1a785e;margin-right:5px}.legend-dot.pale{background:#c7e5d9}.chart{height:150px;position:relative}.chart svg{width:100%;height:100%;overflow:visible}.gridline{stroke:#edf0f1;stroke-width:1}.axis-label{fill:#a2aab2;font:9px 'DM Sans'}.activity-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #f0f2f3}.activity-row:last-child{border:0}.activity-icon{width:31px;height:31px;border-radius:8px;background:#eff6f2;color:#4c8b72;display:grid;place-items:center;font-size:13px}.activity-icon.expense{background:#fbf2e9;color:#c28e59}.activity-icon.paid{background:#edf2fb;color:#6b83b0}.activity-text{min-width:0;flex:1}.activity-text b{font-size:11px;display:block;font-weight:600}.activity-text small{font-size:10px;color:#9aa2ad;display:block;margin-top:3px}.activity-amount{font-size:11px;font-weight:600}.lower-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:15px;margin-top:15px}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;white-space:nowrap}.table th{text-align:left;text-transform:uppercase;letter-spacing:.65px;color:#a0a8b1;font-size:9px;font-weight:700;padding:0 12px 11px}.table td{border-top:1px solid #eff1f2;padding:12px;color:#526071;font-size:11px}.table td:first-child{color:#273447;font-weight:600}.pill{display:inline-block;padding:4px 8px;border-radius:15px;background:#eef6f2;color:#43846d;font-size:9px;font-weight:600}.pill.pending{background:#fcf4e9;color:#b78647}.pill.overdue{background:#fbefee;color:#c16e67}.cash-card{background:#eff7f3;border:0;padding:19px}.cash-card .panel-title{color:#285f4d}.cash-row{display:flex;justify-content:space-between;border-bottom:1px solid #dcebe4;padding:12px 0;font-size:11px;color:#6f857b}.cash-row b{color:#314b40;font-weight:600}.cash-total{display:flex;justify-content:space-between;padding-top:13px;color:#285f4d;font-size:12px;font-weight:700}.section-card{margin-top:14px;padding:20px}.section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}.section-header h2{font:700 14px Manrope;margin:0}.section-header p{margin:5px 0 0;color:#929ba7;font-size:11px}.filter-row{display:flex;gap:8px;margin-bottom:16px}.search{width:220px;border:1px solid var(--line);border-radius:7px;padding:8px 10px;font:11px 'DM Sans';outline:none}.search:focus{border-color:#80aa9b}.filter-select{border:1px solid var(--line);background:#fff;border-radius:7px;padding:7px 10px;color:#667181;font:11px 'DM Sans'}.empty{padding:60px;text-align:center;color:#87919f}.account-row{display:grid;grid-template-columns:1fr 120px 100px;gap:12px;padding:12px;border-top:1px solid var(--line);font-size:11px}.account-row span:last-child{text-align:right}.journal-row{display:flex;align-items:center;padding:13px 10px;border-top:1px solid var(--line);font-size:11px;gap:14px}.journal-date{width:90px;color:#8993a0}.journal-desc{flex:1;font-weight:600}.journal-meta{color:#8993a0;width:110px}.journal-amount{width:100px;text-align:right;font-weight:600}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);background:#203b31;color:white;padding:11px 17px;border-radius:8px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:.25s;font-size:12px;z-index:20}.toast.show{opacity:1;transform:translate(-50%,0)}.modal-backdrop{position:fixed;inset:0;background:#14231e55;display:grid;place-items:center;padding:20px;z-index:10}.modal{width:min(510px,100%);background:white;border-radius:13px;box-shadow:0 24px 70px #14231e38;padding:23px}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.modal-head h2{font:700 18px Manrope;margin:0}.close{border:0;background:none;color:#8993a0;font-size:22px;cursor:pointer}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field{display:flex;flex-direction:column;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:10px;font-weight:600;color:#697586}.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:7px;padding:10px;font:12px 'DM Sans';color:var(--ink);outline:none;background:#fff}.field input:focus,.field select:focus,.field textarea:focus{border-color:#83ab9d}.modal-footer{display:flex;justify-content:flex-end;gap:9px;margin-top:21px}.business-menu{position:absolute;left:17px;top:95px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:9px;padding:6px;width:218px;z-index:4}.business-option{display:flex;width:100%;border:0;background:white;padding:10px;border-radius:6px;text-align:left;gap:9px;align-items:center;cursor:pointer;color:var(--ink);font:12px 'DM Sans'}.business-option:hover{background:#f4f8f6}.business-option small{display:block;color:#919aa6;margin-top:3px}.business-option.selected{background:#eff7f3}.business-switch{position:relative}.business-menu{left:18px;top:95px}@media(max-width:1050px){.content{padding:30px 27px}.topbar{padding:0 27px}.metric-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.sidebar{width:64px;flex-basis:64px;padding:16px 8px}.brand{padding:0 8px}.brand>span:last-child,.business-switch>span:not(.business-icon),.side-label,.nav-item:not(.active) .nav-count,.nav-item{font-size:0}.business-switch{padding:7px 6px;justify-content:center;margin:17px 0}.business-icon{flex:0 0 32px}.nav-item{justify-content:center;padding:0}.nav-item i{font-size:16px}.nav-item.active{font-size:0}.profile{justify-content:center;padding-top:14px}.profile span:not(.avatar){display:none}.content{padding:25px 17px}.topbar{padding:0 18px}.page-heading{align-items:flex-start;gap:14px;flex-direction:column}.dashboard-grid,.lower-grid{grid-template-columns:1fr}.metric-grid{gap:9px}.metric{padding:13px;min-height:105px}.metric-value{font-size:18px}.heading-actions{align-self:stretch}.section-card{padding:14px}.filter-row{flex-wrap:wrap}.business-menu{left:65px;top:85px}}
.brand{padding:0 6px;overflow:hidden}.brand img{display:block;width:100%;max-width:216px;height:auto;object-fit:contain}.brand-mark{display:none}
.brand .brand-logo-dark,.auth-card .brand-logo-dark,:root[data-theme="dark"] .brand-logo-light{display:none}
:root[data-theme="dark"] .brand-logo-dark{display:block}
@media(max-width:760px){.brand{padding:0;justify-content:center}.brand img{width:37px;height:37px;object-fit:cover;object-position:left center;max-width:none}}
.env-badge{font-size:9px;letter-spacing:.8px;font-weight:700;padding:5px 8px;border-radius:5px;background:#fff3d8;color:#98712e;border:1px solid #f1dfb8}:root[data-theme="dark"] .env-badge{background:#403620;color:#f0cb81;border-color:#65552f}
.import-drop{border:1px dashed #b8c8c1;border-radius:10px;padding:24px;text-align:center;background:#f8fbf9;color:#61716a}.import-drop input{display:block;margin:15px auto 0;max-width:100%}.import-files{font-size:11px;color:#778392;line-height:1.8;margin-top:10px}.import-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:16px}.import-status{font-size:12px;padding:11px;border-radius:7px;margin-top:15px;display:none;white-space:pre-wrap}.import-status.visible{display:block}.import-status.error{background:#fbefee;color:#a74f4a}.import-status.success{background:#eef7f2;color:#34715c}.import-summary{margin-top:15px}.import-summary .account-row{grid-template-columns:1fr auto}.reconcile-notice{margin:14px 0;padding:12px 14px;border-radius:8px;border:1px solid #f0ddb3;background:#fff8e9;color:#85672f;font-size:11px;line-height:1.6}.auth-screen{position:fixed;inset:0;z-index:30;background:#f7faf8;display:grid;place-items:center;padding:20px}.auth-card{width:min(430px,100%);background:#fff;border:1px solid #e6ece8;border-radius:14px;padding:28px;box-shadow:0 18px 55px #183c3114;text-align:center}.auth-card img{width:220px;max-width:90%;margin:2px auto 16px}.auth-card h1{font:700 20px Manrope,sans-serif;margin:8px 0}.auth-card p{font-size:12px;color:#52655b;line-height:1.6}.auth-card .button{margin-top:12px}.auth-error{color:#b65650;font-size:11px;margin-top:10px;min-height:16px}:root[data-theme="dark"] .import-drop{background:#1b2722;border-color:#3d564a}:root[data-theme="dark"] .reconcile-notice{background:#393220;border-color:#65552f;color:#e4c47e}:root[data-theme="dark"] .auth-screen{background:#111a17}:root[data-theme="dark"] .auth-card{background:#19231f;border-color:#2e3c37}

#appShell{display:none}#appShell.authenticated{display:flex}
.report-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:16px}.report-heading .section-header{margin:0}.report-range{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}.report-range label{display:flex;flex-direction:column;gap:4px;color:#7b8794;font-size:10px;font-weight:600}.report-range select,.report-range input{height:34px;border:1px solid var(--line);border-radius:7px;background:var(--surface,#fff);padding:6px 9px;color:var(--ink);font:11px 'DM Sans'}.report-range input:disabled{opacity:.5}.report-range .button{height:34px;padding:0 12px}
.report-group{margin-top:18px;font-weight:700;color:var(--ink);border-bottom:1px solid var(--line)}.report-total{font-weight:700;border-top:1px solid var(--line)}
.ledger-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:14px;color:var(--muted);font-size:11px}.ledger-pagination>div{display:flex;gap:8px}.ledger-pagination button:disabled{opacity:.45;cursor:not-allowed}
.dashboard-ledger-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;padding:18px 20px;margin-bottom:18px}.dashboard-ledger-summary>div{display:flex;flex-direction:column;gap:5px}.dashboard-ledger-summary small,.dashboard-ledger-summary span{color:var(--muted);font-size:10px}.dashboard-ledger-summary b{font:700 19px Manrope,sans-serif;color:var(--ink)}@media(max-width:720px){.dashboard-ledger-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}

.invoice-dialog { border: 0; max-width: calc(100% - 32px); max-height: calc(100% - 32px); color: var(--ink); }
.invoice-dialog::backdrop { background: #14231e88; }
#exportBtn:disabled { opacity: .55; cursor: not-allowed; }

.report-print-logo { display: none; }

@media print {
  @page { margin: 16mm; }

  .report-print-logo {
    display: block;
    width: 110pt;
    height: auto;
    margin: 0 0 12pt;
    break-after: avoid;
  }

  body:has(#ledgerReportContent[data-ready]) {
    color-scheme: light;
    background: white !important;
  }
  #appShell:has(#ledgerReportContent[data-ready]) {
    display: block;
    background: white;
  }
  #appShell:has(#ledgerReportContent[data-ready]) :is(.sidebar, .topbar, .page-heading, .report-range),
  body:has(#ledgerReportContent[data-ready]) :is(#modalRoot, #toast) {
    display: none;
  }
  #appShell:has(#ledgerReportContent[data-ready]) :is(.main, .content, .section-card) {
    display: block;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: white;
    color: #18232d;
  }
  .report-heading h2 { font: 700 20pt Arial, sans-serif; }
  .report-heading .section-header p {
    color: #40505b;
    font-size: 10pt;
  }
  .report-heading { break-after: avoid; }
  #ledgerReportContent .account-row {
    display: flex;
    justify-content: space-between;
    gap: 16pt;
    padding: 6pt 0;
    border: 0;
    border-bottom: 1px solid #d7dfe3;
    background: white;
    color: #18232d;
    font-size: 10pt;
    break-inside: avoid;
  }
  #ledgerReportContent .account-row span:first-child { overflow-wrap: anywhere; }
  #ledgerReportContent .account-row span:last-child { white-space: nowrap; }
  #ledgerReportContent .report-group { break-after: avoid; }
  #ledgerReportContent .import-status {
    padding: 8pt 0;
    background: white;
    color: #40505b;
    font-size: 9pt;
    break-inside: avoid;
  }
}
.income-expense-panel { min-width: 0 }
.income-expense-panel .panel-title { margin: 0 }
.income-expense-panel .panel-head, .trend-controls, .trend-legend { display: flex; flex-wrap: wrap; gap: 10px }
.trend-controls label { display: grid; gap: 3px; font-size: 12px }
.trend-controls .period-select { max-width: 100% }
.trend-legend { margin: 8px 0; font-size: 12px }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px }
.trend-legend i { width: 14px; border-top: 2px solid var(--trend-color) }
.trend-income { --trend-color: var(--green) }
.trend-expenses { --trend-color: #a6592d }
:root[data-theme="dark"] .trend-expenses { --trend-color: #eca675 }
.trend-expenses i { border-top-style: dashed }
.trend-plot { display: block; width: 100%; max-height: 202px }
.trend-plot line { stroke: var(--line) }
.trend-plot text { fill: var(--ink); font-size: 11px }
.trend-plot path { fill: none; stroke: var(--trend-color); stroke-width: 2 }
.trend-plot .trend-expenses path { stroke-dasharray: 5 3 }
.trend-plot circle { fill: var(--trend-color) }
[data-trend-plot] { position: relative }
.trend-period {
  position: absolute;
  top: 5.9%;
  height: 80.2%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.trend-period-active { background: color-mix(in srgb, var(--green) 11%, transparent) }
.trend-period:focus-visible { outline: 2px solid var(--green); outline-offset: -2px }
.trend-tooltip {
  position: absolute;
  top: 8px;
  left: clamp(0px, calc(var(--trend-point) - 95px), max(0px, calc(100% - 190px)));
  width: min(190px, 100%);
  z-index: 1;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
}
.trend-tooltip dl { margin: 4px 0 0 }
.trend-tooltip dl div { display: flex; justify-content: space-between; gap: 6px }
.trend-tooltip dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums }
.income-expense-panel details { margin-top: 8px }
.income-expense-panel summary { color: var(--green); cursor: pointer }
.income-expense-panel table { margin-top: 8px; font-variant-numeric: tabular-nums }

.invoice-dialog output {
  display: block;
  min-height: 39px;
  padding-block: 8px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.period-table { overflow-x: auto; margin-block: 12px; }
.period-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.period-table :is(th, td) { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; }
.period-table :is(th:first-child, .period-section th) { text-align: left; }
.period-table tbody th[scope="row"] { font-weight: inherit; }
.period-table :is(th:not(:first-child), td) { white-space: nowrap; }

@media print {
  @page profit-loss { size: landscape; margin: 12mm; }
  #appShell:has(.profit-loss-periods[data-ready]) { page: profit-loss; }
  .profit-loss-periods .period-table { overflow: visible; }
  .profit-loss-periods .period-table + .period-table { break-before: page; }
  .profit-loss-periods table { font: 9pt Arial, sans-serif; color: #18232d; }
  .profit-loss-periods thead { display: table-header-group; }
  .profit-loss-periods tr { break-inside: avoid; }
  .profit-loss-periods .period-section { break-after: avoid; }
  .profit-loss-periods :is(th, td) { padding: 4pt; border-color: #d7dfe3; }
}

.catalog-save { justify-content: end; align-items: start; }
.invoice-lines-title { margin: 20px 0 10px; font-size: 14px; }
.invoice-line {
  min-width: 0;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.invoice-line legend { padding: 0 6px; font-weight: 600; }
.invoice-line .field { min-width: 0; }
.invoice-dialog .field[hidden] { display: none; }
.invoice-line-remove { justify-self: start; }
.invoice-line-description { color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.invoice-details-total { display: flex; justify-content: space-between; gap: 12px; }

.overview-chart { margin-top: 17px; }

.accounting-modal { max-height: 90vh; overflow: auto; }
.accounting-modal .form-grid { border: 0; padding: 0; margin: 0; min-width: 0; }
.journal-form-line { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.journal-form-line input, .journal-form-line select { width: 100%; min-width: 0; }
@media (max-width: 520px) {
  .journal-form-line { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
  .journal-form-line .field:first-child { grid-column: 1 / -1; }
}

.record-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.record-pagination > div { display: flex; gap: 8px; }
.record-pagination button:disabled { opacity: .45; cursor: default; }

/* Keep the attribution below the workspace, including on short pages. */
.main {
  display: flex;
  flex-direction: column;
}
.main > .content {
  width: 100%;
  margin-block: 0;
}
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 9px;
  min-height: 58px;
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: #586677;
  font-size: 12px;
}
.app-footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--ink);
  font: 400 11px Michroma, sans-serif;
  letter-spacing: .075em;
  text-decoration: none;
}
.app-footer-credit:hover { text-decoration: underline; }
.app-footer-domain { color: #1267d5; }
.app-footer-logo-dark,
:root[data-theme="dark"] .app-footer-logo-light { display: none; }
:root[data-theme="dark"] .app-footer-logo-dark { display: block; }
:root[data-theme="dark"] .app-footer { color: #a5b2c1; }
:root[data-theme="dark"] .app-footer-domain { color: #60a5fa; }

#subscriptionNav[hidden], #exportBtn[hidden] { display: none; }

.subscription-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mint);
  margin-bottom: 18px;
}
.subscription-summary h2 { margin: 0; font: 800 16px Manrope, sans-serif; }
.subscription-summary p { margin: 5px 0 0; }
.subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.subscription-plan {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.subscription-plan-current {
  border-color: var(--green);
  box-shadow: inset 0 3px var(--green);
}
.subscription-plan header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.subscription-plan h2 { margin: 0; font: 800 21px Manrope, sans-serif; }
.subscription-plan header span {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
}
.subscription-price { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.subscription-price p { margin: 0 0 8px; }
.subscription-price strong { font: 800 clamp(23px, 3vw, 36px) Manrope, sans-serif; letter-spacing: -.04em; }
.subscription .button { min-height: 40px; height: auto; padding-block: 8px; }
.subscription-price .button { width: 100%; }
.subscription .button:disabled { opacity: .65; cursor: wait; }
:root[data-theme="dark"] .subscription .button.primary { color: #13261e; }
.subscription-note { color: var(--ink); font-size: 12px; margin: 14px 0 0; }
.subscription-error { font-weight: 700; }
.subscription-error:empty { margin: 0; }

@media (max-width: 820px) {
  .subscription-grid { grid-template-columns: 1fr; }
}

.subscription-features {
  margin: 18px 0 0;
  padding: 16px 0 0 18px;
  border-top: 1px solid var(--line);
  line-height: 1.45;
}
.subscription-features li + li { margin-top: 7px; }
.subscription-features li::marker { color: var(--green); }

.account-menu { position: relative; }
.account-menu summary { cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu-panel {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 8px);
  min-width: 152px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.account-menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.account-menu-panel button:hover { background: var(--mint); }

.team-card { margin-top: 18px; }
.team-list { list-style: none; padding: 0; margin: 0 0 18px; }
.team-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.team-email { flex: 1 1 210px; min-width: 0; overflow-wrap: anywhere; }
.team-add {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.team-content > p { margin: 12px 0 0; }
.team-error { color: var(--red); }
.team-error:empty { margin: 0; }
@media (max-width: 600px) {
  .team-add { grid-template-columns: minmax(0, 1fr); }
}

.help-card { margin-top: 16px; }
.help-group + .help-group { margin-top: 20px; }
.help-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.help-topic { border-top: 1px solid var(--line); }
.help-topic:last-child { border-bottom: 1px solid var(--line); }
.help-topic summary {
  padding: 13px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.help-topic[open] { padding-bottom: 16px; }
.help-topic p,
.help-steps {
  max-width: 72ch;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
}
.help-topic p:last-child { margin-bottom: 0; }
.help-steps { padding-inline-start: 1.5em; }
.help-steps li + li { margin-top: 5px; }
.help-figure { margin: 14px 0; }
.help-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.help-figure figcaption {
  font-size: 13px;
  line-height: 1.5;
}
.help-figure figcaption ol {
  display: flex;
  flex-wrap: wrap;
  column-gap: 32px;
  row-gap: 4px;
  margin: 8px 0 0;
  padding-inline-start: 1.5em;
}
.help-figure figcaption li::marker { font-weight: 700; }
.help-image-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
  text-underline-offset: 2px;
}
.help-note {
  padding: 8px 12px;
  border-inline-start: 3px solid var(--green);
}
.help-card :focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.typeahead { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
.typeahead > input { width: 100%; min-width: 0; padding-inline-end: 25px; color: var(--ink); background: var(--surface, var(--white)); }
.typeahead > input:focus { outline: 2px solid var(--green); outline-offset: -2px; }
.typeahead::after { content: ""; position: absolute; inset-inline-end: 10px; top: 50%; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1px 1px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.typeahead-source { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.typeahead-menu { position: fixed; z-index: 1000; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 7px; background: var(--surface, var(--white)); color: var(--ink); box-shadow: var(--shadow); padding: 4px; font-size: 12px; }
.typeahead-menu [role="option"], .typeahead-status { padding: 8px 9px; border-radius: 4px; overflow-wrap: anywhere; }
.typeahead-menu [role="option"] { cursor: pointer; }
.typeahead-menu [aria-selected="true"], .typeahead-menu .typeahead-add { font-weight: 700; }
.typeahead-menu [role="option"]:hover, .typeahead-menu .active { background: var(--mint); color: var(--green-dark); }
.typeahead-status:empty, .business-option[hidden] { display: none; }
.business-search { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface, var(--white)); color: var(--ink); font: inherit; }

:root[data-theme="dark"] .report-range label { color: var(--ink); }
:root[data-theme="dark"] .report-range :is(select, input, .button) {
  background: #24342e;
  border-color: #657b70;
  color: var(--ink);
}

.report-account > :first-child { padding-inline-start: 16px; }
.profit-loss-periods { min-width: 0; }
.period-table .period-account > th { padding-inline-start: 24px; }
.period-print { display: none; }

@media print {
  .period-screen { display: none; }
  .period-print { display: block; }
}

.compact-records { min-width: 0; }
.compact-records .table { font-variant-numeric: tabular-nums; }
.compact-records .table th,
.compact-records .table td { padding: 5px 8px; border: 1px solid var(--line); }
.compact-records .table th {
  background: var(--bg);
  color: var(--ink);
  vertical-align: top;
  text-transform: none;
  letter-spacing: normal;
  font-size: 11px;
}
.compact-records .table tbody tr:nth-child(even) { background: var(--bg); }
.compact-records .table .numeric { text-align: right; }
.compact-records .column-filter {
  display: block;
  width: 100%;
  min-width: 68px;
  margin-top: 4px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: normal;
}
.compact-records .column-filter:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.compact-records .table .button { padding: 3px 7px; }
:root[data-theme="dark"] .compact-records .column-filter { border-color: #657b70; }

.invoice-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
}
.invoice-template-preview {
  border: 1px solid #d6dce3;
  border-top: 5px solid var(--invoice-accent);
  border-radius: 8px;
  padding: 20px;
  overflow-wrap: anywhere;
}
.invoice-template-preview img {
  max-width: 140px;
  max-height: 80px;
  object-fit: contain;
}
.invoice-template-preview p {
  white-space: pre-wrap;
}
@media (max-width: 780px) {
  .invoice-builder-grid { grid-template-columns: minmax(0, 1fr); }
}

.compact-entry.modal, form.modal { padding: 16px; }
form.modal { max-height: calc(100dvh - 40px); overflow: auto; }
.compact-entry .modal-head, form.modal .modal-head { margin-bottom: 10px; }
.compact-entry .modal-footer, form.modal .modal-footer { margin-top: 12px; }
.compact-entry.form-grid, .compact-entry .form-grid, form.modal .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.compact-entry .field, form.modal .field { min-width: 0; gap: 3px; }
.compact-entry .field :is(input, select, textarea), form.modal .field :is(input, select, textarea) {
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
}
.compact-entry .button, form.modal .button { height: 32px; }
.compact-entry.invoice-dialog output { min-height: 32px; padding-block: 6px; }
.compact-entry .invoice-lines-title { margin: 12px 0 4px; }
.compact-entry .invoice-line { margin-bottom: 6px; padding: 6px 8px 8px; }
.invoice-line:has(.invoice-item-picker):has(.invoice-custom-name:not([hidden])) .invoice-line-description-field {
  grid-column: 1 / -1;
}
.invoice-line-remove { min-height: 24px; }
.catalog-entry { padding-block: 14px; }
.catalog-entry .section-header { margin-bottom: 8px; }
.catalog-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: end;
}
.catalog-description { grid-column: span 2; }
.catalog-description textarea { resize: vertical; }
.catalog-save { justify-self: start; }
.catalog-toggle { text-align: left; min-height: 24px; }
.catalog-toggle::before { content: "▸"; margin-inline-end: 5px; }
.catalog-toggle[aria-expanded="true"]::before { content: "▾"; }
.catalog-history[hidden] { display: none; }
.catalog-history-content { padding: 4px; }
.catalog-history-content caption { text-align: left; font-weight: 600; margin-bottom: 4px; }
.catalog-history-content .catalog-rate-grid { width: 100%; table-layout: fixed; }
.catalog-rate-grid th:first-child { width: 38%; }
.catalog-rate-grid th:last-child { width: 28%; }
.catalog-rate-grid :is(th, td):last-child { text-align: right; overflow-wrap: anywhere; }
.compact-records .catalog-rate-grid .catalog-current-rate {
  background: var(--mint);
  color: var(--green-dark);
  font-weight: 600;
}
.catalog-rate-form { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 8px; margin-top: 8px; }
.catalog-rate-form input { width: 130px; }
.catalog-rate-form [role="status"] { flex-basis: 100%; margin: 0; }
.catalog-rate-form [role="status"]:empty { display: none; }

@media (max-width: 540px) {
  .catalog-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-form > :first-child { grid-column: 1 / -1; }
  .compact-entry .field :is(input, select, textarea), form.modal .field :is(input, select, textarea) {
    font-size: 16px;
  }
}

.chatgpt-setup summary { width: fit-content; cursor: pointer; }
.chatgpt-setup p, .chatgpt-setup ol { margin-block: 8px; }
.chatgpt-setup ol { padding-inline-start: 20px; }
.chatgpt-setup li + li { margin-top: 4px; }
.chatgpt-setup-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.chatgpt-setup-fields input { min-width: 0; }
.chatgpt-setup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chatgpt-setup-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.chatgpt-setup [role="status"]:empty { display: none; }

@media (max-width: 540px) {
  .chatgpt-setup-fields { grid-template-columns: minmax(0, 1fr); }
}

:root[data-theme="dark"] {
  --entry-edge: #748d81;
  --entry-field: #111a17;
}
:root[data-theme="dark"] :is(.modal, .typeahead-menu) {
  border: 1px solid var(--entry-edge);
}
:root[data-theme="dark"] :is(.modal, .compact-entry) .field :is(input, select, textarea):not(.typeahead-source) {
  border-color: var(--entry-edge);
  background: var(--entry-field);
}
:root[data-theme="dark"] :is(.modal, .compact-entry) .field :is(input, select, textarea):focus-visible {
  border-color: var(--green);
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

:root[data-theme="dark"] :is(.invoice-line, .catalog-entry) {
  border-color: var(--entry-edge);
}
:root[data-theme="dark"] .invoice-dialog::backdrop { background: #080e0bcc; }

.customer-catalog-details summary { cursor: pointer; color: var(--ink); }
.customer-catalog-content:not(:empty) { min-width: 190px; }
.customer-catalog-content ul { list-style: none; margin: 8px 0; padding: 0; }
.customer-catalog-content li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.customer-catalog-form { display: grid; gap: 6px; margin-top: 8px; }
.customer-catalog-form button { justify-self: start; }
.invoice-catalog-status { margin: 0 0 10px; }
.invoice-catalog-status:empty { display: none; }
.invoice-status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.invoice-status-actions a { text-decoration: none; }

#expenseTable [data-expense-id] { cursor: pointer; }

:root[data-theme="dark"] .auth-card { color: #eff8f1; }
:root[data-theme="dark"] .auth-card p { color: #baccc2; }
:root[data-theme="dark"] .auth-error { color: #ffc1ba; }
