/* ═══════════════════════════════════════════════
   V'Tracker — Premium Colorful UI
   Vibrant gradients · Glassmorphism · Dark/Light
   ═══════════════════════════════════════════════ */

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

/* ── Dark Theme (default) ── */
:root {
    --bg: #07090f;
    --bg2: #0f1120;
    --bg3: #171b2e;
    --glass: rgba(255, 255, 255, 0.035);
    --glass-h: rgba(255, 255, 255, 0.065);
    --glass-b: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.08);
    --border-h: rgba(255, 255, 255, 0.18);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --grad-income: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --grad-expense: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
    --grad-net-pos: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --grad-net-neg: linear-gradient(135deg, #f43f5e 0%, #c026d3 100%);
    --grad-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --grad-teal: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);

    /* Solid colours */
    --primary: #7c6ef5;
    --primary-g: #8b5cf6;
    --income: #10b981;
    --expense: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #f43f5e;
    --info: #06b6d4;

    --text: #eef0f8;
    --text2: #7c82a0;
    --text3: #424660;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    --ssm: 0 4px 16px rgba(0, 0, 0, 0.35);
    --glow-p: 0 0 24px rgba(99, 102, 241, 0.35), 0 0 48px rgba(139, 92, 246, 0.15);
    --glow-g: 0 0 24px rgba(16, 185, 129, 0.35);
    --glow-r: 0 0 24px rgba(244, 63, 94, 0.35);
    --t: 0.2s ease;
    --r: 14px;
    --rsm: 8px;
}

/* ── Light Theme ── */
[data-theme="light"] {
    --bg: #f0f2ff;
    --bg2: #ffffff;
    --bg3: #e8ebff;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-h: rgba(255, 255, 255, 0.9);
    --glass-b: rgba(99, 102, 241, 0.12);
    --border: rgba(99, 102, 241, 0.12);
    --border-h: rgba(99, 102, 241, 0.28);

    --grad-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --primary: #4f46e5;
    --primary-g: #7c3aed;
    --income: #059669;
    --expense: #e11d48;
    --success: #059669;
    --warning: #d97706;
    --danger: #e11d48;

    --text: #0f1020;
    --text2: #5a5f80;
    --text3: #a0a5c0;

    --shadow: 0 8px 32px rgba(79, 70, 229, 0.12);
    --ssm: 0 2px 10px rgba(79, 70, 229, 0.08);
    --glow-p: 0 0 20px rgba(79, 70, 229, 0.2);
    --glow-g: 0 0 20px rgba(5, 150, 105, 0.2);
    --glow-r: 0 0 20px rgba(225, 29, 72, 0.2);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.35s, color 0.35s;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-b);
    border-radius: 99px;
}

/* ── Loading ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

/* ═══════════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════════ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 80% 60% at 15% 15%, rgba(99, 102, 241, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 85% 85%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        var(--bg);
}

.auth-card {
    background: rgba(15, 17, 32, 0.85);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    padding: 44px 38px;
    width: 100%;
    max-width: 430px;
    box-shadow: var(--shadow), 0 0 60px rgba(99, 102, 241, 0.1);
    animation: slideUp 0.45s ease;
}

[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(99, 102, 241, 0.18);
}

.brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.6));
}

.brand-name {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.7px;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 40%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .brand-name {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.brand-sub {
    color: var(--text2);
    font-size: 0.87rem;
    margin-top: 5px;
}

/* Auth tabs */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 26px;
    gap: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text2);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label,
.form-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[data-theme="light"] .form-input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] select,
[data-theme="light"] .form-select {
    background: rgba(255, 255, 255, 0.8);
}

.form-input:focus,
.form-select:focus,
input:focus,
select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
}

input::placeholder {
    color: var(--text3);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237c82a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 3px;
}

.form-error.hidden {
    display: none;
}

input.error,
select.error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.55);
}

.btn-primary:active {
    transform: none;
}

