
    :root {
      color-scheme: dark;
      --bg: #0c0f12;
      --panel: #1b2226;
      --panel-2: #20272b;
      --sidebar: #101225;
      --border: rgba(255,255,255,.055);
      --text: #f5f6fb;
      --muted: #929aa6;
      --muted-2: #68717e;
      --purple: #665cf6;
      --purple-2: #8178ff;
      --pink: #e84ec8;
      --green: #26c987;
      --yellow: #ffc846;
      --orange: #ff963d;
      --red: #ff697d;
      --blue: #4d9fff;
      --radius: 18px;
      --shadow: 0 22px 50px rgba(0,0,0,.18);
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; min-height: 100vh; }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--purple-2); outline-offset: 2px; }
    .app { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
    .sidebar { background: var(--sidebar); border-right: 1px solid rgba(255,255,255,.035); padding: 25px 16px 20px; display: flex; flex-direction: column; gap: 30px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20; }
    .brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; min-height: 48px; }
    .brand-mark { flex: 0 0 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, #7b72ff, #4f45da); box-shadow: 0 8px 22px #5c51e533; }
    .brand-mark svg { width: 23px; height: 23px; }
    .brand-name { font-weight: 750; font-size: 13px; line-height: 1.25; letter-spacing: -.25px; }
    .side-label { color: #626a80; text-transform: uppercase; font-weight: 750; letter-spacing: 1.2px; font-size: 10px; padding: 0 11px; margin: 3px 0 9px; }
    .nav-list { display: grid; gap: 6px; }
    .nav-button { border: 0; width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #8991a6; background: transparent; text-align: left; transition: .18s ease; font-weight: 600; }
    .nav-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
    .nav-button:hover { color: #fff; background: #ffffff0b; }
    .nav-button.active { color: white; background: linear-gradient(100deg, #625af0, #4d48cc); box-shadow: 0 7px 18px #5f56f42a; }
    .side-divider { height: 1px; background: rgba(255,255,255,.065); margin: -13px 8px -11px; }
    .sidebar-bottom { margin-top: auto; }
    .help-card { padding: 14px; border-radius: 14px; border: 1px solid #ffffff0d; background: linear-gradient(145deg,#1c1f3a,#16182b); }
    .help-icon { width: 30px; height: 30px; background: #6860f329; border-radius: 10px; display: grid; place-items: center; color: #aaa5ff; margin-bottom: 11px; }
    .help-card strong { display: block; font-size: 12px; margin-bottom: 5px; }
    .help-card p { margin: 0; color: #858ba0; font-size: 11px; line-height: 1.55; }
    .main { min-width: 0; padding: 30px clamp(18px, 3vw, 42px) 36px; }
    .topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 28px; }
    .eyebrow { font-size: 11px; text-transform: uppercase; font-weight: 750; letter-spacing: 1.5px; color: var(--purple-2); margin-bottom: 6px; }
    h1 { font-size: clamp(24px, 2.3vw, 32px); margin: 0; letter-spacing: -1.05px; line-height: 1.14; }
    .subtitle { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
    .top-actions { display: flex; align-items: center; gap: 10px; }
    .period-pill { display: flex; align-items: center; gap: 8px; color: #c0c4ce; background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; white-space: nowrap; font-size: 12px; }
    .period-pill svg { width: 15px; height: 15px; color: #a8a1ff; }
    .btn { border: 0; border-radius: 11px; padding: 11px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: transform .15s ease, filter .15s ease, background .15s ease; white-space: nowrap; }
    .btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
    .btn svg { width: 17px; height: 17px; }
    .btn-primary { color: white; background: linear-gradient(110deg, #7067ff, #574ce5); box-shadow: 0 8px 22px #6257ed26; }
    .btn-secondary { color: #cbd0dc; background: var(--panel-2); border: 1px solid var(--border); }
    .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 22px; }
    .filter-select, .search-box { color: #d7d9e2; background: #171d21; border: 1px solid var(--border); min-height: 39px; border-radius: 10px; padding: 0 12px; outline: none; }
    .filter-select { min-width: 142px; }
    .search-box { width: min(250px, 100%); display: flex; align-items: center; gap: 8px; }
    .search-box svg { width: 16px; height: 16px; color: #7d8592; flex: 0 0 auto; }
    .search-box input { width: 100%; min-width: 0; border: 0; outline: none; color: white; background: transparent; }
    .filter-spacer { flex: 1; }
    .active-filter { background: #6259ed20; color: #aaa4ff; border: 1px solid #766df038; border-radius: 9px; padding: 9px 11px; font-size: 12px; }
    .section-title { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 25px 0 13px; }
    .section-title h2 { font-size: 15px; margin: 0; letter-spacing: -.25px; }
    .section-title p { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
    .quiet-link { color: #a8a2ff; background: transparent; border: 0; padding: 5px 0; font-size: 12px; font-weight: 650; }
    .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
    .stat-card { min-width: 0; padding: 18px 17px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); position: relative; overflow: hidden; }
    .stat-top { display: flex; justify-content: space-between; gap: 7px; align-items: start; }
    .stat-label { color: #a6adb7; font-size: 12px; font-weight: 550; }
    .stat-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; flex: 0 0 auto; }
    .stat-icon svg { width: 16px; height: 16px; }
    .icon-purple { color: #a49fff; background: #7168ff24; }
    .icon-green { color: #47dfa0; background: #22c98720; }
    .icon-pink { color: #fa88dc; background: #e84ec821; }
    .icon-yellow { color: #ffd66a; background: #ffc8461d; }
    .stat-value { margin: 12px 0 9px; font-size: clamp(18px, 1.6vw, 24px); font-weight: 780; letter-spacing: -.7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .stat-footer { color: #858d98; font-size: 10px; display: flex; align-items: center; gap: 5px; }
    .trend-up { color: #48d99a; }
    .trend-down { color: #ff8197; }
    .sparkline { height: 26px; width: 80px; position: absolute; right: 12px; bottom: 10px; opacity: .5; }
    .content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 14px; margin-top: 14px; }
    .panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 19px; min-width: 0; }
    .panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
    .panel-header h2 { margin: 0; font-size: 14px; letter-spacing: -.2px; }
    .panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
    .legend { display: flex; flex-wrap: wrap; gap: 12px; color: #9ea5b0; font-size: 10px; }
    .legend span { display: flex; gap: 6px; align-items: center; }
    .legend i { width: 7px; height: 7px; border-radius: 3px; display: inline-block; }
    .chart-wrap { width: 100%; overflow: hidden; }
    .bar-chart { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 8px; height: 235px; }
    .y-labels { display: flex; flex-direction: column; justify-content: space-between; padding: 5px 0 24px; color: #737c87; font-size: 9px; text-align: right; }
    .plot { min-width: 0; position: relative; display: flex; flex-direction: column; }
    .grid-lines { position: absolute; inset: 5px 0 25px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
    .grid-lines span { width: 100%; height: 1px; background: #ffffff0b; }
    .bar-columns { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: clamp(3px, .8vw, 11px); flex: 1; z-index: 1; min-height: 0; }
    .bar-month { height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; min-width: 0; }
    .bars { height: calc(100% - 26px); width: 100%; display: flex; align-items: end; justify-content: center; gap: 3px; padding-top: 5px; }
    .bar { width: min(13px, 42%); min-height: 2px; border-radius: 5px 5px 2px 2px; transition: height .35s ease; position: relative; }
    .bar.income { background: linear-gradient(180deg,#7770ff,#4c48ce); box-shadow: 0 0 12px #665cf626; }
    .bar.expense { background: linear-gradient(180deg,#f06bd8,#bd3ba2); }
    .month-label { color: #838b96; font-size: 9px; line-height: 13px; text-align: center; }
    .donut-layout { display: flex; align-items: center; gap: 16px; min-height: 195px; }
    .donut { width: 156px; height: 156px; flex: 0 0 156px; border-radius: 50%; display: grid; place-items: center; position: relative; }
    .donut::before { content: ""; position: absolute; width: 62%; height: 62%; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px #ffffff06; }
    .donut-center { position: relative; z-index: 1; text-align: center; display: grid; gap: 4px; }
    .donut-center strong { font-size: 20px; letter-spacing: -.6px; }
    .donut-center span { color: #929aa6; font-size: 9px; line-height: 1.35; max-width: 75px; margin: 0 auto; }
    .category-legend { display: grid; gap: 9px; min-width: 0; flex: 1; }
    .category-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #a6adb8; font-size: 10px; min-width: 0; }
    .category-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
    .category-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .category-dot { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
    .category-item strong { color: #dce0e8; font-size: 10px; font-weight: 650; white-space: nowrap; }
    .bottom-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
    .progress-list { display: grid; gap: 15px; }
    .progress-row { display: grid; grid-template-columns: minmax(90px, .75fr) minmax(80px, 1.5fr) auto; align-items: center; gap: 11px; }
    .progress-name { color: #abb2bc; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .progress-track { height: 7px; background: #0e1316; border-radius: 20px; overflow: hidden; }
    .progress-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg,#514bcb,#7970ff); }
    .progress-value { color: #cbd0d8; font-size: 10px; white-space: nowrap; }
    .line-chart { width: 100%; height: auto; display: block; overflow: visible; }
    .line-chart text { fill: #7e8792; font-size: 9px; font-family: inherit; }
    .transactions-panel { margin-top: 14px; padding: 0; overflow: hidden; }
    .transactions-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 19px 12px; }
    .transactions-top h2 { margin: 0; font-size: 14px; }
    .transactions-top p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
    .table-scroll { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; text-align: left; min-width: 650px; }
    th { text-transform: uppercase; letter-spacing: .7px; color: #747d89; font-size: 9px; font-weight: 750; padding: 12px 19px; border-top: 1px solid #ffffff08; border-bottom: 1px solid #ffffff08; }
    td { padding: 13px 19px; color: #bac1cb; font-size: 11px; border-bottom: 1px solid #ffffff07; }
    tbody tr:last-child td { border-bottom: 0; }
    tbody tr:hover { background: #ffffff04; }
    .tx-title { color: #e7e9ef; font-weight: 650; display: flex; align-items: center; gap: 10px; }
    .tx-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: #ffffff08; color: #b2acff; }
    .tx-icon svg { width: 15px; height: 15px; }
    .tx-subtitle { color: #7f8894; font-size: 10px; margin-top: 3px; font-weight: 450; }
    .type-tag { display: inline-flex; border-radius: 6px; padding: 5px 7px; font-size: 9px; font-weight: 700; }
    .tag-receita { background: #20c9871a; color: #51dda1; }
    .tag-despesa { background: #ee5a801a; color: #ff8a9f; }
    .tag-investimento { background: #766bff20; color: #aaa3ff; }
    .amount { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .amount.receita { color: #55dca1; }
    .amount.despesa { color: #ff8298; }
    .amount.investimento { color: #aaa3ff; }
    .row-actions { display: flex; gap: 5px; }
    .icon-btn { border: 1px solid transparent; color: #87909c; background: transparent; width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; }
    .icon-btn:hover { color: #fff; background: #ffffff0a; border-color: #ffffff0b; }
    .icon-btn svg { width: 14px; height: 14px; }
    .empty-state { text-align: center; padding: 34px 15px; color: #8e97a2; font-size: 12px; }
    .empty-state strong { display: block; color: #e0e3eb; font-size: 14px; margin-bottom: 7px; }
    .table-footer { padding: 12px 19px; display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid #ffffff08; color: #7f8894; font-size: 10px; }
    .footer { margin-top: 20px; color: #515a65; display: flex; justify-content: space-between; gap: 12px; font-size: 10px; }
    .mobile-nav { display: none; }
    .modal-backdrop { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(4,6,13,.76); backdrop-filter: blur(7px); padding: 20px; align-items: center; justify-content: center; }
    .modal-backdrop.open { display: flex; }
    .modal { width: min(100%, 520px); max-height: min(92vh, 800px); overflow: auto; background: #1b2226; border: 1px solid #ffffff13; border-radius: 20px; box-shadow: 0 30px 100px #0009; }
    .modal-header { padding: 22px 23px 16px; display: flex; align-items: start; justify-content: space-between; gap: 15px; border-bottom: 1px solid #ffffff0a; }
    .modal-header h2 { font-size: 18px; margin: 0; letter-spacing: -.5px; }
    .modal-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
    .close-btn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; border: 1px solid #ffffff0b; background: #ffffff07; color: #aeb5bf; }
    .modal-form { padding: 19px 23px 23px; }
    .type-switch { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; background: #111619; padding: 5px; border-radius: 12px; margin-bottom: 19px; }
    .type-option { border: 0; border-radius: 9px; color: #8f98a3; background: transparent; padding: 10px 5px; font-size: 11px; font-weight: 750; }
    .type-option.selected[data-type="Receita"] { color: #59e3a6; background: #20c98718; }
    .type-option.selected[data-type="Despesa"] { color: #ff92a6; background: #ee5a8018; }
    .type-option.selected[data-type="Investimento"] { color: #aaa3ff; background: #766bff20; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .field { display: grid; gap: 7px; min-width: 0; }
    .field.full { grid-column: 1 / -1; }
    .field label { color: #b6bdc7; font-size: 11px; font-weight: 650; }
    .field input, .field select, .field textarea { min-width: 0; width: 100%; background: #12181b; color: #eef0f5; border: 1px solid #ffffff12; border-radius: 10px; padding: 12px; outline: none; }
    .field input::placeholder, .field textarea::placeholder { color: #626b75; }
    .field input:focus, .field select:focus, .field textarea:focus { border-color: #7167ff9c; }
    .field textarea { min-height: 74px; resize: vertical; }
    .check-field { display: flex !important; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid #ffffff12; border-radius: 11px; background: #12181b; cursor: pointer; color: #e5e7ef !important; }
    .check-field input { width: 17px !important; height: 17px; padding: 0 !important; margin: 0; accent-color: var(--purple-2); flex: 0 0 auto; }
    .field-help { margin: -2px 0 0; color: #87919c; font-size: 10px; line-height: 1.5; }
    .card-preview { padding: 10px 12px; background: #655cf618; border: 1px solid #8178ff25; color: #bab5ff; border-radius: 10px; font-size: 11px; line-height: 1.5; }
    .card-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 0 0 15px; }
    .card-summary { padding: 13px 14px; background: #12181b; border: 1px solid #ffffff09; border-radius: 12px; min-width: 0; }
    .card-summary span { display: block; color: #929aa6; font-size: 10px; line-height: 1.4; }
    .card-summary strong { display: block; color: #f0f1f7; margin-top: 7px; font-size: clamp(14px, 1.3vw, 19px); letter-spacing: -.4px; overflow-wrap: anywhere; }
    .card-summary.purple strong { color: #aaa3ff; }
    .card-summary.pink strong { color: #fa88dc; }
    .card-detail-table { min-width: 690px; }
    .card-badge { display: inline-flex; align-items: center; border-radius: 6px; padding: 5px 7px; background: #665cf61d; color: #b3adff; font-size: 9px; font-weight: 700; white-space: nowrap; }
    .card-detail-sub { display:block; color:#7f8894; font-size:10px; margin-top:4px; }
    .form-error { color: #ff8298; font-size: 11px; min-height: 15px; margin-top: 11px; }
    .modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
    .toast { position: fixed; z-index: 150; bottom: 24px; right: 24px; max-width: calc(100vw - 36px); background: #20292b; color: #e8fff4; border: 1px solid #2ccc8c44; border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s ease; font-size: 12px; }
    .toast.show { transform: translateY(0); opacity: 1; }
    .toast svg { width: 17px; height: 17px; color: #42dda0; }

    /* Authentication and account management */
    body:not(.authenticated) .app, body:not(.authenticated) .mobile-nav { display: none !important; }
    .auth-screen { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 22px; background: radial-gradient(ellipse at 20% 0%, #24204e 0, transparent 42%), radial-gradient(ellipse at 100% 100%, #073c31 0, transparent 35%), #0c0f12; }
    body.authenticated .auth-screen { display: none; }
    .auth-card { width: min(100%, 440px); padding: clamp(24px, 4vw, 38px); border-radius: 24px; border: 1px solid #ffffff14; background: rgba(27,34,38,.96); box-shadow: 0 28px 100px #0008; }
    .auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
    .auth-card h1 { font-size: 26px; letter-spacing: -.8px; }
    .auth-card .subtitle { line-height: 1.6; margin: 9px 0 23px; }
    .auth-form { display: grid; gap: 14px; }
    .auth-form label { display: grid; gap: 7px; color: #b6bdc7; font-size: 12px; font-weight: 650; }
    .auth-form input { min-width: 0; width: 100%; background: #12181b; color: #eef0f5; border: 1px solid #ffffff15; border-radius: 11px; padding: 13px 14px; outline: none; }
    .auth-form input:focus { border-color: #8178ff; }
    .auth-form .btn { width: 100%; margin-top: 4px; min-height: 45px; }
    .auth-error { color: #ff8a9f; font-size: 12px; min-height: 15px; line-height: 1.5; }
    .auth-note { color: #747e8b; font-size: 10px; line-height: 1.6; margin-top: 19px; border-top: 1px solid #ffffff0c; padding-top: 14px; }
    .account-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; margin: -12px 0 21px; border: 1px solid #ffffff0c; border-radius: 13px; background: #161b20; }
    .account-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .account-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(145deg,#7770ff,#4c48ce); color: white; font-weight: 800; font-size: 12px; }
    .account-name { color: #e9ebf2; font-weight: 750; font-size: 12px; }
    .account-role { color: #8b94a1; font-size: 10px; margin-top: 3px; }
    .account-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
    .account-actions .btn { padding: 8px 10px; font-size: 10px; border-radius: 9px; }
    .role-badge { display: inline-flex; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; background: #766bff20; color: #b3adff; }
    .role-badge.admin { background: #22c9871c; color: #58dfa6; }
    .modal-wide { width: min(100%, 850px); }
    .users-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
    .users-tools p { margin: 0; color: #929aa6; font-size: 11px; flex: 1; line-height: 1.5; }
    .users-table { min-width: 600px; }
    .user-row-name { color: #e8eaf0; font-weight: 700; }
    .user-row-sub { display: block; color: #777f8b; margin-top: 4px; font-size: 10px; }
    .status-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; background:#4bd99b; }
    .status-dot.off { background:#ff778f; }
    .user-action-buttons { display: flex; gap: 4px; justify-content: flex-end; }
    .user-action-buttons .btn { padding: 7px 9px; font-size: 10px; }
    .checkbox-line { display:flex; align-items:center; gap:9px; color:#bec4cd; font-size:11px; }
    .checkbox-line input { accent-color:var(--purple-2); width:16px; height:16px; }
    .forced-password .modal-backdrop-close { display:none; }
    @media (max-width: 540px) {
      .auth-screen { padding: 13px; align-items: center; }
      .auth-card { border-radius: 20px; padding: 23px 19px; }
      .account-bar { align-items: flex-start; margin-top: -9px; padding: 10px; }
      .account-actions { width: 100%; justify-content: stretch; }
      .account-actions .btn { flex: 1; }
      .users-tools { align-items: stretch; }
      .users-tools .btn { width: 100%; }
      .user-action-buttons { flex-wrap: wrap; }
    }

    .hidden { display: none !important; }
    @media (max-width: 1160px) {
      .app { grid-template-columns: 205px minmax(0,1fr); }
      .main { padding-left: 24px; padding-right: 24px; }
      .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .content-grid { grid-template-columns: minmax(0,1.35fr) minmax(250px,1fr); }
      .donut-layout { gap: 10px; }
      .donut { width: 125px; height: 125px; flex-basis: 125px; }
    }
    @media (max-width: 880px) {
      .app { display: block; padding-bottom: 75px; }
      .sidebar { display: none; }
      .main { padding: 22px 18px 28px; }
      .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 8px; background: rgba(17,19,38,.94); border: 1px solid #ffffff16; border-radius: 17px; backdrop-filter: blur(18px); z-index: 50; box-shadow: 0 12px 40px #0008; }
      .mobile-nav .nav-button { flex-direction: column; justify-content: center; gap: 5px; padding: 8px 4px; border-radius: 10px; font-size: 9px; }
      .mobile-nav .nav-button svg { width: 19px; height: 19px; }
      .mobile-nav .nav-button.active { box-shadow: none; }
      .content-grid, .bottom-grid { grid-template-columns: 1fr; }
      .topbar { align-items: flex-start; margin-bottom: 21px; }
      .top-actions .period-pill { display: none; }
      .donut-layout { justify-content: flex-start; }
      .donut { width: 145px; height: 145px; flex-basis: 145px; }
      .bar-chart { height: 225px; }
    }
    @media (max-width: 540px) {
      .main { padding: 19px 13px 24px; }
      .topbar { gap: 10px; }
      h1 { font-size: 25px; letter-spacing: -.8px; }
      .subtitle { font-size: 11px; max-width: 240px; line-height: 1.4; }
      .eyebrow { font-size: 9px; }
      .top-actions { gap: 0; }
      .top-actions .btn { width: 42px; height: 42px; padding: 0; border-radius: 12px; font-size: 0; gap: 0; }
      .top-actions .btn svg { width: 20px; height: 20px; }
      .filters { gap: 7px; margin-bottom: 17px; }
      .filter-select { flex: 1; min-width: 0; padding: 0 8px; font-size: 11px; }
      .search-box { order: 4; width: 100%; }
      .filter-spacer { display: none; }
      .active-filter { font-size: 10px; padding: 8px; }
      .stats-grid { gap: 9px; }
      .stat-card { padding: 13px 12px 14px; border-radius: 15px; }
      .stat-label { font-size: 10px; line-height: 1.35; }
      .stat-icon { width: 27px; height: 27px; border-radius: 9px; }
      .stat-value { font-size: 18px; margin: 11px 0 7px; }
      .stat-footer { font-size: 9px; }
      .sparkline { display: none; }
      .section-title { margin-top: 22px; }
      .panel { padding: 15px 13px; border-radius: 16px; }
      .panel-header { margin-bottom: 13px; }
      .donut-layout { gap: 11px; min-height: 155px; }
      .donut { width: 118px; height: 118px; flex-basis: 118px; }
      .donut-center strong { font-size: 17px; }
      .donut-center span { font-size: 8px; }
      .category-legend { gap: 8px; }
      .category-item { font-size: 9px; }
      .category-item strong { font-size: 9px; }
      .bar-chart { height: 205px; grid-template-columns: 28px minmax(0,1fr); gap: 5px; }
      .y-labels { font-size: 8px; }
      .bar-columns { gap: 3px; }
      .bars { gap: 2px; }
      .month-label { font-size: 8px; }
      .progress-row { grid-template-columns: 80px minmax(45px,1fr) auto; gap: 8px; }
      .progress-name, .progress-value { font-size: 9px; }
      .transactions-top { padding: 16px 13px 12px; }
      .transactions-top .btn { font-size: 10px; padding: 9px 10px; }
      .card-summary-grid { grid-template-columns: 1fr; gap: 8px; }
      .card-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
      .card-summary strong { margin-top: 0; text-align: right; }
      .footer { flex-direction: column; gap: 5px; }
      .modal-backdrop { padding: 10px; align-items: flex-end; }
      .modal { width: 100%; max-height: 94vh; border-radius: 20px 20px 12px 12px; }
      .modal-header { padding: 18px 17px 14px; }
      .modal-form { padding: 16px 17px 19px; }
      .form-grid { gap: 12px; }
      .field input, .field select, .field textarea { padding: 11px; font-size: 13px; }
      .modal-actions .btn { flex: 1; }
      .toast { right: 13px; bottom: 90px; }
    }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
  
