:root {
    /* Color Palette - Light Theme */
    --bg-main: #fcfdfe;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-accent: #f1f5f9;
    --primary: #0f172a;
    --text-on-primary: #ffffff;
    --secondary: #3b82f6;
    --accent: #22d3ee;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border-subtle: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --font-main: 'Outfit', sans-serif;
    --sidebar-width: 280px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-lg: 24px;
    --radius-md: 16px;
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-surface: #0f172a;
    --bg-sidebar: #0f172a;
    --bg-accent: #1e293b;
    --primary: #f8fafc;
    --text-on-primary: #020617;
    --secondary: #3b82f6;
    --accent: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling - Clean & Minimal */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 3rem 0;
    z-index: 10;
}

.logo {
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4rem;
}

.logo-icon {
    background: var(--primary);
    color: var(--text-on-primary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--primary);
}

.nav-menu {
    flex: 1;
    padding: 0 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-accent);
    color: var(--secondary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-on-primary);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1);
}

.nav-item .material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 300;
}

.nav-item.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 300;
}

.nav-profile {
    padding: 1.5rem;
    margin: 0 1.5rem;
    background: var(--bg-accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 500;
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    overflow: hidden;
    /* Prevent body-level scroll */
    padding: 2rem 3rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.search-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 400px;
    box-shadow: var(--shadow-sm);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.add-transaction-btn {
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.add-transaction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(15, 23, 42, 0.4);
}

.notif-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dashboard Content */
.view-content {
    display: none;
    height: 100%;
    flex-direction: column;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-content.active {
    display: flex;
}

.view-content canvas {
    flex: 1;
    min-height: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.view-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Stats Grid - Compact */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    margin-top: 1rem;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-accent);
}

.stat-change.positive {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.stat-change.warning {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    font-size: 0.72rem;
}

/* Graphs Area */
.graphs-section {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    height: 380px;
    /* Fixed height for stability */
    flex-shrink: 0;
}

.chart-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-shrink: 0;
}

.deficit-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    animation: shake 0.6s cubic-bezier(.36, .07, .19, .97) both;
    flex-shrink: 0;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.chart-header h3 {
    font-weight: 700;
    font-size: 1.2rem;
}

.chart-period {
    display: flex;
    background: var(--bg-accent);
    padding: 5px;
    border-radius: 12px;
}

.chart-period button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.chart-period button.active {
    background: var(--bg-surface);
    color: var(--secondary);
    box-shadow: var(--shadow-md);
}

/* Recent Activities */
.bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    flex: 1;
    /* Occupy remaining space dynamically */
    min-height: 0;
}

.recent-transactions {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.transaction-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.transaction-item:last-child {
    border-bottom: none;
}

/* Full Transactions View UX */
.filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box.mini {
    width: 250px;
    padding: 8px 16px;
}

.filter-bar select {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.transactions-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 1rem;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    padding: 20px 30px;
    background: var(--bg-accent);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
}

.transaction-list-full {
    flex: 1;
    overflow-y: auto;
}

.transaction-list-full .transaction-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    padding: 20px 30px;
    align-items: center;
    transition: var(--transition-smooth);
    border-bottom: 1px solid var(--border-subtle);
}

.transaction-list-full .transaction-item:hover {
    background: var(--bg-accent);
}

.col-amount {
    font-weight: 700;
    text-align: right;
}

.type-pill {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-pill.income {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.type-pill.expense {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.delete-btn:hover {
    color: var(--danger);
}

/* Categories UI Enhancements */
.view-switcher {
    display: flex;
    background: var(--bg-accent);
    padding: 4px;
    border-radius: 12px;
}

.view-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

.view-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.cat-stats-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.cat-stat-mini {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.cat-stat-mini .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cat-stat-mini .value {
    font-size: 1.4rem;
    font-weight: 700;
}

.add-cat-inline {
    margin-left: auto;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.add-cat-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.categories-container {
    display: grid;
    gap: 1.5rem;
    height: calc(100vh - 350px);
    overflow-y: auto;
    padding-bottom: 2rem;
}

.categories-container.grid-mode {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.categories-container.list-mode {
    grid-template-columns: 1fr;
}

.cat-card-modern {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
}

.cat-card-modern:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: var(--shadow-premium);
}

.grid-mode .cat-card-modern {
    flex-direction: column;
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.cat-icon-lg {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.cat-details {
    flex: 1;
}

.cat-details h4 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.cat-type-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.cat-edit-hint {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.cat-card-modern:hover .cat-edit-hint {
    opacity: 1;
    color: var(--secondary);
}

.tr-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tr-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tr-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.tr-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tr-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Goals Styling - Minimal Progress */
.goals-progress {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow-y: auto;
}

.goal-item {
    margin-top: 1.2rem;
}

.goal-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: var(--bg-accent);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary);
    /* Glowing effect in Dark Mode */
}

/* Modals - Clean Overlays */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-surface);
    margin: 4rem auto;
    padding: 3.5rem;
    width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 32px;
    top: 32px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-group input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.05);
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition-smooth);
}

.color-swatch.selected {
    border-color: var(--primary);
    transform: scale(1.1);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-accent);
    border-radius: var(--radius-md);
}

.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    background: var(--bg-surface);
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.icon-option:hover {
    background: var(--bg-accent);
    color: var(--primary);
}

.icon-option.selected {
    background: var(--primary);
    color: var(--text-on-primary);
}

/* --- Categories View Layout --- */
.categories-container {
    display: grid;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.categories-container.grid-mode {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.categories-container.list-mode {
    grid-template-columns: 1fr;
}

.cat-card-modern {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cat-card-modern:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-premium);
}

.cat-icon-lg {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-type-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.cat-details h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 5px;
}

.cat-edit-hint {
    opacity: 0;
    transition: 0.3s;
    color: var(--text-muted);
}

.cat-card-modern:hover .cat-edit-hint {
    opacity: 1;
}

.cat-stats-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.cat-stat-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-stat-mini .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.cat-stat-mini .value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.add-cat-inline {
    margin-left: auto;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.add-cat-inline:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.cat-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin: 0 auto 1.5rem;
}

/* Simulator View Enhancements */
.simulator-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem;
    height: calc(100vh - 250px);
}

.simulator-controls {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.simulator-controls h3 {
    margin-bottom: 2rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-slider-group {
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-accent);
}

.sim-slider-group:last-child {
    border-bottom: none;
}

.sim-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sim-cat-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.sim-cat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.slider-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}

.sim-slider {
    width: 100%;
    height: 8px;
    appearance: none;
    background: var(--bg-accent);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.sim-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: 4px solid var(--bg-surface);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.sim-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--secondary);
}

.simulator-result {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2.2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

[data-theme="dark"] .result-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.result-card h3 {
    opacity: 0.7;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text-secondary);
}

.result-value {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 12px;
    line-height: 1;
}

#sim-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    display: inline-block;
    padding: 6px 16px;
    border-radius: 12px;
    width: fit-content;
}

