:root {
    /* Color Palette */
    --bg-dark: #020617;
    --bg-gradient: radial-gradient(circle at top right, #1e1b4b 0%, #020617 60%, #020617 100%);
    
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    
    --color-income: #10b981; /* Emerald */
    --color-income-glow: rgba(16, 185, 129, 0.2);
    
    --color-expense: #ef4444; /* Rose */
    --color-expense-glow: rgba(239, 68, 68, 0.2);
    
    --color-savings: #6366f1; /* Indigo */
    --color-savings-glow: rgba(99, 102, 241, 0.2);
    
    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Spacing & Sizes */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Glassmorphism Utilities */
.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: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.text-center { text-align: center; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; }
.section-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.mt-lg { margin-top: 1.5rem; }

/* Layout Grid */
header {
    margin-bottom: 2rem;
    padding: 1.5rem !important;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

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

/* Panel Headers */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.total-badge {
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

.income-badge { background: var(--color-income-glow); color: var(--color-income); border: 1px solid rgba(16, 185, 129, 0.3); }
.expense-badge { background: var(--color-expense-glow); color: var(--color-expense); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Inputs */
.expense-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .expense-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.input-group:focus-within label {
    color: var(--text-primary);
}

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

.currency-symbol {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.calc-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem 0.75rem 2rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    transition: all var(--transition-fast);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.calc-input[type=number] {
    -moz-appearance: textfield;
}

.calc-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.calc-input:focus {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Focused accents based on input type */
.income-input:focus { border-color: var(--color-income); box-shadow: 0 0 0 3px var(--color-income-glow), inset 0 2px 4px rgba(0,0,0,0.2); }
.expense-input:focus { border-color: var(--color-expense); box-shadow: 0 0 0 3px var(--color-expense-glow), inset 0 2px 4px rgba(0,0,0,0.2); }

/* Left Border Indicators */
.block-income { border-left: 4px solid var(--color-income); }
.block-expense { border-left: 4px solid var(--color-expense); }

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.highlight-savings {
    color: var(--color-savings);
    text-shadow: 0 0 20px var(--color-savings-glow);
}
.highlight-debt {
    color: var(--color-expense);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

/* Annual Metrics */
.annual-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.annual-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.annual-item:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.6);
}

.annual-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
}

.annual-icon.income-icon { background: var(--color-income-glow); color: var(--color-income); }
.annual-icon.expense-icon { background: var(--color-expense-glow); color: var(--color-expense); }
.annual-icon.savings-icon { background: var(--color-savings-glow); color: var(--color-savings); }

.annual-details {
    display: flex;
    flex-direction: column;
}

.annual-details .annual-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.annual-details .annual-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.text-income { color: var(--color-income); }
.text-expense { color: var(--color-expense); }
.text-savings { color: var(--color-savings); }

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-panel {
    animation: fadeIn 0.6s ease-out forwards;
}

.dashboard-grid > div:nth-child(1) .glass-panel:nth-child(1) { animation-delay: 0.1s; }
.dashboard-grid > div:nth-child(1) .glass-panel:nth-child(2) { animation-delay: 0.2s; }
.dashboard-grid > div:nth-child(2) .glass-panel:nth-child(1) { animation-delay: 0.3s; }
.dashboard-grid > div:nth-child(2) .glass-panel:nth-child(2) { animation-delay: 0.4s; }
