:root {
    --chocolate: #4b241c;
    --chocolate-2: #6f3828;
    --chocolate-3: #2d1713;
    --gold: #d9a441;
    --gold-soft: #f4dfaa;
    --cream: #fbf7ee;
    --surface: #ffffff;
    --surface-2: #f5f0e7;
    --ink: #1d1715;
    --muted: #736762;
    --line: #e5dbce;
    --green: #16835c;
    --green-soft: #dff4ea;
    --red: #b63a3a;
    --red-soft: #fbe5e5;
    --blue: #3567b7;
    --shadow: 0 18px 45px rgba(64, 35, 25, .11);
    --radius: 18px;
    --radius-sm: 11px;
    --sidebar: 276px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

html[data-theme="dark"] {
    --cream: #160f0d;
    --surface: #211816;
    --surface-2: #2b201d;
    --ink: #f8efe6;
    --muted: #c5b7ae;
    --line: #44332d;
    --green-soft: #163a2e;
    --red-soft: #422323;
    --shadow: 0 18px 48px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 92% 5%, rgba(217,164,65,.12), transparent 29%), radial-gradient(circle at 4% 98%, rgba(75,36,28,.09), transparent 26%); z-index: -1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .72rem .82rem; color: var(--ink); background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(217,164,65,.16); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
td { font-size: .9rem; }
progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-2); accent-color: var(--gold); }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--gold), #edc771); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--gold), #edc771); border-radius: 99px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); transition: grid-template-columns .28s ease; }
.app-shell.is-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; background: linear-gradient(155deg, var(--chocolate-3), var(--chocolate)); color: #fff; overflow: hidden auto; box-shadow: 12px 0 40px rgba(38,20,15,.14); }
.brand { min-height: 52px; display: flex; align-items: center; gap: .8rem; min-width: 235px; }
.brand-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: block;
    object-fit: contain;
    border: 1px solid rgba(217,164,65,.42);
    border-radius: 13px;
    background: #050505;
    box-shadow: 0 8px 22px rgba(217,164,65,.22);
}
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: inline-grid; place-items: center; border-radius: 13px; color: var(--chocolate-3); background: linear-gradient(145deg, #f6dc9b, var(--gold)); font: 800 1.3rem Georgia, serif; box-shadow: 0 8px 22px rgba(217,164,65,.22); }
.brand-mark-large { width: 64px; height: 64px; font-size: 2rem; border-radius: 20px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.brand-copy small { color: #d9c6bb; font-size: .62rem; letter-spacing: .08em; }
.nav-list { display: flex; flex-direction: column; gap: .3rem; }
.nav-item { min-width: 230px; min-height: 44px; display: flex; align-items: center; gap: .9rem; padding: .65rem .75rem; border: 1px solid transparent; border-radius: 12px; color: #e5d9d2; transition: background .2s, transform .2s, color .2s, border-color .2s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(3px); }
.nav-item.is-active { color: #fff; background: linear-gradient(105deg, rgba(217,164,65,.24), rgba(255,255,255,.07)); border-color: rgba(217,164,65,.34); }
.nav-icon { width: 28px; text-align: center; font-size: 1.1rem; }
.sidebar-foot { margin-top: auto; display: grid; gap: .45rem; min-width: 230px; }
.sidebar-foot form, .sidebar-foot button { width: 100%; }
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2.4rem); border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 30%); background: color-mix(in srgb, var(--cream) 86%, transparent); backdrop-filter: blur(18px); }
.topbar-title { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--chocolate), var(--chocolate-2)); font-weight: 800; }
.avatar-image { overflow: hidden; border: 2px solid color-mix(in srgb, var(--gold), transparent 20%); background: var(--surface-2); box-shadow: 0 6px 18px rgba(75,36,28,.18); }
.avatar-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.page { width: min(1440px, 100%); margin: 0 auto; flex: 1; padding: clamp(1rem, 2.5vw, 2.4rem); }
.footer { padding: 1.25rem; color: var(--muted); text-align: center; font-size: .78rem; }
.footer a { color: var(--chocolate-2); font-weight: 750; text-decoration: underline; text-decoration-color: color-mix(in srgb,var(--gold),transparent 35%); text-underline-offset: 3px; }
html[data-theme="dark"] .footer a { color: var(--gold); }
.impersonation-banner { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; padding: .62rem 1rem; color: #fff; background: linear-gradient(90deg, #6d2e77, #a14374); font-size: .84rem; }

.panel { padding: clamp(1rem, 2vw, 1.4rem); border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--shadow); }
.stack { display: grid; gap: 1rem; }
.page-heading, .section-heading, .card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-heading { margin-bottom: 1.2rem; }
.page-heading h1, .section-heading h2, .card-grid h2, .panel h2 { margin: .15rem 0 0; }
.page-heading h1 { font-size: clamp(1.65rem, 4vw, 2.3rem); }
.eyebrow { margin: 0; color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.heading-actions, .card-actions, .row-actions, .modal-actions, .filter-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.text-link { color: var(--chocolate-2); font-size: .82rem; font-weight: 800; }
html[data-theme="dark"] .text-link { color: var(--gold); }

.button { width: auto; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 11px; padding: .66rem 1rem; font-weight: 750; font-size: .88rem; transition: transform .2s, box-shadow .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--chocolate), var(--chocolate-2)); box-shadow: 0 9px 24px rgba(75,36,28,.2); }
.button-gold { color: var(--chocolate-3); background: linear-gradient(135deg, #f4d98b, var(--gold)); box-shadow: 0 9px 24px rgba(217,164,65,.22); }
.button-outline { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button-ghost { color: inherit; background: transparent; }
.button-danger { color: var(--red); border-color: color-mix(in srgb, var(--red), transparent 65%); background: var(--red-soft); }
.button-compact { min-height: 34px; padding: .4rem .68rem; border-radius: 9px; font-size: .76rem; }
.button-large { min-height: 52px; width: 100%; font-size: 1rem; }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); transition: transform .2s, background .2s; }
.icon-button:hover { transform: rotate(4deg) scale(1.04); }
.icon-danger { width: 28px; height: 28px; flex-basis: 28px; color: var(--red); border: 0; background: transparent; }

.hero-card { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; padding: clamp(1.3rem, 4vw, 2.3rem); border-radius: 24px; color: #fff; background: linear-gradient(125deg, var(--chocolate-3), var(--chocolate) 58%, #82502e); box-shadow: 0 22px 52px rgba(63,32,23,.23); overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(217,164,65,.28); border-radius: 50%; right: -80px; top: -140px; box-shadow: 0 0 0 28px rgba(217,164,65,.06), 0 0 0 62px rgba(217,164,65,.04); }
.hero-card > * { position: relative; z-index: 1; }
.hero-card h1 { margin: .2rem 0; font-size: clamp(1.8rem, 5vw, 3rem); }
.hero-card p:last-child { margin-bottom: 0; color: #dfd1ca; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.metric-grid-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-card { min-height: 132px; padding: 1.15rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 30px rgba(54,30,22,.07); position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--gold); }
.metric-card.income::before { background: var(--green); }
.metric-card.expense::before { background: var(--red); }
.metric-card.net::before { background: var(--gold); }
.metric-card.loan::before { background: #7054b8; }
.metric-card span, .metric-card small { color: var(--muted); font-size: .76rem; }
.metric-card strong { font-size: clamp(1.1rem, 2.4vw, 1.65rem); }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; margin-top: 1rem; }
.span-two { min-width: 0; }
.record-list, .progress-list { display: grid; margin-top: .6rem; }
.record-row { display: flex; align-items: center; gap: .8rem; padding: .78rem .15rem; border-bottom: 1px solid var(--line); }
.record-row:last-child { border: 0; }
.record-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.record-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-main small, .cell-meta { display: block; color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.record-icon { width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.record-icon.income { color: var(--green); background: var(--green-soft); }
.record-icon.expense { color: var(--red); background: var(--red-soft); }
.record-icon.net { color: var(--chocolate-2); background: var(--gold-soft); }
.amount-income { color: var(--green); }
.amount-expense { color: var(--red); }
.progress-item { padding: .72rem 0; border-bottom: 1px solid var(--line); }
.progress-item div { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.progress-item span { color: var(--muted); font-size: .72rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; align-content: start; }
.account-card { min-height: 210px; padding: 1.25rem; border-radius: 20px; color: #fff; background: linear-gradient(145deg, var(--chocolate-3), var(--chocolate-2)); box-shadow: 0 16px 34px rgba(64,34,25,.18); position: relative; overflow: hidden; }
.account-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -55px; top: -65px; background: rgba(217,164,65,.12); }
.account-card > * { position: relative; z-index: 1; }
.account-card p, .account-card small { color: #d7c9c2; }
.account-card > strong { display: block; margin: 1rem 0; font-size: 1.5rem; }
.account-card .button-outline { border-color: rgba(255,255,255,.22); color: #fff; background: rgba(255,255,255,.08); }
.is-muted { opacity: .6; }
.status-chip, .step-chip { display: inline-flex; align-items: center; width: fit-content; padding: .25rem .52rem; border-radius: 99px; color: var(--muted); background: var(--surface-2); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.account-card .status-chip { color: #fff; background: rgba(255,255,255,.13); }
.budget-card, .goal-card, .asset-card, .loan-card { display: flex; flex-direction: column; gap: .65rem; min-width: 0; }
.budget-card h2, .goal-card h2, .asset-card h2, .loan-card h2 { font-size: 1.05rem; }
.budget-card .card-actions, .goal-card .card-actions, .asset-card .card-actions, .loan-card .card-actions { margin-top: auto; }
.loan-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.loan-numbers span { display: flex; flex-direction: column; padding: .6rem; border-radius: 12px; background: var(--surface-2); }
.loan-numbers small { color: var(--muted); }
.compact-select { width: auto; min-height: 34px; padding: .35rem 1.8rem .35rem .55rem; font-size: .74rem; }

.split-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,360px); align-items: start; gap: 1rem; }
.sticky-form { position: sticky; top: 92px; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table-panel .table-wrap { margin: -.25rem -.25rem 0; }
.mobile-records { display: none; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; padding-top: 1rem; }
.pagination a { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; }
.pagination a.is-current { color: #fff; border-color: var(--chocolate); background: var(--chocolate); }
.empty-inline { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.empty-state { max-width: 600px; margin: 7vh auto; display: grid; justify-items: center; text-align: center; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; color: var(--red); background: var(--red-soft); font-size: 1.7rem; font-weight: 900; }

.field { display: grid; gap: .4rem; min-width: 0; }
.field > span, .inline-field > span { color: var(--muted); font-size: .73rem; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.inline-form, .inline-field { display: flex; align-items: end; gap: .55rem; flex-wrap: wrap; }
.inline-field { flex-direction: column; align-items: flex-start; }
.inline-field input, .inline-field select, .inline-form input, .inline-form select { width: auto; min-width: 150px; }
.field-help, .fine-print { color: var(--muted); font-size: .75rem; line-height: 1.55; }
.input-action { display: flex; position: relative; }
.input-action input { padding-right: 3rem; }
.input-action button { width: 42px; position: absolute; right: 2px; top: 2px; bottom: 2px; border: 0; color: var(--muted); background: transparent; }
.segmented { display: grid; grid-template-columns: repeat(2,1fr); gap: .45rem; }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span { min-height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem; font-weight: 800; cursor: pointer; }
.segmented label input:checked + span { color: var(--chocolate-3); border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(217,164,65,.12); }
.check-field { display: flex; gap: .55rem; align-items: center; font-size: .84rem; }
.check-field input { width: 18px; min-height: 18px; accent-color: var(--chocolate); }
.callout { display: flex; flex-direction: column; gap: .25rem; padding: .9rem; border-left: 4px solid var(--gold); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.callout strong { color: var(--ink); }

.tab-guide {
    margin-bottom: 1rem;
    border: 1px solid color-mix(in srgb,var(--gold),var(--line) 58%);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(217,164,65,.14), transparent 38%),
        color-mix(in srgb,var(--surface) 96%,transparent);
    box-shadow: 0 13px 34px rgba(64,35,25,.07);
    overflow: hidden;
}
.tab-guide summary {
    min-height: 70px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .75rem 1rem;
    cursor: pointer;
    list-style: none;
    transition: background .25s;
}
.tab-guide summary:hover { background: color-mix(in srgb,var(--gold-soft) 25%,transparent); }
.tab-guide summary::-webkit-details-marker { display: none; }
.guide-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(217,164,65,.45);
    border-radius: 13px;
    color: var(--chocolate-3);
    background: linear-gradient(145deg,#f7e5b4,var(--gold));
    box-shadow: 0 8px 20px rgba(217,164,65,.18);
    font: 800 1rem Georgia,serif;
}
.guide-summary-copy { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.guide-summary-copy strong { font-size: .9rem; }
.guide-summary-copy small { color: var(--muted); font-size: .7rem; }
.guide-toggle { display: flex; align-items: center; gap: .55rem; color: var(--chocolate-2); font-size: .72rem; font-weight: 850; white-space: nowrap; }
html[data-theme="dark"] .guide-toggle { color: var(--gold); }
.guide-toggle i {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--surface-2);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), background .25s;
}
.guide-toggle i::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px,-1px); }
.tab-guide[open] .guide-toggle i { transform: rotate(180deg); background: var(--gold-soft); }
.guide-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s cubic-bezier(.2,.8,.2,1); }
.tab-guide[open] .guide-reveal { grid-template-rows: 1fr; }
.guide-content { min-height: 0; overflow: hidden; padding: 0 1rem; opacity: 0; transform: translateY(-7px); transition: opacity .3s ease, transform .38s ease, padding-bottom .38s ease; }
.tab-guide[open] .guide-content { padding-bottom: 1rem; opacity: 1; transform: none; }
.guide-content > p { max-width: 1000px; margin: 0 0 .8rem 50px; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.guide-tips { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-left: 50px; }
.guide-tips > span { display: flex; align-items: flex-start; gap: .55rem; padding: .72rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: .76rem; line-height: 1.5; }
.guide-tips i { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 8px; color: var(--chocolate-3); background: var(--gold-soft); font-size: .65rem; font-style: normal; font-weight: 900; }
.exchange-strip { display: flex; align-items: center; flex-wrap: wrap; gap: .38rem .55rem; margin: .75rem 0 0 50px; padding-top: .7rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .69rem; }
.exchange-strip strong { color: var(--ink); }
.exchange-strip small { margin-left: auto; color: var(--muted); }
.exchange-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb,var(--green),transparent 83%); }
.exchange-live-dot.is-stale { background: var(--gold); box-shadow: 0 0 0 4px rgba(217,164,65,.18); }

.filter-panel { margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 25px rgba(53,28,20,.06); overflow: hidden; }
.filter-panel summary { width: fit-content; min-height: 39px; display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; color: var(--chocolate-2); font-size: .76rem; font-weight: 850; cursor: pointer; list-style: none; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-toggle-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--chocolate-3); background: var(--gold-soft); transition: transform .25s; }
.filter-panel[open] .filter-toggle-icon { transform: rotate(90deg); }
.filter-form { display: grid; grid-template-columns: repeat(5,minmax(130px,1fr)); align-items: end; gap: .7rem; padding: 0 .8rem .8rem; animation: filter-in .25s ease; }
@keyframes filter-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.app-dialog { width: min(580px, calc(100% - 1.4rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; overflow: auto; }
.app-dialog-wide { width: min(780px, calc(100% - 1.4rem)); }
.app-dialog::backdrop { background: rgba(25,15,12,.68); backdrop-filter: blur(7px); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(25,15,12,.68); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(440px,100%); padding: 1.5rem; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 70px rgba(0,0,0,.28); animation: modal-in .22s ease; }
.modal-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--red); background: var(--red-soft); font-weight: 900; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.toast { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 12px; font-size: .84rem; animation: toast-in .3s ease; }
.toast-success { color: var(--green); border: 1px solid color-mix(in srgb,var(--green),transparent 65%); background: var(--green-soft); }
.toast-error { color: var(--red); border: 1px solid color-mix(in srgb,var(--red),transparent 65%); background: var(--red-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
.reminder-drawer { margin-bottom: 1rem; border: 1px solid color-mix(in srgb,var(--gold),transparent 45%); border-radius: 14px; background: var(--surface); }
.reminder-drawer summary { padding: .8rem 1rem; cursor: pointer; font-weight: 800; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .3rem; border-radius: 99px; color: var(--chocolate-3); background: var(--gold-soft); font-size: .7rem; }
.reminder-list { padding: 0 1rem .7rem; }
.reminder-list article { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.reminder-list p { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }

.bar-chart { min-height: 260px; display: flex; align-items: end; gap: .65rem; padding: 1rem 0; overflow-x: auto; }
.bar-group { min-width: 44px; flex: 1; display: grid; gap: .5rem; text-align: center; }
.bar-stack { height: 200px; display: flex; align-items: end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.bar { width: min(18px,40%); height: var(--bar); min-height: 2px; border-radius: 7px 7px 2px 2px; animation: grow .55s ease; }
.bar-income { background: var(--green); }
.bar-expense { background: var(--red); }
@keyframes grow { from { height: 0; } }
.bar-group small { color: var(--muted); font-size: .65rem; }
.chart-legend { display: flex; gap: 1rem; color: var(--muted); font-size: .75rem; }
.chart-legend span { display: flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend-income { background: var(--green); }
.legend-expense { background: var(--red); }
.horizontal-chart { display: grid; gap: .8rem; padding-top: .7rem; }
.horizontal-chart > div > span { display: flex; justify-content: space-between; margin-bottom: .35rem; }
.horizontal-chart small { color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 1rem; margin-bottom: 1rem; }
.chip-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
.management-chip { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.management-chip > span { min-width: 0; display: flex; flex-direction: column; }
.management-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.management-chip small { color: var(--muted); font-size: .65rem; }
.compact-panel { margin-top: 1rem; }

.public-body { display: flex; min-height: 100vh; flex-direction: column; }
.public-header { min-height: 74px; display: flex; justify-content: space-between; align-items: center; padding: .8rem clamp(1rem,5vw,4rem); border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface) 90%,transparent); backdrop-filter: blur(16px); }
.public-header .brand { color: var(--ink); }
.public-header .brand-copy small { color: var(--muted); }
.public-main { width: min(1200px,100%); margin: auto; padding: 2rem 1rem; }
.auth-card { width: min(470px,100%); margin: 4vh auto; display: grid; justify-items: center; text-align: center; overflow: hidden; position: relative; }
.auth-card::before { content: ""; width: 220px; height: 220px; position: absolute; top: -130px; right: -100px; border-radius: 50%; background: rgba(217,164,65,.12); }
.finance-identity-logo {
    width: 154px;
    height: 154px;
    display: block;
    object-fit: contain;
    border: 1px solid rgba(217,164,65,.38);
    border-radius: 28px;
    background: #050505;
    box-shadow: 0 18px 42px rgba(50,25,17,.18), 0 0 0 6px rgba(217,164,65,.08);
}
.finance-identity-logo-install { width: 180px; height: 180px; }
.auth-card h1 { margin: .6rem 0 .2rem; font-size: 2rem; }
.lead { margin-top: 0; color: var(--muted); }
.auth-points { width: 100%; display: grid; gap: .5rem; margin: 1rem 0 1.3rem; text-align: left; color: var(--muted); font-size: .83rem; }
.auth-card form { width: 100%; }
.install-shell { width: min(1180px,100%); margin: 0 auto; display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 2rem; align-items: start; }
.install-intro { position: sticky; top: 2rem; padding: 2rem 0; }
.install-intro h1 { margin: .7rem 0; font-size: clamp(2.2rem,6vw,4.2rem); line-height: .95; }
.install-intro > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.feature-list { display: grid; gap: .7rem; padding: 0; list-style: none; color: var(--muted); }
.feature-list li::before { content: "◆"; margin-right: .5rem; color: var(--gold); }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-form { grid-template-columns: repeat(3,minmax(130px,1fr)); }
}

@media (max-width: 840px) {
    .app-shell, .app-shell.is-collapsed { display: block; }
    .sidebar { width: min(310px,86vw); position: fixed; left: 0; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .app-shell.is-mobile-open .sidebar { transform: translateX(0); }
    .app-shell.is-mobile-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(20,12,10,.58); backdrop-filter: blur(3px); }
    .topbar { height: 68px; }
    .dashboard-grid, .split-layout, .settings-grid, .install-shell { grid-template-columns: 1fr; }
    .sticky-form, .install-intro { position: static; }
    .install-intro { padding: .5rem 0; }
    .filter-form { grid-template-columns: repeat(2,minmax(130px,1fr)); }
}

@media (max-width: 640px) {
    .page { padding: .9rem; }
    .page-heading { align-items: flex-start; }
    .page-heading, .hero-card { flex-direction: column; }
    .hero-card { align-items: stretch; }
    .hero-card .button { width: fit-content; }
    .metric-grid, .metric-grid-three, .card-grid, .form-grid, .chip-list { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .metric-card { min-height: 112px; }
    .filter-form { grid-template-columns: 1fr; }
    .filter-actions { justify-content: flex-start; }
    .table-wrap { display: none; }
    .mobile-records { display: grid; }
    .mobile-record { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .55rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
    .mobile-record > small, .mobile-record > .row-actions { grid-column: 2 / -1; }
    .mobile-record > div:not(.row-actions) { min-width: 0; display: flex; flex-direction: column; }
    .mobile-record small { color: var(--muted); font-size: .68rem; }
    .record-row { align-items: flex-start; }
    .record-row > strong { font-size: .76rem; }
    .heading-actions { width: 100%; }
    .tab-guide summary { grid-template-columns: 38px minmax(0,1fr) auto; gap: .6rem; padding: .7rem .75rem; }
    .guide-icon { width: 36px; height: 36px; }
    .guide-summary-copy small, .guide-toggle > span { display: none; }
    .guide-content > p, .guide-tips, .exchange-strip { margin-left: 0; }
    .guide-tips { grid-template-columns: 1fr; }
    .exchange-strip small { width: 100%; margin-left: 0; }
    .public-main { padding: 1rem; }
    .install-form { padding: 1rem; }
}

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