  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

  :root {
    --bg: #F7F8F6;
    --card: #FFFFFF;
    --text: #202624;
    --text-secondary: #69736F;
    --text-tertiary: #9AA39F;
    --accent: #397968;
    --accent-hover: #2F6859;
    --lime: #AEEF33;
    --lime-bg: #F5FBEA;
    --light-green: #EFF8F4;
    --border: #E8ECE9;
    --border-strong: #DCEBE5;
    --border-secondary: #EEF1EF;
    --success: #397968;
    --success-bg: #EFF8F4;
    --danger: #D95C5C;
    --danger-bg: #FCEEEE;
    --warning: #D99A3D;
    --warning-bg: #FDF6EB;
    --info: #397968;
    --info-bg: #EFF8F4;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(57,121,104,0.04);
    --transition: 0.2s ease;
    --chart-grid: #EAF0ED;
    --chart-text: #9AA39F;
    --scrollbar: #DCEBE5;
    --chart-fill: rgba(57,121,104,0.08);
    /* Semantic colors for redesigned components */
    --progress-bg: #EAF0ED;
    --progress-bg-alt: #f3f4f6;
    --green-accent: #15803d;
    --green-accent-hover: #166534;
    --green-light: #f0fdf4;
    --green-lighter: #dcfce7;
    --green-border: #bbf7d0;
    --red-accent: #dc2626;
    --red-light: #fef2f2;
    --red-border: #fecaca;
    --amber-accent: #d97706;
    --amber-light: #fffbeb;
    --blue-accent: #2563eb;
    --blue-light: #eff6ff;
    --violet-accent: #7c3aed;
    --violet-light: #faf5ff;
    --gray-accent: #6b7280;
    --gray-light: #f3f4f6;
    --toggle-bg: #DCEBE5;
    --toggle-bg-alt: #d1d5db;
    --focus-shadow: #DDEEE8;
    --cal-today-bg: #f0fdf4;
    --cal-other-month: #fafafa;
    --btn-danger-hover: #C44A4A;
  }

  [data-theme="dark"] {
    --bg: #141816;
    --card: #1C2220;
    --text: #E8EFEC;
    --text-secondary: #8FA098;
    --text-tertiary: #5C6B66;
    --accent: #4B9D85;
    --accent-hover: #5BB098;
    --lime: #C5F562;
    --lime-bg: #1E2D1A;
    --light-green: #1A2A23;
    --border: #2A3330;
    --border-strong: #354540;
    --border-secondary: #232B28;
    --success: #4B9D85;
    --success-bg: #1A2A23;
    --danger: #E07A7A;
    --danger-bg: #2A1C1C;
    --warning: #E8B05E;
    --warning-bg: #2A231A;
    --info: #4B9D85;
    --info-bg: #1A2A23;
    --shadow: 0 1px 3px rgba(0,0,0,0.2);
    --chart-grid: #2A3330;
    --chart-text: #5C6B66;
    --scrollbar: #354540;
    --chart-fill: rgba(75,157,133,0.15);
    /* Semantic colors for redesigned components */
    --progress-bg: #2A3330;
    --progress-bg-alt: #2A3330;
    --green-accent: #4B9D85;
    --green-accent-hover: #5BB098;
    --green-light: #1A2A23;
    --green-lighter: #1A2A23;
    --green-border: #354540;
    --red-accent: #E07A7A;
    --red-light: #2A1C1C;
    --red-border: #2A1C1C;
    --amber-accent: #E8B05E;
    --amber-light: #2A231A;
    --blue-accent: #6B9FFF;
    --blue-light: #1A2332;
    --violet-accent: #A78BFA;
    --violet-light: #1E1A2A;
    --gray-accent: #8FA098;
    --gray-light: #232B28;
    --toggle-bg: #354540;
    --toggle-bg-alt: #354540;
    --focus-shadow: rgba(75,157,133,0.3);
    --cal-today-bg: #1A2A23;
    --cal-other-month: #1C2220;
    --btn-danger-hover: #E07A7A;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  *:focus { outline: none; }

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  input, select, textarea, button { font-family: inherit; font-size: inherit; }

  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }

  .app {
    display: none;
    min-height: 100vh;
  }

  .sidebar {
    width: 230px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 0 8px;
  }

  .sidebar-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
  }

  .sidebar-logo-text { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }

  .nav-section { margin-bottom: 8px; }

  .nav-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 12px;
    margin-bottom: 6px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
  }

  .nav-item:hover { background: var(--light-green); color: var(--accent); }
  .nav-item.active { background: var(--light-green); color: var(--accent); }
  .nav-item.active:hover { background: var(--light-green); color: var(--accent); }

  .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

  .main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .topbar-title { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; }
  .topbar-sub { font-size: 13px; color: var(--text-secondary); }

  .topbar-right { display: flex; align-items: center; gap: 12px; }

  .btn {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .btn:hover { background: var(--light-green); }
  .btn:active { transform: scale(0.98); }

  .btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }

  .btn-primary:hover { background: var(--accent-hover); }

  .btn-sm { padding: 6px 14px; font-size: 13px; }

  .notif-bell-wrap { position: relative; }
  .notif-bell {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
  }
  .notif-bell:hover { background: var(--light-green); }
  .notif-bell:active { transform: scale(0.98); }
  .notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
  }
  .notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    max-width: 90vw;
    background: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    z-index: 100;
    overflow: hidden;
  }
  .notif-dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
  }
  .notif-dropdown-body { max-height: 340px; overflow-y: auto; }
  .notif-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    line-height: 1.45;
  }
  .notif-dropdown-item .notif-dropdown-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--light-green);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .notif-dropdown-item .notif-dropdown-icon svg { width: 14px; height: 14px; }
  .notif-dropdown-item strong { font-weight: 600; }
  .notif-dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
  }
  .notif-dropdown-link {
    display: block;
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    border-top: 1px solid var(--border);
  }
  .notif-dropdown-link:hover { background: var(--light-green); }

  .btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
  }
  .btn-danger:hover { background: var(--btn-danger-hover); }

  .content { padding: 28px 32px; padding-bottom: 100px; max-width: 1200px; overflow-x: hidden; }

  .page { display: none; }
  .page.active { display: block; }

  .grid { display: grid; gap: 20px; }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  @media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 700px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  }
  @media (max-width: 400px) {
    .mobile-more-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-value { font-size: 15px; }
    .summary-icon { width: 32px; height: 32px; }
    .mobile-tx-tab { font-size: 11px; padding: 6px 3px; }
  }

  .card {
    background: var(--card);
    border: none;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
  }

  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .card-title { font-size: 15px; font-weight: 600; }
  .card-body { }

  .metric-card {
    background: var(--card);
    border: none;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
  }

  .metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .metric-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }

  .metric-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
  }

  .metric-positive { color: var(--success); }
  .metric-negative { color: var(--danger); }

  .progress-bar {
    height: 6px;
    background: var(--progress-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
  }

  .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
  }

  .progress-bar-lg {
    height: 12px;
    background: var(--progress-bg);
    border-radius: 6px;
    overflow: hidden;
  }

  .progress-fill-lg {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
  }

  .budget-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
  }
  .budget-card:hover { border-color: var(--border-strong); }

  .budget-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--light-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
  }
  .budget-card-icon svg { width: 22px; height: 22px; }

  .budget-card-body { flex: 1; min-width: 0; }

  .budget-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .budget-card-name {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .budget-card-amounts {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
  }
  .budget-card-amounts strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
  }

  .budget-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
  }

  .budget-card-stat {
    font-size: 13px;
    color: var(--text-secondary);
  }
  .budget-card-stat strong { font-weight: 600; }

  .budget-summary {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
  }
  .budget-summary-item { flex: 1; text-align: center; }
  .budget-summary-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
  .budget-summary-value { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
  .budget-summary-bar {
    height: 12px;
    background: var(--progress-bg);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 16px;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
  }

  .badge-success { background: var(--success-bg); color: var(--success); }
  .badge-danger { background: var(--danger-bg); color: var(--danger); }
  .badge-warning { background: var(--warning-bg); color: var(--warning); }
  .badge-info { background: var(--info-bg); color: var(--info); }
  .badge-gray { background: var(--border-secondary); color: var(--text-secondary); }

  /* Budget alerts */
  .budget-alert-bar {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .budget-alert-bar.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
  }
  .budget-alert-bar.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning);
  }

  .tx-table { width: 100%; }
  .tx-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .tx-row:last-child { border-bottom: none; }

  .tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
  }
  .tx-icon svg { width: 18px; height: 18px; }

  .tx-info { flex: 1; min-width: 0; }
  .tx-desc { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tx-meta { font-size: 12px; color: var(--text-secondary); }

  .tx-amount { font-weight: 600; font-size: 14px; white-space: nowrap; }
  .tx-amount.income { color: var(--success); }
  .tx-amount.expense { color: var(--danger); }
  .tx-amount.giving { color: var(--danger); }
  .tx-amount.transfer { color: var(--danger); }

  .tx-actions { display: flex; gap: 6px; opacity: 0; transition: var(--transition); }
  .tx-row:hover .tx-actions { opacity: 1; }

  .tx-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
  }
  .tx-action-btn svg { width: 14px; height: 14px; }
  .tx-action-btn:hover { background: var(--light-green); color: var(--accent); }

  .filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
  }

  .filter-input {
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    min-width: 0;
  }

  .filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-shadow); }
  .search-input { flex: 1; min-width: 200px; }

  select.filter-input { cursor: pointer; }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
  }

  .modal-overlay.active { display: flex; }

  .modal {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  }

  .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .modal-title { font-size: 18px; font-weight: 600; }

  .modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--light-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
  }
  .modal-close:hover { background: var(--focus-shadow); }

  .modal-body { padding: 24px; }

  .form-group { margin-bottom: 16px; }
  .form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
  .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
  }
  .form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-shadow); }

  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  @media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

  .type-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }

  .type-btn {
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
  }

  .type-btn:hover { background: var(--light-green); }
  .type-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

  .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
  }

  .fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: var(--transition);
  }

  .fab:hover { background: var(--accent-hover); transform: scale(1.05); }
  .fab:active { transform: scale(0.98); }

  .insight-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--light-green);
    margin-bottom: 10px;
    align-items: flex-start;
  }

  .insight-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .insight-icon svg { width: 16px; height: 16px; }

  .insight-text { font-size: 13px; line-height: 1.5; }
  .insight-text strong { font-weight: 600; }

  .sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .sub-item:last-child { border-bottom: none; }

  .sub-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--light-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
  }
  .sub-icon svg { width: 18px; height: 18px; }

  .sub-info { flex: 1; min-width: 0; }
  .sub-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sub-meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sub-cost { font-weight: 600; font-size: 14px; }

  .goal-item {
    margin-bottom: 16px;
  }
  .goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
  .goal-name { font-weight: 500; font-size: 14px; }
  .goal-amounts { font-size: 13px; color: var(--text-secondary); }
  .goal-progress-text { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

  .chart-container { position: relative; height: 280px; width: 100%; }

  .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
  }

  .empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }

  .tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--border-secondary);
    color: var(--text-secondary);
    margin-right: 4px;
  }

  .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }
  .stat-row:last-child { border-bottom: none; }
  .stat-label { color: var(--text-secondary); font-size: 13px; }
  .stat-value { font-weight: 600; font-size: 14px; }

  .mobile-nav { display: none; }
  .mobile-more-sheet { display: none; }

  @media (max-width: 768px) {
    .sidebar { display: none; }
    .content { padding: 16px; padding-bottom: 100px; }
    .topbar { padding: 16px; }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .fab { display: none; }
    .toast { bottom: 110px; }
    .hide-mobile { display: none !important; }
    .topbar-title { font-size: 17px; }
    .topbar-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
    .metric-value { font-size: 22px; }
    .metric-label { font-size: 11px; }
    .metric-sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .card { padding: 16px; }
    #page-dashboard .card { padding: 12px 14px; }
    .card-title { font-size: 14px; }

    /* Dashboard mobile compact */
    #page-dashboard .metric-card { padding: 10px 12px; }
    #page-dashboard .metric-label svg { display: none; }
    #page-dashboard .metric-value { font-size: 18px; }
    #page-dashboard .metric-sub { font-size: 10px; }
    #page-dashboard .chart-container { height: 170px; }
    #dashHealthScore > div { gap: 12px !important; flex-wrap: wrap; }
    #dashHealthScore svg { width: 90px !important; height: 90px !important; }
    #dashHealthScore [style*="position:relative;width:120px"] { width: 90px !important; height: 90px !important; }
    #dashHealthScore [style*="font-size:32px"] { font-size: 22px !important; }
    #dashHealthScore [style*="font-size:15px"] { font-size: 13px !important; margin-bottom: 8px !important; }
    #dashHealthScore [style*="font-size:13px"] { font-size: 11px !important; }
    /* DASHBOARD BUDGET - aggressive compact */
    #dashBudgets .dash-budget-icon { display: none !important; }
    #dashBudgets [style*="padding:14px 0"] { padding: 6px 0 !important; }
    #dashBudgets [style*="gap:10px"] { gap: 4px !important; }
    #dashBudgets [style*="margin-bottom:10px"] { margin-bottom: 3px !important; }
    #dashBudgets [style*="margin-top:8px"] { margin-top: 3px !important; flex-direction: column !important; align-items: flex-start !important; gap: 1px !important; }
    #dashBudgets [style*="font-size:14px"] { font-size: 11px !important; }
    #dashBudgets [style*="font-size:13px"] { font-size: 10px !important; }
    #dashBudgets .badge { font-size: 9px !important; padding: 1px 5px !important; }
    #dashBudgets .progress-bar-lg { height: 6px !important; }
    /* DASHBOARD RENEWALS - hide icons, compact */
    #dashRenewals .sub-icon { display: none !important; }
    #dashRenewals .sub-item { gap: 4px !important; padding: 5px 0 !important; }
    #dashRenewals .sub-name { font-size: 12px !important; }
    #dashRenewals .sub-meta { font-size: 10px !important; }
    #dashRenewals .sub-cost { font-size: 12px !important; }
    #dashRenewals .badge { font-size: 9px !important; padding: 1px 5px !important; }
    .sub-item { padding: 10px 0 !important; }
    .sub-icon { width: 32px !important; height: 32px !important; }
    .sub-icon svg { width: 16px !important; height: 16px !important; }
    .sub-name { font-size: 13px !important; }
    .sub-meta { font-size: 11px !important; }
    .sub-cost { font-size: 14px !important; }
    .upcoming-item { padding: 8px 0 !important; gap: 8px !important; }
    .upcoming-date { width: 36px !important; }
    .upcoming-date-day { font-size: 15px !important; }
    .event-title { font-size: 12px !important; }
    .event-meta { font-size: 10px !important; }
    .event-amount { font-size: 12px !important; }
    /* DASHBOARD RECENT TX - hide icons & actions, compact */
    #dashRecent .tx-icon { display: none !important; }
    #dashRecent .tx-actions { display: none !important; }
    #dashRecent .tx-row { gap: 4px !important; padding: 5px 0 !important; }
    #dashRecent .tx-desc { font-size: 12px !important; }
    #dashRecent .tx-meta { font-size: 10px !important; }
    #dashRecent .tx-amount { font-size: 12px !important; }
    .tx-row { padding: 8px 0 !important; gap: 8px !important; }
    .tx-icon { width: 30px !important; height: 30px !important; }
    .tx-icon svg { width: 14px !important; height: 14px !important; }
    .tx-desc { font-size: 12px !important; }
    .tx-meta { font-size: 10px !important; }
    .tx-amount { font-size: 12px !important; }
    .budget-card { padding: 14px; gap: 12px; }
    .budget-card-icon { width: 40px; height: 40px; }
    .budget-card-icon svg { width: 18px; height: 18px; }
    .budget-card-name { font-size: 14px; }
    .budget-card-stat { font-size: 12px; }
    .budget-summary { padding: 16px; gap: 10px; flex-wrap: wrap; }
    .budget-summary-value { font-size: 20px; }
    .budget-summary-label { font-size: 11px; }
    .settings-card { padding: 16px; }
    .settings-title { font-size: 14px; }
    .settings-label { font-size: 13px; }
    .settings-desc { font-size: 11px; max-width: 200px; }
    .settings-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .toggle-label { font-size: 13px; }
    .toggle-desc { font-size: 11px; }
    .form-row { grid-template-columns: 1fr; }
    .type-selector { grid-template-columns: repeat(2, 1fr); }
    .modal { max-width: 100%; max-height: 92vh; overflow-y: auto; }
    .mobile-tx-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .mobile-tx-tab { flex-shrink: 0; }
    .cal-day { min-height: 70px; padding: 4px 4px; }
    .cal-day-num { font-size: 12px; }
    .cal-event { font-size: 9px; padding: 1px 4px; }
    .cal-week-grid { grid-template-columns: 1fr; }
    .cal-week-day { min-height: auto; }
    .cal-header { flex-wrap: wrap; gap: 12px; }
    .cal-title { font-size: 16px; min-width: 140px; }
    .chart-container { height: 220px; }
    .filter-bar { gap: 6px; flex-wrap: wrap; }
    .filter-input { font-size: 12px; padding: 7px 10px; flex: 1; min-width: 120px; }
    .search-input { min-width: 120px; }
    .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; margin-bottom: 16px; }
    .summary-card { padding: 10px 12px; gap: 8px; }
    .summary-value { font-size: 14px; }
    .summary-label { font-size: 10px; }
    .summary-icon { width: 28px; height: 28px; }
    .summary-icon svg { width: 16px; height: 16px; }
    .summary-sub { font-size: 10px; }
    .tx-desc { font-size: 12px; }
    .tx-meta { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tx-amount { font-size: 13px; }
    .tx-actions { opacity: 1 !important; }
    .event-item { padding: 10px; }
    .event-title { font-size: 13px; }
    .event-meta { font-size: 11px; }
    .upcoming-date-day { font-size: 16px; }
    .mobile-more-grid { grid-template-columns: repeat(3, 1fr); }
    .mobile-more-item { padding: 12px 6px; }
    .mobile-more-item span { font-size: 11px; }
    .mobile-more-item svg { width: 20px; height: 20px; }
    .budget-card-bottom { flex-wrap: wrap; gap: 6px; }
    .budget-card-amounts strong { font-size: 13px; }
    .stat-row { flex-wrap: wrap; gap: 4px; }
    .stat-label { font-size: 12px; }
    .stat-value { font-size: 13px; }

    /* Mobile budget card compact */
    .budget-item-card { padding: 12px 14px; }
    .budget-item-top { gap: 10px; }
    .budget-item-icon { width: 36px; height: 36px; }
    .budget-item-icon svg { width: 18px; height: 18px; }
    .budget-item-name { font-size: 14px; }
    .budget-item-tag { display: none; }
    .budget-item-meta { display: none; }
    .budget-item-health { display: none; }
    .budget-item-actions { display: none; }
    .budget-item-menu { display: flex; }
    .budget-item-bottom { font-size: 12px; gap: 8px; flex-wrap: wrap; }
    .budget-progress-wrap { margin: 6px 0; }

    /* Mobile goal card compact */
    .goal-card { padding: 14px 16px; }
    .goal-card-top { gap: 12px; }
    .goal-icon-wrap { width: 40px; height: 40px; }
    .goal-icon-wrap svg { width: 20px; height: 20px; }
    .goal-name { font-size: 14px; }
    .goal-name-row { flex-wrap: wrap; }
    .goal-badge { font-size: 10px; padding: 2px 8px; }
    .goal-desc { display: none; }
    .goal-target-line { font-size: 12px; margin-bottom: 8px; }
    .goal-progress-row { gap: 10px; margin-bottom: 8px; }
    .goal-saved-big { font-size: 18px; }
    .goal-saved-big span { font-size: 12px; }
    .goal-target-small { font-size: 11px; }
    .goal-right-box { min-width: 90px; padding: 8px 12px; }
    .goal-right-amount { font-size: 14px; }
    .goal-right-label { font-size: 11px; }
    .goal-bottom-row { display: none; }
    .goal-history-toggle { display: none; }
    .goal-item-menu { display: flex; }

    /* Hide icons on mobile to prevent text cutoff */
    .summary-card .summary-icon { display: none; }
    .goal-card .goal-icon-wrap { display: none; }
    .budget-item-card .budget-item-icon { display: none; }
    .sub-item .sub-icon { display: flex; } /* keep sub list icons */
    #page-subscriptions .summary-card .summary-icon { display: none; }
    #page-budgets .summary-card .summary-icon { display: none; }
    #page-goals .summary-card .summary-icon { display: none; }
    #page-giving .summary-card .summary-icon { display: none; }
    #page-income .summary-card .summary-icon { display: none; }
    #page-expenses .summary-card .summary-icon { display: none; }
    #page-transactions .summary-card .summary-icon { display: none; }

    /* Tighter summary cards */
    .summary-card { padding: 8px 10px; gap: 6px; }
    .summary-value { font-size: 13px; }
    .summary-label { font-size: 10px; }
    .summary-sub { font-size: 9px; }

    /* Tighter goal cards */
    .goal-right-box { min-width: 70px; padding: 6px 10px; }
    .goal-right-amount { font-size: 13px; }
    .goal-saved-big { font-size: 16px; }
    .goal-saved-big span { font-size: 11px; }
    .goal-progress-row { flex-wrap: wrap; }
    .goal-percent { min-width: 30px; font-size: 13px; }

    /* Tighter budget cards */
    .budget-item-bottom { font-size: 11px; }
    .budget-spent { font-size: 11px; }
    .budget-pct { font-size: 11px; }
    .budget-remain { font-size: 11px; }

    /* Dashboard upcoming events compact */
    #dashUpcoming .upcoming-item { gap: 6px !important; padding: 5px 0 !important; }
    #dashUpcoming .upcoming-date { width: 32px !important; }
    #dashUpcoming .upcoming-date-day { font-size: 14px !important; }
    #dashUpcoming .event-title { font-size: 11px !important; }
    #dashUpcoming .event-meta { font-size: 9px !important; }
    #dashUpcoming .event-amount { font-size: 11px !important; }
    #dashUpcoming .event-dot { width: 7px !important; height: 7px !important; }

    /* Force dashboard cards to never scroll horizontally */
    #page-dashboard .card { overflow-x: hidden !important; }
    #page-dashboard .card > div { max-width: 100%; }
    .sub-item > div:last-child { flex-shrink: 0; }
    .mobile-profile-chip { display: flex; }

    .mobile-nav {
      display: flex;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: var(--card);
      border-top: 1px solid var(--border);
      z-index: 80;
      padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
      justify-content: space-around;
      align-items: flex-start;
    }
    .mobile-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: 4px 8px;
      cursor: pointer;
      color: var(--text-tertiary);
      font-size: 10px;
      font-weight: 500;
      white-space: nowrap;
      flex: 1;
      min-width: 0;
      transition: var(--transition);
    }
    .mobile-nav-item.active { color: var(--accent); }
    .mobile-nav-item svg { width: 22px; height: 22px; }

    .mobile-nav-add {
      flex: 0 0 56px;
      margin-top: -20px;
    }
    .mobile-nav-add-btn {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: var(--accent);
      color: white;
      border: 3px solid var(--card);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      font-weight: 400;
      box-shadow: 0 2px 8px rgba(57,121,104,0.3);
      transition: var(--transition);
    }
    .mobile-nav-add-btn:active { transform: scale(0.92); }
    .mobile-nav-add-label { font-size: 10px; font-weight: 500; color: var(--accent); margin-top: 2px; }

    .mobile-more-sheet {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: var(--card);
      border-top-left-radius: 20px;
      border-top-right-radius: 20px;
      border-top: 1px solid var(--border);
      box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
      z-index: 95;
      padding: 20px 24px calc(24px + env(safe-area-inset-bottom));
      animation: slideUp 0.25s ease;
    }
    .mobile-more-sheet.active { display: block; }
    @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

    .mobile-more-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.3);
      z-index: 94;
    }
    .mobile-more-overlay.active { display: block; }

    .mobile-more-handle {
      width: 36px;
      height: 4px;
      border-radius: 2px;
      background: var(--border-strong);
      margin: 0 auto 16px;
    }
    .mobile-more-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 16px;
    }
    .mobile-more-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
    }
    .mobile-more-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 16px 8px;
      border-radius: 12px;
      background: var(--bg);
      border: 1px solid var(--border);
      cursor: pointer;
      transition: var(--transition);
    }
    .mobile-more-item:hover, .mobile-more-item:active {
      background: var(--light-green);
      border-color: var(--border-strong);
    }
    .mobile-more-item svg { width: 24px; height: 24px; color: var(--accent); }
    .mobile-more-item span { font-size: 12px; font-weight: 500; color: var(--text); }

    .mobile-tx-tabs {
      display: flex;
      gap: 4px;
      background: var(--bg);
      border-radius: 10px;
      padding: 3px;
      margin-bottom: 16px;
    }
    .mobile-tx-tab {
      flex: 1;
      padding: 7px 4px;
      border-radius: 7px;
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-secondary);
      transition: var(--transition);
      white-space: nowrap;
    }
    .mobile-tx-tab.active { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
  }

  @media (min-width: 769px) {
    .mobile-tx-tabs { display: none; }
    .mobile-profile-chip { display: none !important; }
  }

   .toast {
     position: fixed;
     bottom: 100px;
     left: 50%;
     transform: translateX(-50%) translateY(20px);
     background: var(--accent);
     color: white;
     padding: 12px 26px;
     border-radius: 10px;
     font-size: 14px;
     font-weight: 500;
     z-index: 2000;
     opacity: 0;
     box-shadow: 0 8px 24px rgba(0,0,0,0.18);
     transition: var(--transition);
     pointer-events: none;
     max-width: 90vw;
     text-align: center;
   }
   .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
   .toast-error { background: var(--danger); }
   .toast-success { background: var(--accent); }

  .health-score-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
  }

  /* Toggle Switch */
  .toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--toggle-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
  }
  .toggle.on { background: var(--accent); }
  .toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--card);
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  }
  .toggle.on::after { left: 22px; }
  .toggle-sm { position: relative; width: 32px; height: 18px; background: var(--toggle-bg); border-radius: 9px; cursor: pointer; transition: var(--transition); flex-shrink: 0; }
  .toggle-sm.on { background: var(--accent); }
  .toggle-sm::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); transition: var(--transition); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
  .toggle-sm.on::after { left: 16px; }

  .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-secondary);
  }
  .toggle-row:last-child { border-bottom: none; }
  .toggle-label { font-size: 14px; font-weight: 500; color: var(--text); }
  .toggle-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

  /* Calendar */
  .cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .cal-nav { display: flex; align-items: center; gap: 12px; }
  .cal-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 16px;
  }
  .cal-nav-btn:hover { background: var(--light-green); color: var(--accent); border-color: var(--border-strong); }
  .cal-title { font-size: 18px; font-weight: 600; min-width: 180px; text-align: center; }
  .cal-view-toggle { display: flex; gap: 4px; background: var(--bg); border-radius: 9px; padding: 3px; }
  .cal-view-btn {
    padding: 6px 14px;
    border-radius: 7px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
  }
  .cal-view-btn.active { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .cal-day-header {
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--card);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .cal-day {
    background: var(--card);
    min-height: 90px;
    padding: 6px 8px;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
  }
  .cal-day:hover { background: var(--bg); }
  .cal-day.other-month { background: var(--bg); }
  .cal-day.other-month .cal-day-num { color: var(--text-tertiary); }
  .cal-day.today .cal-day-num {
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
  }
  .cal-day-num { font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
  .cal-event {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: var(--transition);
  }
  .cal-event:hover { opacity: 0.85; }
  .cal-event.income { background: var(--success-bg); color: var(--success); }
  .cal-event.expense { background: var(--danger-bg); color: var(--danger); }
  .cal-event.savings { background: var(--lime-bg); color: var(--lime); }
  .cal-event.neutral { background: var(--border-secondary); color: var(--text-secondary); }

  .cal-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .cal-week-day {
    background: var(--card);
    min-height: 200px;
    padding: 10px;
  }
  .cal-week-day.today { background: var(--light-green); }

  .cal-day-view {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
  }

  .event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    background: var(--card);
    transition: var(--transition);
    cursor: pointer;
  }
  .event-item:hover { border-color: var(--border-strong); box-shadow: 0 1px 4px rgba(57,121,104,0.06); }

  .event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .event-dot.income { background: var(--success); }
  .event-dot.expense { background: var(--danger); }
  .event-dot.savings { background: var(--lime); }
  .event-dot.neutral { background: var(--text-tertiary); }

  .event-info { flex: 1; min-width: 0; }
  .event-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .event-meta { font-size: 12px; color: var(--text-secondary); }
  .event-amount { font-weight: 600; font-size: 14px; white-space: nowrap; }
  .event-amount.income { color: var(--success); }
  .event-amount.expense { color: var(--danger); }

  .event-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
  }
  .event-status.upcoming { background: var(--light-green); color: var(--accent); }
  .event-status.due-today { background: var(--warning-bg); color: var(--warning); }
  .event-status.completed { background: var(--border-secondary); color: var(--text-secondary); }
  .event-status.missed { background: var(--danger-bg); color: var(--danger); }
  .event-status.cancelled { background: var(--border-secondary); color: var(--text-tertiary); text-decoration: line-through; }

  /* Settings */
  .settings-section { margin-bottom: 24px; }
  .auto-rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
  }
  .auto-rule-item .rule-keywords {
    font-weight: 600;
    color: var(--text);
  }
  .auto-rule-item .rule-target {
    color: var(--text-secondary);
    margin-left: 8px;
  }
  .auto-rule-item .rule-actions {
    display: flex;
    gap: 6px;
  }
  .settings-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
  }
  .settings-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
  .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-secondary);
  }
  .settings-row:last-child { border-bottom: none; }
  .settings-label { font-size: 14px; font-weight: 500; color: var(--text); }
  .settings-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; max-width: 400px; }

  .gcal-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
  }
  .gcal-status.connected { background: var(--success-bg); color: var(--success); }
  .gcal-status.disconnected { background: var(--border-secondary); color: var(--text-secondary); }
  .gcal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
  }

  /* Upcoming events on dashboard */
  .upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
  }
  .upcoming-item:hover { background: var(--bg); margin: 0 -8px; padding: 10px 8px; border-radius: 8px; }
  .upcoming-item:last-child { border-bottom: none; }
  .upcoming-date {
    text-align: center;
    flex-shrink: 0;
    width: 44px;
  }
  .upcoming-date-day { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
  .upcoming-date-month { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

  /* Notifications */
  .notif-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--light-green);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
  }
  .notif-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
  }
  .notif-icon svg { width: 16px; height: 16px; }
  .notif-text { font-size: 13px; color: var(--text); line-height: 1.5; }
  .notif-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 18px;
    padding: 0 4px;
    flex-shrink: 0;
  }
  .notif-dismiss:hover { color: var(--text-secondary); }

  /* Auth Login / Landing Page */
  .auth-overlay { position:fixed; inset:0; background:var(--bg); z-index:200; display:none; padding:0; overflow-y:auto; }
  .auth-overlay.active { display:block; }
  .auth-container { max-width:420px; width:100%; text-align:center; margin:0 auto; padding:80px 24px 40px; }
  .auth-btn-google { width:100%; padding:14px 16px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--card); color:var(--text); font-size:14px; font-weight:500; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:10px; transition:var(--transition); margin-bottom:16px; }
  .auth-btn-google:hover { background:var(--bg); }
  .auth-btn-google svg { width:20px; height:20px; }
  .auth-divider { display:flex; align-items:center; gap:12px; font-size:13px; color:var(--text-secondary); margin-bottom:16px; }
  .auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background:var(--border); }
  .auth-form { display:flex; flex-direction:column; gap:12px; }
  .auth-user-card { display:flex; align-items:center; gap:10px; padding:8px 8px 0; }
  .auth-user-avatar { width:36px; height:36px; border-radius:50%; background:var(--light-green); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:14px; color:var(--accent); overflow:hidden; }
  .auth-user-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }
  .auth-user-name { font-size:13px; font-weight:600; }
  .auth-user-email { font-size:12px; color:var(--text-secondary); }
  .auth-logout { font-size:12px; color:var(--danger); cursor:pointer; margin-top:4px; padding:4px 0; background:none; border:none; }
  .auth-logout:hover { text-decoration:underline; }
  .mobile-profile-chip { display:none; align-items:center; gap:8px; cursor:pointer; padding:4px 8px 4px 4px; border-radius:20px; background:var(--card); border:1px solid var(--border); }
  .mobile-profile-avatar { width:28px; height:28px; border-radius:50%; background:var(--light-green); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:12px; color:var(--accent); overflow:hidden; flex-shrink:0; }
  .mobile-profile-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
  .mobile-profile-name { font-size:13px; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100px; }


