﻿:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-primary: #7000ff;
    --accent-secondary: #9d4eff;
    --accent-success: #00ffaa;
    --accent-danger: #ff0055;

    /* Background Specific Accents */
    --bg-accent-1: #4d00ff;
    --bg-accent-2: #00d4ff;
    --bg-accent-3: #ff00c8;
    --bg-accent-4: #7000ff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-main: 'Outfit', sans-serif;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    padding: 0;
}

/* Background Environment */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: #000000;
}

/* Base Noise Overlay */
.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.015;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    mix-blend-mode: screen;
    animation: moveBlob 25s infinite ease-in-out alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--bg-accent-1);
    top: -200px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--bg-accent-2);
    bottom: -100px;
    right: -100px;
    animation-duration: 30s;
    animation-delay: -5s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    background: var(--bg-accent-3);
    top: 20%;
    right: 15%;
    animation-duration: 35s;
    animation-delay: -10s;
}

.blob-4 {
    width: 550px;
    height: 550px;
    background: var(--bg-accent-4);
    bottom: 15%;
    left: 5%;
    animation-duration: 40s;
    animation-delay: -15s;
}

@keyframes moveBlob {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(100px, 50px) scale(1.1) rotate(120deg);
    }

    66% {
        transform: translate(-50px, 150px) scale(0.9) rotate(240deg);
    }

    100% {
        transform: translate(50px, -80px) scale(1) rotate(360deg);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 16px 16px 16px;
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 8px 32px 0 rgba(112, 0, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Header Redesign */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.report-card h4 {
    font-variant-numeric: tabular-nums;
}

#view-dashboard {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.app-version {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.by-line {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 8px;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.neon-icon {
    font-size: 1.4rem;
    color: var(--accent-success);
    filter: drop-shadow(0 0 5px var(--accent-success));
}

/* Feature Buttons (Gig, Vault) */
.feature-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    color: var(--text-secondary);
}

.feature-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.feature-btn:hover::before {
    opacity: 1;
}

.feature-btn i {
    font-size: 1.4rem;
    position: relative;
    z-index: 2;
    transition: transform 0.3s;
}

/* Feature Specifics */
#gig-job-btn i {
    color: #00d4ff;
    filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.4));
}

#gig-job-btn:hover {
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.25);
    border-color: rgba(0, 212, 255, 0.4);
}

#gig-job-btn:hover i {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.8));
}

#gig-settings-btn i {
    color: var(--text-secondary);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s;
}

#gig-settings-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

#gig-settings-btn:hover i {
    color: #fff;
    transform: rotate(90deg);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

#loan-vault-btn i {
    color: #ff0055;
    filter: drop-shadow(0 0 5px rgba(255, 0, 85, 0.4));
}

#loan-vault-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 0, 85, 0.25);
    border-color: rgba(255, 0, 85, 0.4);
}

#loan-vault-btn:hover i {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px rgba(255, 0, 85, 0.8));
}

