/* ============================================
   INFINITE EXPENSE TRACKER - PROFESSIONAL UI
   ============================================ */

/* === CSS VARIABLES === */
:root {
    /* Primary Colors - Amber/Yellow */
    --primary-50: #fffbeb;
    --primary-100: #fef3c7;
    --primary-200: #fde68a;
    --primary-300: #fcd34d;
    --primary-400: #fbbf24;
    --primary-500: #f59e0b;
    --primary-600: #d97706;
    --primary-700: #b45309;
    --primary-800: #92400e;
    --primary-900: #78350f;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --success-500: #22c55e;
    --success-600: #16a34a;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --info-500: #3b82f6;
    --info-600: #2563eb;
    --warning-500: #eab308;

    /* Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --header-height: 70px;
    --container-max: 1400px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-600);
}

/* === UTILITY CLASSES === */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-700);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn-edit:hover {
    background: var(--info-500);
    color: white;
}

.action-btn-delete:hover {
    background: var(--danger-500);
    color: white;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9375rem;
    pointer-events: none;
    z-index: 1;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-error {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--danger-500);
}

.form-hint {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    z-index: 1;
}

.password-toggle:hover {
    color: var(--primary-500);
}

/* === CARDS === */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.0625rem;
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--text-primary);
}

.card-header h3 i {
    color: var(--primary-500);
}

.card-body {
    padding: 1.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* === HEADER === */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--bg-tertiary);
    padding: 4px;
    border: 2px solid var(--primary-500);
}

.header-title h1 {
    font-size: 1.25rem;
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.nav-btn-logout:hover {
    border-color: var(--danger-500);
    color: var(--danger-500);
}

.mobile-menu-btn {
    display: none;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.mobile-user-email {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.mobile-nav-btn:hover {
    background: var(--primary-100);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    z-index: 100;
}

.theme-toggle:hover {
    border-color: var(--primary-500);
    transform: scale(1.05);
}

/* === AUTH SCREENS === */
.auth-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--bg-tertiary);
    padding: 12px;
    border: 3px solid var(--primary-500);
    margin-bottom: 1.5rem;
    transition: transform var(--transition-base);
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-600);
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.auth-link {
    color: var(--primary-500);
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary-600);
    text-decoration: underline;
}

.auth-brand-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.auth-brand-footer a {
    color: var(--primary-500);
    font-weight: 600;
    margin-left: 4px;
}

/* === MAIN SCREENS === */
.main-screen {
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 3rem;
    min-height: 100vh;
}

.dashboard-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-welcome h2 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-welcome p {
    color: var(--text-muted);
}

