/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Layout & Spacing */
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-blur: blur(16px);
}

body.dark-theme {
    --bg-main: #0b0f19;
    --bg-card: rgba(22, 28, 45, 0.65);
    --bg-card-hover: rgba(28, 36, 58, 0.85);
    --bg-sidebar: #0f1322;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-income: #10b981;       /* Emerald */
    --color-income-glow: rgba(16, 185, 129, 0.15);
    --color-expense: #f43f5e;      /* Rose */
    --color-expense-glow: rgba(244, 63, 94, 0.15);
    
    --color-primary: #6366f1;      /* Indigo */
    --color-primary-hover: #4f46e5;
    --color-primary-glow: rgba(99, 102, 241, 0.2);
    
    --color-gold: #f59e0b;         /* Amber */
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 20px 50px -15px rgba(0, 0, 0, 0.8);
}

body.light-theme {
    --bg-main: #f1f5f9;            /* Light grey-blue background */
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-sidebar: #0f1322;         /* Keep sidebar dark slate for premium contrast! */
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(99, 102, 241, 0.6);
    
    --text-primary: #0f172a;       /* Slate 900 */
    --text-secondary: #475569;     /* Slate 600 */
    --text-muted: #64748b;         /* Slate 500 */
    
    --color-income: #10b981;       /* Emerald remains the same */
    --color-income-glow: rgba(16, 185, 129, 0.1);
    --color-expense: #e11d48;      /* Slightly deeper Rose for contrast on light */
    --color-expense-glow: rgba(225, 29, 72, 0.1);
    
    --color-primary: #4f46e5;      /* Deeper Indigo for readability */
    --color-primary-hover: #3730a3;
    --color-primary-glow: rgba(79, 70, 229, 0.15);
    
    --color-gold: #d97706;         /* Deeper Amber */
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -10px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.1);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    z-index: 10;
    
    /* Ensure sidebar uses dark theme tokens since it stays dark */
    --border-color: rgba(255, 255, 255, 0.08);
}


.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 32px 12px;
}
.logo-icon {
    font-size: 24px;
}
.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}
.logo-text span {
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-item i {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary), #4338ca);
    box-shadow: 0 4px 20px -2px var(--color-primary-glow);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item .badge {
    position: absolute;
    right: 16px;
    background-color: var(--color-gold);
    color: #000000;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

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

.settings-btn {
    background: none;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.settings-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, var(--bg-main) 70%);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 40px 16px 40px;
    flex-shrink: 0;
}

.content-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.date-display {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Content Views */
.content-view {
    display: none;
    flex-grow: 1;
    padding: 16px 40px 40px 40px;
    overflow-y: auto;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   GLASS CARDS & COMPONENT STYLING
   ========================================================================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

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

.stat-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card.highlighted {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.05));
    border-color: rgba(99, 102, 241, 0.25);
}

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

.stat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 18px;
    height: 18px;
}

.income-icon { background-color: var(--color-income-glow); color: var(--color-income); }
.expense-icon { background-color: var(--color-expense-glow); color: var(--color-expense); }
.net-icon { background-color: rgba(99, 102, 241, 0.15); color: var(--color-primary); }
.balance-icon { background-color: rgba(245, 158, 11, 0.15); color: var(--color-gold); }

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Text Colors helper */
.income-text { color: var(--color-income); }
.expense-text { color: var(--color-expense); }

/* Dashboard Chart Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 340px;
}

.chart-container h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.chart-wrapper {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

.no-data-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

/* Dashboard Bottom Grid */
.dashboard-bottom-grid {
    margin-bottom: 24px;
}

.recent-transactions {
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--color-primary), #4338ca);
    color: #ffffff;
    border: none;
    outline: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px -2px var(--color-primary-glow);
}
.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -2px var(--color-primary-glow);
}
.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.text-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.text-btn:hover {
    color: #818cf8;
    text-decoration: underline;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.icon-btn:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}