.highlight {
    color: var(--accent-primary);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Grid Layout */
.dashboard-grid {
    flex: 1;
    min-height: 0;
    display: grid;

    grid-template-columns: 320px 1fr 340px;
    grid-template-rows: auto minmax(0, 1fr);
    /* Adjusted for Creative 3 Column Layout: Form | Dashboard | History */
    grid-template-areas:
        "form balance history"
        "form chart   history";
    gap: 16px;
}

@media (max-width: 1024px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .app-container {
        height: auto;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "balance"
            "form"
            "chart"
            "history";
    }
}

/* Typography Headings in Panels */
h3 {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Balance Card */
.balance-card {
    grid-area: balance;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-width: 0;
    text-align: center;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.balance-header h3 {
    margin-bottom: 0;
    font-size: 0.9rem;
}



/* Custom Filter Dropdown */
.custom-filter {
    position: relative;
    z-index: 50;
}

.filter-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.filter-trigger:hover,
.custom-filter.active .filter-trigger {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-options {
    position: absolute;
    top: 120%;
    right: 0;
    width: 140px;
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    list-style: none;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-filter.active .filter-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-options li {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
}

.filter-options li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-options li.active {
    color: var(--accent-primary);
    background: rgba(112, 0, 255, 0.1);
}

.balance-card {
    grid-area: balance;
}

.balance-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 5px 0 10px 0;
    /* Reduced margin-bottom due to trend indicator */
    background: linear-gradient(90deg, #fff, #a0a0b0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.trend-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 2px 10px;
    border-radius: 20px;
    width: fit-content;
}

.trend-indicator.hidden {
    display: none;
}

.trend-indicator.positive {
    background: rgba(0, 255, 170, 0.1);
    color: var(--accent-success);
}

.trend-indicator.negative {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-danger);
}

.trend-indicator.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.balance-details {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
    margin-top: 10px;
}

.detail-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: flex-start;
    /* Align left */
    background: rgba(255, 255, 255, 0.02);
    /* Subtle background for each row */
    padding: 10px;
    border-radius: 12px;
}

.detail-item .icon-box {
    width: 36px;
    /* Slightly smaller */
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    /* Prevent shrinking */
    background: rgba(255, 255, 255, 0.05);
}

.detail-item.income .icon-box {
    color: var(--accent-success);
    background: rgba(0, 255, 170, 0.1);
}

.detail-item.expense .icon-box {
    color: var(--accent-danger);
    background: rgba(255, 0, 85, 0.1);
}

.detail-item div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    /* Contain text */
}

.detail-item span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.detail-item p {
    font-size: 0.95rem;
    /* Smaller font */
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.icon-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.income .icon-box {
    color: var(--accent-success);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.1);
}

.expense .icon-box {
    color: var(--accent-danger);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.1);
}

.detail-item>div {
    min-width: 0;
    overflow: hidden;
}

/* Labels */
.detail-item span {
    font-size: 0.8rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 2px;
}

.income span {
    color: var(--accent-success);
}

.expense span {
    color: var(--accent-danger);
}

/* Numbers */
.detail-item p {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.income p {
    color: var(--accent-success);
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.expense p {
    color: var(--accent-danger);
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}


/* Chart Section */
.chart-section {
    grid-area: chart;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chart-header h3 {
    margin-bottom: 0;
}

.chart-toggles {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.toggle-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.history-section {
    grid-area: history;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-section h3 {
    flex-shrink: 0;
}

.transaction-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    /* Space for scrollbar */
}

.chart-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    min-height: 0;
    min-width: 0;
    /* Important for Chart.js resizing */
    overflow: hidden;
    /* Prevent canvas overflow */
}

/* Fullscreen Chart Mode */
.chart-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5000;
    background: rgba(15, 15, 19, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0;
    padding: 24px;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.chart-section.fullscreen .chart-container {
    height: 100% !important;
    max-height: none;
    padding-bottom: 20px;
}

.chart-section.fullscreen .chart-header {
    margin-bottom: 24px;
}

/* Chart Legend (Visible primarily in Fullscreen) */
/* Chart Legend */
.chart-legend:empty {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.chart-legend {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Show in Fullscreen (All Modes) */
.chart-section.fullscreen .chart-legend {
    display: grid;
}

/* Show in Specific Account (Normal View) - Compact Mode */
body:not(.all-accounts-mode) .chart-section:not(.fullscreen) .chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    max-height: 100px;
    overflow-y: auto;
}

body:not(.all-accounts-mode) .chart-section:not(.fullscreen) .legend-item {
    font-size: 0.8rem;
    /* Smaller font for compact view */
}

/* Hide ONLY legend in specific account view (unless fullscreen) */
body:not(.all-accounts-mode) .chart-section:not(.fullscreen) .chart-legend {
    display: none !important;
}

body:not(.all-accounts-mode) .chart-section:not(.fullscreen) .legend-dot {
    width: 8px;
    height: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-value {
    margin-left: auto;
    color: var(--text-primary);
    font-weight: 500;
}



/* Form Section */
.form-section {
    grid-area: form;
    overflow-y: auto;
    padding: 12px;
    /* Compact padding */
    display: flex;
    flex-direction: column;
}

.form-section h3 {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 6px;
    /* Reduced margin */
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 2px;
    /* Reduced from 4px */
    color: var(--text-secondary);
    font-size: 0.8rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    /* Reduced from 12px */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    /* Slightly smaller font */
    font-family: inherit;
    transition: 0.2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Date Picker Icon Color */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Hide Spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input:focus {
    outline: none;
    border-color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(112, 0, 255, 0.2);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z' fill='rgba(255,255,255,0.5)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

select option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Segmented Control */
.segmented-control-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.segmented-control {
    display: flex;
    position: relative;
    width: 100%;
}

.segmented-control input {
    display: none;
}

.segment-label {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
    transition: 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Glider Logic */
.segment-glider {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: var(--accent-success);
    border-radius: var(--radius-md);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 255, 170, 0.3);
}

/* Logic for sliding */
#type-expense:checked~.segment-glider {
    transform: translateX(100%);
    background: var(--accent-danger);
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

/* Text Active States */
#type-income:checked+.segment-label {
    color: #000;
}

#type-expense:checked+.segment-label {
    color: #fff;
}

.segment-label i {
    font-size: 1.1rem;
}

/* Hero Amount Input */
.hero-input-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.currency-symbol {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: -4px;
}

.hero-amount-input {
    width: auto;
    max-width: 100%;
    background: transparent !important;
    border: none !important;
    font-size: 3rem !important;
    font-weight: 700;
    color: #fff !important;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.hero-amount-input::placeholder {
    color: rgba(255, 255, 255, 0.1);
}

/* Date Input Styled */
.date-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-input-container i {
    color: var(--text-secondary);
}

.date-input-container input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: auto;
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
    font-family: var(--font-main);
}


.cta-btn {
    width: 100%;
    padding: 10px;
    /* Compact padding */
    background: linear-gradient(135deg, var(--accent-primary), #9d4eff);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.4);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(112, 0, 255, 0.6);
}

.cta-btn:active {
    transform: translateY(0);
}

.cta-btn.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    box-shadow: none;
    margin-top: 12px;
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    box-shadow: none;
}

/* History Section */
.history-section {
    grid-area: history;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.transaction-list {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 6px;
    max-height: none;
}

/* Custom Select Component (Replaces Native Select) */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-select-trigger.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(112, 0, 255, 0.2);
}

.custom-select-options {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 6px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 200px;
    overflow-y: auto;
}

.custom-select-container.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.custom-option.selected {
    background: rgba(112, 0, 255, 0.1);
    color: var(--accent-primary);
    font-weight: 600;
}

/* Custom Scrollbar */
/* Custom Scrollbar */
/* Replaced by Global Scrollbar Theme below */

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 4px solid transparent;
    transition: 0.2s;
    animation: slideIn 0.4s ease-out forwards;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.transaction-item.income {
    border-left-color: var(--accent-success);
}

.transaction-item.expense {
    border-left-color: var(--accent-danger);
}


.info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.info small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Explicit Neutral Colors for list items */
.tx-cat {
    color: #fff !important;
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.tx-date {
    color: var(--text-secondary) !important;
    font-size: 0.75rem;
    display: block;
}

/* Editing Glow Effect */
@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px var(--accent-primary);
        border-color: var(--accent-primary);
    }

    50% {
        box-shadow: 0 0 15px var(--accent-primary);
        border-color: rgba(157, 78, 255, 0.6);
    }

    100% {
        box-shadow: 0 0 5px var(--accent-primary);
        border-color: var(--accent-primary);
    }
}

.editing-active {
    animation: glowPulse 1.5s infinite alternate;
    background: rgba(157, 78, 255, 0.1) !important;
    border-left-color: var(--accent-primary) !important;
}

.amount {
    font-weight: 700;
    font-size: 1rem;
    margin-left: auto;
    padding-right: 20px;
}

.income .amount {
    color: var(--accent-success);
}

.expense .amount {
    color: var(--accent-danger);
}

.edit-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: 0.2s;
    opacity: 0;
    margin-right: 4px;
}

.transaction-item:hover .edit-btn {
    opacity: 1;
}

.edit-btn:hover {
    background: rgba(0, 255, 170, 0.2);
    color: var(--accent-success);
}

.delete-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: 0.2s;
    opacity: 0;
}

.transaction-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(255, 0, 85, 0.2);
    color: var(--accent-danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category Icon Slider */
.category-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    padding: 10px 4px 0 0;
    /* Add right padding space for scrollbar to avoid overlap */
    max-height: 210px;
    /* Show ~3 rows roughly */
    overflow-y: auto;
}

/* Custom Scrollbar for container if needed */
/* Removed specific scrollbar styles to use global theme */

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
    cursor: pointer;
    transition: 0.3s;
    min-width: 60px;
}

.cat-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.cat-item:hover .cat-icon {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) rotate(-5deg);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.cat-item.active {
    color: #fff;
    font-weight: 600;
}

.cat-item.active .cat-icon {
    background: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 18px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    transform: translateY(-4px) scale(1.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cat-item span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: 0.3s;
}

.cat-item.active span {
    color: #fff;
    font-weight: 600;
}

/* Footer */
.app-footer {
    display: none;
    text-align: center;
    padding: 10px 0 5px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    z-index: 2005;
}

.profile-trigger {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.profile-trigger:hover,
.profile-dropdown.active .profile-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.2);
}

.profile-menu {
    position: absolute;
    top: 120%;
    right: 0;
    width: 200px;
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 8px;
    display: none;

    /* Toggle Switch */
    .toggle-switch-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        margin-top: 16px;
        cursor: pointer;
        transition: background 0.3s;
    }

    .toggle-switch-container:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .toggle-label {
        display: flex;
        flex-direction: column;
    }

    .toggle-label span {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .toggle-label small {
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .toggle-input {
        display: none;
    }

    .toggle-slider {
        position: relative;
        width: 44px;
        height: 24px;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        transition: 0.3s;
    }

    .toggle-slider::before {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        background-color: white;
        border-radius: 50%;
        top: 3px;
        left: 3px;
        transition: 0.3s;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .toggle-input:checked+.toggle-slider {
        background-color: var(--accent-primary);
    }

    .toggle-input:checked+.toggle-slider::before {
        transform: translateX(20px);
    }

    transform: translateY(-10px);
}

.profile-dropdown.active .profile-menu {
    display: block;
    /* Force show */
    transform: translateY(0);
    animation: fadeInMenu 0.2s ease-out forwards;
}

@keyframes fadeInMenu {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 0.9rem;
    font-family: var(--font-main);
    text-align: left;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.menu-item.danger:hover {
    background: rgba(255, 0, 85, 0.1);
    color: var(--accent-danger);
}

.menu-section {
    padding: 10px;
}

.menu-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.currency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Changed to 3 columns for 6 items */
    gap: 4px;
}

.currency-btn {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}

.currency-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

#app-close-btn {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.icon-btn.danger-hover:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.3);
}

.currency-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    font-weight: 700;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Modal Overlay */
/* --- PREMIUM MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10005;
    /* Consistent High Z-Index */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(20, 20, 25, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 40px rgba(112, 0, 255, 0.15);
    /* Subtle purple glow */
}

/* Modal Typography */
.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.5px;
}

.modal-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px !important;
    line-height: 1.5;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.modal-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    margin-left: 4px;
}

.modal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    outline: none;
}