.btn-full {
    width: 100%;
    margin-top: 6px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.btn-ghost {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    padding: 8px 14px;
}

.btn-ghost:hover {
    background: var(--glass-h);
    color: var(--text);
    border-color: var(--border-h);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    padding: 8px 14px;
}

.btn-secondary:hover {
    background: var(--glass-h);
    border-color: var(--border-h);
}

.btn-danger-solid {
    background: var(--grad-expense);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
}

.btn-danger-solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.79rem;
    border-radius: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 7px 9px;
    border-radius: 9px;
    color: var(--text2);
    font-size: 1rem;
    transition: var(--t);
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    font-weight: 500;
}

.btn-icon:hover {
    background: var(--glass-h);
    color: var(--text);
}

.w-full {
    width: 100%;
}

.mt-2 {
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    font-size: 0.83rem;
    color: var(--text2);
    margin-top: 22px;
}

.auth-switch a {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    font-weight: 700;
}

.error-msg {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.82rem;
    color: #fb7185;
    margin-bottom: 14px;
}

.success-msg {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.82rem;
    color: #34d399;
    margin-bottom: 14px;
}

/* ── Forgot Password link ── */
.forgot-link {
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.85;
    transition: opacity var(--t);
}
.forgot-link:hover { opacity: 1; text-decoration: underline; }

/* ── Auth Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text2);
    font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Google Button ── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 18px;
    border-radius: var(--rsm);
    border: 1.5px solid var(--border-h);
    background: var(--glass);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t), border-color var(--t), transform 0.15s;
    margin-bottom: 4px;
    font-family: inherit;
}
.btn-google:hover {
    background: var(--glass-h);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.btn-google:active { transform: translateY(0); }
.btn-google:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
[data-theme="light"] .btn-google {
    background: #fff;
    border-color: #dadce0;
    color: #3c4043;
}
[data-theme="light"] .btn-google:hover {
    background: #f8f9ff;
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    background: rgba(7, 9, 15, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
    transition: background 0.35s;
}

[data-theme="light"] .app-header {
    background: rgba(240, 242, 255, 0.9);
    border-bottom-color: rgba(99, 102, 241, 0.14);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand-icon-sm {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.header-brand {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .header-brand {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
}

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

.user-badge {
    font-size: 0.73rem;
    color: var(--text2);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 4px 11px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-toggle {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--t);
}

.theme-toggle:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: rotate(10deg);
}

/* ═══════════════════════════════════════════════
   NAV TABS
   ═══════════════════════════════════════════════ */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    background: rgba(7, 9, 15, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    padding: 10px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

[data-theme="light"] .nav-tabs {
    background: rgba(240, 242, 255, 0.85);
    border-bottom-color: rgba(99, 102, 241, 0.12);
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 20px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text2);
    font-family: inherit;
    font-size: 0.79rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

.nav-tab.active {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Container */
.app-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 22px 16px 110px;
}

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    margin-bottom: 14px;
    backdrop-filter: blur(12px);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.card:last-child {
    margin-bottom: 0;
}

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

.card-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.card-sub {
    font-size: 0.73rem;
    color: var(--text2);
}

.mb-4 {
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════
   MONTH SELECTOR
   ═══════════════════════════════════════════════ */
.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.month-label {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    min-width: 170px;
    text-align: center;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .month-label {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ═══════════════════════════════════════════════
   BANK FILTER CHIPS
   ═══════════════════════════════════════════════ */
.bank-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.bank-filter-chips:empty {
    display: none;
}

.bank-filter-chips::-webkit-scrollbar {
    display: none;
}

.bank-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.bank-chip:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
}

.bank-chip.active {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* ═══════════════════════════════════════════════
   SUMMARY CARDS
   ═══════════════════════════════════════════════ */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.summary-card {
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transition: transform 0.25s, box-shadow 0.25s;
}

.summary-card:hover {
    transform: translateY(-3px);
}

.income-card {
    background: var(--grad-income);
    box-shadow: var(--glow-g);
}

.expense-card {
    background: var(--grad-expense);
    box-shadow: var(--glow-r);
}

.net-card {
    background: var(--grad-primary);
    box-shadow: var(--glow-p);
}

.summary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: inherit;
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 7px;
    position: relative;
    z-index: 1;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #fff;
    position: relative;
    z-index: 1;
}

/* Colour classes kept for JS compat */
.clr-income {
    color: #fff;
}

.clr-expense {
    color: #fff;
}

.clr-net {
    color: #fff;
}

/* ═══════════════════════════════════════════════
   BUDGET BAR
   ═══════════════════════════════════════════════ */
.budget-bar-wrap {
    margin-bottom: 14px;
}

.card.budget-bar-wrap {
    background: var(--glass);
}

.budget-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.83rem;
}

.budget-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.budget-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--grad-income);
    transition: width 0.6s ease, background 0.3s ease;
}