/* ===== SESSION-RESTORE SHEET (cold-start auth hydration) ===== */
  .auth-restoring-overlay { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:250; display:flex; align-items:center; justify-content:center; padding:24px; }
  .auth-restoring-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:0 20px 60px rgba(0,0,0,.2); padding:36px 40px; max-width:380px; width:100%; text-align:center; }
  .auth-restoring-card h3 { margin:0 0 8px; font-size:17px; font-weight:600; color:var(--text); }
  .auth-restoring-card p { margin:0; font-size:13px; line-height:1.5; color:var(--text-secondary); }
  .auth-restoring-card .spinner { width:36px; height:36px; margin:0 auto 18px; border-radius:50%; border:3px solid var(--border); border-top-color:var(--accent); animation:spin .8s linear infinite; }


/* ===== FINANCEOS PREMIUM LANDING PAGE ===== */
  .landing-page { width:100%; overflow-x:hidden; background:var(--bg); color:var(--text); font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; -webkit-font-smoothing:antialiased; }

  @keyframes spin { to { transform:rotate(360deg); } }
  @keyframes fqlp-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
  @keyframes fqlp-grow { from{transform:scaleY(0)} to{transform:scaleY(1)} }
  @keyframes fqlp-growx { from{transform:scaleX(0)} to{transform:scaleX(1)} }
  @keyframes fqlp-fade-up { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }

  /* Reveal */
  .fqlp-reveal { opacity:0; transform:translateY(26px); transition:opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1); will-change:opacity, transform; }
  .fqlp-reveal.visible { opacity:1; transform:none; }
  .fqlp-d1 { transition-delay:0.08s; }
  .fqlp-d2 { transition-delay:0.16s; }
  .fqlp-d3 { transition-delay:0.24s; }

  /* ---------- Navbar ---------- */
  .fqlp-nav { position:sticky; top:0; z-index:200; background:rgba(247,248,246,0.86); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); border-bottom:1px solid rgba(232,236,233,0.85); transition:box-shadow .25s ease, background .25s ease, border-color .25s ease; }
  [data-theme="dark"] .fqlp-nav { background:rgba(20,24,22,0.82); border-bottom-color:rgba(42,51,48,0.85); }
  .fqlp-nav.scrolled { box-shadow:0 1px 10px rgba(20,26,24,0.05); border-bottom-color:var(--border); }
  .fqlp-nav-inner { max-width:1200px; margin:0 auto; padding:18px 24px; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:24px; transition:padding .25s ease; }
  .fqlp-nav-logo { justify-self:start; }
  .fqlp-nav-links { display:flex; align-items:center; gap:2px; justify-self:center; }
  .fqlp-nav-right { justify-self:end; }
  .fqlp-nav.scrolled .fqlp-nav-inner { padding:12px 24px; }
  .fqlp-nav-logo { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); font-weight:800; font-size:17px; letter-spacing:-0.3px; }
  .fqlp-nav-logo img { width:30px; height:30px; border-radius:8px; }
  .fqlp-nav-btn { font-family:inherit; font-size:14px; font-weight:600; padding:9px 18px; border-radius:10px; cursor:pointer; transition:background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease; border:1.5px solid transparent; }
  .fqlp-nav-btn.ghost { background:transparent; color:var(--text); border-color:var(--border-strong); }
  .fqlp-nav-btn.ghost:hover { background:var(--card); border-color:var(--accent); color:var(--accent); }
  .fqlp-nav-btn.primary { background:var(--accent); color:#fff; box-shadow:0 1px 2px rgba(57,121,104,0.25); }
  .fqlp-nav-btn.primary:hover { background:var(--accent-hover); box-shadow:0 6px 20px rgba(57,121,104,0.22); }

  /* ---------- Hero ---------- */
  .fqlp-hero { position:relative; display:grid; grid-template-columns:0.8fr 1.2fr; gap:56px; align-items:center; max-width:1200px; margin:0 auto; padding:96px 24px 0; min-height:calc(100vh - 76px); }
  .fqlp-hero h1 { font-size:54px; font-weight:800; line-height:1.06; letter-spacing:-2.5px; color:var(--text); margin:0 0 22px; }
  .fqlp-hero h1 em { font-style:italic; color:var(--accent); }
  .fqlp-hero p { font-size:18px; line-height:1.65; color:var(--text-secondary); max-width:540px; margin:0 0 36px; }
  .fqlp-hero-btns { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }

  /* Dashboard mockup */
  .fqlp-mockup-wrap { position:relative; max-width:940px; margin-left:auto; }
  .fqlp-mockup { border-radius:16px; border:1px solid var(--border); background:var(--card); box-shadow:0 40px 90px -30px rgba(32,48,42,0.28); overflow:hidden; }
  .fqlp-mockup-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; border-bottom:1px solid var(--border-secondary); background:rgba(247,248,246,0.5); }
  [data-theme="dark"] .fqlp-mockup-header { background:rgba(20,24,22,0.4); }
  .fqlp-mockup-dots { display:flex; gap:6px; }
  .fqlp-mockup-dots span { width:10px; height:10px; border-radius:50%; }
  .fqlp-mockup-title { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--text-secondary); }
  .fqlp-mockup-live { margin-left:auto; display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; color:var(--green-accent); background:var(--green-light); border:1px solid var(--green-border); padding:4px 11px; border-radius:999px; }
  .fqlp-mockup-live i { width:6px; height:6px; border-radius:50%; background:var(--green-accent); animation:fqlp-pulse 1.5s ease-in-out infinite; }
  .fqlp-mockup-body { padding:16px; }
  .fqlp-chip { position:absolute; z-index:2; border:1px solid var(--border); border-radius:12px; background:var(--card); box-shadow:0 8px 24px rgba(0,0,0,0.07); padding:9px 13px; text-align:left; }
  .fqlp-chip p { margin:0; }
  .fqlp-chip p:first-child { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-secondary); margin-bottom:1px; }
  .fqlp-chip p:last-child { font-size:15px; font-weight:800; color:var(--text); font-variant-numeric:tabular-nums; }

  /* ---------- Buttons ---------- */
  .fqlp-btn { display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:13px 26px; border-radius:12px; font-family:inherit; font-size:15px; font-weight:600; line-height:1.2; border:1.5px solid transparent; cursor:pointer; text-decoration:none; white-space:nowrap; transition:background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease, color .2s ease; }
  .fqlp-btn.filled { background:var(--accent); color:#fff; box-shadow:0 1px 2px rgba(57,121,104,0.25); }
  .fqlp-btn.filled:hover { background:var(--accent-hover); box-shadow:0 8px 24px rgba(57,121,104,0.22); transform:translateY(-1px); }
  .fqlp-btn.outline { background:transparent; color:var(--text); border-color:var(--border-strong); }
  .fqlp-btn.outline:hover { background:var(--card); border-color:var(--accent); }

  /* ---------- Shared section ---------- */
  .fqlp-section { max-width:1200px; margin:0 auto; padding:112px 24px; }
  .fqlp-section h2 { font-size:40px; font-weight:800; line-height:1.12; letter-spacing:-1.6px; color:var(--text); margin:0 0 18px; }
  .fqlp-section h2 em { font-style:italic; color:var(--accent); }
  .fqlp-section-label { display:inline-block; font-size:12px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:0.14em; margin:0 0 14px; }
  .fqlp-section-sub { font-size:17px; line-height:1.7; color:var(--text-secondary); max-width:620px; margin:0 0 32px; }

  /* ---------- How it works ---------- */
  .fqlp-steps-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin-top:56px; }
  .fqlp-step { border:1px solid var(--border); border-radius:18px; background:var(--card); padding:32px 28px; text-align:center; }
  .fqlp-step-num { font-size:52px; font-weight:800; line-height:1; letter-spacing:-2px; -webkit-text-stroke:1.5px var(--accent); color:transparent; margin-bottom:18px; }
  .fqlp-step h3 { font-size:18px; font-weight:700; color:var(--text); margin:0 0 8px; }
  .fqlp-step p { font-size:14px; color:var(--text-secondary); line-height:1.6; margin:0; }

  /* ---------- Security ---------- */
  .fqlp-security { max-width:1200px; margin:0 auto; padding:0 24px 112px; }
  .fqlp-security-card { display:grid; grid-template-columns:1fr 1fr; gap:56px; align-items:center; }
  .fqlp-badge-grid { display:grid; gap:10px; }
  .fqlp-badge { display:flex; align-items:center; gap:11px; padding:13px 16px; border:1px solid var(--border); border-radius:12px; background:var(--card); font-size:13.5px; font-weight:600; color:var(--text); }
  .fqlp-badge svg { width:20px; height:20px; color:var(--accent); flex-shrink:0; }
  .fqlp-vault { width:230px; height:230px; }

  /* ---------- Final CTA ---------- */
  .fqlp-cta { max-width:1200px; margin:0 auto; padding:60px 24px 112px; }
  .fqlp-cta-inner { border-radius:28px; background:linear-gradient(135deg, #2E6B59 0%, #397968 45%, #4B9D85 100%); color:#fff; text-align:center; padding:80px 40px; position:relative; overflow:hidden; }
  .fqlp-cta-inner::before { content:''; position:absolute; left:10%; top:-120px; width:380px; height:380px; border-radius:50%; background:rgba(255,255,255,0.07); }
  .fqlp-cta-inner::after { content:''; position:absolute; right:8%; bottom:-140px; width:420px; height:420px; border-radius:50%; background:rgba(255,255,255,0.05); }
  .fqlp-cta-inner > * { position:relative; z-index:1; }
  .fqlp-cta h2 { font-size:40px; font-weight:800; letter-spacing:-1.6px; margin:0 0 16px; }
  .fqlp-cta p { font-size:17px; line-height:1.65; opacity:0.85; max-width:520px; margin:0 auto 34px; }
  .fqlp-cta-inner .fqlp-btn.filled { background:#fff; color:#1F3A31; box-shadow:0 8px 24px rgba(0,0,0,0.18); }
  .fqlp-cta-inner .fqlp-btn.filled:hover { background:var(--light-green); }
  .fqlp-cta-inner .fqlp-btn.outline { background:transparent; color:#fff; border-color:rgba(255,255,255,0.55); }
  .fqlp-cta-inner .fqlp-btn.outline:hover { background:rgba(255,255,255,0.12); border-color:#fff; }

  /* ---------- Footer ---------- */
  .fqlp-footer { display:flex; flex-direction:column; align-items:stretch; background:var(--card); border-top:1px solid var(--border); }

  /* Responsive */
  @media (max-width:1024px) {
    .fqlp-hero { grid-template-columns:1fr; gap:48px; padding:72px 24px 0; }
    .fqlp-mockup-wrap { max-width:940px; margin:0 auto; }
    .fqlp-security-card { grid-template-columns:1fr; gap:40px; }
    .fqlp-step { padding:26px 22px; }
  }
  @media (max-width:768px) {
    .fqlp-hero h1 { font-size:38px; letter-spacing:-1.8px; }
    .fqlp-section { padding:80px 20px; }
    .fqlp-security { padding:0 20px 80px; }
    .fqlp-cta { padding:48px 20px 80px; }
    .fqlp-cta-inner { padding:56px 24px; border-radius:22px; }
    .fqlp-cta-inner h2 { font-size:30px; }
    .fqlp-steps-grid { grid-template-columns:1fr; gap:16px; margin-top:40px; }
  }
  @media (max-width:600px) {
    .fqlp-nav-inner { padding:14px 20px; }
    .fqlp-hero { padding:56px 20px 0; gap:40px; }
    .fqlp-hero h1 { font-size:31px; letter-spacing:-1.4px; }
    .fqlp-hero p { font-size:16px; }
    .fqlp-chip { display:none; }
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    .fqlp-reveal { opacity:1 !important; transform:none !important; transition:none; }
    .fqlp-mockup-live i { animation:none !important; }
    .fqlp-chip { transition:none; }
  }
  /* Onboarding */
  .onboarding-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
  }
  .onboarding-overlay.active { display: flex; }
  .onboarding-container {
    max-width: 480px;
    width: 100%;
    text-align: center;
  }
  .onboarding-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 32px;
    margin: 0 auto 24px;
  }
  .onboarding-title { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; color: var(--text); }
  .onboarding-subtitle { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 32px; }
  .onboarding-step { display: none; }
  .onboarding-step.active { display: block; }
  .onboarding-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 32px; }
  .onboarding-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: var(--transition); }
  .onboarding-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
  .onboarding-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    text-align: center;
    margin-bottom: 16px;
  }
  .onboarding-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-shadow); }
  .onboarding-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    margin-bottom: 16px;
    cursor: pointer;
  }
  .onboarding-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; text-align: left; }
  .onboarding-feature { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .onboarding-feature svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
  .onboarding-feature-text { font-size: 14px; color: var(--text); font-weight: 500; }
  .onboarding-btn {
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
  }
  .onboarding-btn:hover { background: var(--accent-hover); }
  .onboarding-btn:active { transform: scale(0.98); }
  .onboarding-btn-secondary {
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
  }
  .onboarding-btn-secondary:hover { color: var(--text); }
  .onboarding-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; text-align: left; }
  .onb-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
  }
  .onb-chip:hover { border-color: var(--accent); }
  .onb-chip.selected { background: var(--accent); color: white; border-color: var(--accent); }
  .onb-budget-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 8px;
  }
  .onb-budget-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }
  .onb-budget-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    min-width: 120px;
    text-align: left;
  }

  /* Create event modal */
  .cal-create-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    background: var(--card);
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
    width: 100%;
  }
  .cal-create-btn:hover { background: var(--light-green); border-color: var(--accent); }
  .cal-create-btn svg { width: 18px; height: 18px; }

  /* Expandable nav groups */
  .nav-group { margin-bottom: 4px; }
  .nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    user-select: none;
  }
  .nav-group-header:hover { background: var(--light-green); color: var(--accent); }
  .nav-group-chevron {
    width: 14px; height: 14px;
    transition: transform 0.2s ease;
    color: var(--text-tertiary);
  }
  .nav-group.expanded .nav-group-chevron { transform: rotate(180deg); }
  .nav-group-items {
    display: none;
    padding-left: 4px;
  }
  .nav-group.expanded .nav-group-items { display: block; }
  .nav-group .nav-item { margin-bottom: 2px; }


  /* --- Redesigned Page Styles --- */
  .page-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:24px; }
  .page-header-title { font-size:22px; font-weight:700; letter-spacing:-0.3px; }
  .page-header-sub { font-size:13px; color:var(--text-secondary); margin-top:4px; }
  .btn-green { background:var(--green-accent); color:#fff; border:none; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; display:flex; align-items:center; gap:6px; transition:0.15s; }
  .btn-green:hover { background:var(--green-accent-hover); }
  .btn-green svg { width:14px; height:14px; }

  /* Summary cards row */
  .summary-row { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; margin-bottom:24px; }
  .summary-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px; display:flex; align-items:center; gap:12px; }
  .summary-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .summary-icon svg { width:20px; height:20px; }
  .summary-label { font-size:12px; color:var(--text-secondary); margin-bottom:2px; }
  .summary-value { font-size:18px; font-weight:700; color:var(--text); }
  .summary-sub { font-size:12px; color:var(--text-tertiary); margin-top:2px; }

  /* Filter chips */
  .filter-chips { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; align-items:center; }
  .filter-chip { padding:6px 14px; border-radius:20px; border:1px solid var(--border); background:var(--card); font-size:13px; color:var(--text-secondary); cursor:pointer; transition:0.15s; display:flex; align-items:center; gap:6px; }
  .filter-chip.active { background:var(--light-green); border-color:var(--border-strong); color:var(--accent); font-weight:500; }
  .filter-chip:hover { border-color:var(--accent); }
  .filter-chip-dot { width:8px; height:8px; border-radius:50%; }

  /* Sort dropdown */
  .sort-select { margin-left:auto; padding:6px 12px; border-radius:8px; border:1px solid var(--border); background:var(--card); font-size:13px; color:var(--text); cursor:pointer; }

  /* Card list container */
  .card-list { display:flex; flex-direction:column; gap:12px; }

  /* Goal card */
  .goal-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px; }
  .goal-card-top { display:flex; gap:16px; }
  .goal-icon-wrap { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; background:var(--green-light); }
  .goal-icon-wrap svg { width:24px; height:24px; color:var(--green-accent); }
  .goal-info { flex:1; min-width: 0; }
  .goal-name-row { display:flex; align-items:center; gap:10px; margin-bottom:4px; }
  .goal-name { font-size:16px; font-weight:600; }
  .goal-badge { padding:3px 10px; border-radius:20px; font-size:12px; font-weight:500; }
  .goal-badge.high { background:var(--red-light); color:var(--red-accent); }
  .goal-badge.medium { background:var(--amber-light); color:var(--amber-accent); }
  .goal-badge.low { background:var(--green-light); color:var(--green-accent); }
  .goal-desc { font-size:13px; color:var(--text-secondary); margin-bottom:8px; }
  .goal-target-line { font-size:13px; color:var(--text-secondary); display:flex; align-items:center; gap:6px; margin-bottom:12px; }
  .goal-progress-row { display:flex; align-items:center; gap:16px; margin-bottom:12px; }
  .goal-progress-left { flex-shrink:0; }
  .goal-saved-big { font-size:22px; font-weight:700; color:var(--text); }
  .goal-saved-big span { font-size:14px; font-weight:400; color:var(--text-secondary); }
  .goal-target-small { font-size:13px; color:var(--text-secondary); margin-top:2px; }
  .goal-progress-bar-wrap { flex:1; height:8px; background:var(--progress-bg-alt); border-radius:4px; overflow:hidden; }
  .goal-progress-bar { height:100%; background:var(--green-accent); border-radius:4px; transition:width 0.3s; }
  .goal-percent { font-size:14px; font-weight:600; color:var(--green-accent); flex-shrink:0; min-width:36px; text-align:right; }
  .goal-right-box { background:var(--green-light); border-radius:10px; padding:12px 16px; text-align:center; min-width:120px; }
  .goal-right-amount { font-size:16px; font-weight:700; color:var(--green-accent); }
  .goal-right-label { font-size:12px; color:var(--text-secondary); margin-top:2px; }
  .goal-bottom-row { display:flex; align-items:center; justify-content:space-between; margin-top:12px; padding-top:12px; border-top:1px solid var(--border-secondary); }
  .goal-monthly { font-size:13px; color:var(--text-secondary); }
  .goal-monthly strong { color:var(--text); font-weight:600; }
  .goal-actions { display:flex; gap:8px; }
  .goal-btn { padding:6px 14px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; border:1px solid var(--border); background:var(--card); display:flex; align-items:center; gap:4px; transition:0.15s; }
  .goal-btn:hover { background:var(--light-green); border-color:var(--accent); }
  .goal-btn.delete { border-color:var(--red-border); color:var(--red-accent); }
  .goal-btn.delete:hover { background:var(--red-light); }
  .goal-history-toggle { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-secondary); cursor:pointer; margin-top:12px; padding-top:12px; border-top:1px solid var(--border-secondary); }
  .goal-history-toggle svg { width:14px; height:14px; transition:transform 0.2s; }
  .goal-history-toggle.open svg { transform:rotate(180deg); }
  .goal-history-count { margin-left:auto; font-size:13px; color:var(--text-secondary); display:flex; align-items:center; gap:4px; }
  .goal-item-menu { display:none; width:32px; height:32px; border-radius:8px; border:none; background:transparent; align-items:center; justify-content:center; cursor:pointer; color:var(--text-secondary); flex-shrink:0; margin-left:auto; }
  .goal-item-menu svg { width:18px; height:18px; }
  .goal-item-details { display:none; margin-top:10px; padding-top:10px; border-top:1px solid var(--border-secondary); }
  .goal-detail-row { display:flex; justify-content:space-between; align-items:center; font-size:12px; padding:4px 0; color:var(--text-secondary); }
  .goal-detail-row span:first-child { font-weight:500; }
  .goal-detail-row span:last-child { color:var(--text); font-weight:600; }
  .goal-detail-actions { display:flex; gap:8px; margin-top:8px; }
  .goal-detail-actions button { flex:1; padding:8px 12px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; border:1px solid var(--border); background:var(--card); display:flex; align-items:center; justify-content:center; gap:4px; }
  .goal-detail-actions button:hover { background:var(--light-green); border-color:var(--accent); }
  .goal-detail-actions button.danger { border-color:var(--red-border); color:var(--red-accent); }
  .goal-detail-actions button.danger:hover { background:var(--red-light); }

  /* Budget card */
  .budget-item-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px 20px; }
  .budget-item-top { display:flex; align-items:flex-start; gap:12px; margin-bottom:10px; }
  .budget-item-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; background:var(--green-light); }
  .budget-item-icon svg { width:20px; height:20px; color:var(--green-accent); }
  .budget-item-info { flex:1; min-width: 0; }
  .budget-item-name-row { display:flex; align-items:center; gap:8px; margin-bottom:2px; }
  .budget-item-name { font-size:15px; font-weight:600; }
  .budget-item-tag { padding:2px 8px; border-radius:6px; font-size:11px; font-weight:500; }
  .budget-item-tag.essential { background:var(--green-light); color:var(--green-accent); }
  .budget-item-tag.lifestyle { background:var(--blue-light); color:var(--blue-accent); }
  .budget-item-meta { font-size:12px; color:var(--text-secondary); }
  .budget-item-health { display:flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; background:var(--green-light); font-size:12px; font-weight:500; color:var(--green-accent); }
  .budget-item-actions { display:flex; gap:6px; }
  .budget-item-btn { width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background:var(--card); display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-secondary); transition:0.15s; }
  .budget-item-btn:hover { background:var(--light-green); border-color:var(--accent); color:var(--accent); }
  .budget-progress-wrap { height:6px; background:var(--progress-bg-alt); border-radius:3px; overflow:hidden; margin:8px 0; }
  .budget-progress-bar { height:100%; background:var(--green-accent); border-radius:3px; transition:width 0.3s; }
  .budget-progress-bar.warning { background:var(--amber-accent); }
  .budget-progress-bar.danger { background:var(--red-accent); }
  .budget-item-bottom { display:flex; justify-content:space-between; font-size:13px; }
  .budget-spent { color:var(--text); font-weight:600; }
  .budget-pct { color:var(--text-secondary); }
  .budget-remain { color:var(--green-accent); font-weight:500; }
  .budget-remain.Over { color:var(--red-accent); }
  .budget-item-menu { display:none; width:32px; height:32px; border-radius:8px; border:none; background:transparent; align-items:center; justify-content:center; cursor:pointer; color:var(--text-secondary); flex-shrink:0; }
  .budget-item-menu svg { width:18px; height:18px; }
  .budget-item-details { display:none; margin-top:10px; padding-top:10px; border-top:1px solid var(--border-secondary); }
  .budget-detail-row { display:flex; justify-content:space-between; align-items:center; font-size:12px; padding:4px 0; color:var(--text-secondary); }
  .budget-detail-row span:first-child { font-weight:500; }
  .budget-detail-row span:last-child { color:var(--text); font-weight:600; }
  .budget-detail-actions { display:flex; gap:8px; margin-top:8px; }
  .budget-detail-actions button { flex:1; padding:8px 12px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; border:1px solid var(--border); background:var(--card); }
  .budget-detail-actions button:hover { background:var(--light-green); border-color:var(--accent); }
  .budget-detail-actions button.danger { border-color:var(--red-border); color:var(--red-accent); }
  .budget-detail-actions button.danger:hover { background:var(--red-light); }

  /* Overall budget bar */
  .overall-budget { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px; margin-bottom:16px; }
  .overall-budget-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
  .overall-budget-title { font-size:14px; font-weight:500; color:var(--text-secondary); }
  .overall-budget-pct { font-size:16px; font-weight:700; color:var(--green-accent); }
  .overall-budget-bar-wrap { height:10px; background:var(--progress-bg-alt); border-radius:5px; overflow:hidden; margin-bottom:8px; }
  .overall-budget-bar { height:100%; background:var(--green-accent); border-radius:5px; }
  .overall-budget-footer { display:flex; justify-content:space-between; font-size:13px; color:var(--text-secondary); }

  /* Insight card */
  .insight-card { background:var(--green-light); border:1px solid var(--green-border); border-radius:12px; padding:16px 20px; display:flex; align-items:center; gap:12px; margin-top:16px; }
  .insight-card-icon { width:36px; height:36px; border-radius:8px; background:var(--green-lighter); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .insight-card-icon svg { width:18px; height:18px; color:var(--green-accent); }
  .insight-card-text { flex:1; }
  .insight-card-title { font-size:14px; font-weight:600; color:var(--green-accent-hover); }
  .insight-card-desc { font-size:13px; color:var(--green-accent); margin-top:2px; }
  .insight-card-link { font-size:13px; font-weight:500; color:var(--green-accent); display:flex; align-items:center; gap:4px; cursor:pointer; }
  .insight-card-link svg { width:14px; height:14px; }

  /* Subscription card (row style) */
  .sub-row { display:flex; align-items:center; gap:14px; padding:16px 20px; border-bottom:1px solid var(--border-secondary); }
  .sub-row:last-child { border-bottom:none; }
  .sub-row-logo { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; background:var(--bg); font-size:18px; }
  .sub-row-logo img { width:24px; height:24px; object-fit:contain; }
  .sub-row-info { flex:1; min-width:0; }
  .sub-row-name { font-size:15px; font-weight:600; }
  .sub-row-meta { font-size:12px; color:var(--text-secondary); margin-top:2px; }
  .sub-row-cost { font-size:16px; font-weight:700; text-align:right; }
  .sub-row-toggle-wrap { display:flex; align-items:center; gap:10px; }
  .sub-toggle { position:relative; width:44px; height:24px; background:var(--toggle-bg-alt); border-radius:12px; cursor:pointer; transition:0.2s; flex-shrink:0; }
  .sub-toggle.on { background:var(--green-accent); }
  .sub-toggle::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:var(--card); transition:0.2s; box-shadow:0 1px 3px rgba(0,0,0,0.15); }
  .sub-toggle.on::after { left:22px; }
  .sub-row-badges { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
  .sub-status-badge { padding:3px 10px; border-radius:20px; font-size:11px; font-weight:500; }
  .sub-status-badge.active { background:var(--green-light); color:var(--green-accent); }
  .sub-status-badge.paused { background:var(--gray-light); color:var(--gray-accent); }
  .sub-days-badge { padding:2px 8px; border-radius:20px; font-size:11px; }
  .sub-days-badge.urgent { background:var(--red-light); color:var(--red-accent); }
  .sub-days-badge.warning { background:var(--amber-light); color:var(--amber-accent); }
  .sub-days-badge.normal { background:var(--green-light); color:var(--green-accent); }
  .sub-row-menu { width:32px; height:32px; border-radius:8px; border:none; background:transparent; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-tertiary); transition:0.15s; margin-left:4px; margin-right:4px; }
  .sub-row-menu:hover { background:var(--light-green); color:var(--accent); }

  /* Tip card */
  .tip-card { background:var(--green-light); border:1px solid var(--green-border); border-radius:12px; padding:14px 20px; display:flex; align-items:center; gap:12px; margin-top:12px; }
  .tip-card-icon { width:32px; height:32px; border-radius:50%; background:var(--green-lighter); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .tip-card-icon svg { width:16px; height:16px; color:var(--green-accent); }
  .tip-card-text { font-size:13px; color:var(--green-accent-hover); }
  .tip-card-text strong { font-weight:600; }
  .tip-card-link { margin-left:auto; font-size:13px; font-weight:500; color:var(--green-accent); display:flex; align-items:center; gap:4px; cursor:pointer; }
  .tip-card-link svg { width:14px; height:14px; }

  /* Calendar redesign */
  .cal-layout { display:flex; gap:20px; }
  .cal-main { flex:1; min-width:0; }
  .cal-sidebar { width:300px; flex-shrink:0; }
  @media (max-width: 768px) {
    .cal-layout { flex-direction:column; }
    .cal-sidebar { width:100%; }
  }
  .cal-sidebar-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px; margin-bottom:16px; }
  .cal-sidebar-title { font-size:14px; font-weight:600; margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; }
  .cal-sidebar-link { font-size:12px; color:var(--accent); cursor:pointer; font-weight:500; }
  .cal-event-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border-secondary); }
  .cal-event-row:last-child { border-bottom:none; }
  .cal-event-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .cal-event-icon.income { background:var(--green-light); color:var(--green-accent); }
  .cal-event-icon.expense { background:var(--red-light); color:var(--red-accent); }
  .cal-event-icon.sub { background:var(--amber-light); color:var(--amber-accent); }
  .cal-event-icon.event { background:var(--blue-light); color:var(--blue-accent); }
  .cal-event-icon.reminder { background:var(--violet-light); color:var(--violet-accent); }
  .cal-event-info { flex:1; min-width:0; }
  .cal-event-name { font-size:13px; font-weight:500; }
  .cal-event-date { font-size:12px; color:var(--text-secondary); margin-top:1px; }
  .cal-event-amount { font-size:13px; font-weight:600; }
  .cal-event-amount.income { color:var(--green-accent); }
  .cal-event-amount.expense { color:var(--red-accent); }
  .cal-add-event-btn { width:100%; padding:8px; border-radius:8px; border:1px dashed var(--border-strong); background:transparent; color:var(--accent); font-size:13px; font-weight:500; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; margin-top:8px; transition:0.15s; }
  .cal-add-event-btn:hover { background:var(--light-green); border-style:solid; }
  .cal-summary-row { display:flex; justify-content:space-between; padding:6px 0; font-size:13px; }
  .cal-summary-label { color:var(--text-secondary); }
  .cal-summary-value { font-weight:600; }
  .cal-summary-value.income { color:var(--green-accent); }
  .cal-summary-value.expense { color:var(--red-accent); }
  .cal-legend { display:flex; flex-direction:column; gap:8px; }
  .cal-legend-item { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-secondary); }
  .cal-legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }

  /* FAB */
  .fab-cal { position:fixed; bottom:24px; right:24px; width:56px; height:56px; border-radius:50%; background:var(--green-accent); color:#fff; border:none; font-size:24px; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 4px 12px rgba(0,0,0,0.2); transition:0.15s; z-index:90; }
  .fab-cal:hover { transform:scale(1.05); }
  @media (max-width: 768px) {
    .fab-cal { bottom:80px; right:16px; width:48px; height:48px; font-size:20px; }
  }

  /* Calendar grid improvements */
  .cal-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:1px; background:var(--border); border-radius:12px; overflow:hidden; border:1px solid var(--border); }
  .cal-day-header { background:var(--card); padding:10px 4px; text-align:center; font-size:11px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; }
  .cal-day { background:var(--card); min-height:100px; padding:6px; cursor:pointer; transition:0.15s; position:relative; }
  .cal-day:hover { background:var(--light-green); }
  .cal-day.today { background:var(--cal-today-bg); }
  .cal-day.today .cal-day-num { color:#fff; font-weight:700; background:var(--green-accent); width:24px; height:24px; display:flex; align-items:center; justify-content:center; border-radius:50%; margin:0 auto 4px; }
  .cal-day.other-month { background:var(--cal-other-month); }
  .cal-day-num { font-size:13px; color:var(--text); margin-bottom:4px; }
  .cal-day-event { font-size:10px; padding:2px 4px; border-radius:4px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cal-day-event.income { background:var(--green-light); color:var(--green-accent); }
  .cal-day-event.expense { background:var(--red-light); color:var(--red-accent); }
  .cal-day-event.sub { background:var(--amber-light); color:var(--amber-accent); }
  .cal-day-event.more { background:var(--border-secondary); color:var(--text-secondary); text-align:center; }

  /* Page toolbar */
  .page-toolbar { display:flex; gap:8px; align-items:center; }
  .page-toolbar-btn { padding:6px 12px; border-radius:8px; border:1px solid var(--border); background:var(--card); font-size:13px; color:var(--text-secondary); cursor:pointer; display:flex; align-items:center; gap:6px; transition:0.15s; }
  .page-toolbar-btn:hover { border-color:var(--accent); color:var(--accent); }
  .page-toolbar-btn svg { width:14px; height:14px; }

  /* Budget icon picker */
  .budget-icon-chip {
    display:inline-flex; align-items:center; gap:6px;
    padding:8px 12px; border-radius:10px;
    border:1px solid var(--border); background:var(--card);
    cursor:pointer; font-size:12px; font-weight:500;
    color:var(--text-secondary); transition:0.15s;
  }
  .budget-icon-chip:hover { border-color:var(--accent); color:var(--accent); }
  .budget-icon-chip.selected { background:var(--light-green); border-color:var(--accent); color:var(--accent); }
  .budget-icon-chip svg { width:18px; height:18px; }

  /* Goal icon picker */
  .goal-icon-chip {
    display:inline-flex; align-items:center; justify-content:center;
    width:44px; height:44px; border-radius:10px;
    border:1px solid var(--border); background:var(--card);
    cursor:pointer; transition:0.15s;
  }
  .goal-icon-chip:hover { border-color:var(--accent); background:var(--light-green); }
  .goal-icon-chip.selected { background:var(--light-green); border-color:var(--accent); }
  .goal-icon-chip svg { width:20px; height:20px; color:var(--accent); }
  .goal-icon-label { font-size:11px; color:var(--text-secondary); text-align:center; margin-top:4px; }


  /* PIN lock */
  .pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
  }
  .pin-overlay.hidden { opacity: 0; pointer-events: none; }
  .pin-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
  .pin-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
  .pin-dots {
    display: flex;
    gap: 14px;
    margin-bottom: 32px;
    justify-content: center;
  }
  .pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    transition: var(--transition);
  }
  .pin-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
  }
  .pin-dot.error {
    border-color: var(--danger);
    background: var(--danger-bg);
    animation: pinShake 0.4s;
  }
  .pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 12px;
    justify-content: center;
    margin: 0 auto;
  }
  .pin-key {
    width: 72px;
    height: 56px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    user-select: none;
  }
  .pin-key:hover { background: var(--bg-secondary); }
  .pin-key:active { transform: scale(0.96); background: var(--light-green); }
  .pin-key.empty { border: none; background: transparent; cursor: default; pointer-events: none; }
  .pin-key.empty:hover { background: transparent; }
  .pin-key.backspace svg { width: 22px; height: 22px; }
  .pin-error { color: var(--danger); font-size: 13px; margin-top: 16px; min-height: 20px; text-align: center; }
  .pin-forgot {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    text-align: center;
  }
  .pin-forgot:hover { color: var(--danger); }
  @keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
  }
  @media (max-width: 768px) {
    .pin-keypad { grid-template-columns: repeat(3, 64px); gap: 10px; justify-content: center; margin: 0 auto; }
    .pin-key { width: 64px; height: 52px; font-size: 18px; }
  }


