:root {
    color-scheme: light;
    --ink: #18251f;
    --muted: #68756f;
    --line: #e4eae5;
    --surface: #ffffff;
    --surface-soft: #f5f8f5;
    --green: #16734a;
    --green-dark: #105b3a;
    --green-soft: #e6f4ec;
    --amber-soft: #fff4da;
    --red: #a73e3e;
    --red-soft: #fff0ef;
    --shadow: 0 22px 70px rgba(27, 54, 39, .09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(48, 145, 94, .08), transparent 28rem),
        linear-gradient(135deg, #f7faf7 0%, #edf4ef 100%);
}

a { color: var(--green); text-decoration: none; font-weight: 650; }
a:hover { color: var(--green-dark); text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { width: min(1160px, calc(100% - 48px)); height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.topbar-brand-group { min-width: 0; display: inline-flex; align-items: center; gap: 10px; }
.settings-trigger { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: #58675e; background: rgba(255,255,255,.82); cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.settings-trigger:hover { transform: translateY(-1px); border-color: #acd0b7; color: var(--green-dark); background: #f4faf5; }
.settings-trigger svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-trigger:focus-visible { outline: 3px solid rgba(49, 145, 100, .3); outline-offset: 2px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-weight: 780; letter-spacing: -.04em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--green); font-size: 13px; letter-spacing: -.04em; box-shadow: 0 7px 16px rgba(22, 115, 74, .2); }
.topbar-action { margin: 0; }
.context-switcher { display: flex; align-items: center; gap: 7px; margin: 0 auto 0 20px; }
.context-switcher select { max-width: 250px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 12px; }
.js-enabled .context-switch-submit { display: none; }
.context-role-badge { padding: 7px 10px; border: 1px solid #d7e9dd; border-radius: 999px; color: #286744; background: var(--green-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.context-confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(18, 42, 28, .24); }
.context-confirm-dialog::backdrop { background: rgba(18, 34, 25, .42); backdrop-filter: blur(3px); }
.context-dialog-content { padding: 28px; }
.context-dialog-content h2 { margin: 8px 0; font-size: 23px; letter-spacing: -.04em; }
.context-dialog-content p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.context-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.context-dialog-actions form { margin: 0; }
.context-dialog-actions[hidden] { display: none !important; }
.context-switch-progress { display: flex; align-items: center; gap: 11px; margin-top: 22px; padding: 14px; border: 1px solid #d7e9dd; border-radius: 12px; color: #286744; background: #f2f8f4; font-size: 13px; font-weight: 650; }
.context-switch-progress[hidden] { display: none; }
.context-switch-spinner { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #c9dfd0; border-top-color: var(--green); border-radius: 50%; animation: context-switch-spin .75s linear infinite; }
@keyframes context-switch-spin { to { transform: rotate(360deg); } }
.mobile-bottom-nav { display: none; }
.desktop-sidebar { display: none; }
.mobile-sheet-dialog { width: min(100%, 580px); max-height: min(84dvh, 720px); margin: auto; padding: 22px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(18, 42, 28, .24); }
.mobile-sheet-dialog::backdrop { background: rgba(18, 34, 25, .42); backdrop-filter: blur(3px); }
.settings-dialog { width: min(380px, calc(100% - 32px)); }
.settings-menu { display: grid; gap: 8px; }
.settings-menu-link { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #e8eeea; border-radius: 13px; color: #34443a; background: #fff; text-decoration: none; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.settings-menu-link:hover { transform: translateY(-1px); border-color: #bdd8c5; background: #f8fbf8; text-decoration: none; }
.settings-menu-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; color: #28744e; background: #edf6ef; font-size: 19px; font-weight: 750; }
.settings-menu-link > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.settings-menu-link strong { font-size: 12px; }
.settings-menu-link small { color: #78847d; font-size: 10px; }
.settings-menu-arrow { margin-left: auto; color: #87938b; font-size: 21px; line-height: 1; }
.settings-menu-danger .settings-menu-icon { color: #a33b3b; background: #fff1ef; }
.settings-menu-danger:hover { border-color: #ecc8c4; background: #fffaf9; }
.settings-menu-link:focus-visible { outline: 3px solid rgba(49, 145, 100, .3); outline-offset: 2px; }
.reset-data-panel .form-heading { margin-bottom: 19px; }
.reset-data-warning { margin-bottom: 18px; font-size: 12px; line-height: 1.55; }
.reset-scope-options { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.reset-scope-options legend { margin-bottom: 8px; color: #35463c; font-size: 12px; font-weight: 750; }
.reset-scope-option { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #e2eae4; border-radius: 13px; background: #fbfdfb; cursor: pointer; }
.reset-scope-option:has(input:checked) { border-color: #8db99b; background: #f4faf5; box-shadow: 0 0 0 2px rgba(49, 145, 100, .08); }
.reset-scope-option input, .reset-confirm-check input { width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0 0; accent-color: var(--green); }
.reset-scope-option > span { display: grid; gap: 5px; }
.reset-scope-option strong { color: #35463c; font-size: 12px; }
.reset-scope-option small { color: #748178; font-size: 10px; line-height: 1.5; }
.reset-confirm-check { display: flex; align-items: flex-start; gap: 9px; color: #58665e; font-size: 11px; line-height: 1.5; }
.reset-data-panel .form-stack { gap: 14px; }
.mobile-sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.mobile-sheet-heading h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.04em; }
.mobile-sheet-close { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; font-size: 25px; line-height: 1; cursor: pointer; }
.mobile-action-list { display: grid; gap: 9px; }
.mobile-action-link { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; }
.mobile-action-link:hover { border-color: #cfe3d5; color: var(--ink); background: #f7fbf8; text-decoration: none; }
.mobile-action-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; font-size: 22px; font-weight: 600; }
.mobile-action-income { color: #176b43; background: #e6f4ec; }
.mobile-action-expense { color: #a73e3e; background: #fff0ef; }
.mobile-action-transfer { color: #425b9a; background: #edf1ff; }
.mobile-action-link strong, .mobile-action-link small { display: block; }
.mobile-action-link strong { font-size: 13px; }
.mobile-action-link small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 450; }
.mobile-action-arrow { color: #91a097; font-size: 23px; text-align: right; }
.mobile-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.mobile-module-grid a { min-height: 47px; display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: #405047; background: #fbfcfb; font-size: 12px; }
.mobile-module-grid a:hover { border-color: #cfe3d5; color: var(--green-dark); background: #f2f8f3; text-decoration: none; }
.mobile-menu-settings { display: grid; gap: 5px; margin-top: 17px; padding-top: 12px; border-top: 1px solid var(--line); }
.mobile-menu-settings > .desktop-sidebar-label { margin: 0 0 3px; }
.mobile-menu-settings > a { min-height: 37px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-radius: 9px; color: #405148; background: #f7faf7; font-size: 11px; font-weight: 700; }
.mobile-menu-settings > a:hover { color: var(--green-dark); background: #edf6ef; text-decoration: none; }
.mobile-menu-settings > .mobile-menu-settings-danger { color: #a33b3b; background: #fff7f6; }
.mobile-menu-settings > .mobile-menu-settings-danger:hover { color: #8d2828; background: #fff0ee; }
.mobile-menu-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.mobile-menu-account form { margin: 0; }
.main-content { width: min(1160px, calc(100% - 48px)); margin: 18px auto 42px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.page-footer { padding: 0 24px 24px; color: #87928c; text-align: center; font-size: 12px; }

.auth-layout { min-height: 590px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid rgba(220, 231, 222, .85); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.auth-layout-register { min-height: 670px; }
.welcome-panel { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(38px, 6vw, 76px); color: #f7fff9; background: linear-gradient(145deg, #125b3a 0%, #16734a 55%, #228957 100%); }
.welcome-panel::before, .welcome-panel::after { position: absolute; z-index: -1; content: ""; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.welcome-panel::before { width: 440px; height: 440px; right: -190px; bottom: -235px; }
.welcome-panel::after { width: 320px; height: 320px; right: -130px; bottom: -175px; }
.eyebrow { display: inline-block; color: #6d9a80; font-size: 10px; font-weight: 800; letter-spacing: .16em; line-height: 1.5; }
.welcome-panel .eyebrow { color: #a7dec0; }
.welcome-panel h1 { max-width: 460px; margin: 18px 0 16px; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -.055em; }
.welcome-panel p { max-width: 410px; margin: 0; color: rgba(241, 255, 246, .76); font-size: 15px; line-height: 1.75; }
.welcome-decoration { display: flex; align-items: end; gap: 9px; height: 84px; margin-top: 42px; }
.welcome-decoration span { width: 13px; border-radius: 8px; background: rgba(225, 255, 237, .76); }
.welcome-decoration span:nth-child(1) { height: 33px; opacity: .42; }
.welcome-decoration span:nth-child(2) { height: 55px; opacity: .66; }
.welcome-decoration span:nth-child(3) { height: 78px; }

.form-panel { align-self: center; width: 100%; max-width: 510px; margin: 0 auto; padding: clamp(32px, 5vw, 64px); }
.form-heading { margin-bottom: 28px; }
.form-heading h1, .form-heading h2 { margin: 9px 0 8px; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.045em; }
.form-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.form-stack { display: flex; flex-direction: column; gap: 17px; }
.inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.inline-actions form { margin: 0; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 8px; color: #37463e; font-size: 13px; font-weight: 700; }
.checkbox-field { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-top: 2px; color: #59675f; font-size: 11px; font-weight: 600; cursor: pointer; }
.field .checkbox-field input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--green); }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #dbe4dd; border-radius: 11px; outline: none; color: var(--ink); background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.field input::placeholder { color: #a8b2ac; }
.field input:focus { border-color: #319164; box-shadow: 0 0 0 4px rgba(49, 145, 100, .12); }
.field small { color: #86938b; font-size: 11px; font-weight: 450; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-options { display: flex; justify-content: flex-end; margin-top: -4px; font-size: 12px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 750; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); text-decoration: none; }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 8px 16px rgba(22, 115, 74, .17); }
.button-primary:hover { color: #fff; background: var(--green-dark); box-shadow: 0 11px 19px rgba(22, 115, 74, .22); }
.button-wide { width: 100%; margin-top: 4px; }
.button-quiet { color: #506057; border-color: var(--line); background: rgba(255,255,255,.72); }
.button-quiet:hover { color: var(--green-dark); background: #fff; }
.button.button-danger { border: 1px solid #a83232; color: #fff; background: #b33a3a; box-shadow: 0 5px 13px rgba(153, 39, 39, .14); }
.button.button-danger:hover { border-color: #8e2828; color: #fff; background: #992f2f; }
.button-small { min-height: 38px; padding: 0 14px; font-size: 12px; }
.form-switch { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.notice ul { margin: 0; padding-left: 19px; }
.notice li + li { margin-top: 3px; }
.notice-error { color: #8d3434; border-color: #f1cecb; background: var(--red-soft); }
.notice-success { color: #17623e; border-color: #c8e4d2; background: var(--green-soft); }
.notice-readonly { color: #56685d; border-color: #d7e3da; background: #f1f6f2; }
.read-only-context .main-content form:not(.context-switcher):not(.topbar-action):not(.report-filters):not(.global-account-form):not(.dashboard-month-selector):not(.transaction-period-filter) { display: none; }
.support-note { margin: 25px 0 0; color: #8a958e; text-align: center; font-size: 11px; line-height: 1.6; }
.narrow-panel { width: min(480px, 100%); margin: auto; padding: clamp(28px, 5vw, 48px); border: 1px solid var(--line); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow); }

.dashboard-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 14px 0 28px; }
.dashboard-context-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.dashboard-charts-trigger { display: inline-flex; align-items: center; gap: 7px; }
.dashboard-charts-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.finance-chart-dialog { width: min(1020px, calc(100% - 36px)); max-height: min(90dvh, 900px); overflow-y: auto; margin: auto; padding: 27px; border: 1px solid #e0e8e2; border-radius: 24px; color: var(--ink); background: #f8faf8; box-shadow: 0 28px 100px rgba(18, 42, 28, .28); }
.finance-chart-dialog.is-chart-expanded { width: min(1500px, calc(100% - 28px)); height: min(940px, calc(100dvh - 28px)); max-height: calc(100dvh - 28px); padding: 24px 30px 30px; }
.finance-chart-dialog.is-chart-expanded .finance-chart-summary, .finance-chart-dialog.is-chart-expanded .finance-chart-expenses, .finance-chart-dialog.is-chart-expanded .finance-chart-footnote { display: none; }
.finance-chart-dialog.is-chart-expanded .finance-chart-grid { display: block; }
.finance-chart-dialog.is-chart-expanded .finance-chart-monthly { min-height: calc(100% - 76px); }
.finance-chart-dialog::backdrop { background: rgba(18, 34, 25, .48); backdrop-filter: blur(5px); }
.finance-chart-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.finance-chart-dialog-header h2 { margin: 5px 0 4px; font-size: 25px; letter-spacing: -.045em; }
.finance-chart-dialog-header p { margin: 0; color: var(--muted); font-size: 12px; }
.finance-chart-dialog-header .mobile-sheet-close { flex-basis: 40px; width: 40px; height: 40px; }
.finance-chart-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.finance-chart-summary article { min-width: 0; display: grid; gap: 8px; padding: 14px 16px; border: 1px solid #e6ece7; border-radius: 14px; background: #fff; }
.finance-chart-summary article > span { color: #738078; font-size: 10px; font-weight: 700; }
.finance-chart-summary article > strong { overflow-wrap: anywhere; color: #25372d; font-size: 17px; letter-spacing: -.025em; }
.finance-chart-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 14px; }
.finance-chart-card { min-width: 0; padding: 19px; border: 1px solid #e5ebe6; border-radius: 17px; background: #fff; box-shadow: 0 8px 22px rgba(27, 54, 39, .035); }
.finance-chart-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 48px; margin-bottom: 10px; }
.finance-chart-card-heading h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.finance-chart-card-heading p { margin: 5px 0 0; color: #87928b; font-size: 10px; }
.finance-chart-heading-meta { display: flex; align-items: center; gap: 12px; }
.finance-chart-year { display: none; padding: 5px 9px; border: 1px solid #e3ebe5; border-radius: 999px; color: #53645a; background: #f6f9f6; font-size: 10px; font-weight: 800; }
.finance-chart-monthly.is-expanded .finance-chart-year { display: inline-flex; }
.finance-chart-legend { display: flex; gap: 10px; padding-top: 2px; color: #758179; font-size: 9px; white-space: nowrap; }
.finance-chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.finance-chart-legend i, .expense-legend-name i { width: 8px; height: 8px; flex: 0 0 8px; display: inline-block; border-radius: 50%; }
.legend-income { background: #16734a; }
.legend-expenses { background: #d97766; }
.monthly-chart-bars { height: 205px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: stretch; padding: 8px 3px 0; border-bottom: 1px solid #e9eeea; background: repeating-linear-gradient(to bottom, transparent 0, transparent 48px, #edf1ee 49px, transparent 50px); }
.monthly-chart-bars[hidden] { display: none !important; }
.monthly-chart-interactive { border-radius: 10px; cursor: zoom-in; outline: none; }
.monthly-chart-interactive:focus-visible { outline: 3px solid rgba(49, 145, 100, .32); outline-offset: 4px; }
.finance-chart-monthly.is-expanded { grid-column: 1 / -1; }
.finance-chart-monthly.is-expanded .monthly-chart-interactive { cursor: zoom-out; }
.finance-chart-monthly.is-expanded .monthly-chart-bars { height: 330px; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.finance-chart-monthly.is-expanded .monthly-chart-columns { height: 285px; }
.finance-chart-monthly.is-expanded .monthly-chart-bar { width: min(32px, 38%); }
.finance-chart-monthly.is-expanded .monthly-chart-month > small { font-size: 10px; }
.finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-bars { height: calc(100dvh - 255px); min-height: 360px; }
.finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-columns { height: calc(100dvh - 330px); min-height: 285px; }
.finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-bars-annual { display: flex; flex-flow: row nowrap; }
.finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-bars-annual .monthly-chart-month { flex: 1 1 0; min-width: 0; }
.monthly-chart-bars-empty { opacity: .62; }
.monthly-chart-bars-empty .monthly-chart-bar { height: 4px !important; opacity: .42; }
.finance-chart-empty-note { margin: 8px 0 0; color: #89948d; font-size: 11px; text-align: center; }
.monthly-chart-month { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.monthly-chart-columns { width: 100%; height: 170px; display: flex; align-items: flex-end; justify-content: center; gap: clamp(3px, .7vw, 8px); }
.monthly-chart-bar { width: min(26px, 35%); min-height: 0; display: block; border-radius: 6px 6px 2px 2px; transition: opacity .18s ease, filter .18s ease; }
.monthly-chart-month:hover .monthly-chart-bar { filter: brightness(1.08); }
.chart-bar-income { background: linear-gradient(180deg, #55ae7a 0%, #16734a 100%); }
.chart-bar-expenses { background: linear-gradient(180deg, #ed9a83 0%, #ce6656 100%); }
.monthly-chart-month > small { color: #758179; font-size: 9px; font-weight: 700; }
.expense-chart-body { min-height: 205px; display: grid; grid-template-columns: minmax(125px, .9fr) minmax(0, 1.1fr); align-items: center; gap: 14px; }
.expense-chart-body-empty { opacity: .78; }
.expense-chart-empty-legend { padding: 10px 0; color: #89948d; font-size: 11px; line-height: 1.45; }
.expense-chart-donut { width: min(170px, 100%); aspect-ratio: 1; display: grid; place-items: center; justify-self: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(26, 50, 37, .06); }
.expense-chart-donut > div { width: 67%; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 50%; background: #fff; box-shadow: 0 4px 15px rgba(25, 45, 33, .07); text-align: center; }
.expense-chart-donut small { color: #87928b; font-size: 8px; font-weight: 650; }
.expense-chart-donut strong { max-width: 90%; overflow-wrap: anywhere; color: #293b31; font-size: 12px; letter-spacing: -.035em; }
.expense-chart-legend { min-width: 0; display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.expense-chart-legend li { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid #f0f2f0; }
.expense-legend-name { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; color: #56645b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.expense-chart-legend li > strong { color: #33443a; font-size: 9px; white-space: nowrap; }
.finance-chart-empty { min-height: 205px; display: grid; place-items: center; padding: 20px; color: #89948d; font-size: 12px; line-height: 1.5; text-align: center; }
.finance-chart-footnote { margin: 14px 2px 0; color: #829087; font-size: 10px; line-height: 1.45; }
.dashboard-intro h1 { margin: 9px 0 8px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.055em; }
.dashboard-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.context-chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid #d6e8dc; border-radius: 999px; color: #236241; background: #f0f8f2; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #32a56d; box-shadow: 0 0 0 4px rgba(50,165,109,.12); }
.setup-card { display: flex; align-items: center; gap: 18px; padding: 23px 25px; border: 1px solid #dcebe0; border-radius: 18px; background: linear-gradient(120deg, #fff 0%, #f4faf5 100%); }
.setup-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-soft); font-size: 21px; font-weight: 800; }
.setup-card h2 { margin: 5px 0 6px; font-size: 18px; letter-spacing: -.025em; }
.setup-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dashboard-panel.onboarding-panel { margin-bottom: 16px; padding: 22px 24px; border-color: #f0c49f; color: #5b2c15; background: linear-gradient(115deg, #fff5eb 0%, #ffead8 58%, #ffe2c8 100%); box-shadow: 0 10px 26px rgba(151, 82, 37, .11); }
.onboarding-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; list-style: none; cursor: pointer; }
.onboarding-summary::marker { content: ""; }
.onboarding-summary::-webkit-details-marker { display: none; }
.onboarding-summary:focus-visible { outline: 3px solid #d86b2b; outline-offset: 5px; border-radius: 8px; }
.onboarding-summary .eyebrow { color: #a64b1b; }
.onboarding-summary h2 { margin: 5px 0 6px; color: #512b19; font-size: 18px; letter-spacing: -.025em; }
.onboarding-summary p { margin: 0; color: #70452f; font-size: 13px; line-height: 1.6; }
.onboarding-toggle { flex: 0 0 auto; }
.onboarding-toggle.button-primary { border-color: #b9501a; color: #fff; background: #b9501a; box-shadow: 0 5px 16px rgba(185, 80, 26, .2); }
.onboarding-toggle.button-primary:hover { border-color: #963d12; color: #fff; background: #963d12; }
.onboarding-details { margin-top: 18px; padding-top: 17px; border-top: 1px solid #edc9ac; }
.onboarding-intro { margin: 0 0 15px; color: #70452f; font-size: 13px; line-height: 1.6; }
.setup-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.setup-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.setup-step-marker { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #dce6df; border-radius: 50%; color: #6f7e75; background: #f5f8f5; font-size: 12px; font-weight: 800; }
.setup-step > div strong { display: block; font-size: 13px; }
.setup-step > div p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.setup-step-done { border-color: #d5e9db; background: #f8fcf9; }
.setup-step-done .setup-step-marker { border-color: #bcdcc7; color: var(--green); background: var(--green-soft); }
.setup-step-blocked { background: #f8f9f8; }
.setup-step-blocked > div strong, .setup-step-blocked > div p { color: #86928a; }
.step-optional-label { margin-left: 5px; color: #79867f; font-size: 10px; font-weight: 600; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 18px; }
.feature-card { min-height: 156px; position: relative; display: block; padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; background: rgba(255,255,255,.82); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.feature-card:hover { color: var(--ink); text-decoration: none; }
.feature-card:focus-visible { outline: 3px solid rgba(49,145,100,.45); outline-offset: 3px; }
.feature-card:active { transform: scale(.985); }
.feature-card-active { border-color: #cfe3d5; background: #fff; }
.feature-number { color: #9aa79f; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.feature-card h3 { margin: 17px 0 6px; font-size: 15px; letter-spacing: -.025em; }
.feature-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.feature-state { display: inline-block; margin-top: 13px; color: #728078; font-size: 10px; font-weight: 750; }
.feature-card-active .feature-state { color: var(--green); }

@media (hover: hover) and (pointer: fine) {
    .feature-card-active:hover { transform: translateY(-4px); border-color: #8fc5a2; background: #fbfefc; box-shadow: 0 14px 28px rgba(22, 75, 45, .12); }
}

.investment-metrics { margin-top: 15px; }
.investment-list { display: grid; gap: 9px; }
.investment-row-trigger { width: 100%; display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(110px, 1fr)) auto 16px; align-items: center; gap: 14px; padding: 15px 17px; border: 1px solid #e5ece6; border-radius: 15px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.investment-row-trigger:nth-of-type(even) { background: #f8fbf8; }
.investment-row-trigger:hover, .investment-row-trigger:focus-visible { transform: translateY(-2px); border-color: #a9cdb5; box-shadow: 0 10px 24px rgba(27, 54, 39, .08); outline: none; }
.investment-row-main, .investment-row-value { min-width: 0; display: grid; gap: 4px; }
.investment-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.investment-row-main small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.investment-row-value small { color: var(--muted); font-size: 10px; }
.investment-row-value strong { overflow-wrap: anywhere; font-size: 12px; }
.investment-row-arrow { color: var(--muted); font-size: 23px; }
.investment-detail-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.investment-detail-values > div { min-width: 0; display: grid; gap: 6px; }
.investment-detail-values small { color: var(--muted); font-size: 11px; }
.investment-detail-values strong { overflow-wrap: anywhere; font-size: 14px; }
.investment-movement-title { margin: 20px 0 12px; font-size: 16px; }
.investment-detail-dialog .investment-movement-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.investment-card { padding: 17px; border: 1px solid #e5ece6; border-radius: 15px; background: #fff; }
.investment-dialog { width: min(650px, calc(100% - 28px)); max-height: min(90dvh, 900px); overflow-y: auto; margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(18, 42, 28, .24); }
.investment-dialog::backdrop { background: rgba(18, 34, 25, .48); backdrop-filter: blur(3px); }
.investment-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.investment-dialog-header h2 { margin: 6px 0; font-size: 22px; letter-spacing: -.04em; }
.investment-dialog-header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: 24px; cursor: pointer; }
.investment-dialog .form-stack { margin-top: 20px; }
.investment-portfolio { margin-top: 20px; }
.investment-portfolio .section-heading { margin-bottom: 14px; }
.investment-portfolio .empty-state .button { margin-top: 14px; }
.investment-portfolio .privacy-hint { margin-bottom: 0; }
.investment-filters { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px) auto auto; align-items: end; gap: 10px; margin: 0 0 14px; }
.investment-filters .field { min-width: 0; }
.investment-filters .button { min-height: 42px; }
.investment-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.investment-pagination > div { display: flex; gap: 8px; }
.investment-card .account-card-top { align-items: flex-start; }
.investment-card .account-name-block h3 { margin: 4px 0; font-size: 15px; }
.investment-card .account-name-block p { margin: 0; color: var(--muted); font-size: 11px; }
.investment-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 15px 0; padding: 12px 0; border-top: 1px solid #edf1ee; border-bottom: 1px solid #edf1ee; }
.investment-values > div { min-width: 0; display: grid; gap: 5px; }
.investment-values strong { overflow-wrap: anywhere; font-size: 13px; }
.investment-movement-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; }
.investment-movement-form .field { min-width: 0; font-size: 11px; }
.investment-movement-form .field input, .investment-movement-form .field select { height: 40px; min-height: 40px; padding: 0 9px; font-size: 11px; }
.investment-movement-form .button { grid-column: 1 / -1; justify-self: start; }
.investment-history { margin-top: 15px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; margin: 0 0 16px; }
.dashboard-summary-grid { align-items: stretch; }
.metric-card { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.92); }
.metric-primary { border-color: #cfe3d5; background: linear-gradient(145deg, #fff 0%, #f1f8f3 100%); }
.metric-alert { border-color: #f1cecb; background: linear-gradient(145deg, #fff 0%, #fff7f5 100%); }
.metric-label { color: #718078; font-size: 11px; font-weight: 700; }
.metric-card strong { overflow-wrap: anywhere; font-size: clamp(18px, 2vw, 25px); letter-spacing: -.045em; }
.metric-note { color: #87938b; font-size: 10px; line-height: 1.45; }
.metric-open-summary { margin-bottom: 16px; }
.metric-open-summary > .metric-label { font-size: 12px; }
.open-amounts { min-width: 0; flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: center; gap: 10px; }
.open-amount { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 7px 9px; border-radius: 11px; background: rgba(248,250,249,.9); }
.open-amount > span { color: #65746b; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.open-status-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.open-status-line strong { overflow-wrap: anywhere; font-size: clamp(12px, 1.2vw, 16px); letter-spacing: -.035em; }
.open-status-line small { color: #87938b; font-size: 9px; line-height: 1.35; }
.open-receivable strong { color: #2563a6; }
.open-payable strong { color: #b33a3a; }
.open-net-balance { align-content: center; background: #f2f7f4; }
.open-net-balance strong.amount-positive { color: #16734a; }
.open-net-balance strong.amount-negative { color: #b33a3a; }
.dashboard-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.dashboard-panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.92); }
.health-panel { margin-top: 16px; padding: 23px; }
.health-panel-heading { align-items: center; margin-bottom: 17px; }
.health-panel-heading h2 { margin: 4px 0 3px; font-size: 20px; letter-spacing: -.035em; }
.health-panel-heading p { margin: 0; color: #77847c; font-size: 11px; line-height: 1.45; }
.health-period { padding: 7px 11px; border: 1px solid #e5ece6; border-radius: 999px; color: #59675e; background: #f8faf8; font-size: 10px; font-weight: 750; white-space: nowrap; }
.health-indicators { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.health-indicator { min-width: 0; min-height: 130px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 13px; padding: 15px; border: 1px solid #e7ece8; border-radius: 13px; background: #fff; }
.health-indicator-top { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.health-indicator-label { color: #66736b; font-size: 10px; font-weight: 750; line-height: 1.35; }
.health-status { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; color: #58665e; background: #f0f3f1; font-size: 8px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.health-indicator > strong { color: #25372d; font-size: clamp(15px, 1.4vw, 19px); line-height: 1.2; letter-spacing: -.03em; }
.health-indicator > small { margin-top: auto; color: #77847c; font-size: 10px; line-height: 1.45; }
.health-help-line { display: flex; align-items: center; gap: 7px; margin-top: auto; }
.health-help-line > small { color: #77847c; font-size: 10px; line-height: 1.45; }
.health-help-button { width: 20px; height: 20px; flex: 0 0 20px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #cbd9cf; border-radius: 50%; color: #24764f; background: #f4f8f5; font-size: 12px; font-weight: 800; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.health-help-button:hover { transform: translateY(-1px); border-color: #8db99b; color: #fff; background: #24764f; }
.health-help-button:focus-visible { outline: 3px solid rgba(49, 145, 100, .3); outline-offset: 2px; }
.health-help-dialog { width: min(520px, calc(100% - 32px)); max-height: min(82dvh, 600px); overflow-y: auto; margin: auto; padding: 24px; border: 1px solid #e0e8e2; border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(18, 42, 28, .24); }
.health-help-dialog::backdrop { background: rgba(18, 34, 25, .48); backdrop-filter: blur(4px); }
.health-help-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.health-help-dialog-header h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.04em; }
.health-help-dialog > p { color: #59675e; font-size: 13px; line-height: 1.65; }
.health-help-dialog > .health-help-note { margin-bottom: 0; padding: 11px 13px; border-radius: 11px; color: #647269; background: #f4f8f5; font-size: 11px; }
.health-positive { border-color: #e4ece6; background: #fcfdfc; }
.health-positive .health-status { color: #176b43; background: #e8f4ec; }
.health-positive > strong { color: #176b43; }
.health-warning { border-color: #eee7d8; background: #fffefd; }
.health-warning .health-status { color: #8b651a; background: #fff3d9; }
.health-warning > strong { color: #8b651a; }
.health-negative { border-color: #eee1e0; background: #fffdfd; }
.health-negative .health-status { color: #a33b3b; background: #fdebea; }
.health-negative > strong { color: #a33b3b; }
.health-neutral { border-color: #e8ece9; background: #fbfcfb; }
.health-neutral .health-status { color: #657168; background: #edf1ee; }
.health-neutral > strong { color: #59665e; font-size: 13px; }
.health-overdue-values { display: grid; gap: 3px; font-size: 12px !important; }
.health-method { margin-top: 15px; padding-top: 12px; border-top: 1px solid #edf1ed; }
.health-method summary { width: fit-content; color: var(--green); font-size: 10px; font-weight: 750; cursor: pointer; }
.health-method ul { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 17px; color: #68756f; font-size: 10px; line-height: 1.5; }
.health-method li strong { color: #35463c; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.03em; }
.panel-heading > a { flex: 0 0 auto; font-size: 11px; }
.balance-list { display: grid; }
.balance-row { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #edf1ee; }
.balance-row:first-child { border-top: 0; }
.balance-account { min-width: 0; flex: 1; display: grid; gap: 4px; }
.balance-account strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.balance-account span { overflow: hidden; color: #849087; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.balance-value { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
.invoice-mini-icon { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #785c16; background: #fff4da; }
.compact-empty { padding: 19px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.recent-panel { margin-bottom: 19px; }
.recent-list { display: grid; }
.recent-row { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #edf1ee; }
.recent-row:first-child { border-top: 0; }
.recent-kind { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #f1f5f1; font-size: 16px; font-weight: 800; }
.recent-description { min-width: 0; display: grid; gap: 4px; }
.recent-description strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recent-description span { overflow: hidden; color: #849087; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recent-status { padding: 4px 7px; border-radius: 999px; color: #735c20; background: #fff4da; font-size: 9px; font-weight: 700; white-space: nowrap; }
.recent-overdue { color: #8d3434; background: var(--red-soft); }
.recent-amount { font-size: 11px; white-space: nowrap; }
.quick-access .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-access .panel-heading { margin: 0 0 12px; }
.report-filters-panel, .report-breakdown, .report-detail { margin-bottom: 15px; }
.report-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.report-filters .field { min-width: 0; }
.report-filters .button { white-space: nowrap; }
.report-metrics { margin-top: 15px; }
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th, .report-table td { padding: 11px 9px; border-top: 1px solid #e5ebe6; text-align: left; vertical-align: top; }
.report-table tbody tr:nth-child(even) { background: #f7faf7; }
.report-table th { color: #748178; font-size: 10px; font-weight: 750; white-space: nowrap; }
.report-table td strong { display: block; }
.report-table td small { display: block; margin-top: 4px; color: #87938b; font-size: 10px; }
.report-table .numeric-cell { text-align: right; white-space: nowrap; }
.report-note { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.account-page-intro { align-items: center; }
.member-manage-form { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
.member-manage-form select { min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 11px; }
.member-row { align-items: center; }
.account-layout { display: grid; grid-template-columns: minmax(310px, .85fr) minmax(0, 1.15fr); align-items: start; gap: 20px; }
.account-form-card, .account-list-section { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 12px 34px rgba(27,54,39,.045); }
.section-heading { margin-bottom: 23px; }
.section-heading h2 { margin: 6px 0; font-size: 20px; letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid #dbe4dd; border-radius: 11px; outline: none; color: var(--ink); background: #fff; }
.field select { height: 48px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field select:focus, .field textarea:focus { border-color: #319164; box-shadow: 0 0 0 4px rgba(49,145,100,.12); }
.privacy-hint { margin: -5px 0 0; color: #748178; font-size: 11px; line-height: 1.5; }
.account-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-list-heading h2 { margin-bottom: 0; }
.count-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: #637168; background: var(--surface-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.empty-state { display: grid; justify-items: center; padding: 48px 22px; border: 1px dashed #d9e4dc; border-radius: 14px; background: #fbfdfb; text-align: center; }
.empty-state-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-soft); font-size: 25px; }
.empty-state h3 { margin: 15px 0 6px; font-size: 15px; }
.empty-state p { max-width: 285px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.account-list { display: grid; gap: 12px; }
.account-list-page { width: 100%; }
.account-list-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.account-grid-row { min-width: 0; display: grid; grid-template-columns: 38px minmax(150px, 1fr) repeat(3, minmax(120px, auto)) auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.account-grid-row:nth-of-type(even), .management-grid-row:nth-of-type(even) { background: #f8fbf8; }
.account-grid-row:hover { border-color: #b8d9c4; box-shadow: 0 8px 22px rgba(27,54,39,.08); transform: translateY(-1px); }
.account-grid-row:focus-visible { outline: 3px solid rgba(49,145,100,.3); outline-offset: 2px; }
.recurrence-layout { grid-template-columns: minmax(0, 1fr); }
.management-grid-row { min-width: 0; display: grid; grid-template-columns: 38px minmax(180px, 1.5fr) repeat(3, minmax(115px, .8fr)) auto auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.recurrence-grid-row .account-name-block h3 { margin: 0 0 4px; font-size: 14px; }
.recurrence-grid-row .account-name-block p { margin: 0; }
.recurrence-grid-row .account-grid-value strong { overflow-wrap: anywhere; font-size: 12px; }
.management-row-action { margin: 0; }
.account-grid-value { display: grid; gap: 5px; }
.account-grid-value strong { font-size: 13px; white-space: nowrap; }
.account-grid-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.account-grid-actions form { margin: 0; }
.account-list-page + .investment-dialog .account-form-card { margin: 18px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.account-list-page + .investment-dialog .section-heading { display: none; }
.account-list-page + .investment-dialog .account-form-card .form-stack { margin-top: 0; }
.account-list-page + .investment-dialog .form-stack > .button-wide { width: 100%; }
.account-list-page + .investment-dialog .form-stack > a.button-wide { display: flex; align-items: center; justify-content: center; }
.account-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.account-card-inactive { background: #f8faf8; }
.record-inactive .balance-account strong,
.record-inactive .balance-account > span,
.record-inactive .account-name-block h3,
.record-inactive .account-name-block p,
.record-inactive .account-grid-value strong,
.record-inactive .account-meta-label { color: #87918b !important; }
.record-inactive .account-avatar,
.record-inactive .recent-kind { filter: grayscale(1); opacity: .72; }
.account-card-top { display: flex; align-items: center; gap: 11px; }
.account-avatar { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 15px; font-weight: 800; }
.card-avatar { color: #785c16; background: #fff4da; }
.account-name-block { min-width: 0; flex: 1; }
.account-name-block h3 { overflow: hidden; margin: 0 0 4px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.account-name-block p { overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-status { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.contact-default-lock { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; color: var(--muted, #68776f); border: 1px solid var(--line, #dce5df); border-radius: 10px; background: #f7faf8; cursor: help; }
.contact-default-lock svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-list-link { color: inherit; text-decoration: none; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, transform .16s ease; }
.contact-list-link:hover, .contact-list-link:focus-visible { color: inherit; background: #f7faf8; border-color: #b8d8c8; text-decoration: none; }
.contact-list-link:focus-visible { outline: 3px solid rgba(23, 119, 78, .2); outline-offset: 2px; }
.contact-row-chevron { color: var(--muted, #68776f); font-size: 24px; line-height: 1; }
.contact-active-toggle { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line, #dce5df); border-radius: 12px; background: #f8faf9; }
.contact-active-toggle > span { display: grid; gap: 4px; }
.contact-active-toggle small { color: var(--muted, #68776f); font-size: 12px; }
.record-active-toggle { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line, #dce5df); border-radius: 12px; background: #f8faf9; }
.record-active-toggle > span { display: grid; gap: 4px; }
.record-active-toggle small { color: var(--muted, #68776f); font-size: 12px; }
.record-active-toggle input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--green); }
.system-users-panel { display: grid; gap: 18px; }
.system-users-panel > .section-heading { margin-bottom: 0; }
.system-users-panel > .section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.system-admin-action-form { margin: 0; }
.system-admin-action-form .button { white-space: nowrap; }
@media (max-width: 700px) { .system-admin-action-form { grid-column: 2 / -1; } .system-admin-action-form .button { width: 100%; } }
.system-user-search { margin: 0; }
.system-user-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.system-user-row > .contact-row-chevron { grid-column: 4; }
.system-user-editor { display: grid; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #f8faf8; }
.system-user-editor > .section-heading { margin: 0; }
.system-user-contexts { display: grid; gap: 10px; }
.system-user-contexts h3 { margin: 0; font-size: 14px; }
.system-user-contexts > p { margin: 0; color: var(--muted); font-size: 13px; }
.system-user-context-row { grid-template-columns: 38px minmax(0, 1fr) minmax(160px, auto); }
.system-user-access-form { padding-top: 18px; border-top: 1px solid var(--line); }
.system-user-row { gap: 14px; }
.system-user-metrics { display: grid; justify-items: end; gap: 5px; }
.system-user-metrics > strong { font-size: 12px; }
.system-user-access-label { color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.system-admin-mobile-link { grid-column: 1 / -1; }
.is-active { color: #17623e; background: var(--green-soft); }
.is-inactive { color: #69766f; background: #edf0ed; }
.account-balance-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 19px; padding-top: 14px; border-top: 1px solid #edf1ee; }
.account-balance-row > div { display: grid; gap: 5px; }
.account-balance-row strong { font-size: 17px; letter-spacing: -.025em; }
.account-meta-label { color: #87938b; font-size: 10px; font-weight: 650; }
.account-date { color: #435249; font-size: 12px; font-weight: 650; }
.account-details { margin: 12px 0 0; color: #68756f; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.account-card-action { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf1ee; }
.text-button { padding: 4px 0; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; }
.text-button-muted { color: #8a5555; }
.transaction-layout { grid-template-columns: minmax(330px, .9fr) minmax(0, 1.1fr); }
.transaction-list { display: grid; overflow: hidden; border: 1px solid #dfe8e1; border-radius: 14px; background: #fff; }
.transaction-grid-head, .transaction-grid-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(115px, .36fr) minmax(420px, 1.5fr); align-items: center; gap: 10px; }
.transaction-grid-head { padding: 10px 15px; color: #7a877f; background: #f6f9f6; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.transaction-card { min-width: 0; padding: 8px 12px; border: 0; border-top: 1px solid #e3ebe4; background: #fff; transition: background .16s ease; }
.transaction-grid-row:nth-of-type(even) { background: #f8fbf8; }
.transaction-grid-row:hover { background: #fbfdfb; }
.transaction-grid-row.is-settled, .transaction-grid-row.is-settled:nth-of-type(even) { background: #f0f2f0; }
.transaction-grid-row.is-settled:hover { background: #e9ece9; }
.transaction-grid-row.is-settled .transaction-main h3, .transaction-grid-row.is-settled .transaction-main p, .transaction-grid-row.is-settled .transaction-inline-dates, .transaction-grid-row.is-settled .transaction-kind, .transaction-grid-row.is-settled .transaction-amount { color: #69736d; }
.transaction-grid-row.is-settled .transaction-status { color: #56625b; background: #dfe4e0; }
.transaction-grid-row > .transaction-main { grid-column: 1; }
.transaction-grid-row > .transaction-side { grid-column: 2; align-items: flex-start; flex-direction: column; gap: 5px; margin-top: 0; }
.transaction-grid-row > .transaction-actions { grid-column: 3; justify-content: flex-start; gap: 6px; margin-top: 0; padding-top: 0; border-top: 0; }
.transaction-grid-row .settle-form { flex-wrap: nowrap; gap: 5px; }
.transaction-list-page { padding-top: 21px; }
.transaction-period-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px; padding: 12px; border: 1px solid #e5ece6; border-radius: 13px; background: #f8fbf8; }
.transaction-period-filter .field { width: min(260px, 100%); margin: 0; }
.transaction-period-filter .button { min-height: 42px; }
.transaction-main { min-width: 0; }
.transaction-kind { display: inline-block; flex: 0 0 auto; margin: 0; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.transaction-title-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kind-income { color: #24744d; }
.kind-expense { color: #9a5650; }
.kind-transfer { color: #5b668f; }
.transaction-main h3 { overflow: hidden; overflow-wrap: anywhere; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-main p { overflow: hidden; overflow-wrap: anywhere; margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.transaction-side { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 0; }
.transaction-amount { font-size: 14px; letter-spacing: -.02em; white-space: nowrap; }
.amount-income { color: #17623e; }
.amount-expense { color: #8d4141; }
.transaction-status { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.transaction-pending { color: #735c20; background: #fff4da; }
.transaction-overdue { color: #8d3434; background: var(--red-soft); }
.transaction-settled { color: #17623e; background: var(--green-soft); }
.transaction-canceled { color: #69766f; background: #edf0ed; }
.transaction-inline-dates { color: #718078; }
.transaction-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 6px; margin-top: 0; padding-top: 0; border-top: 0; }
.transaction-copy-pix, .transaction-pix-spacer { flex: 0 0 48px; width: 48px; }
.transaction-copy-pix { display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: #176b47; }
.transaction-copy-pix svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.transaction-icon-action { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid #dce8df; border-radius: 10px; color: #176b47; background: #f7fbf8; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.transaction-icon-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.transaction-icon-action:hover { border-color: #b8d8c3; background: #edf7f0; transform: translateY(-1px); }
.transaction-icon-cancel { border-color: #f0dddd; color: #a34c4c; background: #fffafa; }
.transaction-icon-cancel:hover { border-color: #e9c1c1; background: #fff0f0; }
.transaction-icon-restore { border-color: #d8e4f2; color: #456f9a; background: #f8fbff; }
.transaction-icon-restore:hover { border-color: #bfd1e8; background: #eef5ff; }
.transaction-icon-unsettle { border-color: #d9dfda; color: #58645c; background: #f5f7f5; }
.transaction-icon-unsettle:hover { border-color: #c4cec6; background: #e9eeea; }
.transaction-icon-action:disabled { border-color: #e5e9e6; color: #a8b2ab; background: #f2f4f2; cursor: not-allowed; transform: none; opacity: .72; }
.transaction-icon-action:focus-visible { outline: 3px solid rgba(49, 145, 100, .3); outline-offset: 2px; }
.settle-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.settle-form select, .settle-form input { min-height: 34px; max-width: 132px; padding: 5px 8px; border: 1px solid #dbe4dd; border-radius: 8px; color: var(--ink); background: #fff; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.intro-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.transaction-view-tabs { display: flex; align-items: center; gap: 7px; margin: -10px 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.75); width: fit-content; }
.transaction-view-tabs a { padding: 9px 14px; border-radius: 9px; color: #65736a; font-size: 12px; font-weight: 750; }
.transaction-view-tabs a:hover { color: var(--green-dark); text-decoration: none; }
.transaction-view-tabs a.is-active { color: var(--green-dark); background: var(--green-soft); }
.transaction-program-tabs { margin-top: 0; }
.management-program-list { margin-bottom: 18px; }
.transaction-form-layout { grid-template-columns: minmax(0, 1fr); }
.read-only-context .management-program-list .empty-state > .button { display: none; }
.entry-mode-fields[hidden] { display: none !important; }
.transaction-date-fields-wide { grid-template-columns: 1fr; }
.installment-grid-row { grid-template-columns: 38px minmax(180px, 1.5fr) repeat(3, minmax(115px, .8fr)) auto; }
.program-installment-details { display: grid; gap: 9px; }
.invoice-list { display: grid; gap: 15px; }
.invoice-card { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.93); box-shadow: 0 12px 34px rgba(27,54,39,.045); }
.invoice-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.invoice-card-heading h2 { margin: 5px 0; font-size: 19px; letter-spacing: -.035em; }
.invoice-card-heading p, .invoice-due { margin: 0; color: var(--muted); font-size: 11px; }
.invoice-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 21px; }
.invoice-summary > div { display: grid; gap: 5px; }
.invoice-summary strong { overflow-wrap: anywhere; font-size: 16px; }
.invoice-progress { height: 8px; overflow: hidden; margin-top: 16px; border-radius: 999px; background: #edf1ee; }
.invoice-progress span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #2d9864, #75c18e); }
.invoice-due { margin-top: 10px; }
.invoice-payments { margin-top: 15px; border-top: 1px solid #edf1ee; border-bottom: 1px solid #edf1ee; }
.invoice-payments summary { padding: 11px 0; color: var(--green); font-size: 11px; font-weight: 750; cursor: pointer; }
.invoice-payments ul { display: grid; gap: 9px; margin: 0; padding: 0 0 13px; list-style: none; }
.invoice-payments li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; color: #68756f; font-size: 11px; }
.invoice-payments li strong { color: var(--ink); }
.invoice-payments li small { grid-column: 1 / -1; color: #8a958e; }
.invoice-payment-form { display: grid; gap: 12px; margin-top: 16px; }
.invoice-payment-form .field-grid { grid-template-columns: 1fr 1fr; }
.invoice-payment-form .button { justify-self: start; }
.invoice-empty { margin-top: 30px; }
.invoice-empty .button { margin-top: 18px; }

@media (max-width: 900px) {
    .settings-trigger { display: none; }
    .app-authenticated .app-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .mobile-bottom-nav { position: fixed; z-index: 50; inset: auto 0 0; min-height: 70px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid rgba(218, 228, 220, .95); background: rgba(255, 255, 255, .96); box-shadow: 0 -8px 28px rgba(27, 54, 39, .09); backdrop-filter: blur(18px); }
    .mobile-bottom-nav-readonly { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mobile-nav-item { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 3px 2px; border: 0; color: #748178; background: transparent; font-size: 9px; font-weight: 750; line-height: 1.1; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .mobile-nav-item:hover { color: var(--green-dark); text-decoration: none; }
    .mobile-nav-item > svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-nav-item.is-active { color: var(--green); }
    .mobile-nav-item.is-active > svg { filter: drop-shadow(0 2px 4px rgba(22, 115, 74, .12)); }
    .mobile-nav-create { margin-top: -13px; }
    .mobile-nav-create-icon { width: 47px; height: 47px; display: grid; place-items: center; margin-bottom: 1px; border: 4px solid #f2f7f3; border-radius: 50%; color: #fff; background: var(--green); box-shadow: 0 5px 15px rgba(22, 115, 74, .3); }
    .mobile-nav-create-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
    .mobile-nav-create > span:last-child { color: var(--green-dark); }
    .mobile-nav-item:focus-visible, .mobile-sheet-close:focus-visible, .mobile-action-link:focus-visible, .mobile-module-grid a:focus-visible { outline: 3px solid rgba(49, 145, 100, .3); outline-offset: 2px; }
    .mobile-sheet-dialog { position: fixed; inset: auto 0 0; width: min(100%, 620px); max-height: min(84dvh, 720px); margin: 0 auto; padding: 21px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
    .auth-layout { grid-template-columns: .85fr 1.15fr; }
    .welcome-panel { padding: 38px; }
    .form-panel { padding: 38px; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .health-indicators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-access .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-context-actions { justify-content: flex-start; }
}

@media (max-width: 1199px) {
    .transaction-grid-head { display: none; }
    .transaction-grid-row { grid-template-columns: minmax(0, 1fr) minmax(110px, .55fr); gap: 7px 12px; }
    .transaction-grid-row > .transaction-side { grid-column: 2; }
    .transaction-grid-row > .transaction-actions { grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid #edf1ed; }
}

@media (min-width: 901px) {
    .settings-dialog { position: fixed; top: 72px; right: max(32px, calc((100vw - 1568px) / 2)); left: auto; margin: 0; }
    .app-authenticated .app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 82px minmax(0, 1fr) auto; }
    .app-authenticated .topbar { grid-column: 2; grid-row: 1; width: calc(100% - 64px); max-width: 1320px; }
    .app-authenticated .main-content { grid-column: 2; grid-row: 2; width: calc(100% - 64px); max-width: 1320px; margin: 18px auto 42px; }
    .app-authenticated .page-footer { grid-column: 2; grid-row: 3; }
    .desktop-sidebar { grid-column: 1; grid-row: 1 / 4; position: sticky; top: 0; height: 100vh; min-height: 640px; display: flex; flex-direction: column; padding: 22px 15px 16px; border-right: 1px solid rgba(218, 228, 220, .95); background: rgba(255, 255, 255, .88); }
    .desktop-sidebar-context { display: grid; gap: 6px; margin: 0 1px 18px; padding: 13px 12px; border: 1px solid #e3ece5; border-radius: 13px; background: #f8fbf8; }
    .desktop-sidebar-context .eyebrow { font-size: 9px; }
    .desktop-sidebar-context strong { overflow-wrap: anywhere; color: #314239; font-size: 12px; line-height: 1.4; }
    .desktop-sidebar-context small { color: var(--muted); font-size: 10px; }
    .desktop-sidebar-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
    .desktop-sidebar-label { margin: 0 10px 5px; color: #8a968e; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
    .desktop-sidebar-label-more { margin-top: 16px; }
    .desktop-sidebar-link { min-height: 39px; display: flex; align-items: center; padding: 0 11px; border-radius: 10px; color: #58665e; font-size: 12px; font-weight: 650; transition: color .16s ease, background .16s ease, transform .16s ease; }
    .desktop-sidebar-link:hover { transform: translateX(2px); color: var(--green-dark); background: #f2f8f3; text-decoration: none; }
    .desktop-sidebar-link.is-active { color: var(--green-dark); background: var(--green-soft); font-weight: 760; }
    .desktop-sidebar-create { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 1px 2px; border: 0; border-radius: 11px; color: #fff; background: var(--green); box-shadow: 0 5px 13px rgba(22, 115, 74, .17); font-size: 12px; font-weight: 750; cursor: pointer; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
    .desktop-sidebar-create:hover { transform: translateY(-1px); background: var(--green-dark); box-shadow: 0 8px 17px rgba(22, 115, 74, .23); }
    .desktop-sidebar-create > span { font-size: 19px; font-weight: 450; line-height: 1; }
    .desktop-sidebar-account { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 14px 3px 0; border-top: 1px solid var(--line); }
    .desktop-sidebar-account > span { overflow: hidden; color: #536158; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
    .desktop-sidebar-account form { flex: 0 0 auto; margin: 0; }
    .desktop-sidebar-account .button { min-height: 32px; padding: 0 9px; }
    .app-authenticated .topbar-action { display: none; }
}

@media (max-width: 640px) {
    .topbar, .main-content { width: min(100% - 28px, 520px); }
    .open-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .open-net-balance { grid-column: 1 / -1; }
    .topbar { height: auto; min-height: 68px; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
    .context-switcher { order: 3; width: 100%; margin: 0; }
    .context-switcher select { flex: 1; min-width: 0; max-width: none; }
    .context-role-badge { margin-left: auto; }
    .main-content { margin-top: 10px; margin-bottom: 28px; }
    .auth-layout { display: block; border-radius: 20px; }
    .welcome-panel { min-height: 205px; padding: 27px 25px; }
    .welcome-panel h1 { max-width: 370px; margin: 10px 0 8px; font-size: 27px; }
    .welcome-panel p { max-width: 380px; font-size: 12px; line-height: 1.55; }
    .welcome-decoration { position: absolute; right: 26px; bottom: 19px; height: 48px; gap: 5px; margin: 0; opacity: .8; }
    .welcome-decoration span { width: 7px; }
    .welcome-decoration span:nth-child(1) { height: 19px; }
    .welcome-decoration span:nth-child(2) { height: 31px; }
    .welcome-decoration span:nth-child(3) { height: 43px; }
    .form-panel { max-width: none; padding: 29px 24px 31px; }
    .form-heading { margin-bottom: 23px; }
    .form-heading h2, .form-heading h1 { font-size: 27px; }
    .auth-layout-register .welcome-panel { min-height: 190px; }
    .auth-layout-register .form-panel { padding-top: 25px; }
    .field-grid { grid-template-columns: 1fr; gap: 17px; }
    .narrow-panel { padding: 28px 22px; border-radius: 19px; }
    .dashboard-intro { align-items: start; flex-direction: column; gap: 16px; margin-top: 8px; }
    .account-page-intro { align-items: start; }
    .intro-actions { width: 100%; }
    .dashboard-columns { grid-template-columns: 1fr; gap: 12px; }
    .transaction-grid-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 10px 12px; }
    .transaction-grid-row > .transaction-main, .transaction-grid-row > .transaction-actions { grid-column: 1 / -1; }
    .transaction-grid-row > .transaction-side { grid-column: 1 / -1; align-items: center; flex-direction: row; }
    .transaction-grid-row > .transaction-actions { justify-content: flex-start; }
    .dashboard-panel { padding: 17px; }
    .health-indicator { padding: 12px 10px; }
    .health-help-dialog { padding: 18px; border-radius: 17px; }
    .health-help-dialog-header h2 { font-size: 18px; }
    .finance-chart-dialog { width: calc(100% - 18px); max-height: 94dvh; padding: 17px; border-radius: 19px; }
    .finance-chart-dialog.is-chart-expanded { width: calc(100% - 10px); height: calc(100dvh - 10px); max-height: calc(100dvh - 10px); padding: 14px 12px; border-radius: 14px; }
    .finance-chart-dialog-header { margin-bottom: 15px; }
    .finance-chart-dialog-header h2 { font-size: 21px; }
    .finance-chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .finance-chart-summary article { padding: 11px; }
    .finance-chart-summary article:last-child { grid-column: 1 / -1; }
    .finance-chart-summary article > strong { font-size: 14px; }
    .finance-chart-grid { grid-template-columns: 1fr; gap: 10px; }
    .finance-chart-card { padding: 15px; }
    .finance-chart-card-heading { flex-wrap: wrap; }
    .monthly-chart-bars { gap: 3px; }
    .monthly-chart-columns { gap: 4px; }
    .finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-bars { height: calc(100dvh - 250px); min-height: 300px; gap: 2px; }
    .finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-columns { height: calc(100dvh - 315px); min-height: 240px; }
    .finance-chart-dialog.is-chart-expanded .finance-chart-monthly.is-expanded .monthly-chart-bars-annual { gap: 2px; }
    .expense-chart-body { grid-template-columns: minmax(105px, .8fr) minmax(0, 1.2fr); gap: 10px; }
    .recent-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; }
    .recent-amount { grid-column: 2 / 3; }
    .recent-status { grid-column: 3 / 4; grid-row: 1 / 2; }
    .quick-access .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filters .button { grid-column: 1 / -1; }
    .account-layout { grid-template-columns: 1fr; gap: 13px; }
    .account-grid-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
    .management-grid-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
    .management-grid-row > .account-grid-value, .management-grid-row > .account-status, .management-grid-row > .management-row-action { grid-column: 2 / -1; }
    .management-grid-row > a { grid-column: 2 / -1; }
    .management-grid-row > .account-status { justify-self: start; }
    .management-row-action { padding-top: 7px; border-top: 1px solid #edf1ee; }
    .account-grid-row > .account-status { grid-column: 2; justify-self: start; }
    .account-grid-value { grid-column: 2; }
    .account-grid-dates { grid-column: 2 / -1; }
    .account-grid-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 8px; border-top: 1px solid #edf1ee; }
    .account-list-tools { flex-wrap: wrap; }
    .transaction-view-tabs { width: 100%; }
    .transaction-view-tabs a { flex: 1; text-align: center; }
    .investment-filters { grid-template-columns: 1fr 1fr; }
    .investment-filters .field:first-child { grid-column: 1 / -1; }
    .investment-pagination { align-items: flex-start; flex-direction: column; }
    .investment-row-trigger { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px; }
    .investment-row-main, .investment-row-status { grid-column: 1 / -1; }
    .investment-row-arrow { display: none; }
    .investment-detail-values { grid-template-columns: 1fr; }
    .investment-detail-dialog .investment-movement-form { grid-template-columns: 1fr; }
    .member-row { align-items: flex-start; flex-direction: column; }
    .member-manage-form { justify-content: flex-start; width: 100%; }
    .system-user-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .system-user-row .balance-account { grid-column: 2; grid-row: 1; }
    .system-user-row .system-user-metrics { grid-column: 2 / -1; grid-row: 2; display: flex; align-items: center; justify-items: start; flex-wrap: wrap; gap: 8px; }
    .system-user-row > .contact-row-chevron { grid-column: 3; grid-row: 1; }
    .system-user-row .account-avatar { grid-column: 1; grid-row: 1 / 3; }
    .system-user-context-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .transaction-layout { grid-template-columns: 1fr; }
    .transaction-period-filter .field { flex: 1 1 100%; width: 100%; }
    .transaction-period-filter .button { flex: 1 1 auto; }
    .account-form-card, .account-list-section { padding: 19px; border-radius: 16px; }
    .account-balance-row strong { font-size: 15px; }
    .invoice-card { padding: 17px; }
    .invoice-summary { gap: 8px; }
    .invoice-summary strong { font-size: 13px; }
    .invoice-payment-form .field-grid { grid-template-columns: 1fr; }
    .setup-card { align-items: start; padding: 18px; }
    .setup-card h2 { font-size: 16px; }
    .context-dialog-content { padding: 22px; }
    .investment-dialog { width: 100%; max-width: none; max-height: 94dvh; margin: auto 0 0; padding: 20px; border-radius: 20px 20px 0 0; }
    .context-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .context-dialog-actions .button { padding: 0 10px; font-size: 12px; }
    .onboarding-summary { align-items: flex-start; flex-direction: column; }
    .onboarding-toggle { width: 100%; }
    .setup-step { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
    .setup-step-marker { width: 28px; height: 28px; }
    .setup-step .button { grid-column: 2; justify-self: start; min-height: 38px; }
    .feature-grid { gap: 9px; }
    .feature-card { min-height: 150px; padding: 15px; }
    .feature-card h3 { font-size: 14px; }
    .investment-values { grid-template-columns: 1fr 1fr; }
    .page-footer { padding-bottom: 17px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.field[hidden] { display: none !important; }

/* Análise integrada ao painel */
.dashboard-analysis { margin: 20px 0; scroll-margin-top: 24px; border: 1px solid #e5ebe6; border-radius: 17px; background: #f6f9f6; }
.dashboard-analysis > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; cursor: pointer; list-style: none; border-left: 4px solid #8768bd; border-radius: 16px; }
.dashboard-analysis > summary::-webkit-details-marker { display: none; }
.dashboard-analysis > summary strong { display: block; color: #514075; font-size: 16px; }
.dashboard-analysis > summary small { display: block; margin-top: 5px; color: #738078; }
.dashboard-analysis > summary:focus-visible { outline: 3px solid #8768bd; outline-offset: 3px; }
.analysis-chevron { font-size: 24px; transition: transform .2s; }
.dashboard-analysis[open] .analysis-chevron { transform: rotate(180deg); }
.dashboard-analysis-content { padding: 0 16px 18px; }
.dashboard-analysis .finance-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-analysis .finance-chart-monthly { grid-column: 1 / -1; }
.dashboard-analysis .finance-chart-monthly.is-expanded .monthly-chart-bars { gap: 4px; }
.dashboard-analysis .finance-chart-footnote { font-size: 12px; line-height: 1.6; }
.dashboard-analysis .finance-chart-card-heading p { font-size: 12px; line-height: 1.5; }
.dashboard-analysis .expense-legend-name, .dashboard-analysis .expense-chart-legend li > strong { font-size: 12px; }
.dashboard-analysis .expense-chart-legend strong small { display: block; margin-top: 3px; color: #738078; text-align: right; }
.situation-bars { display: grid; gap: 20px; padding: 12px 0; }
.situation-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12px; }
.situation-row > strong { font-size: 12px; white-space: nowrap; }
.situation-track { height: 23px; background: #f0f3f1; border-radius: 5px; overflow: hidden; }
.situation-fill { display: block; height: 100%; border-radius: 5px; }
.situation-income { background: #258558; }
.situation-expense { background: #cf6658; }
.situation-chart > a { display: inline-block; margin-top: 12px; font-size: 12px; }
@media (max-width: 900px) {
 .dashboard-analysis .finance-chart-grid { grid-template-columns: 1fr; }
 .dashboard-analysis .expense-chart-body { grid-template-columns: minmax(100px, .8fr) minmax(0, 1.2fr); }
}
@media (max-width: 480px) {
 .dashboard-analysis-content { padding: 0 8px 12px; }
 .dashboard-analysis .finance-chart-card { padding: 12px; }
 .situation-row { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 6px; }
 .situation-row > strong { font-size: 11px; }
 .dashboard-analysis .expense-chart-body { grid-template-columns: 1fr; }
 .dashboard-analysis .monthly-chart-month > small { font-size: 8px; }
 .dashboard-analysis .finance-chart-monthly.is-expanded .monthly-chart-bars-annual { min-width: 600px; }
 .dashboard-analysis .monthly-chart-interactive { overflow-x: auto; }
}

.dashboard-analysis .monthly-chart-bars-empty .monthly-chart-bar { height: 0 !important; }

/* Cards expansíveis: totais e alertas permanecem no cabeçalho. */
.dashboard-fold { width: 100%; box-sizing: border-box; padding: 0; margin-bottom: 16px; align-self: stretch; overflow: hidden; }
.dashboard-fold-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; cursor: pointer; list-style: none; border-left: 4px solid #319164; border-radius: 16px; background: #f6f9f6; }
.dashboard-fold-summary::-webkit-details-marker { display: none; }
.dashboard-fold-title { min-width: 0; }
.dashboard-fold-title > strong { display: block; font-size: 16px; color: #25372d; }
.dashboard-fold-title > small { display: block; margin-top: 7px; font-size: 12px; line-height: 1.6; color: #65756b; overflow-wrap: anywhere; }
.dashboard-fold-summary:focus-visible { outline: 3px solid #319164; outline-offset: -3px; }
.dashboard-fold[open] > summary .analysis-chevron { transform: rotate(180deg); }
.dashboard-fold .analysis-chevron { flex: 0 0 auto; color: #587364; }
.dashboard-fold-content { padding: 18px 20px 20px; border-top: 1px solid #e5ebe6; }
.dashboard-fold-actions { margin-bottom: 12px; text-align: right; font-size: 12px; }
.dashboard-fold-warning { display: block; width: fit-content; margin-top: 6px; padding: 4px 9px; border-radius: 6px; color: #a33b3b; background: #fdebea; font-weight: 700; }
.dashboard-columns > .dashboard-fold { width: 100%; }
@media (max-width: 600px) {
 .dashboard-fold-summary { padding: 16px 14px; gap: 10px; }
 .dashboard-fold-content { padding: 14px; }
 .dashboard-fold-title > strong { font-size: 15px; }
}

/* Resumo mensal em destaque */
.month-hero { position: relative; isolation: isolate; overflow: hidden; width: 100%; padding: 18px 20px; margin-bottom: 16px; border-radius: 17px; color: #fff; background: linear-gradient(115deg, #105b3a, #16734a 60%, #1b7458); box-shadow: 0 12px 28px rgba(16, 91, 58, .14); }
.month-hero::before, .month-hero::after { content: ''; position: absolute; z-index: -1; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.month-hero::before { top: -100px; right: -30px; }
.month-hero::after { bottom: -160px; left: -60px; }
.month-hero-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.month-hero-heading h2 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #d5eee0; }
.month-hero-heading p { margin: 0 0 6px; font-size: 14px; font-weight: 650; color: #edf8f1; }
.month-hero-total { display: block; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
.month-hero-status { max-width: 200px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.14); font-size: 12px; line-height: 1.5; }
.month-hero-chart { display: block; width: 100%; height: 46px; margin-top: 8px; overflow: visible; }
.month-hero-chart line, .month-hero-chart polyline { vector-effect: non-scaling-stroke; fill: none; }
.month-hero-zero { stroke: rgba(255,255,255,.25); stroke-width: 1; }
.month-hero-actual { stroke: #91f0cc; stroke-width: 2.5; stroke-linejoin: round; }
.month-hero-forecast { stroke: #d4e8ff; stroke-width: 2; stroke-dasharray: 5 5; }
.month-hero-chart-labels { display: flex; justify-content: space-between; gap: 10px; color: #e5f4eb; font-size: 12px; margin-bottom: 10px; }
.month-hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.month-hero-metrics article { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 11px; border: 1px solid rgba(255,255,255,.6); border-radius: 11px; color: #16734a; background: #f1f8f4; }
.month-hero-metrics article > div { min-width: 0; }
.month-hero-metrics article div > span { display: block; color: #52665b; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.month-hero-metrics strong { display: block; margin-top: 3px; font-size: clamp(16px, 1.6vw, 19px); overflow-wrap: anywhere; }
.month-hero-icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #155449; background: #90e6bb; font-weight: 800; }
.month-hero-icon-expense { color: #733642; background: #ffb7bd; }
.month-hero-note { margin: 8px 0; color: #e5f4eb; font-size: 12px; line-height: 1.55; }
@media (max-width: 600px) {
 .month-hero { padding: 15px 12px; border-radius: 16px; }
 .month-hero-status { max-width: 130px; font-size: 12px; }
 .month-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .month-hero-metrics article:last-child { grid-column: 1 / -1; }
 .month-hero-chart-labels { flex-wrap: wrap; font-size: 12px; line-height: 1.5; }
 .month-hero-chart-labels span:nth-child(2) { order: 3; flex-basis: 100%; text-align: center; }
}

.month-hero-metrics .month-hero-expense strong { color: #a73e3e; }
.month-hero-metrics .month-hero-closing { color: #245c96; background: #eef5fc; }
.month-hero-metrics .month-hero-closing .month-hero-icon { color: #245c96; background: #d5e5f7; }
.month-hero-heading > div { min-width: 0; }
.dashboard-analysis > summary { border-left-color: var(--green); }
.dashboard-analysis > summary strong { color: var(--green-dark); }
.dashboard-analysis > summary:focus-visible { outline-color: var(--green); }
.dashboard-fold-summary { min-height: 64px; }
@media (max-width: 600px) {
 .month-hero-heading { flex-wrap: wrap; gap: 10px; }
 .month-hero-status { max-width: 100%; }
 .month-hero-note { font-size: 13px; line-height: 1.6; }
 .month-hero-chart { height: 52px; }
 .month-hero-metrics strong { font-size: 17px; }
 .month-hero-metrics article { gap: 7px; }
}
@media (max-width: 380px) {
 .month-hero-metrics { grid-template-columns: 1fr; }
 .month-hero-metrics article:last-child { grid-column: auto; }
}

/* Totais disponíveis mesmo com o card recolhido. */
.dashboard-fold-summary-total { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; }
.dashboard-fold-total { display: grid; gap: 4px; padding: 9px 12px; border-radius: 10px; background: #edf4ef; text-align: right; }
.dashboard-fold-total > small { color: #617167; font-size: 11px; line-height: 1.4; }
.dashboard-fold-total > strong { font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.dashboard-fold-total .amount-positive { color: #16734a; }
.dashboard-fold-total .amount-negative { color: #a73e3e; }
[data-dashboard-fold="pending"] .open-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) and (min-width: 601px) {
 .dashboard-columns .dashboard-fold-summary-total { grid-template-columns: minmax(0, 1fr) 20px; }
 .dashboard-columns .dashboard-fold-total { grid-column: 1 / -1; grid-row: 2; text-align: left; }
 .dashboard-columns .dashboard-fold-summary-total > .analysis-chevron { grid-column: 2; grid-row: 1; }
}
@media (max-width: 600px) {
 .dashboard-fold-summary-total { grid-template-columns: minmax(0, 1fr) 20px; }
 .dashboard-fold-total { grid-column: 1 / -1; grid-row: 2; text-align: left; }
 .dashboard-fold-summary-total > .analysis-chevron { grid-column: 2; grid-row: 1; }
 .dashboard-fold-total > strong { font-size: 20px; }
 .dashboard-fold-total > small { font-size: 12px; }
}

.dashboard-health-result { display: grid; gap: 4px; padding: 10px 14px; border-radius: 10px; text-align: right; }
.dashboard-health-result > small { font-size: 11px; line-height: 1.4; }
.dashboard-health-result > strong { font-size: 18px; line-height: 1.3; }
.health-result-positive { color: #176b43; background: #e8f4ec; }
.health-result-negative { color: #a33b3b; background: #fdebea; }
.health-result-neutral { color: #536159; background: #edf1ee; }
@media (max-width: 600px) {
 .dashboard-health-result { grid-column: 1 / -1; grid-row: 2; text-align: left; }
 .dashboard-health-result > small { font-size: 12px; }
}

.dashboard-month-selector { display: flex; flex-wrap: wrap; justify-content: center; align-items: end; gap: 10px; margin-bottom: 16px; }
.dashboard-month-selector label { display: grid; gap: 5px; color: #536159; font-size: 12px; font-weight: 700; }
.dashboard-month-selector input { min-height: 44px; min-width: 160px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: 16px; }
.dashboard-month-selector .button { min-height: 44px; min-width: 44px; }
.dashboard-month-selector > p { flex-basis: 100%; margin: 0; color: #68756f; font-size: 12px; line-height: 1.6; }
.dashboard-current-month { padding: 12px 4px; font-size: 13px; }
@media (max-width: 420px) {
 .dashboard-month-selector { gap: 6px; }
 .dashboard-month-selector label { flex: 1; min-width: 0; }
 .dashboard-month-selector input { width: 100%; min-width: 0; }
 .dashboard-month-selector .button { padding-left: 10px; padding-right: 10px; }
}

.has-scope-dialog .recurring-scope-fallback { display: none; }
.recurring-scope-actions { display: grid; gap: 10px; margin-top: 18px; }
.recurring-scope-actions .button { min-height: 46px; white-space: normal; text-align: center; }

.transaction-edit-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; border-radius: 8px; }
.transaction-edit-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.transaction-edit-icon:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.transaction-icon-unsettle { border-color: #ead5b5; color: #855016; background: #fff6e8; }
.transaction-icon-unsettle:hover { border-color: #d6af76; background: #ffedcf; }
@media (max-width: 900px) { .transaction-icon-action { width: 44px; height: 44px; flex-shrink: 0; } }

.metric-card-link { width: 100%; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
.metric-card-link:hover { border-color: #9dcbb0; box-shadow: 0 6px 20px rgba(16,91,58,.1); }
.metric-card-link:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.monthly-details-dialog { width: min(800px, calc(100% - 32px)); max-height: 90dvh; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); box-shadow: var(--shadow); overflow-y: auto; }
.monthly-details-dialog::backdrop { background: rgba(18,34,25,.5); }
.monthly-details-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.monthly-details-header h2 { margin: 6px 0; font-size: 23px; }
.monthly-details-header p { margin: 0; color: #68756f; font-size: 13px; }
.monthly-details-header .mobile-sheet-close { min-width: 44px; min-height: 44px; }
.monthly-details-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 15px; margin-top: 18px; background: #f1f8f4; border-radius: 12px; }
.monthly-details-total > strong { font-size: 25px; overflow-wrap: anywhere; }
.monthly-details-description { font-size: 13px; line-height: 1.6; color: #68756f; }
.monthly-details-list { margin: 16px 0; padding: 0; list-style: none; }
.monthly-details-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 15px 10px; border-bottom: 1px solid var(--line); }
.monthly-details-list > li:nth-child(odd) { background: #f8faf8; }
.monthly-detail-main, .monthly-detail-value { min-width: 0; display: grid; gap: 6px; overflow-wrap: anywhere; }
.monthly-detail-main > strong { font-size: 14px; }
.monthly-detail-main > span, .monthly-detail-main > small { font-size: 12px; color: #68756f; line-height: 1.5; }
.monthly-detail-value { text-align: right; }
.monthly-detail-value > strong { font-size: 16px; }
.monthly-detail-status { justify-self: end; padding: 4px 7px; border-radius: 6px; font-size: 11px; background: #edf1ee; color: #52665b; }
.monthly-detail-status.is-projected { color: #245c96; background: #eaf3ff; }
.monthly-details-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.monthly-details-footer .button { min-height: 44px; }
@media (max-width: 600px) {
 .monthly-details-dialog { width: calc(100% - 16px); max-height: 94dvh; padding: 16px; }
 .monthly-details-list > li { grid-template-columns: 1fr; gap: 10px; }
 .monthly-detail-value { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
 .monthly-details-footer .button { flex: 1 1 100%; justify-content: center; }
 .metric-card-link .metric-note { font-size: 12px; }
}

.transaction-scope-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 15px; }
.transaction-scope-nav > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: #52665b; background: #fff; text-decoration: none; font-size: 13px; font-weight: 700; }
.transaction-scope-nav > a[aria-current="page"] { color: #fff; background: var(--green); border-color: var(--green); }
.transaction-scope-nav > a:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.transaction-filter-summary { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 14px; border-radius: 12px; background: #f1f8f4; font-size: 13px; line-height: 1.6; }
.transaction-filter-help { color: #68756f; font-size: 12px; line-height: 1.7; }
.transaction-period-filter .field select, .transaction-period-filter .field input { min-height: 44px; }
@media (max-width: 600px) {
 .transaction-scope-nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
 .transaction-filter-summary { display: grid; gap: 6px; }
 .transaction-period-filter .field { flex: 1 1 100%; width: 100%; }
}

.transaction-title-with-help { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.transaction-help-trigger { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #cfe3d5; border-radius: 50%; color: var(--green-dark); background: #e8f4ec; font: inherit; font-size: 22px; font-weight: 800; cursor: pointer; }
.transaction-help-trigger:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.transaction-help-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.transaction-help-header .mobile-sheet-close { min-width: 44px; min-height: 44px; }
.transaction-help-dialog { max-height: 90dvh; overflow-y: auto; }
.transaction-help-dialog ul { padding-left: 20px; margin: 16px 0 22px; color: #52665b; font-size: 14px; line-height: 1.65; }
.transaction-help-dialog li + li { margin-top: 12px; }
.transaction-help-dialog .button { min-height: 44px; }

/* Fechamento: realizados e pendências separados, com previsão em destaque. */
.month-hero-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); }
.month-hero-closing small { display: block; margin-top: 4px; color: #52665b; font-size: 12px; }
@media (max-width: 1100px) {
 .month-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .month-hero-metrics .month-hero-closing { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
 .month-hero-metrics { grid-template-columns: 1fr; }
 .month-hero-metrics .month-hero-closing { grid-column: auto; }
}

.has-cancel-dialog .cancel-scope-fallback { display: none; }
.cancel-scope-fallback { display: grid; gap: 5px; font-size: 12px; }
.cancel-scope-fallback select { min-height: 44px; max-width: 190px; }
[data-cancel-transaction-dialog] .context-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
[data-cancel-transaction-dialog] .context-dialog-actions .button { min-height: 44px; white-space: normal; }
[data-cancel-transaction-future][hidden] { display: none !important; }
@media (max-width: 600px) { [data-cancel-transaction-dialog] .context-dialog-actions .button { flex: 1 1 100%; } }

.grid-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; width: 100%; grid-column: 1 / -1; padding: 12px 0; scroll-margin-top: 20px; font-size: 12px; color: #52665b; }
.grid-pagination > div { display: flex; flex-wrap: wrap; gap: 6px; }
.grid-pagination a, .grid-pagination button, .grid-pagination [aria-disabled] { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--green-dark); font: inherit; text-decoration: none; }
.grid-pagination button { cursor: pointer; }
.grid-pagination [aria-disabled], .grid-pagination button:disabled { opacity: .5; cursor: default; }
.grid-pagination a:focus-visible, .grid-pagination button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
[data-local-grid] > [hidden] { display: none !important; }
@media (max-width: 600px) { .grid-pagination { flex-direction: column; align-items: stretch; } .grid-pagination > div { justify-content: center; } }

.investment-pagination .button { min-height: 44px; min-width: 44px; }

/* Resultado mensal e disponibilidade bancária têm indicadores distintos. */
.month-hero-metrics { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.month-hero-metrics > article, .month-hero-metrics > a { grid-column: span 3; }
.month-hero-metrics .month-hero-closing, .month-hero-metrics .month-hero-bank-current, .month-hero-metrics .month-hero-bank-forecast { grid-column: span 4; }
.month-hero-metrics > a { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 11px; border: 1px solid rgba(255,255,255,.6); border-radius: 11px; color: #16734a; background: #f1f8f4; text-decoration: none; }
.month-hero-metrics > a > div { min-width: 0; }
.month-hero-metrics > a div > span { display: block; color: #52665b; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.month-hero-metrics > a:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.month-hero-metrics > a:hover { background: #e4f3ea; }
.month-hero-metrics .month-hero-bank-forecast { color: #245c96; background: #eef5fc; }
.month-hero-bank-forecast .month-hero-icon { color: #245c96; background: #d5e5f7; }
.month-hero-bank-current small, .month-hero-bank-forecast small { display: block; margin-top: 4px; color: #52665b; font-size: 12px; line-height: 1.5; }
@media (max-width: 1100px) {
 .month-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .month-hero-metrics > article, .month-hero-metrics > a, .month-hero-metrics .month-hero-closing, .month-hero-metrics .month-hero-bank-current { grid-column: auto; }
 .month-hero-metrics .month-hero-bank-forecast { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
 .month-hero-metrics { grid-template-columns: 1fr; }
 .month-hero-metrics .month-hero-bank-forecast { grid-column: auto; }
}

/* Quadro compacto: cinco indicadores, com saldo bancário incorporado à previsão. */
.month-hero-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); }
.month-hero-metrics > article, .month-hero-metrics .month-hero-closing { grid-column: auto; }
.month-hero-bank-note { margin: 10px 0 0; color: #e5f4eb; font-size: 12px; line-height: 1.6; }
@media (max-width: 1100px) {
 .month-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .month-hero-metrics .month-hero-closing { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
 .month-hero-metrics { grid-template-columns: 1fr; }
 .month-hero-metrics .month-hero-closing { grid-column: auto; }
}

.company-settings-block { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.company-settings-block > h3 { margin: 0 0 18px; font-size: 17px; }
.company-invite-block { border-color: #bad9c7; border-left: 4px solid var(--green); background: #edf7f1; }
.company-link-heading { display: flex; align-items: center; gap: 12px; }
.company-link-heading h3 { margin: 0 0 6px; font-size: 19px; color: var(--green-dark); }
.company-link-heading p { margin: 0; font-size: 14px; line-height: 1.5; color: #52665b; }
.company-link-icon { flex: 0 0 44px; display: grid; place-items: center; height: 44px; border-radius: 12px; background: var(--green); color: white; font-size: 26px; }
.company-link-guidance { margin: 14px 0; color: #52665b; font-size: 13px; line-height: 1.65; }
.company-settings-block .button, .company-settings-block select { min-height: 44px; }
@media (max-width: 600px) { .company-settings-block { padding: 16px 12px; } .company-link-heading { align-items: flex-start; } .company-link-heading h3 { font-size: 17px; } }

.member-search-form { display: flex; align-items: end; gap: 10px; margin: 16px 0; }
.member-search-form .field { flex: 1; min-width: 0; }
.access-choice-list { width: 100%; min-height: 180px; font-size: 14px; }
.access-choice-list option { padding: 10px; white-space: normal; }
.access-choice-list option:disabled { color: #68756f; background: #f1f3f1; }
@media (max-width: 600px) { .member-search-form { flex-direction: column; align-items: stretch; } .access-choice-list { font-size: 16px; } }

.member-choice-group { min-width: 0; margin: 0; padding: 12px; border: 1px solid #bad9c7; border-radius: 12px; background: #fff; }
.member-choice-group legend { padding: 0 6px; color: #37463e; font-size: 14px; font-weight: 700; }
.member-choice-results { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.member-choice-row { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; min-height: 64px; border: 1px solid #dbe4dd; border-radius: 10px; background: #fafcfb; cursor: pointer; }
.member-choice-row > input { flex: 0 0 20px; width: 20px; height: 20px; accent-color: var(--green); }
.member-choice-person { flex: 1 1 150px; min-width: 0; display: grid; gap: 5px; overflow-wrap: anywhere; }
.member-choice-person > strong { font-size: 14px; color: #25372d; }
.member-choice-person > span { font-size: 13px; color: #52665b; }
.member-choice-status { padding: 5px 8px; border-radius: 6px; color: #176b43; background: #e8f4ec; font-size: 12px; }
.member-choice-row:has(input:checked) { border-color: var(--green); background: #e8f4ec; box-shadow: inset 0 0 0 1px var(--green); }
.member-choice-row:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.member-choice-row.is-unavailable { cursor: default; background: #f2f4f2; }
.member-choice-row.is-unavailable .member-choice-status { color: #68756f; background: #e6ebe7; }
.member-choice-count { margin: 10px 0 0; color: #68756f; font-size: 12px; line-height: 1.5; }
.company-settings-block .field select.access-choice-list { height: auto; min-height: 220px; }
@media (max-width: 600px) { .member-choice-group { padding: 10px; } .member-choice-row { padding: 12px 10px; } .member-choice-status { margin-left: 30px; } }

.company-settings-block .field select.access-compact-select { width: 100%; height: 48px; min-height: 48px; padding: 10px 12px; font-size: 14px; background: #fff; }
@media (max-width: 600px) { .company-settings-block .field select.access-compact-select { font-size: 16px; } }

.account-layout.company-access-only { grid-template-columns: minmax(0, 1fr); }

#dashboard-start h1 { font-size: clamp(15px, 2vw, 21px); }

/* Perfil, gráficos e período em uma mesma faixa no celular. */
.dashboard-profile-short { display: none; }
#dashboard-start .dashboard-month-selector { margin: 0; align-items: center; }
#dashboard-start .dashboard-month-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
 #dashboard-start { margin-bottom: 16px; gap: 12px; }
 #dashboard-start .dashboard-context-actions { display: flex; flex-wrap: nowrap; width: 100%; min-width: 0; gap: 8px; align-items: center; }
 #dashboard-start .context-chip { min-height: 44px; padding: 8px 10px; gap: 6px; flex-shrink: 0; font-size: 12px; }
 #dashboard-start .dashboard-profile-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
 #dashboard-start .dashboard-profile-short { display: inline; }
 #dashboard-start .dashboard-charts-trigger { justify-content: center; width: 44px; min-width: 44px; min-height: 44px; padding: 10px; flex-shrink: 0; }
 #dashboard-start .dashboard-charts-trigger > span { display: none; }
 #dashboard-start .dashboard-month-selector { display: flex; flex: 1 1 0; min-width: 0; gap: 0; }
 #dashboard-start .dashboard-month-selector label { flex: 1 1 0; min-width: 0; width: 100%; }
 #dashboard-start .dashboard-month-selector input { width: 100%; min-width: 0; min-height: 44px; padding: 8px; font-size: 16px; }
 #dashboard-start .dashboard-month-selector > a { display: none; }
}

.dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.month-hero-detail-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.month-hero-detail-links > button { min-height: 44px; padding: 8px 0; border: 0; color: #fff; background: transparent; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.month-hero-detail-links > button:focus-visible { outline: 2px solid white; outline-offset: 3px; border-radius: 3px; }

/* Posição patrimonial atual separada do resultado mensal. */
.current-assets { margin: 6px 0 20px; }
.current-assets-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.current-assets-heading h2 { margin: 0; color: #25372d; font-size: 18px; }
.current-assets-heading > span { color: #68756f; font-size: 12px; }
.current-assets .dashboard-summary-grid { margin: 0; }
.current-assets .asset-card { gap: 10px; padding: 20px; border: 1px solid #b9d8c6; border-top: 4px solid #16734a; background: linear-gradient(145deg, #edf8f1, #fff); box-shadow: 0 6px 18px rgba(16,91,58,.07); }
.current-assets .asset-card-investments { border-color: #c8dced; border-top-color: #376e9c; background: linear-gradient(145deg, #edf5fc, #fff); }
.asset-card-heading { display: flex; align-items: center; gap: 9px; }
.asset-card-heading .metric-label { color: #25372d; font-size: 14px; }
.asset-card-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; color: #16734a; background: #d7eddf; }
.asset-card-investments .asset-card-icon { color: #245c96; background: #dcebf8; }
.asset-card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.current-assets .asset-card > strong { color: #105b3a; font-size: clamp(23px, 2.5vw, 30px); letter-spacing: -.035em; }
.current-assets .asset-card-investments > strong { color: #245c96; }
.current-assets .asset-card .metric-note { color: #52665b; font-size: 12px; line-height: 1.5; }
.asset-card-action { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 9px; border-top: 1px solid #d5e5dc; color: #105b3a; font-size: 13px; font-weight: 700; }
.asset-card-investments .asset-card-action { border-color: #d5e3ef; color: #245c96; }
@media (max-width: 600px) {
 .current-assets .asset-card { padding: 15px 12px; }
 .asset-card-heading { flex-wrap: wrap; gap: 8px; }
 .current-assets .asset-card > strong { font-size: clamp(21px, 5.5vw, 26px); }
 .current-assets-heading h2 { font-size: 17px; }
}
@media (max-width: 350px) { .current-assets .dashboard-summary-grid { grid-template-columns: 1fr; } }

/* Saúde financeira concentra apenas os indicadores complementares. */
#dashboard-health .health-indicators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { #dashboard-health .health-indicators { grid-template-columns: 1fr; } }

/* Cabeçalhos das seções com contraste claro em relação ao fundo do painel. */
.dashboard-fold > .dashboard-fold-summary,
.dashboard-analysis > summary { background: #d2e8db; border-left-color: #16734a; box-shadow: inset 0 -1px 0 #b4d2c0; }
.dashboard-fold-title > strong,
.dashboard-analysis > summary strong { color: #153f2a; }
.dashboard-fold-title > small,
.dashboard-analysis > summary small { color: #3d5e4b; }
.dashboard-fold > .dashboard-fold-summary .analysis-chevron,
.dashboard-analysis > summary .analysis-chevron { color: #205638; }
.dashboard-fold-total { background: #f5faf7; border: 1px solid #aecdbb; }
.dashboard-fold-total > small { color: #466353; }
.dashboard-fold-summary:hover,
.dashboard-analysis > summary:hover { background: #c7e1d2; }

/* Evita espaço branco sob o cabeçalho dos cards vizinhos recolhidos. */
.dashboard-columns > .dashboard-fold { align-self: start; }

/* Alinhamento dos cabeçalhos de Contas e Faturas no desktop. */
@media (min-width: 1101px) {
 .dashboard-columns > .dashboard-fold > .dashboard-fold-summary { min-height: 104px; box-sizing: border-box; }
}

/* Cabeçalho e conteúdo formam uma peça única quando expandidos. */
.dashboard-fold[open], .dashboard-analysis[open] { border-color: #9fc6b0; border-left: 4px solid #16734a; box-shadow: 0 5px 16px rgba(16,91,58,.07); }
.dashboard-fold[open] > .dashboard-fold-summary,
.dashboard-analysis[open] > summary { border-left: 0; border-radius: 12px 12px 0 0; box-shadow: none; }
.dashboard-fold[open] > .dashboard-fold-content,
.dashboard-analysis[open] > .dashboard-analysis-content { background: #f3f9f5; border-top: 1px solid #a9cdb9; border-radius: 0 0 12px 12px; }
.dashboard-analysis[open] > .dashboard-analysis-content { padding-top: 16px; }

/* Seções compactas, sem caixas aninhadas no conteúdo. */
.dashboard-fold { margin-bottom: 10px; }
.dashboard-analysis { margin: 10px 0; }
.dashboard-fold > .dashboard-fold-summary,
.dashboard-analysis > summary,
.dashboard-columns > .dashboard-fold > .dashboard-fold-summary { min-height: 64px; padding: 10px 14px; gap: 10px; box-sizing: border-box; }
.dashboard-fold-title > strong, .dashboard-analysis > summary strong { font-size: 15px; }
.dashboard-fold-title > small, .dashboard-analysis > summary small { margin-top: 3px; font-size: 12px; line-height: 1.4; }
.dashboard-fold .dashboard-fold-total,
.dashboard-fold .dashboard-health-result { padding: 0; border: 0; border-radius: 0; background: transparent; gap: 2px; }
.dashboard-fold-total > strong, .dashboard-health-result > strong { font-size: 16px; line-height: 1.4; }
.dashboard-fold-total > small { font-size: 11px; line-height: 1.3; }
.dashboard-fold-total > small:last-child, .dashboard-health-result > small { display: none; }
.dashboard-fold .dashboard-fold-content { padding: 10px 14px; }
.dashboard-fold-actions { margin-bottom: 8px; }
.dashboard-fold-warning { margin-top: 4px; padding: 2px 6px; font-size: 11px; }
.dashboard-columns { gap: 12px; margin-bottom: 10px; }
.dashboard-fold .open-amount { background: transparent; border: 0; border-radius: 0; padding: 5px 8px; gap: 5px; }
.dashboard-fold .open-amount + .open-amount { border-left: 1px solid #cbded2; }
.dashboard-fold .open-amount > span, .dashboard-fold .open-status-line small { font-size: 12px; }
#dashboard-health .health-indicators { gap: 0; }
#dashboard-health .health-indicator { min-height: 0; padding: 6px 10px; gap: 7px; border: 0; border-radius: 0; background: transparent; }
#dashboard-health .health-indicator + .health-indicator { border-left: 1px solid #cbded2; }
#dashboard-health .health-indicator-label, #dashboard-health .health-indicator > small, #dashboard-health .health-help-line > small { font-size: 12px; }
#dashboard-health .health-status { padding: 0; border-radius: 0; font-size: 11px; background: transparent; }
#dashboard-health .health-indicator > small, #dashboard-health .health-help-line { margin-top: 0; }
#dashboard-health .health-method { margin-top: 8px; padding-top: 8px; border-color: #cbded2; }
#dashboard-health .health-method summary { min-height: 44px; display: flex; align-items: center; font-size: 12px; }
#dashboard-health .health-help-button { width: 44px; height: 44px; flex-basis: 44px; background: transparent; }
.dashboard-analysis[open] > .dashboard-analysis-content { padding: 10px 14px; }
.dashboard-analysis .finance-chart-card { padding: 10px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dashboard-analysis .finance-chart-grid { column-gap: 20px; row-gap: 10px; }
.dashboard-analysis .finance-chart-monthly { border-top: 1px solid #cbded2; }
.dashboard-analysis .finance-chart-card-heading { min-height: 0; margin-bottom: 8px; }
@media (max-width: 600px) {
 .dashboard-fold > .dashboard-fold-summary, .dashboard-analysis > summary { padding: 10px 12px; min-height: 56px; }
 .dashboard-fold-summary-total { grid-template-columns: minmax(0, 1fr) 18px; row-gap: 4px; }
 .dashboard-fold .dashboard-fold-total, .dashboard-fold .dashboard-health-result { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 8px; text-align: left; }
 .dashboard-fold-summary-total > .analysis-chevron { grid-column: 2; grid-row: 1 / 3; align-self: center; }
 .dashboard-fold .dashboard-fold-content { padding: 8px 12px; }
 .dashboard-fold .open-amount { padding: 4px; }
 #dashboard-health .health-indicator { padding: 7px 0; }
 #dashboard-health .health-indicator + .health-indicator { border-left: 0; border-top: 1px solid #cbded2; }
 .dashboard-analysis .finance-chart-expenses { border-top: 1px solid #cbded2; }
 .dashboard-analysis[open] > .dashboard-analysis-content { padding: 8px 12px; }
}
