:root {
  --text-base: 16px;
  --green: #173f35;
  --green-2: #2c6956;
  --green-3: #5f8d79;
  --mint: #b9dfca;
  --lime: #d9eea9;
  --paper: #f6f3eb;
  --panel: #fffdfa;
  --ink: #17231f;
  --muted: #69736e;
  --line: #ddd9cf;
  --soft: #eeece5;
  --coral: #d9785f;
  --amber: #d9a84e;
  --danger: #a54734;
  --shadow: 0 15px 40px rgba(31, 48, 41, .06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-size: var(--text-base); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(44, 105, 86, .22); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 8px; color: var(--green-2); font-size: .5625rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 224px; flex-direction: column; padding: 29px 20px 24px; color: #fff; background: var(--green); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 31px; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-family: Georgia, serif; font-size: 1.3125rem; font-weight: 400; letter-spacing: -.02em; }
.brand small { color: rgba(255,255,255,.44); font-size: .5rem; letter-spacing: .13em; text-transform: uppercase; }
.brand-mark { position: relative; display: flex; width: 33px; height: 33px; align-items: end; justify-content: center; gap: 2px; padding: 8px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.brand-mark i { display: block; width: 4px; border-radius: 3px 3px 1px 1px; background: var(--lime); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; }
.nav-label { margin: 0 11px 8px; color: rgba(255,255,255,.32); font-size: .5rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.side-nav { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; width: 100%; height: 43px; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 9px; color: rgba(255,255,255,.58); background: transparent; cursor: pointer; font-size: .6875rem; text-align: left; }
.nav-item > span { display: grid; width: 19px; place-items: center; color: rgba(255,255,255,.46); font-size: .9375rem; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.11); }
.nav-item.active > span { color: var(--lime); }
.nav-count { display: grid; min-width: 19px; height: 19px; place-items: center; margin-left: auto; border-radius: 50%; color: var(--green); background: var(--lime); font-size: .5rem; }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; }
.privacy-note { display: flex; gap: 9px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; color: rgba(255,255,255,.42); font-size: .5rem; line-height: 1.5; }
.privacy-note i { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(217,238,169,.08); }
.privacy-note strong { display: block; margin-bottom: 2px; color: rgba(255,255,255,.75); font-size: .5625rem; }
.sidebar-foot > a, .sidebar-foot form button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 10px 12px; border: 0; color: rgba(255,255,255,.56); background: transparent; cursor: pointer; font-size: .5625rem; text-decoration: none; }
.sidebar-foot > a:hover, .sidebar-foot form button:hover { color: #fff; }

.main-content { min-height: 100vh; margin-left: 224px; padding: 30px clamp(24px, 3.2vw, 50px) 60px; }
.topbar { display: flex; max-width: 1440px; align-items: center; justify-content: space-between; gap: 30px; margin: 0 auto 12px; }
.heading-group h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.125rem, 2.25rem + .9vw, 3.0625rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.05; }
.heading-group > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .6875rem; }
.top-actions { display: flex; align-items: end; gap: 8px; }
.select-control { display: grid; gap: 5px; }
.select-control > span { padding-left: 2px; color: var(--muted); font-size: .5rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.select-control input, .select-control select { height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--panel); font-size: .625rem; }
.select-control input { width: 130px; }
.currency-control select { width: 83px; }
.icon-button, .primary-button, .secondary-button, .danger-button { display: inline-flex; height: 40px; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; cursor: pointer; font-size: .625rem; font-weight: 700; }
.icon-button { width: 40px; border: 1px solid var(--line); background: var(--panel); font-size: 1.0625rem; }
.icon-button.loading { animation: spin .7s linear infinite; }
.primary-button { padding: 0 15px; border: 1px solid var(--green); color: #fff; background: var(--green); }
.primary-button:hover { background: #225247; }
.secondary-button { padding: 0 15px; border: 1px solid #bfc8c2; color: var(--green); background: transparent; }
.secondary-button:hover { background: rgba(44,105,86,.05); }
.danger-button { padding: 0 15px; border: 1px solid var(--danger); color: #fff; background: var(--danger); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { cursor: wait; opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-line { display: flex; max-width: 1440px; align-items: center; gap: 8px; margin: 0 auto 17px; color: var(--muted); font-size: .5625rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #58a879; box-shadow: 0 0 0 4px rgba(88,168,121,.1); }
.error-banner { max-width: 1440px; margin: 0 auto 17px; padding: 12px 14px; border: 1px solid #e7b9ac; border-radius: 10px; color: #873b2b; background: #fff0eb; font-size: .6875rem; }
.view { max-width: 1440px; margin: 0 auto; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 18px; align-items: start; }
.overview-main { display: grid; gap: 18px; min-width: 0; }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 18px; }
.panel, .position-card, .rail-card { position: relative; min-width: 0; border-radius: var(--radius); }
.panel, .rail-card { border: 1px solid rgba(210,207,197,.82); background: var(--panel); box-shadow: var(--shadow); }
.panel { padding: 22px; }
.position-card { min-height: 305px; overflow: hidden; padding: 25px; color: #f9f7ee; background: var(--green); box-shadow: 0 22px 55px rgba(23,63,53,.16); }
.position-card::before { position: absolute; right: -88px; bottom: -120px; width: 290px; height: 290px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; }
.position-card::after { position: absolute; right: -24px; bottom: -59px; width: 160px; height: 160px; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; content: ""; }
.card-head, .panel-heading, .rail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.card-head h2, .panel-heading h2, .rail-card h2 { margin: 0; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 400; letter-spacing: -.025em; }
.card-head.inverse .eyebrow { color: var(--mint); }
.subtle { margin: 3px 0 0; color: var(--muted); font-size: .5625rem; }
.inverse .subtle { color: rgba(255,255,255,.43); }
.privacy-chip, .metric-chip, .count-badge, .status-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 0 9px; border-radius: 99px; font-size: .5rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.privacy-chip { color: var(--green); background: var(--lime); }
.metric-chip { color: var(--green); background: #e6eee7; }
.metric-chip.negative { color: #984530; background: #f7e4de; }
.count-badge { color: var(--muted); background: var(--soft); }
.status-chip { color: #356a54; background: #e7f0e8; }
.status-chip.archived, .status-chip.paused { color: #77756e; background: #eceae4; }
.status-chip.completed { color: #526c2c; background: #e8efdb; }
.status-chip.paid { color: #356a54; background: #dfeee2; }
.status-chip.overdue { color: #9a4532; background: #f7e4de; }
.hero-amount { position: relative; z-index: 1; margin: 48px 0 55px; font-family: Georgia, serif; font-size: clamp(2.375rem, 2.45rem + 1.2vw, 3.625rem); font-weight: 400; letter-spacing: -.055em; }
.position-breakdown { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.13); }
.position-breakdown span { display: block; margin-bottom: 5px; color: rgba(255,255,255,.44); font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; }
.position-breakdown strong { font-size: .75rem; }
.position-orbit { position: absolute; right: 38px; bottom: 35px; z-index: 2; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 11px rgba(217,238,169,.07); }
.pulse-panel { min-height: 305px; }
.trend-chart { display: flex; height: 174px; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 21px 3px 0; border-bottom: 1px solid var(--line); }
.trend-group { display: grid; width: 16%; height: 100%; grid-template-rows: 1fr 20px; gap: 7px; text-align: center; }
.trend-bars { display: flex; height: 100%; align-items: flex-end; justify-content: center; gap: 4px; }
.trend-bar { width: min(12px, 38%); min-height: 2px; border-radius: 4px 4px 1px 1px; transition: height .3s ease; }
.trend-bar.income { background: var(--green-2); }
.trend-bar.expense { background: var(--coral); }
.trend-group small { color: var(--muted); font-size: .5rem; }
.chart-foot { display: flex; align-items: center; gap: 13px; margin-top: 11px; color: var(--muted); font-size: .5rem; }
.chart-foot span { display: inline-flex; align-items: center; gap: 5px; }
.chart-foot i { width: 6px; height: 6px; border-radius: 2px; }
.chart-foot .income { background: var(--green-2); }
.chart-foot .expense { background: var(--coral); }
.chart-foot strong { margin-left: auto; color: var(--ink); font-size: .5625rem; }

.overview-rail { display: grid; gap: 14px; }
.rail-card { padding: 19px; }
.quick-card { color: #fff; border-color: var(--green); background: var(--green); }
.quick-card .eyebrow { color: var(--mint); }
.quick-card h2 { max-width: 180px; color: #fff; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 18px; }
.quick-grid button { display: grid; min-height: 69px; place-items: center; gap: 4px; padding: 8px; border: 1px solid rgba(255,255,255,.11); border-radius: 10px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.055); cursor: pointer; font-size: .5rem; }
.quick-grid button:hover { color: #fff; background: rgba(255,255,255,.1); }
.quick-grid button span { color: var(--lime); font-size: 1.125rem; }
.rail-heading { align-items: center; }
.rail-heading .eyebrow { margin: 0; }
.rail-heading > span { color: var(--muted); font-size: .5625rem; }
.rail-heading button { padding: 0; border: 0; color: var(--green-2); background: transparent; cursor: pointer; font-size: .5625rem; font-weight: 750; }
.month-metrics { display: grid; gap: 12px; margin: 18px 0 0; }
.month-metrics div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--soft); }
.month-metrics dt { color: var(--muted); font-size: .5625rem; }
.month-metrics dd { margin: 0; font-size: .6875rem; font-weight: 700; }
.spend-section { margin-top: 17px; }
.category-list { display: grid; gap: 11px; margin-top: 14px; }
.category-row { display: grid; gap: 5px; }
.category-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .5rem; }
.category-meta span { color: var(--muted); }
.bar-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e7e5de; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--green-2); transition: width .3s ease; }
.category-row:nth-child(2n) .bar-fill { background: var(--amber); }
.category-row:nth-child(3n) .bar-fill { background: var(--coral); }
.coverage-line { display: flex; align-items: baseline; gap: 6px; margin: 18px 0 10px; }
.coverage-line strong { font-family: Georgia, serif; font-size: 1.875rem; font-weight: 400; }
.coverage-line span { color: var(--muted); font-size: .5625rem; }
.emergency-card > p { margin: 10px 0 0; color: var(--muted); font-size: .5625rem; line-height: 1.5; }

.alerts { display: flex; flex-wrap: wrap; gap: 8px; }
.alert { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border: 1px solid #e6d7b4; border-radius: 9px; color: #6d5928; background: #fff9e9; font-size: .5625rem; }
.alert::before { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); content: ""; }
.alert.warning::before { background: var(--coral); }
.panel-heading { align-items: center; margin-bottom: 18px; }
.text-button { padding: 5px 0; border: 0; color: var(--green-2); background: transparent; cursor: pointer; font-size: .5625rem; font-weight: 750; }
.text-button span { margin-left: 4px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-heading, .account-overview-panel > .panel-heading { margin: 0; padding: 20px 22px 17px; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 54px; padding: 0 21px; color: var(--muted); font-size: .5625rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #f5f3ed; font-size: .5rem; font-weight: 750; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
td { height: 60px; padding: 11px 17px; border-bottom: 1px solid #ebe8e0; font-size: .625rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(246,243,235,.55); }
td strong { display: block; font-size: .625rem; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: .5rem; }
.align-right { text-align: right; }
.action-column { width: 106px; text-align: right; }
.table-empty { height: 115px; color: var(--muted); text-align: center; }
.account-cell { display: flex; align-items: center; gap: 10px; }
.entity-icon { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: var(--green); background: #e6eee7; font-family: Georgia, serif; font-size: .8125rem; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions button { height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--green-2); background: #fff; cursor: pointer; font-size: .5rem; font-weight: 700; }
.row-actions button:hover { border-color: #9fb2a9; }
.row-actions .destructive { color: var(--danger); }
.amount-income { color: var(--green-2); }
.amount-expense { color: var(--danger); }
.approval-preview { padding: 21px; }
.approval-list { display: grid; gap: 9px; }
.approval-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--soft); border-radius: 11px; background: #fbfaf6; }
.approval-row .proposal-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; color: var(--green); background: #e7f0e8; font-size: .9375rem; }
.approval-row strong { display: block; font-size: .625rem; }
.approval-row small { display: block; margin-top: 4px; color: var(--muted); font-size: .5rem; }
.approval-row button { height: 29px; padding: 0 10px; border: 1px solid var(--green); border-radius: 7px; color: var(--green); background: transparent; cursor: pointer; font-size: .5rem; font-weight: 750; }
.empty-inline { padding: 22px 8px; color: var(--muted); font-size: .625rem; text-align: center; }
.empty-state { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 20px 22px; border: 1px solid #d2dacd; border-radius: var(--radius); background: #edf2e6; }
.empty-symbol { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-family: Georgia, serif; font-size: 1.3125rem; }
.empty-state h2 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 1.375rem; font-weight: 400; }
.empty-state p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .625rem; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 34px 0 19px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.9375rem, 2.05rem + .75vw, 2.75rem); font-weight: 400; letter-spacing: -.04em; }
.section-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .625rem; }
.section-actions { display: flex; align-items: center; gap: 13px; }
.management-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card-activity-panel, .card-statement-panel { margin-top: 16px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .55rem; }
.statement-dialog { width: min(620px, calc(100vw - 28px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 24px 80px rgba(20, 49, 41, .24); }
.statement-dialog::backdrop { background: rgba(13, 30, 26, .55); backdrop-filter: blur(3px); }
.statement-dialog form { padding: 24px; display: grid; gap: 20px; }
.statement-fields { display: grid; grid-template-columns: 1fr; gap: 14px; }
.statement-ai-option { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--green-2) 6%, var(--panel)); cursor: pointer; }
.statement-ai-option input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green-2); flex: 0 0 auto; }
.statement-ai-option span { display: grid; gap: 4px; }
.statement-ai-option strong { font-size: .62rem; }
.statement-ai-option small { color: var(--muted); font-size: .53rem; line-height: 1.5; }
.statement-ai-option:has(input:disabled) { opacity: .58; cursor: not-allowed; background: var(--soft); }
.ai-meaning { color: var(--green-2) !important; }
.statement-privacy { display: grid; gap: 5px; padding: 14px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); }
.statement-privacy strong { font-size: .65rem; }
.statement-privacy span { color: var(--muted); font-size: .55rem; line-height: 1.55; }
.management-card { display: grid; min-height: 210px; align-content: space-between; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.management-card.archived { opacity: .65; box-shadow: none; }
.management-card-head { display: flex; justify-content: space-between; gap: 12px; }
.management-card h3 { margin: 8px 0 3px; font-family: Georgia, serif; font-size: 1.3125rem; font-weight: 400; }
.management-card .caption { margin: 0; color: var(--muted); font-size: .5625rem; }
.card-value { margin: 23px 0 13px; font-family: Georgia, serif; font-size: 1.6875rem; }
.card-progress { margin-bottom: 16px; }
.card-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: .5rem; }
.management-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 13px; border-top: 1px solid var(--soft); color: var(--muted); font-size: .5rem; }
.management-card-foot .row-actions { margin-left: auto; }
.approval-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 18px; align-items: start; }
.approval-list.full .approval-row { grid-template-columns: auto minmax(0,1fr) auto; padding: 15px; }
.approval-actions { display: flex; gap: 6px; }
.approval-actions .cancel-proposal { border-color: var(--line); color: var(--danger); }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--soft); }
.audit-row:first-child { border-top: 0; }
.audit-mark { width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: var(--green-3); }
.audit-row strong { display: block; font-size: .5625rem; text-transform: capitalize; }
.audit-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .5rem; }

.debt-action-column { width: 205px; }
.reminder-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 18px; align-items: start; }
.reminder-config { display: grid; gap: 20px; }
.reminder-config .panel-heading { margin-bottom: 0; padding-bottom: 18px; border-bottom: 1px solid var(--soft); }
.reminder-switch { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f4; cursor: pointer; }
.reminder-switch > span { display: grid; gap: 4px; }
.reminder-switch strong, .reminder-field strong { font-size: .6875rem; }
.reminder-switch small, .reminder-field small { color: var(--muted); font-size: .5625rem; line-height: 1.45; }
.reminder-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reminder-switch i { position: relative; flex: 0 0 42px; width: 42px; height: 24px; border-radius: 99px; background: #c9c8c2; transition: background .2s ease; }
.reminder-switch i::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(26,40,34,.18); content: ""; transition: transform .2s ease; }
.reminder-switch input:checked + i { background: var(--green-2); }
.reminder-switch input:checked + i::after { transform: translateX(18px); }
.reminder-switch input:focus-visible + i { outline: 3px solid rgba(44,105,86,.22); outline-offset: 2px; }
.reminder-field { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.reminder-field label { display: grid; gap: 4px; }
.reminder-field select { width: 118px; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: .6875rem; }
.reminder-thresholds { min-width: 0; margin: 0; padding: 0; border: 0; }
.reminder-thresholds legend { padding: 0; font-size: .6875rem; font-weight: 700; }
.reminder-thresholds > p { margin: 5px 0 12px; color: var(--muted); font-size: .5625rem; line-height: 1.45; }
.threshold-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.threshold-grid label { position: relative; min-width: 0; cursor: pointer; }
.threshold-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.threshold-grid span { display: grid; gap: 3px; min-height: 64px; align-content: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s ease, background .15s ease; }
.threshold-grid strong { font-size: .625rem; }
.threshold-grid small { color: var(--muted); font-size: .5rem; }
.threshold-grid input:checked + span { border-color: var(--green-2); background: #edf3ee; box-shadow: inset 0 0 0 1px var(--green-2); }
.threshold-grid input:focus-visible + span { outline: 3px solid rgba(44,105,86,.22); outline-offset: 2px; }
.reminder-save { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--soft); }
.reminder-save > span { color: var(--muted); font-size: .5625rem; }
.reminder-cycles .panel-heading { margin-bottom: 12px; }
.reminder-explainer { margin: 0 0 17px; color: var(--muted); font-size: .5625rem; line-height: 1.55; }
.reminder-cycle-list { display: grid; }
.reminder-cycle-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid var(--soft); }
.cycle-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--green); background: #e7f0e8; font-size: .625rem; font-weight: 800; }
.cycle-mark.paid { color: #fff; background: var(--green-2); }
.cycle-mark.overdue { color: #984530; background: #f7e4de; }
.reminder-cycle-row strong { display: block; font-size: .625rem; }
.reminder-cycle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .5rem; }
.reminder-how { margin-top: 16px; padding: 15px; border-radius: 11px; color: #e7eee8; background: var(--green); }
.reminder-how > strong { font-family: Georgia, serif; font-size: 1rem; font-weight: 400; }
.reminder-how ol { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 19px; color: rgba(255,255,255,.62); font-size: .5rem; line-height: 1.5; }

.drawer-layer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(15,31,26,.42); cursor: default; }
.editor-drawer { position: relative; z-index: 1; width: min(465px, 100%); height: 100%; overflow-y: auto; padding: 28px; background: var(--panel); box-shadow: -18px 0 60px rgba(20,39,32,.18); animation: drawer-in .22s ease-out; }
@keyframes drawer-in { from { transform: translateX(35px); opacity: .65; } }
.drawer-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.9375rem; font-weight: 400; letter-spacing: -.035em; }
.drawer-head > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .625rem; line-height: 1.5; }
.close-button { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.1875rem; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; padding: 25px 0; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field > span { font-size: .5rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fff; font-size: .6875rem; }
.form-field input, .form-field select { height: 43px; padding: 0 11px; }
.form-field textarea { min-height: 78px; padding: 11px; resize: vertical; }
.form-field small { color: var(--muted); font-size: .5rem; line-height: 1.45; }
.checkbox-field { display: flex; grid-column: 1 / -1; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.checkbox-field input { width: 15px; height: 15px; margin-top: 1px; accent-color: var(--green-2); }
.checkbox-field strong { display: block; font-size: .5625rem; }
.checkbox-field small { display: block; margin-top: 3px; color: var(--muted); font-size: .5rem; line-height: 1.4; }
.drawer-actions { position: sticky; bottom: -28px; display: flex; justify-content: flex-end; gap: 8px; padding: 16px 0 28px; border-top: 1px solid var(--line); background: var(--panel); }
.form-error { margin: 0 0 14px; padding: 11px 12px; border: 1px solid #efc4b8; border-radius: 9px; color: #873b2b; background: #fff0eb; font-size: .5625rem; }

.confirm-dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 17px; background: var(--panel); box-shadow: 0 30px 90px rgba(14,31,25,.3); }
.confirm-dialog::backdrop { background: rgba(15,31,26,.5); }
.confirm-dialog form { padding: 27px; }
.confirm-symbol { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 17px; border-radius: 50%; color: var(--danger); background: #f8e4de; font-family: Georgia, serif; font-size: 1.25rem; }
.confirm-dialog h2 { margin: 0; font-family: Georgia, serif; font-size: 1.6875rem; font-weight: 400; letter-spacing: -.03em; }
.confirm-dialog form > p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: .625rem; line-height: 1.6; }
.confirm-detail { max-height: 210px; margin-top: 15px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #f7f5ef; font: .5625rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; }
.appearance-dialog { width: min(490px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 17px; background: var(--panel); box-shadow: 0 30px 90px rgba(14,31,25,.3); }
.appearance-dialog::backdrop { background: rgba(15,31,26,.5); }
.appearance-dialog form { padding: 27px; }
.appearance-head { display: flex; justify-content: space-between; gap: 20px; }
.appearance-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.6875rem; font-weight: 400; letter-spacing: -.03em; }
.appearance-head > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .625rem; line-height: 1.55; }
.text-size-preview { display: grid; gap: 5px; margin: 22px 0; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #f7f5ef; }
.text-size-preview small { color: var(--green-2); font-size: .5rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.text-size-preview strong { font-family: Georgia, serif; font-size: 1.3125rem; font-weight: 400; }
.text-size-preview span { color: var(--muted); font-size: .625rem; }
.size-slider { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: .625rem; font-weight: 750; }
.size-slider output { color: var(--green-2); font-variant-numeric: tabular-nums; }
.range-control { width: 100%; margin: 15px 0 6px; accent-color: var(--green-2); cursor: pointer; }
.size-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .5rem; }
.size-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 19px; }
.size-presets button { height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; font-size: .5625rem; font-weight: 700; }
.size-presets button:hover, .size-presets button.active { border-color: var(--green-2); color: var(--green); background: #edf2ee; }
.appearance-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); }
.text-size-button { font-size: .6875rem; letter-spacing: -.03em; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: 380px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #fff; background: var(--green); box-shadow: 0 16px 50px rgba(20,39,32,.24); font-size: .625rem; }
.mobile-nav { display: none; }

/* Login shares the same private-finance visual language. */
.login-page { min-height: 100vh; background: var(--green); }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(340px,.85fr) minmax(480px,1.15fr); }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px,6vw,76px); overflow: hidden; color: #fff; background: var(--green); }
.login-brand::after { position: fixed; left: -110px; bottom: -190px; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; content: ""; }
.login-brand .eyebrow { color: var(--mint); }
.login-brand h1 { margin: 0 0 22px; font-family: Georgia, serif; font-size: clamp(2.6875rem, 2.9rem + 2vw, 4.75rem); font-weight: 400; letter-spacing: -.055em; line-height: .99; }
.login-brand > div > p:last-child { max-width: 480px; color: rgba(255,255,255,.6); font-size: .875rem; line-height: 1.7; }
.login-foot { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.38); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; }
.login-form-wrap { display: grid; place-items: center; padding: 28px; border-radius: 36px 0 0 36px; background: var(--paper); }
.login-form { width: min(100%,390px); }
.login-form h2 { margin: 0 0 9px; font-family: Georgia, serif; font-size: 2.1875rem; font-weight: 400; letter-spacing: -.03em; }
.login-form > p:not(.eyebrow) { margin: 0 0 27px; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.login-form label { display: grid; gap: 7px; margin-top: 17px; }
.login-form label span { font-size: .625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.login-form input { height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--panel); }
.login-form button { display: flex; width: 100%; height: 50px; align-items: center; justify-content: space-between; margin-top: 22px; padding: 0 18px; border: 0; border-radius: 11px; color: #fff; background: var(--green); cursor: pointer; font-weight: 650; }
.login-form small { display: block; margin-top: 16px; color: var(--muted); font-size: .5625rem; line-height: 1.5; text-align: center; }
.login-form .login-error { margin-bottom: 17px !important; padding: 11px 13px; border: 1px solid #efcbbf; border-radius: 9px; color: #8a3e2e !important; background: #fff0eb; }

@media (max-width: 1180px) {
  .overview-layout { grid-template-columns: 1fr; }
  .overview-rail { grid-template-columns: repeat(3, 1fr); }
  .management-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .approval-layout { grid-template-columns: 1fr; }
  .reminder-layout { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .sidebar { width: 190px; padding-inline: 15px; }
  .main-content { margin-left: 190px; padding-inline: 22px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions .primary-button { margin-left: auto; }
  .summary-grid { grid-template-columns: 1fr; }
  .overview-rail { grid-template-columns: 1fr 1fr; }
  .quick-card { grid-row: span 2; }
}

@media (max-width: 700px) {
  body { padding-bottom: 66px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px 14px 38px; }
  .topbar { gap: 18px; }
  .heading-group h1 { font-size: 2.125rem; }
  .top-actions { display: grid; grid-template-columns: 1fr 85px 40px 40px; }
  .top-actions .primary-button { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; }
  .select-control input, .select-control select { width: 100%; }
  .position-card, .panel, .rail-card { border-radius: 15px; }
  .position-card { min-height: 290px; padding: 21px; }
  .hero-amount { margin-block: 46px 50px; font-size: 2.375rem; }
  .position-breakdown strong { font-size: .625rem; }
  .overview-rail, .management-grid { grid-template-columns: 1fr; }
  .quick-card { grid-row: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; margin-top: 22px; }
  .section-actions { width: 100%; justify-content: space-between; }
  .section-heading .secondary-button { width: 100%; }
  .panel-heading h2 { font-size: 1.125rem; }
  .account-overview-panel .panel-heading { align-items: flex-start; }
  th { display: none; }
  table, tbody, tr, td { display: block; }
  tbody tr { position: relative; padding: 13px 15px; border-bottom: 1px solid var(--soft); }
  td { height: auto; min-height: 0; padding: 3px 0; border: 0; }
  td.action-column { width: auto; margin-top: 8px; text-align: left; }
  .row-actions { justify-content: flex-start; }
  .table-empty { padding: 45px 8px; }
  .approval-row, .approval-list.full .approval-row { grid-template-columns: auto minmax(0,1fr); }
  .approval-row > button, .approval-actions { grid-column: 2; justify-self: start; }
  .editor-drawer { padding: 22px 18px; }
  .editor-fields { grid-template-columns: 1fr; }
  .form-field.full, .checkbox-field { grid-column: 1; }
  .threshold-grid { grid-template-columns: 1fr 1fr; }
  .reminder-save { align-items: stretch; flex-direction: column; }
  .reminder-save .primary-button { width: 100%; }
  .drawer-actions { bottom: -22px; padding-bottom: 22px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 40; display: flex; gap: 2px; overflow-x: auto; padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,250,.96); backdrop-filter: blur(14px); }
  .mobile-nav button { display: grid; flex: 0 0 67px; gap: 2px; place-items: center; padding: 3px 1px; border: 0; color: #7f8a85; background: transparent; cursor: pointer; font-size: .4375rem; }
  .mobile-nav button span { font-size: .9375rem; }
  .mobile-nav button.active { color: var(--green); }
  .toast { right: 14px; bottom: 78px; left: 14px; max-width: none; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 255px; padding: 30px 25px; }
  .login-brand > div { margin-top: 55px; }
  .login-brand h1 { font-size: 2.625rem; }
  .login-brand > div > p:last-child, .login-foot { display: none; }
  .login-form-wrap { min-height: calc(100vh - 240px); padding: 38px 24px; border-radius: 28px 28px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