.modal-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(112, 0, 255, 0.1);
}

.modal-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.modal-btn {
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-main);
}

/* Primary Action (Log In) */
.modal-btn.confirm {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.3);
}

.modal-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(112, 0, 255, 0.5);
}

.modal-btn.confirm:active {
    transform: translateY(0);
}

/* Secondary Action (Cancel/Toggle) */
.modal-btn.cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Danger Action */
.modal-btn.danger {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: var(--accent-danger);
}

.modal-btn.danger:hover {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.duration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.duration-grid button {
    width: 100%;
}

/* Report Display Modal */
.report-modal-content {
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.report-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--glass-border);
}

.report-summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding: 24px;
}

.report-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.report-card span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.report-card h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

.trend-badge {
    font-size: 0.75rem;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-badge.positive {
    background: rgba(0, 255, 170, 0.1);
    color: var(--accent-success);
}

.trend-badge.negative {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-danger);
}

.report-insights-container {
    padding: 0 24px 24px;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.insight-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.insight-item span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.insight-item h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}



.report-card.balance h4 {
    color: #fff;
}

.report-card.income h4 {
    color: var(--accent-success);
}

.report-card.expense h4 {
    color: var(--accent-danger);
}

.report-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
    /* content padding */
}

.report-section-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    background: rgba(15, 15, 19, 0.95);
    /* match modal bg */
    padding: 8px 0;
    z-index: 10;
}

