:root{
  --pine:#123c3a; --pine-2:#1d5c57; --brass:#8a6414; --paper:#f4f6f3; --card:#fff; --line:#d5ddd9; --ink:#17302d;
  --pos:#176b3f; --neg:#a53422;
  --bs-primary:#1d5c57; --bs-primary-rgb:29,92,87; --bs-link-color:#1d5c57; --bs-link-hover-color:#123c3a;
  --bs-body-bg:var(--paper); --bs-body-color:var(--ink);
}
[data-bs-theme=dark]{
  --paper:#0f1816; --card:#162321; --line:#2c3d39; --ink:#e3ece8; --pos:#5fcf94; --neg:#ff9c86; --brass:#e0b45a;
  --bs-primary:#4fa89f; --bs-primary-rgb:79,168,159; --bs-link-color:#7cc7bf; --bs-link-hover-color:#a6ddd7;
  --bs-body-bg:var(--paper); --bs-body-color:var(--ink);
}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;font-variant-numeric:tabular-nums}
.btn-primary{--bs-btn-bg:#1d5c57;--bs-btn-border-color:#1d5c57;--bs-btn-hover-bg:#123c3a;--bs-btn-hover-border-color:#123c3a;--bs-btn-active-bg:#123c3a;--bs-btn-disabled-bg:#1d5c57;--bs-btn-disabled-border-color:#1d5c57}
[data-bs-theme=dark] .btn-primary{--bs-btn-bg:#2f7f77;--bs-btn-border-color:#2f7f77;--bs-btn-hover-bg:#3b948b;--bs-btn-hover-border-color:#3b948b;--bs-btn-color:#fff}
.pos{color:var(--pos)} .neg{color:var(--neg)}
.skip-link{position:absolute;left:.5rem;top:.5rem;z-index:2000;background:#fff;color:#000;padding:.4rem .8rem;border-radius:.3rem}

/* shell */
.app-shell{display:flex;min-height:100vh}
.sidebar{--bs-offcanvas-width:16rem;background:var(--pine);color:#dce8e4;width:16rem;flex:0 0 16rem}
.sidebar.offcanvas-lg{--bs-offcanvas-bg:var(--pine);--bs-offcanvas-color:#dce8e4}
@media (min-width:992px){.sidebar{position:sticky;top:0;height:100vh;overflow-y:auto}}
.sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:1.1rem 1rem .8rem}
.brand{display:flex;align-items:center;gap:.65rem;color:#fff;text-decoration:none;font:600 1.05rem/1.2 Georgia,"Times New Roman",serif}
.brand-mark{display:inline-grid;place-items:center;width:2rem;height:2rem;border:1.5px solid #d9b25c;color:#d9b25c;border-radius:.3rem;font:700 1.1rem Georgia,serif}
.sidebar-nav{padding:.4rem .6rem 1.5rem}
.nav-link-x{display:flex;align-items:center;gap:.7rem;width:100%;padding:.6rem .75rem;border:0;background:none;color:#cfe0db;text-decoration:none;border-radius:.4rem;font:inherit;text-align:left;margin-bottom:2px}
.nav-link-x:hover{background:rgba(255,255,255,.08);color:#fff}
.nav-link-x.active{background:#f4f6f3;color:var(--pine);font-weight:600}
.nav-link-x:focus-visible,.btn:focus-visible,a:focus-visible,.form-control:focus,.form-select:focus{outline:3px solid #d9b25c;outline-offset:1px}
.content-col{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;gap:.75rem;padding:.8rem 1.25rem;border-bottom:1px solid var(--line);background:var(--card);position:sticky;top:0;z-index:30}
.page-title{font:600 1.35rem Georgia,"Times New Roman",serif;margin:0;flex:1 1 auto}
.topbar-actions{display:flex;align-items:center;gap:.5rem}
.user-chip{max-width:11rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;font-weight:600;padding:.25rem .6rem;border:1px solid var(--line);border-radius:2rem;color:var(--ink)}
@media (max-width:575px){.user-chip{display:none}}
.dot{position:absolute;top:2px;right:2px;width:.55rem;height:.55rem;background:#d9902f;border-radius:50%}
.page{padding:1.25rem;flex:1 1 auto;width:100%;max-width:82rem}
.app-footer{padding:1rem 1.25rem;color:#5b6d68;font-size:.85rem;border-top:1px solid var(--line)}
[data-bs-theme=dark] .app-footer{color:#8fa39d}

/* panels */
.panel{background:var(--card);border:1px solid var(--line);border-radius:.5rem;padding:1.1rem 1.25rem;height:100%}
.panel.narrow{max-width:46rem;height:auto}
.panel h2{font:600 1.1rem Georgia,"Times New Roman",serif;margin:0 0 .8rem}
.table{--bs-table-bg:transparent}
.list-group-item.unread{border-left:4px solid #d9902f}
.ver{font:600 2.2rem Georgia,serif;line-height:1.1}

/* the ledger strip: net cash flow, ruled like a statement */
.ledger{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:1.5rem;background:var(--card);border:1px solid var(--line);border-top:4px solid var(--brass);border-radius:.5rem;padding:1.4rem 1.5rem}
.ledger-label{font-weight:600;color:#52645f}
[data-bs-theme=dark] .ledger-label{color:#9db1ab}
.ledger-figure{font:600 clamp(1.9rem,5vw,2.9rem)/1.15 Georgia,"Times New Roman",serif;margin:.25rem 0}
.ledger-note{font-size:.95rem}
.ledger-lines{margin:0;display:grid;align-content:center}
.ledger-lines>div{display:flex;justify-content:space-between;gap:1rem;padding:.55rem 0;border-bottom:1px solid var(--line)}
.ledger-lines dt{font-weight:500}.ledger-lines dd{margin:0;font-weight:600}
.ledger-lines .total{border-bottom:0;border-top:3px double var(--ink);margin-top:.2rem}
@media (max-width:767px){.ledger{grid-template-columns:1fr}}
.acct-list li{display:flex;justify-content:space-between;gap:1rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.acct-list li:last-child{border-bottom:0}

/* empty states */
.empty{text-align:center;padding:2.5rem 1rem;color:#52645f}
[data-bs-theme=dark] .empty{color:#9db1ab}
.empty i{font-size:2rem;color:var(--brass)}
.empty h2,.empty h3{font:600 1.1rem Georgia,serif;margin:.5rem 0 .25rem;color:var(--ink)}
.empty p{margin:0 auto;max-width:28rem}
.empty.compact{padding:1.25rem .5rem}

/* sign-in */
.auth-body{background:var(--pine);min-height:100vh;display:grid;place-items:center}
.auth-wrap{width:100%;max-width:26rem;padding:1.25rem}
.auth-brand{display:flex;align-items:center;gap:.7rem;color:#fff;font:600 1.3rem Georgia,serif;margin-bottom:1rem}
.auth-card{background:var(--card);color:var(--ink);border-radius:.5rem;padding:1.6rem}
.auth-title{font:600 1.3rem Georgia,serif;margin:0 0 1rem}
.auth-foot{color:#a9c1bb;font-size:.8rem;text-align:center;margin:1rem 0 0}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media print{.sidebar,.topbar,.app-footer,.btn{display:none!important}.page{padding:0}}