/* === STATS SECTION === */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-monthly::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-weekly::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-daily::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-budget::before { background: linear-gradient(90deg, #22c55e, #4ade80); }

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-monthly .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-weekly .stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-daily .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-budget .stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }

.stat-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.stat-card-body {
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-body);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.stat-card-footer {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.stat-period {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Budget Card Specifics */
.budget-progress-wrapper {
    margin-bottom: 0.75rem;
}

.budget-progress-bar {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.budget-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
    border-radius: 10px;
    transition: width var(--transition-slow);
}

.budget-progress-fill.over-budget {
    background: linear-gradient(90deg, var(--danger-500), var(--danger-600));
}

.budget-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.budget-remaining {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-600);
}

.budget-form {
    display: flex;
    gap: 0.5rem;
}

.budget-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.budget-input:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* === CONTENT GRID === */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Add Expense Card */
.add-expense-card .expense-form {
    display: flex;
    flex-direction: column;
}

/* Charts Card */
.charts-card .card-body {
    padding: 0;
}

.charts-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.chart-tab {
    flex: 1;
    padding: 14px 20px;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.chart-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.chart-tab.active {
    color: var(--primary-500);
    border-bottom-color: var(--primary-500);
}

.chart-panels {
    padding: 1.5rem;
}

.chart-panel {
    display: none;
}

.chart-panel.active {
    display: block;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.chart-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* === DATA TABLE === */
.table-card .card-header {
    flex-wrap: wrap;
    gap: 1rem;
}

.table-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-600);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.action-column {
    width: 120px;
    text-align: center;
}

/* === FILTER SECTION === */
.filter-card {
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* === FILTERED RESULTS === */
.filtered-summary {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-align: center;
}

.filtered-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.filtered-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: all var(--transition-fast);
}

.filtered-item:hover {
    background: var(--primary-50);
}

[data-theme="dark"] .filtered-item:hover {
    background: var(--bg-secondary);
}

.filtered-item strong {
    color: var(--text-primary);
}

.filtered-item small {
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-info {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 1rem;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* === PROFILE SCREEN === */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-header h2 i {
    color: var(--primary-500);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.profile-card .card-body {
    min-height: 200px;
}

.category-list,
.recurring-list {
    list-style: none;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.category-item,
.recurring-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.add-item-form {
    display: flex;
    gap: 0.75rem;
}

.add-item-form .input-wrapper {
    flex: 1;
}

.recurring-form .form-group {
    margin-bottom: 0.75rem;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-weight: 700;
}

.modal-header h3 i {
    color: var(--primary-500);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-500);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* === LOADER === */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loader {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    font-size: 0.9375rem;
    font-weight: 600;
}

/* === MESSAGES === */
.success-message,
.error-message {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    z-index: 2500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.success-message {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* === PWA INSTALL PROMPT === */
.pwa-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-prompt-content {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pwa-prompt-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pwa-prompt-text {
    flex: 1;
    min-width: 150px;
}

.pwa-prompt-text h4 {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 700;
    margin-bottom: 2px;
}

.pwa-prompt-text p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.pwa-prompt-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.pwa-btn-install {
    flex: 1;
    padding: 10px 16px;
    background: var(--primary-500);
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.pwa-btn-install:hover {
    background: var(--primary-400);
}

.pwa-btn-dismiss {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.pwa-btn-dismiss:hover {
    background: var(--border-color);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .header-tagline {
        display: none;
    }

    .theme-toggle {
        top: calc(var(--header-height) + 12px);
        right: 12px;
        width: 42px;
        height: 42px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-logo {
        width: 80px;
        height: 80px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    /* Mobile Table */
    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px dashed var(--border-color);
    }

    .data-table td:last-child {
        border-bottom: none;
        padding-top: 1rem;
        justify-content: flex-end;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8125rem;
        text-transform: uppercase;
    }

    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }

    .export-actions {
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filtered-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filtered-item > div {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .modal-actions {
        flex-direction: column;
    }

    .add-item-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 0 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.875rem;
    }

    .pwa-prompt-content {
        flex-direction: column;
        text-align: center;
    }

    .pwa-prompt-actions {
        flex-direction: column;
    }
}

/* ============================================
   CHRISTMAS THEME
   ============================================ */

/* Snow Container */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: snow-fall linear infinite;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes snow-fall {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) translateX(20vw) rotate(360deg);
    }
}

/* Christmas Theme Colors */
.christmas-theme {
    --primary-500: #dc2626;
    --primary-600: #b91c1c;
    --primary-400: #ef4444;
}

.christmas-theme .btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.christmas-theme .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* Christmas Stat Cards */
.christmas-theme .stat-monthly::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.christmas-theme .stat-monthly .stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }

.christmas-theme .stat-weekly::before { background: linear-gradient(90deg, #dc2626, #ef4444); }
.christmas-theme .stat-weekly .stat-icon { background: linear-gradient(135deg, #dc2626, #b91c1c); }

.christmas-theme .stat-daily::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.christmas-theme .stat-daily .stat-icon { background: linear-gradient(135deg, #fbbf24, #d97706); }

/* Christmas Auth Logo Decoration */
.christmas-theme .auth-logo {
    border-color: #dc2626;
    position: relative;
}

.christmas-theme #login-screen .auth-header::after,
.christmas-theme #signup-screen .auth-header::after {
    content: '🎄';
    position: absolute;
    top: 10px;
    right: 30px;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.christmas-theme #login-screen .auth-header::before,
.christmas-theme #signup-screen .auth-header::before {
    content: '🎅';
    position: absolute;
    top: 10px;
    left: 30px;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite 1.5s;
}

.christmas-theme .auth-header {
    position: relative;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Christmas Header */
.christmas-theme .header-logo {
    border-color: #dc2626;
}

.christmas-theme .card-header h3 i {
    color: #dc2626;
}

.christmas-theme .chart-tab.active {
    color: #dc2626;
    border-bottom-color: #dc2626;
}

.christmas-theme .budget-progress-fill {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.christmas-theme .budget-remaining {
    color: #dc2626;
}

.christmas-theme .table-total {
    color: #dc2626;
}

.christmas-theme .form-input:focus,
.christmas-theme .form-select:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.christmas-theme .auth-link {
    color: #dc2626;
}

.christmas-theme .auth-link:hover {
    color: #b91c1c;
}

.christmas-theme .auth-brand-footer a {
    color: #dc2626;
}