:root {
    /* Color Palette - Modern & Fresh */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    /* Neutrals - Fresh Light Theme */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Header Redesign */
.header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800; /* Extra Bold for importance */
    color: var(--text-main);
}

.user-name {
    font-weight: 700;
    margin-right: 0.75rem;
    color: var(--primary);
}

.user-menu .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Auth Screens */
.auth-container {
    max-width: 400px;
    margin: 10vh auto;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-container h2 {
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Section Titles */
.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

/* Cards */
.report-card, .add-expense-section, .all-expenses-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.report-card h3 {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Forms */
.expense-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 700; /* Bolder Labels */
    color: var(--text-main); /* Darker for clarity */
}

input, select {
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background: var(--bg-main); color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); color: white; }

.btn-block { width: 100%; display: flex; }

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

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.25rem;
    border-radius: 10px;
    width: fit-content;
    margin-bottom: 1.5rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Expense Items */
.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg-main);
    margin-bottom: 0.75rem;
    transition: transform 0.2s;
}

.expense-item:hover {
    transform: translateX(4px);
    background: #f1f5f9;
}

.expense-info {
    display: flex;
    flex-direction: column;
}

.expense-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expense-category-badge {
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 4px;
    font-size: 0.75rem;
}

.expense-description { font-weight: 700; }
.expense-date { font-size: 0.75rem; color: var(--text-muted); }

.quick-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-header-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.strip-stats, .strip-filters, .strip-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.unified-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.unified-stat .label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
}

.unified-stat .value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.compact-filter {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.expense-amount {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-item:last-child { border: none; }

.summary-label { font-weight: 500; }
.summary-value { font-weight: 700; }

.summary-item.interactive:hover {
    background: var(--bg-main);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 4px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
}

.modal-large { max-width: 800px; }

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

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Loading Roadmap */
.loading-roadmap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chart-container {
    position: relative;
    width: 100%;
    padding: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .app-container { padding: 1rem; }
    .header { padding: 1rem; margin-bottom: 1rem; }
    .header-content { flex-direction: column; text-align: center; }
    .header-right { width: 100%; justify-content: center; }
    .reports-grid { grid-template-columns: 1fr; }
}