/* ===== DASHBOARD WIDGET CUSTOMIZATION ===== */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.dash-widget {
  position: relative;
  min-width: 0;
}

.dash-widget[data-span="4"] {
  grid-column: span 3;
}

.dash-widget[data-span="2"] {
  grid-column: span 2;
}

.dash-widget .card {
  height: 100%;
}

.dash-widget-handle {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--border-secondary);
  cursor: grab;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 5;
  border: 1px solid var(--border);
}
.dash-widget-handle svg { width: 14px; height: 14px; }
.dash-widget-handle:active { cursor: grabbing; }

.dash-customize-active .dash-widget-handle {
  display: flex;
}

.dash-customize-active .dash-widget {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 0;
}

.dash-customize-active .dash-widget.dragging {
  opacity: 0.5;
  border-color: var(--accent);
}

.dash-customize-active .dash-widget.drag-over {
  border-color: var(--accent);
  border-style: solid;
  background: var(--light-green);
}

.dash-sort-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--light-green);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-widget[data-span="4"] { grid-column: span 2; }
  .dash-widget[data-span="2"] { grid-column: span 2; }
}

@media (max-width: 700px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-widget[data-span="4"], .dash-widget[data-span="2"] { grid-column: span 1; }
}

.dash-widget-hide {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--border-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  z-index: 6;
}
.dash-widget-hide svg { width: 14px; height: 14px; }
.dash-widget-hide:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