.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.w-full {
    width: 100%;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.tx-table th, .tx-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tx-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-table tbody tr {
    transition: var(--transition-smooth);
}

.tx-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.tx-table td {
    color: var(--text-primary);
}

.amount-col {
    text-align: right;
    font-weight: 600;
}

.tx-table.compact th, .tx-table.compact td {
    padding: 12px 16px;
}

.bank-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.bank-tag.sparkasse {
    background-color: rgba(224, 0, 0, 0.15);
    color: #ff3333;
    border: 1px solid rgba(224, 0, 0, 0.2);
}

.bank-tag.easybank {
    background-color: rgba(0, 150, 255, 0.15);
    color: #33a3ff;
    border: 1px solid rgba(0, 150, 255, 0.2);
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.05);
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.frequency-tag {
    font-size: 12px;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.action-edit-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}
.action-edit-btn:hover {
    color: #818cf8;
    background-color: rgba(99, 102, 241, 0.1);
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   TRANSACTIONS VIEW: FILTER BAR
   ========================================================================== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 20px;
    gap: 20px;
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-input-wrapper input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px 12px 42px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input-wrapper input:focus {
    border-color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.filters-group {
    display: flex;
    gap: 12px;
}

@media (max-width: 485px) {
    .filters-group {
        flex-direction: column;
    }
}

.filters-group select {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* ==========================================================================
   IMPORT & AI VIEW
   ========================================================================== */
.import-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .import-grid {
        grid-template-columns: 1fr;
    }
}

.import-card, .ai-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.import-card h3, .ai-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group select {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.form-group input {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}


/* Drag & Drop Zone */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--color-primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.drop-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    stroke-width: 1.5;
}

.drop-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.selected-file-name {
    font-size: 12px;
    color: var(--text-muted);
}

/* Log Console */
.import-log {
    margin-top: 24px;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
}

.import-log h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.log-content {
    font-family: monospace;
    font-size: 12px;
    color: #a7f3d0; /* Soft green */
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* AI Panel styling */
.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-sparkle-icon {
    font-size: 20px;
}

.ai-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-income);
    text-transform: uppercase;
}

.ai-status-badge.running {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-gold);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.ai-stats-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.ai-stat-number {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 4px;
}

.ai-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.ai-action-btn {
    background: linear-gradient(135deg, #a855f7, #6366f1); /* Purple to Indigo */
    color: #ffffff;
    border: none;
    outline: none;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px -2px rgba(168, 85, 247, 0.3);
    margin-bottom: 24px;
}

.ai-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -2px rgba(168, 85, 247, 0.4);
}

.ai-action-btn:disabled {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.sparkles-animation {
    display: inline-block;
}
.ai-action-btn:hover:not(:disabled) .sparkles-animation {
    animation: rotate 1s linear infinite;
}

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

.ai-progress-container {
    margin-bottom: 24px;
}

.progress-bar-bg {
    background-color: rgba(255, 255, 255, 0.04);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transition: width 0.4s ease;
}

.progress-status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.ai-notes h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-notes ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-notes li {
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
    padding-left: 16px;
}

.ai-notes li::before {
    content: "•";
    color: var(--color-primary);
    font-weight: bold;
    position: absolute;
    left: 4px;
}

/* ==========================================================================
   FORECAST VIEW
   ========================================================================== */
.forecast-settings {
    padding: 24px 32px;
    margin-bottom: 24px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}

@media (max-width: 768px) {
    .settings-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.currency-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-input-wrapper span {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-weight: 600;
}

.currency-input-wrapper input {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px 12px 32px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    width: 240px;
    transition: var(--transition-smooth);
}

@media (max-width: 768px) {
    .currency-input-wrapper input {
        width: 100%;
    }
}

.currency-input-wrapper input:focus {
    border-color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.07);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
}

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

@media (max-width: 1024px) {
    .forecast-charts-grid {
        grid-template-columns: 1fr;
    }
}

.main-forecast-chart {
    min-height: 360px;
}
.sub-forecast-chart {
    min-height: 360px;
}

/* Forecast Timeline / Accordion */
.forecast-timeline-wrapper {
    padding: 32px;
}

.forecast-timeline-wrapper h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.forecast-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-month-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
}

.timeline-month-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.02);
}