.report-modal-content .modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    margin-top: 0 !important;
}

.modal-warning {
    color: var(--accent-danger);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: #fff;
    font-size: 1rem;
    transition: 0.3s;
}

.modal-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(112, 0, 255, 0.2);
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.modal-btn:disabled,
.modal-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.8);
}

.modal-btn.cancel {
    background: transparent;
    color: var(--text-secondary);
}

.modal-btn.cancel:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-btn.confirm {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.4);
}

.modal-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.6);
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    min-width: 280px;
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition: 0.3s;
}

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast.success {
    border-left: 4px solid var(--accent-success);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: var(--accent-success);
}

.toast.error i {
    color: var(--accent-danger);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Improved Toggle Visibility */
.hidden {
    display: none !important;
}

/* Custom Category Input Animation */
.custom-cat-input {
    width: 100%;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    height: 46px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 12px;
    overflow: hidden;
}

.custom-cat-input.collapsed {
    opacity: 0;
    transform: translateY(-10px);
    height: 0;
    padding: 0;
    margin-top: 0;
    border: none;
    pointer-events: none;
}

/* Planning Modal Styles */
.planning-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--accent-neutral);
}

.planning-item.expense {
    border-left-color: var(--accent-danger);
}

.planning-item.income {
    border-left-color: var(--accent-success);
}

