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

:root {
    /* Sapphire Vibrance Palette */
    --primary: #6366f1;
    --primary-alt: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1, #3b82f6);
    --bg-app: transparent;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-sidebar: rgba(2, 6, 23, 0.85);
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-main: #f8fafc;
    --text-header: #ffffff;
    --text-accent: #818cf8;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --transition: all 0.2s ease;
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* =============================================
   1. AUTHENTICATION (ELITE GLASS-FROST)
   ============================================= */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), url('assets/finance-bg.jpg') no-repeat center center;
    background-size: cover;
    z-index: 5000;
    overflow-y: auto;
    overflow-x: hidden;
}

#particleCanvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.auth-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.9));
    backdrop-filter: blur(10px);
}

.auth-card-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 95%;
    max-width: 1100px;
    display: flex;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    margin: 40px auto;
}

.auth-illustration {
    flex: 1.2;
    background: #0f172a url('assets/auth-bg.png') no-repeat center center;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-illustration::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.85));
}

.auth-body {
    flex: 1;
    padding: 60px 50px;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    position: relative;
}

.auth-logo-img {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    object-fit: contain;
}

.auth-title-large {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.auth-subtitle-clean {
    margin-bottom: 40px;
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.auth-form {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 24px;
    position: relative;
}

.auth-form label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.1rem;
    z-index: 10;
    pointer-events: none;
}

.auth-form .input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 52px !important;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    color: #0f172a;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Fix Autofill issues */
.input-wrapper input:-webkit-autofill,
.input-wrapper input:-webkit-autofill:hover, 
.input-wrapper input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 50px #f8fafc inset !important;
    -webkit-text-fill-color: #0f172a !important;
    border: 2px solid var(--primary) !important;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: #ffffff;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    font-size: 0.9rem;
    width: 100%;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #475569;
    font-weight: 600;
    margin: 0;
    user-select: none;
}

.remember-me input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.forgot-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.forgot-link:hover {
    color: #4338ca;
    text-decoration: underline;
}

.btn-primary-large {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
}

.btn-primary-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 35px -5px rgba(99, 102, 241, 0.6);
}

.auth-divider {
    margin: 32px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.google-login-container {
    margin-top: 16px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.google-login-btn-custom {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #1e293b;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.google-login-btn-custom:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.google-icon {
    width: 24px;
    height: 24px;
}

.auth-footer {
    margin-top: 40px;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .auth-card {
        flex-direction: column;
        border-radius: 24px;
    }

    .auth-illustration {
        min-height: 180px;
    }
    
    .auth-card-wrapper {
        padding: 10px;
    }

    .auth-illustration::after {
        background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.95));
    }

    .auth-body {
        padding: 40px 20px;
    }

    .auth-title-large {
        font-size: 1.75rem;
    }
    
    .auth-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-actions {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .remember-me {
        justify-content: center;
        width: 100%;
    }

    .auth-body {
        padding: 30px 15px;
    }
    
    .auth-title-large {
        font-size: 1.5rem;
    }

    .auth-illustration {
        display: none;
    }
}

/* =============================================
   2. MAIN LAYOUT (SIDEBAR & CONTENT)
   ============================================= */

.app-container {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.85)), url('assets/finance-bg.jpg') no-repeat center center fixed;
    background-size: cover;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 12px;
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
}

.logo span {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-header);
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    margin-bottom: 6px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.user-profile {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-header);
}

/* =============================================
   3. DASHBOARD & COMPONENTS
   ============================================= */

.main-content {
    flex-grow: 1;
    padding: 48px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.greeting h1 {
    font-size: 2rem;
    margin-bottom: 6px;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.greeting p {
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.stat-card {
    border-top: 4px solid var(--border);
}

.stat-card.balance {
    border-top-color: var(--primary);
}

.stat-card.income {
    border-top-color: var(--success);
}

.stat-card.expense {
    border-top-color: var(--danger);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-header);
}

.date-display {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.date-display i {
    color: var(--primary);
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.5));
}

.live-time {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.live-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-left: 2px solid var(--border);
    padding-left: 14px;
    margin-left: 2px;
}

/* Table Styling */
.table-card {
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Dashboard Table Color Accents */
.dashboard-tables-grid .table-card:nth-child(1) {
    border-top: 4px solid var(--primary);
}

.dashboard-tables-grid .table-card:nth-child(2) {
    border-top: 4px solid var(--success);
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.card-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-header);
}

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

th {
    text-align: left;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.5);
    color: #cbd5e1;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

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

/* =============================================
   4. NEW DASHBOARD COMPONENTS (CHARTS & GRIDS)
   ============================================= */

.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

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

.chart-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-header);
}

.chart-select {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}

.canvas-wrapper {
    flex-grow: 1;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.view-all-btn {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.view-all-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* Components */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateY(-2px);
}

.action-btn.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.5);
}

.action-btn.btn-edit:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.5);
}

/* Search Box Styling */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 16px;
    height: 48px;
    transition: all 0.3s ease;
}

.search-box i {
    color: var(--text-muted);
    font-size: 1rem;
    margin-right: 12px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    width: 250px;
    outline: none;
}