.timeline-month-header {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.timeline-month-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.timeline-month-name {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    width: 160px;
}

.timeline-month-summary {
    display: flex;
    gap: 24px;
}

.timeline-summary-item {
    font-size: 14px;
}
.timeline-summary-item span {
    color: var(--text-secondary);
    margin-right: 4px;
}

.timeline-month-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.timeline-month-balance {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    width: 140px;
}

.timeline-month-balance span {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.timeline-month-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.timeline-month-item.open .timeline-month-arrow {
    transform: rotate(180deg);
}

.timeline-month-details {
    display: none;
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    background-color: rgba(0, 0, 0, 0.2);
}

.timeline-month-item.open .timeline-month-details {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.details-tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.02);
}

.details-tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.details-tx-label {
    font-weight: 500;
}

.details-tx-type-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.details-tx-type-tag.recurring {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.details-tx-type-tag.variable {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.details-tx-freq {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   EDIT DRAWER
   ========================================================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

.edit-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    bottom: 0;
    width: 450px;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
    .edit-drawer {
        width: 100%;
        right: -100%;
    }
}

.edit-drawer.active {
    right: 0;
}

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

.drawer-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-meta-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.meta-label {
    color: var(--text-secondary);
}
.meta-value {
    font-weight: 500;
}

.divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.checkbox-group {
    margin: 24px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.ai-rationale-box {
    background-color: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 24px 0;
}

.ai-rationale-box h5 {
    font-size: 13px;
    font-weight: 600;
    color: #d8b4fe;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ai-rationale-box p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.drawer-actions {
    margin-top: 32px;
}

/* ==========================================================================
   SETTINGS MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: block;
    opacity: 1;
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 480px;
    max-width: 90%;
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 32px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.settings-modal.active {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

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

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.modal-body input[type="password"] {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 42px 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper button {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
}

.settings-status-box {
    margin: 16px 0 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-indicator.configured {
    background-color: var(--color-income);
    box-shadow: 0 0 8px var(--color-income);
}

.status-indicator.missing {
    background-color: var(--color-expense);
    box-shadow: 0 0 8px var(--color-expense);
}

/* ==========================================================================
   LIGHT MODE OVERRIDES
   ========================================================================== */
body.light-theme .main-content {
    background: radial-gradient(circle at 50% 0%, #e0e7ff 0%, var(--bg-main) 70%);
}
body.light-theme .nav-item {
    color: #94a3b8;
}
body.light-theme .nav-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}
body.light-theme .nav-item.active {
    color: #ffffff;
}
body.light-theme .settings-btn {
    color: #94a3b8;
}
body.light-theme .settings-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}
body.light-theme .tx-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
}
body.light-theme .details-tx-row {
    background-color: rgba(0, 0, 0, 0.02);
}
body.light-theme .timeline-month-item {
    background-color: rgba(0, 0, 0, 0.005);
}
body.light-theme .timeline-month-item:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

/* ==========================================================================
   LOGIN OVERLAY
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #060814 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: var(--transition-smooth);
}

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

.login-card {
    width: 420px;
    max-width: 100%;
    padding: 40px;
    background: rgba(22, 28, 45, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.login-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.login-header p {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Glassmorphic Login input overrides */
.login-card .form-group input {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.login-card .form-group input:focus {
    background: rgba(15, 23, 42, 0.6);
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-card .form-group label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    letter-spacing: 0.8px;
}

.login-card .primary-btn {
    margin-top: 12px;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
    font-weight: 600;
}