.planning-item .info h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.planning-item .info small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.planning-item .amount {
    font-weight: 600;
    margin-right: 10px;
}

.delete-plan-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
}

.delete-plan-btn:hover {
    color: var(--accent-danger);
}

.pay-plan-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
    margin-right: 8px;
}

.pay-plan-btn:hover {
    color: var(--accent-success);
}

/* Upcoming / History List Styles */
.list-header {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 15px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.upcoming-item {
    border-left-style: dashed !important;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.02);
}

.upcoming-item:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.pay-btn-small {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 5px;
    transition: 0.2s;
    border-radius: 50%;
}

.pay-btn-small:hover {
    color: var(--accent-success);
    background: rgba(0, 255, 170, 0.1);
}


@keyframes menuSlide {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.menu-section {
    padding: 12px;
}

.menu-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}

.currency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.currency-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.currency-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.currency-btn.active {
    background: rgba(112, 0, 255, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    text-decoration: none;
    transition: 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.menu-item i {
    font-size: 1.1rem;
    color: var(--text-secondary);
}


.menu-divider {
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-family: monospace;
}

/* Account Box (Donate) */
.account-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.account-box:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.account-box:active {
    transform: translateY(0);
}

/* End of File */
/* --- ACCOUNT SWITCHER --- */
.account-dropdown {
    position: relative;
    z-index: 1001;
    /* Higher than profile */
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 50px;
    /* Pill shape */
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    justify-content: center;
}

.account-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.account-trigger i {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    /* Or left depending on preference, right aligns better with header flow usually, but let's try left aligned to trigger or right */
    left: 0;
    min-width: 220px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.account-dropdown.active .account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

/* Specific scrollbar styles removed in favor of global theme */

.account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.account-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.account-item.active {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent-primary);
}

.account-item.active i {
    color: var(--accent-primary);
}

.account-icon {
    font-size: 1.2rem;
}

/* Account Actions (Edit/Delete) */
.account-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: 0.2s;
}

.account-item:hover .account-actions {
    opacity: 1;
}

.account-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.account-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.account-action-btn.edit:hover {
    background: rgba(112, 0, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(112, 0, 255, 0.2);
}

.account-action-btn.delete:hover {
    background: rgba(255, 0, 85, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
    box-shadow: 0 4px 12px rgba(255, 0, 85, 0.2);
}

.account-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    pointer-events: none;
    /* Let parent handle click */
}

/* All Accounts Mode Layout */
body.all-accounts-mode .dashboard-grid {
    grid-template-columns: 320px 1fr;
    grid-template-areas:
        "balance history"
        "chart   history";
}

body.all-accounts-mode .form-section {
    display: none !important;
    /* Ensure it is hidden by CSS too for layout calc */
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    width: 100%;
    font-style: italic;
    opacity: 0.7;
}

#balance-toggle-btn:hover {
    transform: none;
    color: var(--accent-primary);
    opacity: 1 !important;
}

/* --- ONBOARDING TOUR --- */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tour-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tour-highlight {
    position: relative;
    z-index: 9001 !important;
    box-shadow: 0 0 0 4px rgba(112, 0, 255, 0.5), 0 0 0 100vh rgba(0, 0, 0, 0.5);
    /* Improved focus */
    background: #18181b !important;
    /* Solid dark color to prevent dimming */
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tour-tooltip {
    position: fixed;
    z-index: 9999 !important;
    /* Must be higher than tour-stack-promote (9005) */
    background: rgba(20, 20, 25, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px;
    border-radius: 16px;
    width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
}

.tour-tooltip.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tour-step-count {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.tour-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.tour-desc {
    font-size: 0.9rem;
    color: #e4e4e7;
    /* Brighter grey/white for better readability */
    line-height: 1.6;
    margin-bottom: 20px;
}

.tour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-weight: 500;
}

.tour-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
}

.tour-btn.secondary:hover {
    color: #fff;
}

.tour-btn.primary {
    background: var(--accent-primary);
    color: #fff;
}

.tour-btn.primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

/* Version Info in Dropdown */
.version-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 16px;
    opacity: 0.6;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.tour-stack-promote {
    z-index: 9005 !important;
    position: relative;
    /* Ensure z-index applies */
    transition: none !important;
    /* Prevent conflicts */
    background-color: #0f0f13 !important;
    /* Force opacity */
    border-color: rgba(255, 255, 255, 0.2) !important;
    /* Highlight border */
}

/* Hide Actions in All Accounts View */
body.all-accounts-mode .transaction-item .edit-btn,
body.all-accounts-mode .transaction-item .delete-btn {
    display: none !important;
}

/* --- RECENT ACTIVITY TIMELINE --- */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

.date-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 600;

    /* Sticky Positioning */
    position: sticky;
    top: 10px;
    /* Slight offset from top edge */
    z-index: 5;

    /* Pill Styling */
    align-self: center;
    /* Centers item in flex column */
    background: #0f0f13;
    /* Solid to prevent transparency overlap issues */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Lift it up */
    border-radius: 50px;
    padding: 6px 16px;
    margin: 24px 0 12px 0;
    width: fit-content;

    /* Flex Layout */
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-header::before,
.date-header::after {
    display: none;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 16px;
    transition: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* Prevent vertical squashing */
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Left Side: Icon + Info */
.tx-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

/* Icon Wrapper */
.tx-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.transaction-item.income .tx-icon-wrapper {
    background: rgba(0, 255, 170, 0.1);
    color: var(--accent-success);
}

.transaction-item.expense .tx-icon-wrapper {
    background: rgba(255, 0, 85, 0.1);
    color: var(--accent-danger);
}

/* Info Text */
.tx-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.tx-cat {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #a0a0b0;
}

/* Right Side: Amount + Actions */
.tx-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    position: relative;
    min-width: 80px;
    /* Reserve minimum space for buttons */
    height: 40px;
}

.tx-amount {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: 0.2s ease;
    opacity: 1;
    transform: translateY(0);
    position: relative;
    /* In-flow to reserve space */
    right: auto;
    white-space: nowrap;
}

.transaction-item.income .tx-amount {
    color: var(--accent-success);
}

.transaction-item.expense .tx-amount {
    color: var(--accent-danger);
    /* Standard red for expense */
}

/* Buttons (Edit/Delete) - Swap with Amount */
.tx-btns {
    position: absolute;
    right: 0;
    opacity: 0;
    display: flex;
    gap: 6px;
    transform: translateY(10px);
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}


.transaction-item:hover .tx-amount {
    opacity: 0;
    transform: translateY(-10px);
}

/* Fix: Do not hide amount in All Accounts Mode (buttons are hidden) */
body.all-accounts-mode .transaction-item:hover .tx-amount {
    opacity: 1;
    transform: translateY(0);
}

.transaction-item:hover .tx-btns {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Mobile: Always show buttons? Space is tighter. 
   Let's stick to hover/tap for now, or maybe make buttons smaller. 
   For simplicity, keeping Swap behavior. 
*/
@media (max-width: 600px) {
    /* Maybe just show small icons always? */
}

.tx-btns button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-btns button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.edit-btn:hover {
    color: var(--accent-primary) !important;
}

.delete-btn:hover {
    color: var(--accent-danger) !important;
}

/* --- CUSTOM RADIO & TOGGLES --- */
.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.radio-label {
    cursor: pointer;
    position: relative;
}

.radio-label input {
    display: none !important;
    /* Hide default white circle */
}

.custom-radio {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: 0.2s;
    font-size: 0.9rem;
}

.radio-label input:checked+.custom-radio {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(112, 0, 255, 0.3);
}

.toggle-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
}

.toggle-input {
    display: none !important;
    /* Hide default checkbox */
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-input:checked+.toggle-slider {
    background: var(--accent-success);
}

.toggle-input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

.edit-btn:hover {
    color: var(--accent-primary) !important;
}

.delete-btn:hover {
    color: var(--accent-danger) !important;
}

/* Chart Section Fullscreen */
.chart-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    padding: 20px;
    background: rgba(15, 15, 19, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.chart-section.fullscreen .chart-container {
    flex: 1;
    height: 100% !important;
    max-height: none !important;
}

/* Force Default Layout Reset - Vital for Fullscreen Exit */
body:not(.all-accounts-mode) .dashboard-grid {
    grid-template-columns: 320px 1fr 340px !important;
    grid-template-rows: auto 1fr !important;
    grid-template-areas:
        "form balance history"
        "form chart   history" !important;
}

body:not(.all-accounts-mode) .chart-section:not(.fullscreen) {
    grid-area: chart !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 24px !important;
    border-radius: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    /* Fix for flex item overflow */
    transition: none !important;
    /* Prevent glass-panel transition interference */
}

/* Global Scrollbar Theme */
/* Firefox Standard */
@supports (scrollbar-width: thin) {
    html {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    }
}

/* WebKit (Chrome, Edge, Safari) */
@supports selector(::-webkit-scrollbar) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
}

/* --- TIME INPUT STYLING --- */
input[type="time"] {
    color-scheme: dark;
    /* Forces browser picker to be dark */
    cursor: pointer;
    position: relative;
}

@supports selector(::-webkit-calendar-picker-indicator) {
    input[type="time"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
        /* Make the icon white */
        cursor: pointer;
        background-size: 16px;
        opacity: 0.6;
        transition: 0.2s;
    }
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    gap: 12px;
    pointer-events: none;
    /* Allow clicks through container */
}

.toast {
    background: rgba(18, 18, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    width: fit-content;
    min-width: 280px;
    pointer-events: auto;
    /* Re-enable pointer events for toasts */

    /* Animation */
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: right center;
}

.toast.hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast i {
    font-size: 1.2rem;
}

.toast span {
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(20%) scale(0.95);
        height: 0;
        /* Collapse height */
        margin: 0;
        /* Remove margin */
        padding: 0;
        /* Remove padding */
        overflow: hidden;
        /* Hide content during collapse */
    }
}

/* --- NEON TOAST THEMES --- */
.toast.neon-blue {
    border-left: 4px solid #00d4ff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.toast.neon-blue i {
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff;
}

.toast.neon-green {
    border-left: 4px solid var(--accent-success);
    box-shadow: 0 4px 12px rgba(0, 255, 170, 0.3);
}

.toast.neon-green i {
    color: var(--accent-success);
    text-shadow: 0 0 10px var(--accent-success);
}

/* --- Global Animations --- */
@keyframes purge-shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
        filter: hue-rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
        filter: hue-rotate(90deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
        filter: invert(0.2);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
        filter: invert(0.5);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
        filter: invert(0);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
        filter: hue-rotate(0deg);
    }
}

.purge-shake {
    animation: purge-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Additional Neon Toast Themes */
.toast.neon-purple {
    border-left: 4px solid #9d4eff;
    box-shadow: 0 4px 12px rgba(157, 78, 255, 0.3);
}

.toast.neon-purple i {
    color: #9d4eff;
    text-shadow: 0 0 10px #9d4eff;
}

.toast.neon-red {
    border-left: 4px solid #ff0055;
    box-shadow: 0 4px 12px rgba(255, 0, 85, 0.3);
}

.toast.neon-red i {
    color: #ff0055;
    text-shadow: 0 0 10px #ff0055;
}

/* --- GLOBAL BACK BUTTON --- */
.back-home-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.back-home-btn:hover {
    background: rgba(112, 0, 255, 0.15);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 20px rgba(112, 0, 255, 0.3), inset 0 0 10px rgba(112, 0, 255, 0.1);
    transform: translateY(-2px);
}

.back-home-btn .neon-icon {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.back-home-btn:hover .neon-icon {
    transform: scale(1.1) rotate(-10deg);
    filter: drop-shadow(0 0 8px var(--accent-success));
}

.back-home-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(112, 0, 255, 0.2);
}



/* --- HEADER CONTROLS STANDARDIZATION --- */
/* Ensure both control containers behave identically */
#gig-controls,
#vault-controls {
    display: none;
    /* Toggled via JS */
    align-items: center;
    gap: 12px;
    margin-right: 12px;
    /* Ensure spacing from divider */
}

/* Remove any spacer influence if parent doesn't stretch */
#gig-controls>div,
#vault-controls>div {
    display: none;
    /* Hide the spacer div effectively */
}

/* Missing Neon Blue Toast */
.toast.neon-blue {
    border-left: 4px solid #00d4ff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.toast.neon-blue i {
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff;
}


/* --- RESPONSIVE LAYOUT SYSTEM --- */

/* TABLET (Horizontal) & Small Laptops (Max Width: 1200px) */
@media screen and (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            'balance history'
            'form    history'
            'chart   chart';
        gap: 20px;
    }

    .chart-section {
        min-height: 400px;
    }
}