[data-theme="dark"] #sim-status {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.sim-chart-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    border-radius: var(--radius-lg);
    flex: 1;
    min-height: 300px;
}

/* Custom Scrollbar - Clean */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Goals View Grid & Cards --- */
.goals-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
    overflow-y: auto;
    flex: 1;
}

.goal-card-premium {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.goal-card-premium:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    background: var(--bg-accent);
}

.goal-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--goal-color, var(--secondary));
}

.goal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.goal-title-group h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.goal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.goal-actions-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px;
    border-radius: 8px;
}

.goal-actions-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.goal-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.goal-mini-stat {
    display: flex;
    flex-direction: column;
}

.goal-mini-stat label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.goal-mini-stat span {
    font-weight: 700;
    font-size: 1.1rem;
}

.goal-progress-section {
    margin-top: 0.5rem;
}

.goal-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.goal-progress-bar-lg {
    height: 12px;
    background: var(--bg-accent);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.goal-progress-fill {
    height: 100%;
    background: var(--goal-color, var(--secondary));
    border-radius: 20px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.goal-annual-projection-card {
    background: rgba(15, 23, 42, 0.03);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--goal-color, var(--secondary));
}

[data-theme="dark"] .goal-annual-projection-card {
    background: rgba(255, 255, 255, 0.03);
}

.projection-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 2px;
    display: block;
}

.projection-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.delete-goal {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.3;
    transition: var(--transition-smooth);
}


.delete-goal:hover {
    opacity: 1;
}

/* --- Goal Allocation UI --- */
#goal-allocation-group {
    transition: var(--transition-smooth);
    animation: slideDown 0.3s ease;
}

#tr-save-to-goal {
    accent-color: var(--secondary);
    cursor: pointer;
}

#goal-allocation-group label {
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

#tr-target-goal {
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

/* --- Notifications --- */
.notification-wrapper {
    position: relative;
    display: inline-block;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 320px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-subtle);
    display: none;
    z-index: 1100;
    padding: 1.5rem;
    animation: slideDown 0.3s ease;
}

.notif-dropdown.active {
    display: block;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-accent);
}

.notif-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

#clear-notifs {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-accent);
}

.notif-item:last-child {
    border: none;
}

.notif-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-content p {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 3px;
    line-height: 1.4;
}

.notif-content span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Category Budget Progress --- */
.cat-budget-progress {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--bg-accent);
}

.budget-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.budget-spent {
    color: var(--text-primary);
}

.budget-total {
    color: var(--text-muted);
}

.budget-bar {
    height: 6px;
    background: var(--bg-accent);
    border-radius: 10px;
    overflow: hidden;
}

