@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #003087;
    --primary-light: #0070ba;
    --accent: #ffc439;
    --green: #00c853;
    --red: #ff5252;
    --bg: #0a0e1a;
    --bg-card: #121828;
    --bg-sidebar: #0d1220;
    --bg-hover: #1a2238;
    --text: #e8eaf0;
    --text-dim: #8892a4;
    --border: #1e2a42;
    --glow: rgba(0, 112, 186, 0.15);
}

/* ── Light Theme ── */
.light-theme {
    --bg: #f5f6fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: #eef1f6;
    --text: #1a1a2e;
    --text-dim: #6b7280;
    --border: #e2e5eb;
    --glow: rgba(0, 112, 186, 0.1);
}

.light-theme .sidebar-logo h1,
.light-theme .page-title,
.light-theme .brain-panel h2,
.light-theme .panel-header h2,
.light-theme .transactions-panel h2,
.light-theme .chart-card h3 { color: #1a1a2e; }

.light-theme .stat-value { color: #1a1a2e; }

.light-theme .brain-msg.user {
    background: rgba(0, 112, 186, 0.1);
    color: #003087;
    border-color: rgba(0, 112, 186, 0.2);
}

.light-theme .brain-msg.bot {
    background: rgba(0, 200, 83, 0.06);
    color: #1a5c2e;
    border-color: rgba(0, 200, 83, 0.15);
}

.light-theme .alert-item { color: #c62828; }
.light-theme .forecast { color: #1b5e20; }
.light-theme .saving-tip { color: #01579b; }
.light-theme .suggestion { color: #003087; }
.light-theme .category-tag { color: #003087; }

.light-theme footer a { color: var(--primary-light); }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-layout { min-height: 100vh; }

/* ── Hamburger ── */
.hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 22px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ── Sidebar ── */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: fixed;
    width: 240px;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo h1 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: 800;
}

.ai-badge {
    background: var(--accent);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--primary-light); }

.sidebar-nav { list-style: none; flex: 1; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: var(--bg-hover);
    color: var(--text);
    border-left-color: var(--primary-light);
}

.sidebar-nav li a .nav-icon { font-size: 18px; width: 20px; text-align: center; }

.sidebar-bottom {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.demo-badge {
    background: rgba(255, 196, 57, 0.15);
    border: 1px solid rgba(255, 196, 57, 0.3);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    display: block;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.connect-paypal-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 10px;
}
.connect-paypal-btn:hover { opacity: 0.9; }

.powered-by {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
}

/* ── Main Content ── */
.main-content {
    margin-left: 240px;
    width: calc(100% - 240px);
    padding: 24px 32px;
    min-height: 100vh;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.header-btn:hover { border-color: var(--primary-light); background: var(--bg-hover); }

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.balance::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.income::before { background: linear-gradient(90deg, #00c853, #69f0ae); }
.stat-card.expenses::before { background: linear-gradient(90deg, #ff5252, #ff8a80); }
.stat-card.net::before { background: linear-gradient(90deg, var(--accent), #ffe082); }

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-card.balance .stat-icon { background: rgba(0, 112, 186, 0.15); }
.stat-card.income .stat-icon { background: rgba(0, 200, 83, 0.15); }
.stat-card.expenses .stat-icon { background: rgba(255, 82, 82, 0.15); }
.stat-card.net .stat-icon { background: rgba(255, 196, 57, 0.15); }

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

/* ── Panels ── */
.panel {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.panel-icon { font-size: 20px; }

/* ── Insights ── */
.insight-summary {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.6;
}

.alerts { margin-bottom: 12px; }

.alert-item {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #ff8a80;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.forecast {
    background: rgba(0, 200, 83, 0.08);
    border: 1px solid rgba(0, 200, 83, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #69f0ae;
}

.saving-tip {
    background: rgba(0, 112, 186, 0.1);
    border: 1px solid rgba(0, 112, 186, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #82b1ff;
}

/* ── Charts ── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.chart-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

/* ── Brain ── */
.brain-panel {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    position: relative;
}

.brain-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
    border-radius: 12px 12px 0 0;
}

.brain-panel h2 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.brain-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }

.brain-chat {
    min-height: 60px;
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.brain-msg {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 85%;
}

.brain-msg strong { font-weight: 600; }
.brain-msg ul { margin: 6px 0 6px 16px; }
.brain-msg li { margin-bottom: 2px; }

.brain-msg.user {
    background: rgba(0, 112, 186, 0.15);
    color: #82b1ff;
    margin-left: auto;
    text-align: right;
    border: 1px solid rgba(0, 112, 186, 0.2);
}

.brain-msg.bot {
    background: rgba(0, 200, 83, 0.08);
    color: #a5d6a7;
    border: 1px solid rgba(0, 200, 83, 0.15);
}

.brain-input-row { display: flex; gap: 8px; margin-bottom: 10px; }

.brain-input-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg);
    color: var(--text);
}

.brain-input-row input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--glow); }

.brain-input-row button {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s;
}

.brain-input-row button:hover { opacity: 0.9; }

.brain-suggestions { display: flex; gap: 8px; flex-wrap: wrap; }

.suggestion {
    background: rgba(0, 112, 186, 0.1);
    border: 1px solid rgba(0, 112, 186, 0.2);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    color: #82b1ff;
    transition: all 0.2s;
}

.suggestion:hover {
    background: rgba(0, 112, 186, 0.2);
    border-color: var(--primary-light);
}

/* ── Brain Header & Actions ── */
.brain-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.brain-header-actions { display: flex; gap: 8px; }

.copy-chat-btn {
    background: rgba(0, 112, 186, 0.1);
    border: 1px solid rgba(0, 112, 186, 0.25);
    color: #82b1ff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.copy-chat-btn:hover { background: rgba(0, 112, 186, 0.2); }

.clear-chat-btn {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.25);
    color: #ff8a80;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.clear-chat-btn:hover { background: rgba(255, 82, 82, 0.2); border-color: #ff5252; }

/* ── Agentic Actions ── */
.brain-action {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 200, 83, 0.15);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: rgba(0, 112, 186, 0.15);
    border: 1px solid rgba(0, 112, 186, 0.3);
    color: #82b1ff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.action-btn:hover { background: rgba(0, 112, 186, 0.25); transform: translateY(-1px); }

.action-btn.action-secondary {
    background: rgba(255, 196, 57, 0.1);
    border-color: rgba(255, 196, 57, 0.3);
    color: var(--accent);
}

/* ── Thinking Indicator ── */
.brain-msg.thinking { color: var(--text-dim); font-style: italic; }
.dot-pulse { display: inline-block; animation: dotPulse 1.2s infinite; }
@keyframes dotPulse {
    0%, 80% { opacity: 0.4; }
    40% { opacity: 1; }
}

/* ── Empty States ── */
.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 24px;
    font-size: 13px;
}
.empty-state-brain {
    text-align: center;
    color: var(--text-dim);
    padding: 20px;
    font-size: 13px;
    font-style: italic;
}

/* ── Notification Bell ── */
.notif-bell-wrap { position: relative; }

.notif-bell {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}
.notif-bell:hover { border-color: var(--primary-light); background: var(--bg-hover); }

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulse-dot 2s infinite;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    z-index: 9997;
    overflow: hidden;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.notif-clear {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.notif-clear:hover { background: var(--bg-hover); }

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 24px;
    font-size: 13px;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.5;
    transition: background 0.2s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item:last-child { border-bottom: none; }

.notif-item-text { color: var(--text); margin-bottom: 4px; }

.notif-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-time { font-size: 10px; color: var(--text-dim); }

.notif-dismiss {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}
.notif-dismiss:hover { color: var(--red); background: rgba(255, 82, 82, 0.1); }

.notif-item.notif-warning { border-left: 3px solid #ff9800; }
.notif-item.notif-success { border-left: 3px solid var(--green); }

/* ── Toast Notifications ── */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 9999;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.toast.show { transform: translateX(0); }

.toast { display: flex; align-items: flex-start; gap: 10px; }
.toast-content { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }

.toast-warning {
    background: #1a1000;
    border: 1px solid #ff9800;
    color: #ffcc80;
}
.toast-success {
    background: #0a1a0e;
    border: 1px solid #00c853;
    color: #a5d6a7;
}

.light-theme .toast-warning { background: #fff3e0; color: #e65100; border-color: #ff9800; }
.light-theme .toast-success { background: #e8f5e9; color: #1b5e20; border-color: #00c853; }

/* ── Loading Skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.modal-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; line-height: 1.5; }
.modal-note { font-size: 11px; color: var(--text-dim); margin-top: 12px; text-align: center; font-style: italic; }

.modal-input-row { display: flex; gap: 8px; }
.modal-input-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.modal-input-row input:focus { border-color: var(--primary-light); }
.modal-input-row button {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

/* ── Email Preview ── */
.modal-preview { margin-bottom: 16px; }
.email-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    font-size: 12px;
}
.email-subject { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.email-body p { margin-bottom: 6px; }

/* ── Connect PayPal ── */
.connect-steps { margin-bottom: 20px; }
.connect-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.connect-step:last-child { border-bottom: none; }
.step-num {
    width: 28px;
    height: 28px;
    background: rgba(0, 112, 186, 0.15);
    color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.connect-step strong { font-size: 13px; color: var(--text); display: block; }
.connect-step p { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.paypal-connect-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #0070ba;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.paypal-connect-btn:hover { background: #005ea6; }
.paypal-logo {
    font-style: italic;
    font-weight: 800;
    margin-right: 4px;
}

/* ── Reports Panel ── */
.report-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.report-filters {
    display: flex;
    gap: 16px;
    align-items: end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--glow);
}

.custom-date-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.report-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.report-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.report-btn:hover {
    border-color: var(--primary-light);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.report-btn-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.report-btn-full {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(0, 48, 135, 0.2), rgba(0, 112, 186, 0.15));
    border-color: var(--primary-light);
    font-weight: 600;
}

.report-btn-full:hover {
    background: linear-gradient(135deg, rgba(0, 48, 135, 0.35), rgba(0, 112, 186, 0.25));
}

.reports-panel { animation-delay: 0.42s; }

/* ── Transactions Table ── */
.transactions-panel {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.transactions-panel h2 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

tr:hover { background: var(--bg-hover); }

.amount-positive { color: var(--green); font-weight: 600; }
.amount-negative { color: var(--red); font-weight: 600; }

.category-tag {
    background: rgba(0, 112, 186, 0.12);
    color: #82b1ff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    white-space: nowrap;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card, .panel, .chart-card, .brain-panel, .transactions-panel {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.panel { animation-delay: 0.25s; }
.chart-card:nth-child(1) { animation-delay: 0.3s; }
.chart-card:nth-child(2) { animation-delay: 0.35s; }
.brain-panel { animation-delay: 0.4s; }
.transactions-panel { animation-delay: 0.45s; }

/* ── Architecture ── */
.architecture-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 20px 0;
}
.arch-step {
    text-align: center;
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 130px;
    transition: border-color 0.2s;
}
.arch-step:hover { border-color: var(--primary-light); }
.arch-icon { font-size: 28px; margin-bottom: 6px; }
.arch-label { font-size: 13px; font-weight: 600; color: var(--text); }
.arch-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.arch-arrow { font-size: 20px; color: var(--primary-light); }
.arch-tech-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.arch-tag {
    background: rgba(0, 112, 186, 0.1);
    border: 1px solid rgba(0, 112, 186, 0.2);
    color: #82b1ff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
}

/* ── Compare Months ── */
.compare-grid {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.compare-card {
    flex: 1;
    min-width: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.compare-card h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.compare-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
.compare-row:last-child { border-bottom: none; }
.compare-net { font-weight: 600; }
.compare-vs {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dim);
}
.compare-change {
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

/* ── Powered Badges ── */
.powered-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}
.powered-badge {
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
}
.paypal-badge { background: rgba(0, 48, 135, 0.2); color: #82b1ff; border: 1px solid rgba(0, 112, 186, 0.3); }
.gemini-badge { background: rgba(255, 196, 57, 0.15); color: var(--accent); border: 1px solid rgba(255, 196, 57, 0.3); }
.render-badge { background: rgba(0, 200, 83, 0.1); color: #69f0ae; border: 1px solid rgba(0, 200, 83, 0.2); }

/* ── Scroll to Top ── */
.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 112, 186, 0.3);
}
.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-top-btn:hover { opacity: 0.9; }

/* ── Ask Button States ── */
.brain-input-row button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Welcome Screen ── */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.welcome-card {
    text-align: center;
    max-width: 480px;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    animation: fadeInUp 0.5s ease forwards;
}
.welcome-icon { font-size: 48px; margin-bottom: 16px; }
.welcome-card h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.welcome-card > p { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 24px; }
.welcome-steps {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 28px;
}
.welcome-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
}
.welcome-num {
    width: 24px; height: 24px;
    background: rgba(0, 112, 186, 0.15);
    color: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.welcome-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.welcome-demo-btn {
    padding: 14px 40px;
    background: var(--primary-light);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.welcome-demo-btn:hover { background: var(--primary); }

/* ── Transaction Filters ── */
.transactions-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.txn-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.txn-filters input, .txn-filters select {
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.txn-filters input { width: 200px; }
.txn-filters input:focus, .txn-filters select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--glow);
}

/* ── Page Section Transitions ── */
section {
    animation: fadeInUp 0.5s ease forwards;
}

/* ── Error States ── */
.error-state {
    text-align: center;
    padding: 32px;
    color: var(--red);
    font-size: 14px;
}
.error-state-icon { font-size: 32px; margin-bottom: 8px; }
.error-retry-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ff8a80;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.error-retry-btn:hover { background: rgba(255, 82, 82, 0.25); }

/* ── Footer ── */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 12px;
    margin-left: 240px;
}

footer a {
    color: #82b1ff;
    text-decoration: none;
}
footer a:hover { text-decoration: underline; }

/* ── Accessibility Panel ── */
.sidebar-section { padding: 0 12px; margin-bottom: 8px; }

.sidebar-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(0, 112, 186, 0.08);
    border: 1px solid rgba(0, 112, 186, 0.15);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-section-toggle:hover { background: rgba(0, 112, 186, 0.15); border-color: var(--primary-light); }

.toggle-arrow { font-size: 10px; transition: transform 0.2s; }
.toggle-arrow.open { transform: rotate(90deg); }

.a11y-panel { padding: 8px 4px 4px; }

.a11y-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
.a11y-option:last-of-type { border-bottom: none; }

.a11y-option label { cursor: pointer; }

.a11y-option input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary-light);
    cursor: pointer;
}

.a11y-option select {
    padding: 3px 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 11px;
}

.a11y-wcag-badge {
    text-align: center;
    margin-top: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #0072B2, #6C63FF);
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.chart-alt-text {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
    line-height: 1.4;
    display: none;
}
.show-alt-text .chart-alt-text { display: block; }

/* ── Colour-blind safe palette ── */
.cb-mode .amount-positive,
.cb-mode td.amount-positive { color: #0072B2 !important; }
.cb-mode .amount-negative,
.cb-mode td.amount-negative { color: #E69F00 !important; }
.cb-mode .alert-item { color: #E69F00; border-color: rgba(230, 159, 0, 0.3); background: rgba(230, 159, 0, 0.1); }
.cb-mode .forecast { color: #0072B2; border-color: rgba(0, 114, 178, 0.2); background: rgba(0, 114, 178, 0.08); }
.cb-mode .stat-card.income::before { background: linear-gradient(90deg, #0072B2, #56B4E9); }
.cb-mode .stat-card.expenses::before { background: linear-gradient(90deg, #E69F00, #F0E442); }
.cb-mode .stat-card.net-flow .stat-value.amount-negative { color: #E69F00 !important; }
.cb-mode .stat-card.net-flow .stat-value.amount-positive { color: #0072B2 !important; }
.cb-mode .status-dot { background: #0072B2; box-shadow: 0 0 6px #0072B2; }
.cb-mode .notif-item.notif-success { border-left-color: #0072B2; }
.cb-mode .tip { color: #0072B2; }
.cb-mode .render-badge { color: #56B4E9; background: rgba(86, 180, 233, 0.1); border-color: rgba(86, 180, 233, 0.3); }

/* ── High contrast ── */
.hc-mode {
    --bg: #000000;
    --bg-card: #0a0a0a;
    --bg-sidebar: #000000;
    --text: #ffffff;
    --text-dim: #cccccc;
    --border: #555555;
}
.hc-mode .stat-value { color: #ffffff; }
.hc-mode .sidebar-logo h1, .hc-mode .page-title,
.hc-mode .brain-panel h2, .hc-mode .panel-header h2,
.hc-mode .transactions-panel h2, .hc-mode .chart-card h3 { color: #ffffff; }
.hc-mode .stat-card { border-width: 2px; }
.hc-mode .brain-msg.user { color: #ffffff; border-width: 2px; }
.hc-mode .brain-msg.bot { color: #ffffff; border-width: 2px; }

/* ── Font sizes ── */
.font-small { font-size: 12px; }
.font-medium { font-size: 15px; }
.font-large { font-size: 18px; }

.font-small *, .font-medium *, .font-large * {
    font-size: inherit;
}

.font-small h1, .font-small .page-title { font-size: 1.5em !important; }
.font-small h2, .font-small .panel-header h2 { font-size: 1.25em !important; }
.font-small h3 { font-size: 1.1em !important; }
.font-small .stat-value { font-size: 1.4em !important; }
.font-small .stat-label { font-size: 0.7em !important; }
.font-small .sidebar-nav a { font-size: 0.9em !important; }
.font-small .category-badge { font-size: 0.7em !important; }
.font-small .notif-item { font-size: 0.9em !important; }
.font-small .btn, .font-small button { font-size: 0.85em !important; }
.font-small .brain-msg { font-size: 0.9em !important; }
.font-small .powered-badge { font-size: 0.7em !important; }
.font-small .tech-tag { font-size: 0.7em !important; }
.font-small .arch-label { font-size: 0.75em !important; }
.font-small .sidebar-logo h1 { font-size: 1.2em !important; }

.font-large h1, .font-large .page-title { font-size: 2em !important; }
.font-large h2, .font-large .panel-header h2 { font-size: 1.6em !important; }
.font-large h3 { font-size: 1.35em !important; }
.font-large .stat-value { font-size: 1.8em !important; }
.font-large .stat-label { font-size: 0.85em !important; }
.font-large .sidebar-nav a { font-size: 1.15em !important; }
.font-large .category-badge { font-size: 0.9em !important; }
.font-large .notif-item { font-size: 1.1em !important; }
.font-large .btn, .font-large button { font-size: 1.1em !important; }
.font-large .brain-msg { font-size: 1.1em !important; }
.font-large .powered-badge { font-size: 0.9em !important; }
.font-large .tech-tag { font-size: 0.9em !important; }
.font-large .arch-label { font-size: 0.95em !important; }
.font-large .sidebar-logo h1 { font-size: 1.5em !important; }
.font-large td, .font-large th { font-size: 1.05em !important; }
.font-large .compare-row { font-size: 1.05em !important; }
.font-large .brain-input input { font-size: 1.05em !important; }
.font-large .quick-btn { font-size: 0.95em !important; }
.font-large .report-card { font-size: 1.05em !important; }
.font-large .daily-digest-btn { font-size: 1.05em !important; }
.font-large .account-subtitle { font-size: 1em !important; }

/* ── Dyslexia font ── */
.dyslexia-font, .dyslexia-font * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif !important;
    letter-spacing: 0.05em;
    word-spacing: 0.15em;
}

/* ── Reduced motion ── */
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* ── Read Aloud button ── */
.read-aloud-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    margin-left: auto;
    transition: background 0.2s;
}
.read-aloud-btn:hover { background: var(--bg-hover); }
.panel-header { display: flex; align-items: center; gap: 8px; }

/* ── Zoom controls ── */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}
.zoom-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.zoom-btn:hover { background: var(--bg-hover); }
#zoomLevel {
    font-size: 10px;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
}

/* ── Skip to content link ── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.2s;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Focus styles for keyboard nav ── */
*:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--glow);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .hamburger { display: block; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100% !important; padding: 16px; padding-top: 60px; overflow-x: hidden; transform: none !important; }
    .zoom-controls { display: none; }
    footer { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 18px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
    .report-buttons { grid-template-columns: 1fr 1fr; }
    .brain-msg { max-width: 95%; }
    .brain-suggestions { flex-direction: column; }
    .suggestion { text-align: center; }
    .toast { left: 16px; right: 16px; max-width: none; }
    .notif-panel { position: fixed; top: 70px; bottom: auto; left: 16px; right: 16px; width: auto; max-width: none; max-height: 60vh; }
    .notif-bell-wrap { position: static; }
    .transactions-panel { overflow-x: auto; }
    table { min-width: 0; }
    th, td { padding: 8px 6px; font-size: 12px; }
    td:last-child { text-align: right; white-space: nowrap; }
    .compare-grid { flex-direction: column; align-items: center; }
    .compare-card { width: 100%; }
    .architecture-flow { flex-direction: column; align-items: center; }
    .arch-arrow { transform: rotate(90deg); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .report-buttons { grid-template-columns: 1fr; }
    .brain-header-actions { flex-direction: column; gap: 4px; }
    .header-actions { gap: 6px; }
    .header-btn { font-size: 11px; padding: 6px 10px; }
    .notif-panel { left: 8px; right: 8px; }
    .txn-filters { flex-direction: column; }
    .txn-filters input, .txn-filters select { width: 100%; }
}