.dash-customize-active .dash-widget-hide {
  display: flex;
}

.dash-widget.is-hidden-widget {
  opacity: 0.45;
  border-color: var(--text-tertiary) !important;
  background: var(--bg);
}
.dash-widget.is-hidden-widget .card {
  filter: grayscale(1);
}
.dash-widget.is-hidden-widget .dash-widget-hide {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.dash-widget-handle::after {
  content: '';
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='8' y2='6.01'/%3E%3Cline x1='8' y1='12' x2='8' y2='12.01'/%3E%3Cline x1='8' y1='18' x2='8' y2='18.01'/%3E%3Cline x1='12' y1='6' x2='12' y2='6.01'/%3E%3Cline x1='12' y1='12' x2='12' y2='12.01'/%3E%3Cline x1='12' y1='18' x2='12' y2='18.01'/%3E%3Cline x1='16' y1='6' x2='16' y2='6.01'/%3E%3Cline x1='16' y1='12' x2='16' y2='12.01'/%3E%3Cline x1='16' y1='18' x2='16' y2='18.01'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ===== Dashboard zero-state onboarding ===== */
.dash-empty {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, var(--card-bg), var(--bg));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary, #4f46e5);
  border-radius: 12px;
  padding: 20px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.dash-empty-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #4f46e5);
  background: color-mix(in srgb, var(--primary, #4f46e5) 12%, transparent);
}
.dash-empty-body { flex: 1; min-width: 0; }
.dash-empty-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}
.dash-empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
  max-width: 620px;
}
.dash-empty-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-empty-dismiss {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  margin-left: 4px;
  text-decoration: underline;
}
.dash-empty-dismiss:hover { color: var(--text); }

@media (max-width: 640px) {
  .dash-empty { flex-direction: column; align-items: flex-start; padding: 16px; gap: 12px; }
  .dash-empty-icon { width: 44px; height: 44px; }
}

/* ============================================================
   UI POLISH + MOTION (analytics-style overhaul, playful)
   Layered on top of the existing system, reversible.
   ============================================================ */

/* --- Motion easings & softer shadows ------------------------ */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.06);
  --dur: 260ms;
}
[data-theme="dark"] {
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.25);
}