.budget-fill {
    height: 100%;
    transition: width 1s ease;
}

.budget-over {
    color: var(--danger) !important;
}

/* --- Selectors --- */
.small-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
}

.small-select:focus {
    border-color: var(--primary);
}

/* --- Category Delete Button --- */
.delete-btn-full {
    width: 100%;
    margin-top: 15px;
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.delete-btn-full:hover {
    background: var(--danger);
    color: white;
}

/* --- RESPONSIVE DESIGN --- */

.mobile-only {
    display: none;
}

/* Tablet & Mobile Consolidation */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: -100%;
        /* Fully hidden above */
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        z-index: 3000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 4rem 2rem;
        transition: top 0.6s cubic-bezier(0.85, 0, 0.15, 1);
        border-right: none;
    }

    .sidebar.active {
        top: 0;
    }

    .sidebar-header {
        position: absolute;
        top: 2rem;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
        width: 100%;
        margin-bottom: 0;
    }

    .sidebar-header .logo span,
    .sidebar-header .logo .logo-icon,
    #close-mobile-nav {
        color: white;
    }

    #close-mobile-nav {
        background: rgba(255, 255, 255, 0.1);
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        padding: 0;
    }

    .nav-item {
        font-size: 1.8rem;
        color: rgba(255, 255, 255, 0.6);
        padding: 1rem 2rem;
        width: 100%;
        max-width: 300px;
        justify-content: center;
        margin: 0;
        border-radius: 20px;
    }

    .nav-item.active {
        color: white;
        background: var(--secondary);
        box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
    }

    .nav-item .material-symbols-rounded {
        font-size: 2.2rem;
    }

    .nav-profile {
        position: absolute;
        bottom: 3rem;
        left: 2rem;
        right: 2rem;
        width: auto;
        margin: 0;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: white;
    }

    .avatar {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        border-color: rgba(255, 255, 255, 0.2);
    }

    .main-content {
        padding: 1.5rem;
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
    }

    .mobile-only {
        display: flex;
    }

    .mobile-hide {
        display: none !important;
    }

    #open-mobile-nav {
        background: var(--bg-surface);
        border: 1px solid var(--border-subtle);
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-sm);
        cursor: pointer;
    }

    .top-bar {
        display: grid;
        grid-template-areas:
            "burger actions"
            "search search";
        grid-template-columns: auto 1fr;
        gap: 1.2rem;
        align-items: center;
        margin-bottom: 2.5rem;
    }

    #open-mobile-nav {
        grid-area: burger;
    }

    .header-actions {
        grid-area: actions;
        justify-content: flex-end;
        width: 100%;
    }

    .search-box {
        grid-area: search;
        width: 100%;
    }

    .graphs-section {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chart-container {
        height: 350px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1.5rem auto;
        padding: 2.5rem 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .stat-value {
        font-size: 2.2rem;
    }

    .stat-card {
        padding: 2rem;
    }

    .add-transaction-btn {
        position: fixed;
        bottom: 2.5rem;
        right: 1.5rem;
        width: 64px;
        height: 64px;
        border-radius: 20px;
        padding: 0;
        justify-content: center;
        z-index: 100;
        box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
    }

    .add-transaction-btn span:not(.material-symbols-rounded) {
        display: none;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styling Improvements */
.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-accent);
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--secondary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    border-color: rgba(255, 255, 255, 0.05);
}

/* Fix for Category Select visibility */
#tr-category {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* --- Auth Overlay & Premium Login --- */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

.auth-overlay.active {
    display: flex;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 32px;
    padding: 3.5rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.auth-header {
    text-align: center;
    margin-bottom: 3rem;
}

.auth-logo {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
    color: var(--primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.auth-toggle {
    display: flex;
    background: var(--bg-accent);
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    gap: 4px;
}

.auth-toggle button {
    flex: 1;
    border: none;
    background: none;
    padding: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 12px;
    transition: var(--transition-smooth);
    color: var(--text-muted);
}

.auth-toggle button.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.auth-form .form-group {
    margin-bottom: 1.8rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .material-symbols-rounded {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 1.4rem;
    transition: var(--transition-smooth);
}

.input-with-icon input {
    width: 100%;
    padding: 18px 18px 18px 52px !important;
    border-radius: 16px !important;
}

.input-with-icon input:focus+.material-symbols-rounded {
    color: var(--secondary);
}

.auth-submit-btn {
    width: 100%;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 1.2rem;
    border-radius: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 1rem;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.2);
}

.auth-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.3);
}

.auth-footer {
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    opacity: 0.8;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Auth responsive tweaks */
@media (max-width: 480px) {
    .auth-card {
        padding: 2.5rem 1.5rem;
        border-radius: 24px;
    }

    .auth-header h1 {
        font-size: 1.8rem;
    }
}