.budget-bar-fill.warn {
    background: var(--grad-gold);
}

.budget-bar-fill.over {
    background: var(--grad-expense);
}

.budget-bar-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.73rem;
    color: var(--text2);
}

/* ═══════════════════════════════════════════════
   DAILY CHART
   ═══════════════════════════════════════════════ */
.chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
}

/* ═══════════════════════════════════════════════
   CATEGORY BREAKDOWN
   ═══════════════════════════════════════════════ */
.category-list {
    list-style: none;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    transition: padding 0.15s ease;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:hover {
    padding-left: 4px;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 0.83rem;
    color: var(--text2);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.category-percent {
    font-size: 0.72rem;
    color: var(--text3);
    min-width: 36px;
    text-align: right;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════════════════ */
.section-header {
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .section-title {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ═══════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════ */
.filter-bar {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    backdrop-filter: blur(8px);
}

.filter-bar .search-input-wrapper {
    grid-column: 1 / -1;
}

.filter-bar .date-grid {
    grid-column: 1 / -1;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input-wrapper .form-input {
    padding-left: 36px;
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ═══════════════════════════════════════════════
   TRANSACTION LIST
   ═══════════════════════════════════════════════ */
.transaction-day-group {
    margin-bottom: 12px;
}

.transaction-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 4px;
    margin-bottom: 6px;
}

.transaction-day-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.transaction-day-total {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
}

.transaction-day-total.pos {
    color: #34d399;
}

.transaction-day-total.neg {
    color: #fb7185;
}

.transaction-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.transaction-row {
    display: flex;
    align-items: center;
    gap: 11px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: fadeIn 0.2s ease;
    position: relative;
    overflow: hidden;
}

.transaction-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 12px 0 0 12px;
}

.transaction-row[data-type="income"]::before {
    background: var(--grad-income);
}

.transaction-row[data-type="expense"]::before {
    background: var(--grad-expense);
}

.transaction-row:hover {
    background: var(--glass-h);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateX(3px);
    box-shadow: var(--ssm);
}

.transaction-icon {
    font-size: 1.3rem;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-category {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-note {
    font-size: 0.72rem;
    color: var(--text2);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.93rem;
    flex-shrink: 0;
}

.transaction-amount.income {
    color: #34d399;
}

.transaction-amount.expense {
    color: #fb7185;
}

.transaction-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.tx-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 8px;
    color: var(--text3);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.tx-action.edit:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    transform: scale(1.15);
}

.tx-action.delete:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    transform: scale(1.15);
}

/* ═══════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════ */
.settings-section {
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 0.71rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-tool-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.settings-label {
    font-size: 0.87rem;
    font-weight: 600;
}

.settings-label.text-danger {
    color: #fb7185;
}

.settings-desc {
    font-size: 0.75rem;
    color: var(--text2);
    margin-top: 2px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.bank-account-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.bank-account-item:last-child {
    border-bottom: none;
}

.bank-account-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--grad-primary);
}

.bank-account-name {
    flex: 1;
    font-size: 0.87rem;
    font-weight: 600;
}

.bank-account-actions {
    display: flex;
    gap: 4px;
}

/* ═══════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 9px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 13px;
    font-size: 0.83rem;
    font-weight: 600;
    min-width: 240px;
    max-width: 340px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    pointer-events: all;
    animation: toastIn 0.3s ease;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hide {
    opacity: 0;
    transform: translateX(20px);
}

.toast-success {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.96), rgba(6, 182, 212, 0.96));
    color: #fff;
}

.toast-error {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.96), rgba(251, 146, 60, 0.96));
    color: #fff;
}

.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.96), rgba(251, 191, 36, 0.96));
    color: #fff;
}

.toast-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.96), rgba(139, 92, 246, 0.96));
    color: #fff;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-undo {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    border-radius: 7px;
    padding: 3px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}

.toast-undo:hover {
    background: rgba(255, 255, 255, 0.35);
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 2px;
}

.toast-close:hover {
    color: #fff;
}

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
/* Delete confirm */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: #0f1120;
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 22px;
    padding: 36px 28px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.1), var(--shadow);
    text-align: center;
    animation: slideUp 0.25s ease;
}

[data-theme="light"] .modal-card {
    background: #fff;
}

.modal-icon {
    font-size: 2.6rem;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-body {
    font-size: 0.83rem;
    color: var(--text2);
    margin-bottom: 24px;
    line-height: 1.65;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 100px;
}

/* Slide-up add/edit modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.app-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: #0f1120;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .app-modal {
    background: #fff;
    border-top-color: rgba(99, 102, 241, 0.18);
}

.app-modal.active {
    transform: translateY(0);
}

@media (min-width: 600px) {
    .app-modal {
        max-width: 560px;
        margin: 0 auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(100%);
    }

    .app-modal.active {
        transform: translateX(-50%) translateY(0);
    }
}

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

.modal-header .modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body-scroll {
    overflow-y: auto;
    padding: 16px 20px 0;
    flex: 1;
}

.modal-footer-form {
    padding: 12px 20px 26px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

.modal-footer-form .btn {
    flex: 1;
}

/* Type chips */
.type-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.type-chip {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: 1.5px solid var(--border);
    background: var(--glass);
    color: var(--text2);
    border-radius: 11px;
    font-family: inherit;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-chip.active[data-type="expense"] {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(251, 146, 60, 0.15));
    border-color: #f43f5e;
    color: #fb7185;
}

.type-chip.active[data-type="income"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border-color: #10b981;
    color: #34d399;
}

.type-chip:hover:not(.active) {
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

/* ═══════════════════════════════════════════════
   FAB
   ═══════════════════════════════════════════════ */
.fab {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 600;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    border: none;
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5), 0 0 0 0 rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    animation: fabPulse 2.5s ease-in-out infinite;
}

.fab:hover {
    transform: scale(1.1) rotate(45deg);
    box-shadow: 0 10px 36px rgba(99, 102, 241, 0.65);
}

.fab:active {
    transform: scale(0.93);
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.35;
    animation: bounce 2.5s ease-in-out infinite;
}

.empty-state-title {
    font-size: 0.97rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.empty-state-text {
    font-size: 0.83rem;
    color: var(--text2);
    line-height: 1.6;
}

/* Skeleton */
.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg, var(--glass) 25%, var(--glass-h) 50%, var(--glass) 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    margin-bottom: 8px;
    animation: shimmer 1.6s infinite;
}

.spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    display: inline-block;
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(32px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fabPulse {

    0%,
    100% {
        box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5), 0 0 0 0 rgba(99, 102, 241, 0.35);
    }

    50% {
        box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5), 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 580px) {
    .summary-value {
        font-size: 1rem;
    }

    .auth-card {
        padding: 28px 18px;
    }

    .app-container {
        padding: 14px 12px 100px;
    }

    .nav-tab span {
        display: none;
    }

    .nav-tab {
        padding: 10px 18px;
    }

    .user-badge {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .transaction-actions {
        display: none;
    }

    .fab {
        width: 54px;
        height: 54px;
        bottom: 20px;
        right: 20px;
    }
}