/* TABLET (Vertical) (Max Width: 900px) */
@media screen and (max-width: 900px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .app-container {
        height: auto;
        padding: 12px;
        overflow: visible;
    }

    #view-dashboard {
        height: auto;
        overflow: visible;
    }

    .header {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto;
        grid-template-areas: "logo account actions";
        gap: 12px;
        padding: 12px 16px;
        align-items: center;
    }

    .logo {
        grid-area: logo;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .app-version {
        font-size: 0.7rem;
        opacity: 0.9;
    }

    .header-actions {
        grid-area: actions;
    }

    .account-dropdown {
        grid-area: account;
        width: auto;
        justify-content: center;
    }

    .account-trigger {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Order for Stacked Layout */
    .balance-card {
        order: 1;
    }

    .form-section {
        order: 2;
    }

    .chart-section {
        order: 3;
        min-height: 350px;
    }

    .history-section {
        order: 4;
        max-height: 500px;
        /* Prevent infinite scroll on mobile */
    }

    /* Adjust specific panels to avoid cutoffs */
    .form-section,
    .balance-card,
    .chart-section,
    .history-section {
        width: 100%;
        overflow: visible;
    }

    .window-controls {
        display: none !important;
    }
}

/* MOBILE PHONES (Max Width: 600px) */
@media screen and (max-width: 600px) {
    .header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "logo actions"
            "account account";
        gap: 8px;
        padding: 10px 12px;
        text-align: left;
    }

    .logo {
        grid-area: logo;
        margin-bottom: 0;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .header-actions {
        grid-area: actions;
        width: auto;
        justify-content: flex-end;
    }

    .account-dropdown {
        grid-area: account;
        margin: 4px 0 0 0;
        width: 100%;
    }

    .account-trigger {
        width: 100%;
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .balance-card h2 {
        font-size: 2rem;
    }

    .hero-amount-input {
        font-size: 2.3rem !important;
    }

    .balance-details {
        flex-direction: column;
        gap: 12px;
    }
}

/* Mobile Bottom Nav Styles */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 65px;
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    gap: 4px;
    flex: 1;
    cursor: pointer;
    position: relative;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.4rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--accent-primary);
}