.search-box:focus-within {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.search-box:focus-within i {
    color: var(--primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.type-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.type-badge.income {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.type-badge.expense {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    padding: 32px;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-header);
    letter-spacing: 0.02em;
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--danger);
    color: white;
}

/* Modal Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group > input,
.form-group > select,
.form-group > .input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
    color: #475569;
    font-weight: 500;
}

.form-group select option {
    background: #0f172a;
    color: var(--text-main);
}

/* Confirmation Modal Specifics */
.confirm-content {
    max-width: 400px;
    text-align: center;
    padding: 40px 32px;
}

#confirmTitle {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-header);
    margin-bottom: 12px;
}

#confirmMessage {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 32px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* =============================================
   5. BUDGET MANAGEMENT & OTHER VIEWS
   ============================================= */

.budget-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.budget-form-card {
    padding: 24px 32px;
}

.budget-form-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-header);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

#budgetForm {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

#budgetForm .form-group {
    margin-bottom: 0;
    flex: 1;
}

#budgetForm .form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#budgetForm .form-group input,
#budgetForm .form-group select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.2s ease;
    outline: none;
}

#budgetForm .form-group input:focus,
#budgetForm .form-group select:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#budgetForm .btn-primary {
    height: 48px;
    padding: 0 32px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* =============================================
   6. FINANCIAL REPORTS VIEW
   ============================================= */

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.report-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Different color accents for different report cards */
.report-card:nth-child(1) {
    border-top: 4px solid var(--primary);
}

.report-card:nth-child(2) {
    border-top: 4px solid var(--success);
}

.report-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.report-card:nth-child(1) .report-icon {
    color: var(--primary);
}

.report-card:nth-child(2) .report-icon {
    color: var(--success);
}

.report-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-header);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.report-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.export-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.export-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.export-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.export-group input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

.export-group input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
}

/* Cash Flow "Table Format" Layout */
.cash-flow-summary {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-top: auto;
}

.flow-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.flow-item:last-child {
    border-right: none;
}

.flow-item span {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.flow-item h4 {
    font-size: 1.25rem;
    font-weight: 800;
}

.flow-item:nth-child(1) h4 {
    color: var(--success);
}

.flow-item:nth-child(2) h4 {
    color: var(--danger);
}

.flow-item:nth-child(3) h4 {
    color: #38bdf8;
}

/* Net Savings */

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Fix view sections to not overlap if they are transitioning */
.view-section {
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   7. ACCOUNT SETTINGS VIEW
   ============================================= */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 32px;
}

.settings-card {
    padding: 32px;
}

.settings-card:nth-child(1) {
    border-top: 4px solid var(--primary);
}

.settings-card:nth-child(2) {
    border-top: 4px solid #a855f7;
}

/* Purple accent */

.settings-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-header);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-avatar-container {
    position: relative;
    width: 110px;
    height: 110px;
}

.profile-avatar-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar-container:hover img {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.5);
}

.avatar-edit-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #0f172a;
    transition: all 0.2s ease;
    z-index: 10;
}

.avatar-edit-badge:hover {
    transform: scale(1.15);
    background: #4f46e5;
}

.profile-meta h2 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.profile-meta p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.control-meta label {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.control-meta p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--success);
    border-color: var(--success);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.cyber-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    outline: none;
}

.cyber-select:focus {
    border-color: var(--primary);
}

.settings-footer {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
}

.logout-btn-large {
    width: 100%;
    max-width: 350px;
    padding: 18px 36px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(225, 29, 72, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logout-btn-large:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(225, 29, 72, 0.6);
    filter: brightness(1.2);
}

.logout-btn-large i {
    font-size: 1.2rem;
}

/* =============================================
   8. REPORTS VIEW ENHANCEMENTS
   ============================================= */

.reports-table-section {
    margin-top: 32px;
    padding: 32px;
}

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

.reports-table-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-header);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-summary-pills {
    display: flex;
    gap: 16px;
}

.summary-pill {
    padding: 12px 24px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.summary-pill .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.summary-pill .value {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.summary-pill.inflow .value {
    color: var(--success);
}

.summary-pill.outflow .value {
    color: var(--danger);
}

.summary-pill.net .value {
    color: #38bdf8;
}

.reports-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

#reportsTransactionTable {
    width: 100%;
    border-collapse: collapse;
}

#reportsTransactionTable th {
    position: sticky;
    top: 0;
    background: #0f172a;
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    border-bottom: 2px solid var(--border);
    z-index: 10;
}

#reportsTransactionTable td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

#reportsTransactionTable tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }

    .logo span,
    .nav-item span,
    .user-info {
        display: none;
    }

    .main-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px;
    }

    .nav-item {
        margin-bottom: 0;
    }

    #mainNav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }
}
/* =============================================
   9. GOOGLE SETUP UI (MINIMAL & GUIDED)
   ============================================= */

.google-setup-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.4));
}

.setup-header {
    text-align: center;
    margin-bottom: 30px;
}

.setup-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 8px;
}

.setup-header p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.setup-steps {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 500;
}

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

.step-num {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.step a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.step a:hover {
    text-decoration: underline;
}

/* Loading State for Buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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