/* --- Page enter: staggered fade + slide --------------------- */
.page.active { animation: pageIn var(--dur) var(--ease-out); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.page.active .card,
.page.active .metric-card,
.page.active .dash-widget,
.page.active .budget-card,
.page.active .goal-card,
.page.active .tx-item,
.page.active .grid > * {
  animation: riseIn 520ms var(--ease-out) both;
}
.page.active .card:nth-child(1),
.page.active .metric-card:nth-child(1),
.page.active .dash-widget:nth-child(1),
.page.active .grid > *:nth-child(1) { animation-delay: 20ms; }
.page.active .card:nth-child(2),
.page.active .metric-card:nth-child(2),
.page.active .dash-widget:nth-child(2),
.page.active .budget-card:nth-child(2),
.page.active .tx-item:nth-child(2),
.page.active .goal-card:nth-child(2),
.page.active .grid > *:nth-child(2) { animation-delay: 60ms; }
.page.active .card:nth-child(3),
.page.active .metric-card:nth-child(3),
.page.active .dash-widget:nth-child(3),
.page.active .budget-card:nth-child(3),
.page.active .tx-item:nth-child(3),
.page.active .goal-card:nth-child(3),
.page.active .grid > *:nth-child(3) { animation-delay: 100ms; }
.page.active .card:nth-child(4),
.page.active .metric-card:nth-child(4),
.page.active .dash-widget:nth-child(4),
.page.active .grid > *:nth-child(4) { animation-delay: 140ms; }
.page.active .card:nth-child(5),
.page.active .metric-card:nth-child(5),
.page.active .dash-widget:nth-child(5) { animation-delay: 180ms; }
.page.active .card:nth-child(6) { animation-delay: 220ms; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* --- Cards: rounded, soft shadow, playful hover ------------- */
.card,
.metric-card,
.dash-widget,
.budget-card,
.goal-card {
  border-radius: 16px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur) var(--ease-spring),
              box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              background var(--dur) var(--ease-out);
  will-change: transform;
}
.card:hover,
.metric-card:hover,
.budget-card:hover,
.goal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}
.card-header { transition: transform var(--dur) var(--ease-out); }