/* Custom Active Colors */
.mobile-bottom-nav .nav-item[data-view="gig"].active,
.mobile-bottom-nav .nav-item[data-view="gig"].active i,
.mobile-bottom-nav .nav-item[data-view="gig"].active span {
    color: #00A3FF;
}

.mobile-bottom-nav .nav-item[data-view="gig"].active i {
    filter: drop-shadow(0 0 8px #00A3FF);
}

.mobile-bottom-nav .nav-item[data-view="vault"].active,
.mobile-bottom-nav .nav-item[data-view="vault"].active i,
.mobile-bottom-nav .nav-item[data-view="vault"].active span {
    color: #FF0055;
}

.mobile-bottom-nav .nav-item[data-view="vault"].active i {
    filter: drop-shadow(0 0 8px #FF0055);
}

.mobile-bottom-nav #nav-settings-trigger.active,
.mobile-bottom-nav #nav-settings-trigger.active i,
.mobile-bottom-nav #nav-settings-trigger.active span {
    color: #FFD700;
}

.mobile-bottom-nav #nav-settings-trigger.active i {
    filter: drop-shadow(0 0 8px #FFD700);
}

.mobile-bottom-nav .nav-item.active i {
    transform: translateY(-4px);
    /* Default color fallback */
    color: inherit;
    filter: inherit;
}

.mobile-bottom-nav .nav-item:not([data-view="gig"]):not([data-view="vault"]):not(#nav-settings-trigger).active i {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.mobile-bottom-nav .nav-item.active span {
    opacity: 1;
    color: inherit;
}

.mobile-bottom-nav .nav-item:not([data-view="gig"]):not([data-view="vault"]):not(#nav-settings-trigger).active span {
    color: var(--accent-primary);
}

@media screen and (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* Hide header feature buttons on mobile */
    #loan-vault-btn,
    #gig-job-btn,
    #profile-btn,
    #gig-back-btn,
    #vault-back-btn {
        display: none !important;
    }

    .app-container {
        padding-bottom: 110px !important;
    }

    /* Adjust header layout if needed */
    .header {
        padding-bottom: 5px !important;
    }

    /* Target the container as well to ensure it's not hidden */
    .header-actions .profile-dropdown {
        display: block !important;
    }

    .profile-menu {
        position: fixed;
        top: auto;
        bottom: 90px;
        /* Reduced gap - closer to button */
        left: auto;
        /* Remove centering */
        right: 15px;
        /* Stick to right (button location) */
        transform: none;
        /* Remove centering transform */
        width: 260px;
        /* More menu-like width */
        max-width: 90vw;
        max-height: 60vh;
        overflow-y: auto;
        transform-origin: bottom right;
        /* Animate from button */
        z-index: 10001 !important;
        display: none !important;
        flex-direction: column;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        border-bottom-right-radius: 4px;
        /* Optional: emphasize anchor point */
    }

    .profile-dropdown.active .profile-menu {
        display: flex !important;
        animation: mobileMenuPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes mobileMenuPop {
        from {
            opacity: 0;
            transform: scale(0.9) translateY(20px);
        }

        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}