/* ===================================
   FinTracker - Modern Finance Dashboard
   =================================== */

/* CSS Variables for Theme */
:root[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    /* Card Backgrounds */
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-bg-hover: rgba(30, 41, 59, 0.85);
    --glass-bg: rgba(30, 41, 59, 0.6);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Accent Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    
    /* Status Colors */
    --income-color: #10b981;
    --expense-color: #ef4444;
    --savings-color: #06b6d4;
    --spi-color: #8b5cf6;
    
    /* UI Elements */
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    
    /* Card Backgrounds */
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-bg-hover: rgba(255, 255, 255, 1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Accent Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    
    /* Status Colors */
    --income-color: #10b981;
    --expense-color: #ef4444;
    --savings-color: #06b6d4;
    --spi-color: #8b5cf6;
    
    /* UI Elements */
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ==================
   Global Styles
   ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ==================
   Sidebar Styles
   ================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    height: 73px;
    display: flex;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-brand i {
    font-size: 2rem;
}

.brand-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link i {
    font-size: 1.25rem;
}

.nav-link:hover {
    background: var(--card-bg);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

/* ==================
   Main Content
   ================== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 73px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 900;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--card-bg);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-menu:hover {
    background: var(--card-bg-hover);
}

.profile-img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}

.profile-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================
   Page Content
   ================== */
.page-content {
    padding: 2rem 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

/* ==================
   Cards
   ================== */
.summary-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.income-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.expense-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.savings-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.spi-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

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

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

.card-badge.neutral {
    background: rgba(139, 92, 246, 0.1);
    color: var(--spi-color);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
}

.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title-custom {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

/* ==================
   Chart Styles
   ================== */
.chart-placeholder {
    padding: 1rem 0;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 0.5rem 0.5rem 0 0;
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.5rem;
}

.chart-bar:hover {
    transform: scaleY(1.05);
}

.chart-bar span {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
}

.income-color {
    background: var(--income-color);
}

.expense-color {
    background: var(--expense-color);
}

.savings-color {
    background: var(--savings-color);
}

/* ==================
   Quick Actions
   ================== */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s ease, background 0.2s ease;
}

.action-btn:hover {
    transform: translateX(4px);
    background: var(--card-bg-hover);
}

.action-btn i {
    font-size: 1.25rem;
}

.income-btn:hover {
    border-color: var(--income-color);
    color: var(--income-color);
}

.expense-btn:hover {
    border-color: var(--expense-color);
    color: var(--expense-color);
}

.savings-btn:hover {
    border-color: var(--savings-color);
    color: var(--savings-color);
}

.report-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ==================
   Tables
   ================== */
.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.custom-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.custom-table tbody tr:hover {
    background: var(--card-bg);
}

.table-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

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

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

.table-badge.savings {
    background: rgba(6, 182, 212, 0.1);
    color: var(--savings-color);
}

.table-amount {
    font-weight: 600;
    font-size: 1rem;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--expense-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==================
   Forms
   ================== */
.custom-form {
    margin-top: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg-hover);
    color: var(--text-primary);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group-text {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 0.75rem 0 0 0.75rem;
    color: var(--text-muted);
}

.input-group .form-control {
    border-radius: 0 0.75rem 0.75rem 0;
    border-left: none;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary-custom {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-secondary-custom:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}

.btn-danger-custom {
    background: rgba(239, 68, 68, 0.1);
    color: var(--expense-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.btn-danger-custom:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==================
   Mini Summary Cards
   ================== */
.mini-summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.875rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s ease;
}

.mini-summary-card:hover {
    transform: translateY(-2px);
}

.mini-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.mini-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.mini-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ==================
   Progress Bars
   ================== */
.savings-progress, .breakdown-item {
    margin-top: 1.5rem;
}

.progress-label, .breakdown-label {
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-value, .breakdown-value {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar-custom {
    height: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 1rem;
    transition: width 0.5s ease;
}

.income-fill {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.expense-fill {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.savings-fill {
    background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
}

.progress-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ==================
   Monthly Report
   ================== */
.report-summary-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.report-summary-card:hover {
    transform: translateY(-4px);
}

.report-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.income-card .report-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.expense-card .report-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.savings-card .report-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.spi-card .report-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.report-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.report-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.breakdown-item {
    padding: 1rem 0;
}

.breakdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.net-balance {
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.balance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.balance-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.balance-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.balance-formula {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ==================
   SPI Gauge
   ================== */
.spi-gauge {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.spi-circle {
    position: relative;
}

.spi-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spi-percentage {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.spi-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.spi-description {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ==================
   Insights
   ================== */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.insight-item i {
    color: var(--primary);
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.insight-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ==================
   Settings Page
   ================== */
.profile-section {
    text-align: center;
}

.profile-avatar-large {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--border-color);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    color: white;
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.avatar-edit-btn:hover {
    transform: scale(1.1);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.settings-info {
    flex: 1;
}

.settings-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.settings-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Theme Switch */
.theme-switch {
    position: relative;
}

.theme-switch-input {
    display: none;
}

.theme-switch-label {
    display: block;
    width: 3.5rem;
    height: 2rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
}

.theme-switch-button {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.theme-switch-input:checked + .theme-switch-label {
    background: var(--primary);
}

.theme-switch-input:checked + .theme-switch-label .theme-switch-button {
    transform: translateX(1.5rem);
}

/* App Info */
.app-info-content {
    margin-top: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary);
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ==================
   Auth / Login Page
   ================== */
.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.22), transparent 45%),
                radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.2), transparent 40%),
                var(--bg-primary);
}

.auth-theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 460px;
}

.auth-card {
    padding: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-brand i {
    font-size: 2rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.auth-form .form-control {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-message {
    margin-top: 1rem;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--income-color);
    border-color: rgba(16, 185, 129, 0.25);
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--expense-color);
    border-color: rgba(239, 68, 68, 0.25);
}

/* ==================
   Responsive Design
   ================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }

    .top-navbar {
        justify-content: space-between;
    }
    
    .page-content {
        padding: 1.5rem 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .card-value {
        font-size: 1.5rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .card-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }
    
    .profile-name {
        display: none;
    }
    
    .quick-actions {
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.875rem;
        font-size: 0.875rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

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

.page-content > * {
    animation: fadeIn 0.5s ease;
}

/* ==================
   Utility Classes
   ================== */
.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

.pt-3 {
    padding-top: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.text-danger {
    color: var(--expense-color) !important;
}

/* ==================
   Pagination
   ================== */
.pagination {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pagination .page-item .page-link {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    transition: background 0.2s, color 0.2s;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}
.pagination .page-item .page-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==================
   Select2 Theme
   ================== */
.select2-container {
    width: 100% !important;
}
.select2-dropdown {
    z-index: 9999 !important;
}
.select2-container--default .select2-selection--single {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.75rem !important;
    height: auto !important;
    padding: 0.75rem 1rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    line-height: 1.5 !important;
    padding: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 0.75rem !important;
    height: auto !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text-muted) transparent !important;
}
.select2-dropdown {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.75rem !important;
    overflow: hidden;
}
.select2-results__options {
    background: var(--bg-secondary) !important;
}
.select2-container--default .select2-results__option {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    padding: 0.6rem 1rem !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background: var(--primary) !important;
    color: #fff !important;
}
.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--default .select2-results__option[data-selected=true] {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.5rem !important;
    color: var(--text-primary) !important;
    padding: 0.4rem 0.75rem !important;
}

/* ==================
   Flatpickr Theme
   ================== */
.flatpickr-calendar {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.75rem !important;
    box-shadow: var(--shadow) !important;
}
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday {
    background: var(--bg-secondary) !important;
    color: var(--text-muted) !important;
    fill: var(--text-muted) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--text-primary) !important;
    background: transparent !important;
}
.flatpickr-day {
    color: var(--text-secondary) !important;
    border-radius: 0.5rem !important;
    background: transparent !important;
}
.flatpickr-day:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.flatpickr-day.today {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
}
.flatpickr-day.today:hover {
    background: var(--primary) !important;
    color: #fff !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-muted) !important;
    opacity: 0.4 !important;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: var(--text-muted) !important;
}

/* Flatpickr Month Select Plugin */
.flatpickr-monthSelect-months {
    background: var(--bg-secondary) !important;
}
.flatpickr-monthSelect-month {
    color: var(--text-secondary) !important;
    border-radius: 0.5rem !important;
}
.flatpickr-monthSelect-month:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}
.flatpickr-monthSelect-month.selected {
    background: var(--primary) !important;
    color: #fff !important;
}