/* Metric value: smooth hue pop on entry */
.metric-value { display: inline-block; transition: color var(--dur) var(--ease-out); }

/* --- Buttons: press + ripple (playful) ----------------------- */
.btn {
  border-radius: 11px;
  transition: transform 140ms var(--ease-pop),
              box-shadow var(--dur) var(--ease-out),
              background var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(57,121,104,0.18); }
.btn:active { transform: translateY(1px) scale(0.96) !important; box-shadow: 0 2px 6px rgba(0,0,0,0.10); }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  box-shadow: 0 6px 16px rgba(57,121,104,0.24);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(57,121,104,0.34); }

/* --- Nav pill (active sliding indicator + hover glow) -------- */
.nav-item {
  position: relative;
  transition: background var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out),
              transform 160ms var(--ease-pop);
}
.nav-item:hover { transform: translateX(2px); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent);
  transform: translateY(-50%) scaleY(0);
  transition: transform 260ms var(--ease-spring);
}
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.nav-item.active { background: var(--light-green); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* --- Widgets: nicer handles, smooth customize state ---------- */
.dash-widget-active { transition: transform 220ms var(--ease-spring), box-shadow 220ms var(--ease-out); }
.dash-widget.dragging {
  opacity: 0.85;
  transform: scale(1.03) rotate(-0.5deg);
  box-shadow: var(--shadow-hover) !important;
  cursor: grabbing;
}
.dash-widget.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* --- Firestore-accent copy polish ---------------------------- */
.topbar-title { letter-spacing: -0.4px; }
.alert-text, .empty-state { transition: opacity var(--dur) var(--ease-out); }

/* --- Reduced motion: respect accessibility ------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Dashboard toolbar (welcome + month nav + customize) --------- */
.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-welcome-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}
.dash-welcome-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

@media (max-width: 720px) {
  .dash-toolbar { flex-direction: column; align-items: flex-start; }
  .dash-toolbar-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .dash-welcome-name { font-size: 17px; }
}

/* --- Dashboard widget customization: desktop only --------------- */
/* Drag-to-reorder is a pointer-precision interaction that doesn't map to
   touch, so the entry point is hidden on phones/tablets. The customize
   mode itself is additionally guarded in app.js. */
@media (max-width: 768px) {
  #dashCustomizeBtn, .dash-sort-hint { display: none !important; }
}

/* --- Topbar month navigation ---------------------------------- */
.topbar-month {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 2px;
  box-shadow: var(--shadow-soft);
  animation: monthIn 320ms var(--ease-out);
}
@keyframes monthIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.month-nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform 120ms var(--ease-pop);
}
.month-nav-btn:hover { background: var(--light-green); color: var(--accent); }
.month-nav-btn:active { transform: scale(0.9); }
.month-nav-label {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  min-width: 110px;
  white-space: nowrap;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.month-nav-label:hover { background: var(--light-green); color: var(--accent); }
.topbar-month.browsing .month-nav-label { color: var(--accent); }

@media (max-width: 720px) {
  .topbar-month { order: 3; margin-top: 10px; width: 100%; justify-content: center; }
  .topbar { flex-wrap: wrap; }
}

.settings-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.settings-tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.settings-tab:hover { background: var(--light-green); color: var(--accent); }
.settings-tab.active { background: var(--accent); color: #fff; }

.import-table th {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border-strong);
  padding: 7px 10px;
  color: var(--text-secondary);
  font-weight: 600;
}
.import-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.import-table tr:last-child td { border-bottom: none; }

.import-cat-select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  max-width: 140px;
}

/* Floating PWA Install Button */
.floating-install-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  font-family: inherit;
  white-space: nowrap;
}
.floating-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}
.floating-install-btn:active {
  transform: translateY(0);
}
.floating-install-btn.hidden { display: none; }
.floating-install-btn svg { flex-shrink: 0; }

/* Install Modal */
.install-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.install-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.install-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.install-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 22px;
  line-height: 1;
}
.install-modal-close:hover { color: var(--text); }
.install-modal h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}
.install-modal > p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.install-platform {
  margin-bottom: 18px;
}
.install-platform-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.install-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.install-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.install-step-desc {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
}
.install-step-icon {
  display: inline-block;
  vertical-align: middle;
  margin: 0 3px;
}
.install-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .floating-install-btn {
    bottom: 16px;
    right: 16px;
    padding: 12px 18px;
    font-size: 14px;
  }
  .install-modal {
    padding: 22px 18px;
  }
}
