/* ═══════════════════════════════════════════════════════════
   MILLION DOLLAR BABY - Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-primary), sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums lining-nums;
}

/* ── TYPOGRAPHY HIERARCHY ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--line-height-tight);
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--text-primary);
    font-optical-sizing: auto;
}

h1 { font-size: var(--font-size-4xl); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: var(--font-size-3xl); font-weight: 700; letter-spacing: -0.03em;  }
h3 { font-size: var(--font-size-2xl); font-weight: 700; }
h4 { font-size: var(--font-size-xl);  font-weight: 600; }

/* ── TYPOGRAPHY UTILITIES ── */
.font-display { font-family: var(--font-display); }
.font-primary { font-family: var(--font-primary); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.text-light { font-weight: var(--font-weight-light); }
.text-normal { font-weight: var(--font-weight-normal); }
.text-medium { font-weight: var(--font-weight-medium); }
.text-semibold { font-weight: var(--font-weight-semibold); }
.text-bold { font-weight: var(--font-weight-bold); }
.text-extrabold { font-weight: var(--font-weight-extrabold); }

/* ── PREMIUM TYPOGRAPHY IN COMPONENTS ── */
.header-title,
.login-title,
.wizard-title,
.hero-metric__amount,
.hero-metric__label,
.stat-card__label,
.stat-card__value,
.section-title {
    font-family: var(--font-display);
}

.btn,
.tab,
.chart-tab {
    font-family: var(--font-display);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-normal);
}

.stat-card__value {
    font-weight: var(--font-weight-extrabold);
    letter-spacing: var(--letter-spacing-tight);
}

/* ══════════════════════════════════════════════════════════
   NUMERIC TYPOGRAPHY
   Space Grotesk applied to all financial figures.
   tabular-nums keeps digit widths equal (no layout jitter).
   lining-nums keeps all digits on the baseline.
   ══════════════════════════════════════════════════════════ */
.hero-metric__amount,
.hero-metric__currency,
.stat-card__value,
.stat-card__sub,
.health-score__number,
.money-amount,
.num {
    font-family: var(--font-numeric) !important;
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ═══ GLOBAL TAB TYPOGRAPHY ═══
   Enforce premium font stack across all dynamically rendered tab content.
   Inline styles in JS can still override per-element where needed.        */

/* Headings inside tabs always use display font */
.tab-content h2, .tab-content h3, .tab-content h4 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* All numbers rendered with font-numeric get tabular figures */
.tab-content [style*="font-numeric"],
.tab-content [style*="font-family:var(--font-numeric)"] {
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Labels / muted meta text */
.tab-content label,
.tab-content .tab-horizontal,
.tab-content .btn {
    font-family: var(--font-primary);
    letter-spacing: 0;
}

/* ─────────────────────────── */

input[type="number"],
input.money-input {
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    letter-spacing: 0.01em;
}

/* ══════════════════════════════════════════════════════════
   LOGIN SCREEN - Modern Split Layout
   ══════════════════════════════════════════════════════════ */
.login-screen-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    z-index: 9999;
    overflow: hidden;
}

/* ─── LEFT PANEL - Branding ─── */
.login-panel-left {
    /* Dynamic backgrounds that contrast with AMC logo (orange/amber) */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px;
    position: relative;
    overflow: hidden;
    animation: backgroundShift 20s ease-in-out infinite;
}

/* Dynamic background animations */
@keyframes backgroundShift {
    0%, 100% {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    }
    25% {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    }
    50% {
        background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0c4a6e 100%);
    }
    75% {
        background: linear-gradient(135deg, #134e4a 0%, #115e59 50%, #134e4a 100%);
    }
}

/* Animated gradient orbs */
.login-panel-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatOrb1 12s ease-in-out infinite;
}

.login-panel-left::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatOrb2 15s ease-in-out infinite reverse;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 50px) scale(1.1); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -40px) scale(1.15); }
}

.login-left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 48px;
    position: relative;
    z-index: 1;
}

/* Brand Section */
.login-brand-modern {
    display: flex;
    align-items: center;
    gap: 20px;
}

.login-logo-modern {
    width: auto;
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 8px 24px rgba(245, 158, 11, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-brand-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin: 0;
    color: white;
}

.login-brand-subtitle {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
    margin: 0;
}

/* Quote Section */
.login-quote-section {
    margin-top: 20px;
}

.login-quote-icon {
    font-size: 48px;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.login-quote {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    padding-left: 24px;
}

.login-quote-text {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.5;
    font-weight: 500;
    margin: 0 0 16px 0;
    color: white;
}

.login-quote-author {
    font-size: 14px;
    font-style: normal;
    opacity: 0.8;
}

/* Features List */
.login-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}

.login-feature {
    display: flex;
    gap: 16px;
    align-items: start;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.login-feature:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(8px);
}

.login-feature-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.login-feature-text h4 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: white;
}

.login-feature-text p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* Left Footer with Rotating Quote */
.login-left-footer {
    padding-top: 42px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.login-quote-footer {
    margin: 0;
    opacity: 0;
    animation: fadeInQuote 0.5s ease-in-out forwards;
}

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

.login-quote-text-footer {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.6;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.95);
    font-style: italic;
}

.login-quote-author-footer {
    font-size: 16px;
    font-style: normal;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* ─── RIGHT PANEL - Login Form ─── */
.login-panel-right {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.login-form-container {
    width: 100%;
    max-width: 440px;
}

/* Mobile brand logo — hidden on desktop, shown on mobile via mobile.css */
.login-mobile-brand { display: none; }

/* Welcome Section */
.login-welcome {
    margin-bottom: 48px;
    text-align: center;
}

.login-welcome-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.login-welcome-subtitle {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Form Content */
.login-form-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Google Sign In Button - Modern */
.btn-google-modern {
    width: 100%;
    padding: 16px 24px;
    background: white;
    color: #1f2937;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.btn-google-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.6s;
}

.btn-google-modern:hover::before {
    left: 100%;
}

.btn-google-modern:hover {
    background: #f9fafb;
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.btn-google-modern:active {
    transform: translateY(0);
}

.btn-google-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.login-divider-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.login-divider-text {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Info Cards */
.login-info-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #4b5563;
    font-size: 14px;
    transition: all 0.2s ease;
}

.login-info-card svg {
    color: #6366f1;
    flex-shrink: 0;
}

.login-info-card:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Help Text */
.login-help {
    margin-top: 32px;
    text-align: center;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
}

.login-help p {
    font-size: 14px;
    color: #1e40af;
    margin: 0;
    line-height: 1.6;
}

.login-help strong {
    font-weight: 600;
    color: #1e3a8a;
}

/* ─── RESPONSIVE DESIGN ─── */
@media (max-width: 1024px) {
    .login-screen-modern {
        grid-template-columns: 1fr;
    }

    .login-panel-left {
        display: none;
    }

    .login-panel-right {
        padding: 40px 24px;
    }
}

@media (max-width: 640px) {
    .login-welcome-title {
        font-size: 28px;
    }

    .login-welcome-subtitle {
        font-size: 14px;
    }

    .login-form-container {
        max-width: 100%;
    }
}

/* Loading spinner for auth */
.auth-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── CONTAINER ── */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: visible;
}

/* ── HEADER - Modern Light Theme with Glassmorphism ── */
.app-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95) 0%, rgba(67, 56, 202, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    text-align: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.15);
    overflow: visible;
}
.header-user-info {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    opacity: 0.95;
    font-size: var(--font-size-sm);
}

/* Header Brand - Logo + Text */
.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.header-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.header-logo {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 4px 16px rgba(255, 255, 255, 0.3));
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.header-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.15em;
    margin: 0;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.header-subtitle {
    opacity: 0.9;
    font-size: var(--font-size-base);
    font-weight: 400;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}
.header-nav {
    margin-top: var(--space-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.header-month-display {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    min-width: 200px;
    text-align: center;
    color: white;
    letter-spacing: -0.5px;
}
.header-actions {
    margin-top: var(--space-md);
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.header-status {
    margin-top: var(--space-sm);
    font-size: var(--font-size-sm);
    opacity: 0.85;
}

/* ── BUTTONS ── */
/* ══════════════════════════════════════════════════════════
   PREMIUM BUTTON SYSTEM - High-end Design
   ══════════════════════════════════════════════════════════ */

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.02em;
}

/* Hover Effect - Lift & Glow */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Active/Pressed State */
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Focus State - Accesibilidad */
.btn:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Disabled State */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Ripple Effect (animated background) */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ─── PRIMARY BUTTON - Indigo Gradient ─── */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--color-accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--accent-primary) 100%);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

/* ─── SECONDARY BUTTON - Soft Gray ─── */
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: var(--color-surface-alt);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ─── SUCCESS BUTTON - Emerald Green ─── */
.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

/* ─── DANGER BUTTON - Soft Red ─── */
.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

/* ─── NAV BUTTON - Glass Effect ─── */
.btn-nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ─── SMALL BUTTONS - Compact Variants ─── */
.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
}

.btn-danger-sm {
    background: var(--color-danger);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger-sm:hover {
    background: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-edit-sm {
    background: var(--color-secondary);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.btn-edit-sm:hover {
    background: var(--color-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-success-sm {
    background: var(--color-success);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-success-sm:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ─── ACTION BUTTONS - Legacy Support ─── */
.btn-action {
    padding: 10px 20px;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
}

.btn-export {
    background: var(--color-success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-import {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-danger-action {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ─── UTILITY CLASSES ─── */
.btn-block {
    width: 100%;
}

.btn-icon-only {
    padding: 10px;
    border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════════════════════
   PREMIUM TABS - Modern Design
   ══════════════════════════════════════════════════════════ */
.tab-nav {
    display: flex;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow var(--transition-base);
}

.tab-nav.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 1;
    min-width: 120px;
    padding: 14px 20px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.tab:hover {
    background: var(--color-surface-alt);
    color: var(--accent-primary);
}

.tab:hover::before {
    width: 100%;
}

.tab.active {
    background: transparent;
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab.active::before {
    width: 100%;
}

/* ── CONTENT ── */
.content-area { padding: var(--space-xl); }
.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── DASHBOARD GRID ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* ── STAT CARDS - Modern Clean Design ── */
.stat-card {
    color: var(--color-text);
    padding: var(--space-xl) var(--space-lg);
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card--income    { background: var(--gradient-income);    color: white; }
.stat-card--expense   { background: var(--gradient-expense);   color: white; }
.stat-card--emergency { background: var(--gradient-emergency);  color: white; }
.stat-card--invest    { background: var(--gradient-invest);    color: white; }
.stat-card--leisure   { background: var(--gradient-leisure);   color: white; }
.stat-card--primary   { background: var(--gradient-primary);   color: white; }
.stat-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}
.stat-card__value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-xs);
}
.stat-card__sub {
    font-size: var(--font-size-xs);
    opacity: 0.8;
}

/* ── SECTION PANELS - Clean Modern Design ── */
.section-panel {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--card-shadow);
}
.section-panel h3, .section-panel h2 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}
.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

/* ── INNER CARDS - Clean Design ── */
.inner-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: var(--space-md);
    box-shadow: var(--card-shadow);
    margin-bottom: var(--space-md);
}

/* ── FORMS ── */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--font-size-sm);
}
.form-control, select, input, textarea {
    width: 100%;
    padding: 10px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-primary), sans-serif;
    transition: all var(--transition-fast);
}
.form-control:focus, select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: #FFFFFF;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.form-check input[type="checkbox"] { width: auto; accent-color: var(--color-accent); }
.form-check label { margin: 0; }

/* ── ALERTS ── */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
}
.alert-success { background: var(--color-success-bg); color: #155724; border-left: 4px solid var(--color-success-border); }
.alert-warning { background: var(--color-warning-bg); color: #856404; border-left: 4px solid var(--color-warning-border); }
.alert-danger { background: var(--color-danger-bg); color: #721c24; border-left: 4px solid var(--color-danger-border); }
.alert-info { background: var(--color-info-bg); color: #0c5460; border-left: 4px solid var(--color-info-border); }

/* ── INCOME / LIST ITEMS ── */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--space-md);
    background: var(--color-surface);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-success);
    transition: background var(--transition-fast);
}
.list-item:hover { background: var(--color-surface-alt); }
.list-item--debt { border-left-color: var(--color-danger); }
.list-item--neutral { border-left-color: var(--color-text-muted); }
.list-item__label { font-weight: 600; }
.list-item__value { font-weight: 700; }
.list-item__value--positive { color: var(--color-success); }
.list-item__value--negative { color: var(--color-danger); }
.list-item__value--accent { color: var(--color-accent); }
.list-item__actions { display: flex; gap: var(--space-xs); }

/* ── TABLES ── */
table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
th { background: var(--gradient-primary); color: white; padding: 14px var(--space-md); text-align: left; font-weight: 600; font-size: var(--font-size-sm); }
td { padding: 12px var(--space-md); border-bottom: 1px solid var(--color-border-light); font-size: var(--font-size-sm); }
tr:hover { background: var(--color-surface-alt); }
tr:last-child td { border-bottom: none; }

/* ── CHART CONTAINERS ── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}
.chart-box {
    background: var(--color-surface);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.chart-box h3 { margin-bottom: var(--space-md); font-size: var(--font-size-base); }
.chart-box__footer { margin-top: var(--space-md); text-align: center; color: var(--color-text-muted); font-size: var(--font-size-xs); }

/* ── HEALTH SCORE ── */
.health-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-lg);
    align-items: center;
}
.health-score {
    text-align: center;
}
.health-score__number {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
}
.health-score__label {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}
.health-bar { margin-bottom: var(--space-md); }
.health-bar__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-sm);
}
.health-bar__track {
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}
.health-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-slow);
}
.health-bar__fill--danger { background: var(--color-danger); }
.health-bar__fill--success { background: var(--color-success); }
.health-bar__fill--accent { background: var(--color-accent); }

/* ── PROGRESS BAR ── */
.progress { width: 100%; height: 12px; background: var(--color-border); border-radius: 6px; overflow: hidden; }
.progress__fill { height: 100%; transition: width var(--transition-slow); border-radius: 6px; }

/* ── SUMMARY TOTALS ── */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}
.summary-row--border { padding-top: var(--space-md); margin-top: var(--space-sm); border-top: 2px solid var(--color-border); }
.summary-total {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.summary-total--info { background: var(--color-info-bg); border-left: 4px solid var(--color-info-border); }
.summary-total--warning { background: var(--color-warning-bg); border-left: 4px solid var(--color-warning-border); }
.summary-total--danger { background: var(--color-danger-bg); border-left: 4px solid var(--color-danger-border); }

/* ── CREDIT CARD DISPLAY - Clean Design ── */
.credit-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 5px solid var(--accent-primary);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--card-shadow);
}
.credit-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}
.credit-card__badges { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-xs); }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: white;
}
.credit-card__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.credit-card__stat {
    background: var(--color-surface-alt);
    padding: 12px;
    border-radius: var(--radius-sm);
}
.credit-card__stat-label { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.credit-card__stat-value { font-size: var(--font-size-lg); font-weight: 700; }

/* ── MONTH-END PANEL ── */
.month-end-panel {
    padding: var(--space-xl);
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    color: white;
    margin-top: var(--space-xl);
}
.month-end-panel h3 { margin-bottom: var(--space-md); }
.month-end-panel ul { margin: var(--space-md) 0 var(--space-lg) var(--space-lg); }
.month-end-panel li { margin-bottom: var(--space-sm); }

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.toast {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    max-width: 350px;
}
.toast--success { background: var(--color-success); }
.toast--error { background: var(--color-danger); }
.toast--warning { background: var(--color-warning); color: var(--color-text); }
.toast--info { background: var(--color-info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(50%); } }

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-info { color: var(--color-info) !important; }
.text-bold { font-weight: 700; }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.hidden { display: none !important; }
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.empty-state-message {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}
.scrollable { max-height: 300px; overflow-y: auto; }

/* ══════════════════════════════════════════════════════════
   ONBOARDING WIZARD — Premium redesign
   ══════════════════════════════════════════════════════════ */
.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.wizard-container {
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    display: flex;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
    animation: slideUp 0.4s ease;
}

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

/* ── Brand Panel (left) ── */
.wizard-brand-panel {
    width: 210px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #ea580c 0%, #c2410c 100%);
    color: white;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wizard-brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wizard-brand-tagline { flex: 1; }

.wizard-brand-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wizard-brand-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    opacity: 0.45;
    transition: all 0.2s ease;
}

.wizard-brand-step.active    { opacity: 1; background: rgba(255,255,255,.18); }
.wizard-brand-step.completed { opacity: 0.8; }

.wizard-brand-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wizard-brand-step.active    .wizard-brand-step-icon { background: white; color: #ea580c; }
.wizard-brand-step.completed .wizard-brand-step-icon { background: rgba(255,255,255,.35); }

.wizard-brand-step-label {
    font-family: var(--font-primary);
    font-size: .78rem;
    font-weight: 600;
}

/* ── Content Panel (right) ── */
.wizard-content-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    background: var(--color-surface);
}

.wizard-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 10px;
}

.wizard-step-counter {
    font-family: var(--font-primary);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--color-text-muted);
}

.wizard-skip-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: .8rem;
    color: var(--color-text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .2s, background .2s;
}
.wizard-skip-link:hover { color: var(--color-text); background: var(--color-bg); }

/* Progress bar */
.wizard-progress {
    height: 3px;
    background: var(--color-border);
    margin: 0 24px 4px;
    border-radius: 99px;
}
.wizard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ea580c, #f97316);
    transition: width 0.4s ease;
    border-radius: 99px;
}

/* Wizard content area */
.wizard-content {
    flex: 1;
    padding: 18px 24px 12px;
    overflow-y: auto;
}

.wizard-step-content { animation: fadeInContent .25s ease; }

@keyframes fadeInContent {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0);    }
}

/* Step icon */
.wizard-step-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--color-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.wizard-step-icon .material-symbols-outlined { font-size: 26px; color: var(--color-primary); }

.wizard-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -.025em;
    margin: 0 0 6px;
}

.wizard-description {
    font-family: var(--font-primary);
    font-size: .875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0 0 18px;
}

/* Amount input block (Step 1) */
.wizard-amount-input {
    background: var(--color-bg);
    border-radius: 14px;
    padding: 14px 16px;
}

.wizard-currency-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wizard-currency-select {
    font-family: var(--font-numeric);
    font-size: .95rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    width: 76px;
    flex-shrink: 0;
}

.wizard-amount-field {
    font-family: var(--font-numeric);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    letter-spacing: -.04em;
}
.wizard-amount-field::placeholder { color: var(--color-border); }

/* Wizard tip */
.wizard-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: .78rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Expenses list (Step 2) */
.wizard-expenses-list {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    margin-bottom: 10px;
}

.wizard-expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
}
.wizard-expense-item:last-child { border-bottom: none; }

.wizard-add-expense { margin-top: 8px; }

.form-row { display: flex; gap: 8px; align-items: center; }

/* Choice buttons (Step 3) */
.wizard-choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 4px 0;
}

.wizard-choice-btn {
    padding: 20px 14px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wizard-choice-btn:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(234,88,12,.12);
}
.wizard-choice-btn.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
}

.wizard-choice-icon {
    font-size: 30px !important;
    color: var(--color-text-muted);
    transition: color .2s;
}
.wizard-choice-btn:hover .wizard-choice-icon,
.wizard-choice-btn.selected .wizard-choice-icon { color: var(--color-primary); }

.wizard-choice-label {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: .875rem;
    color: var(--color-text);
}
.wizard-choice-desc {
    font-family: var(--font-primary);
    font-size: .72rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Navigation bar */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    margin-top: auto;
}

/* Empty state mini */
.empty-state-mini {
    text-align: center;
    padding: 18px;
    color: var(--color-text-muted);
    font-family: var(--font-primary);
    font-size: .8rem;
}

/* Delete btn in wizard list */
.btn-icon-danger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    color: var(--color-danger);
    opacity: 0.55;
    transition: opacity .2s, background .2s;
    display: flex;
    align-items: center;
}
.btn-icon-danger:hover { opacity: 1; background: rgba(239,68,68,.08); }

/* Hide brand panel on mobile */
@media (max-width: 600px) {
    .wizard-brand-panel { display: none; }
    .wizard-container   { max-height: 95vh; }
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR PROFILE PROGRESS WIDGET
   ══════════════════════════════════════════════════════════ */
.sidebar-progress-widget {
    margin: 0;
    padding: 5px 8px;
    background: var(--color-primary-bg);
    border: 1px solid rgba(234,88,12,.18);
    border-radius: 9px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.sidebar-progress-widget:hover {
    background: rgba(234,88,12,.13);
    border-color: rgba(234,88,12,.3);
}

.sidebar-progress-widget__inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-progress-widget__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 5px;
    font-family: var(--font-primary);
}

.sidebar-progress-widget__track {
    height: 4px;
    background: rgba(234,88,12,.18);
    border-radius: 99px;
    overflow: hidden;
}

.sidebar-progress-widget__fill {
    height: 100%;
    background: linear-gradient(90deg, #ea580c, #f97316);
    border-radius: 99px;
    transition: width .6s ease;
}

/* Progress panel (dropdown) — fixed so it escapes sidebar overflow */
.progress-panel {
    position: fixed;
    width: 260px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
    z-index: 99999;
    overflow: hidden;
}
.progress-panel.hidden { display: none; }

.progress-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 14px 10px;
}

.progress-panel__bar-wrap {
    height: 4px;
    background: var(--color-bg);
    margin: 0 14px 12px;
    border-radius: 99px;
    overflow: hidden;
}

.progress-panel__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ea580c, #f97316);
    border-radius: 99px;
    transition: width .5s ease;
}

.progress-panel__items { padding: 0 8px 4px; }

.progress-panel__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
}
.progress-panel__item:hover:not(.done) { background: var(--color-bg); }
.progress-panel__item.done { cursor: default; }

.progress-panel__footer {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   COACHMARKS (TOOLTIPS)
   ══════════════════════════════════════════════════════════ */
.coachmark {
    position: fixed;
    z-index: 9999;
    animation: coachmarkAppear 0.3s ease;
}

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

.coachmark-content {
    background: var(--color-primary);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 300px;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.coachmark-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: var(--font-size-lg);
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    margin-left: var(--space-sm);
}

.coachmark-close:hover {
    opacity: 1;
}

.coachmark-arrow {
    position: absolute;
    width: 0;
    height: 0;
}

.coachmark-bottom .coachmark-arrow {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--color-primary);
}

.coachmark-right .coachmark-arrow {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--color-primary);
}

/* ══════════════════════════════════════════════════════════
   PROFILE PROGRESS INDICATOR
   ══════════════════════════════════════════════════════════ */
.profile-progress {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--color-border);
}

.profile-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.profile-progress-percentage {
    color: var(--color-primary);
    font-size: var(--font-size-lg);
}

.profile-progress-bar {
    height: 8px;
    background: var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.profile-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: var(--radius-lg);
}

.profile-progress-fill--success {
    background: linear-gradient(90deg, var(--color-success), #4ade80);
}

.profile-progress-fill--info {
    background: linear-gradient(90deg, var(--color-info), #818CF8);
}

.profile-progress-fill--warning {
    background: linear-gradient(90deg, var(--color-warning), #fbbf24);
}

.profile-progress-fill--danger {
    background: linear-gradient(90deg, var(--color-danger), #f87171);
}

/* ══════════════════════════════════════════════════════════
   HERO METRIC - Modern Light Design
   ══════════════════════════════════════════════════════════ */
.hero-metric {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    margin-bottom: var(--space-lg);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;

}

.hero-metric__label {
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-metric__value {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-xs);
    margin: var(--space-sm) 0;
}

/* ── Hero Amount Wrapper: sets the base em for children ── */
.hero-amount-wrapper {
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-size: clamp(1.4rem, 3vw, 1.8rem); /* mismo rango que las demás KPI cards */
}

/* 1. SÍMBOLO DE MONEDA */
.hero-metric__currency {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1em;
    font-weight: 900;
    font-family: var(--font-numeric);
}

/* 2. MONTO ENTERO */
.hero-metric__amount {
    color: white;
    font-size: 1em;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* 3. DECIMALES */
.hero-decimal {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.65em;
    font-weight: 600;
    letter-spacing: 0;
}

.hero-metric__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    font-weight: 400;
}

/* Hero metric states */
.hero-metric--warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.hero-metric--danger {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ══════════════════════════════════════════════════════════
   CHART TABS
   ══════════════════════════════════════════════════════════ */
.chart-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
}

.chart-tab {
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chart-tab:hover {
    color: var(--color-primary);
    background: var(--color-primary-bg);
}

.chart-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.chart-container {
    position: relative;
    min-height: 400px;
}

.chart-panel {
    display: none;
    animation: fadeInChart 0.3s ease;
}

.chart-panel.active {
    display: block;
}

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

/* ══════════════════════════════════════════════════════════
   STAT CARDS - ENHANCED STATES
   ══════════════════════════════════════════════════════════ */
.stat-card {
    position: relative;
    overflow: visible;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Warning state - gastos > 40% */
.stat-card--warning::before {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    opacity: 0.3;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Danger state - gastos > 50% */
.stat-card--danger::before {
    background: linear-gradient(135deg, #F87171, #EF4444);
    opacity: 0.5;
    animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}

/* Success state - ingresos altos */
.stat-card--success::before {
    background: linear-gradient(135deg, #34D399, #10B981);
    opacity: 0.2;
}

/* ══════════════════════════════════════════════════════════
   COUNT-UP ANIMATION
   ══════════════════════════════════════════════════════════ */
@keyframes countUp {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-count-up {
    animation: countUp 0.5s ease;
}

/* Number change flash */
@keyframes flashNumber {
    0% { background: rgba(79, 70, 229, 0.3); }
    100% { background: transparent; }
}

.number-changed {
    animation: flashNumber 0.6s ease;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    display: inline-block;
}

/* ══════════════════════════════════════════════════════════
   ACCESSIBILITY (WCAG 2.1 AA)
   ══════════════════════════════════════════════════════════ */

/* ── FOCUS RINGS (Visible keyboard navigation) ── */
*:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* High contrast focus for buttons */
.btn:focus-visible,
.tab:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.3);
}

/* ── IMPROVED COLOR CONTRAST (4.5:1 minimum) ── */

/* Fix text-muted contrast - was too light */
.text-muted {
    color: #525252; /* Improved from original to pass 4.5:1 on white */
}

.stat-card__sub {
    color: #525252; /* Improved contrast */
}

.header-subtitle {
    opacity: 1;
    color: rgba(255, 255, 255, 0.95); /* Improved for dark backgrounds */
}

/* Empty state message contrast */
.empty-state-message {
    color: #525252; /* Improved from text-muted */
}

/* Login screen text */
.login-subtitle {
    color: #525252; /* Improved contrast */
}

/* Wizard description */
.wizard-description {
    color: #525252; /* Improved contrast */
}

/* Chart tab inactive state */
.chart-tab {
    color: #404040; /* Improved from text-muted */
}

/* ── SKIP LINK (for keyboard users) ── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ── SCREEN READER ONLY TEXT ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Disable specific animations */
    .hero-metric::before {
        animation: none;
    }

    .stat-card--warning::before,
    .stat-card--danger::before {
        animation: none;
    }

    .hero-metric--danger {
        animation: none;
    }

    .animate-count-up {
        animation: none;
    }

    .number-changed {
        animation: none;
    }

    .wizard-overlay,
    .wizard-container,
    .wizard-step-content,
    .chart-panel,
    .coachmark {
        animation: none;
    }
}

/* ── HIGH CONTRAST MODE SUPPORT ── */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000000;
        --color-text-muted: #404040;
        --color-border: #000000;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .stat-card {
        border: 2px solid var(--color-border);
    }
}

/* ── DARK MODE (if user prefers) ── */
@media (prefers-color-scheme: dark) {
    /* This is optional - can be implemented later */
    /* For now, we maintain light mode for consistency */
}

/* ══════════════════════════════════════════════════════════
   MOBILE-FIRST DESIGN
   ══════════════════════════════════════════════════════════ */

/* ── BOTTOM NAVIGATION BAR (Mobile) ── */
.bottom-nav {
    display: none; /* Hidden on desktop */
}

.tab-nav {
    display: flex; /* Desktop: horizontal tabs */
}

/* ── FAB (Floating Action Button) ── */
.fab {
    position: fixed;
    bottom: 80px; /* Above bottom nav */
    right: var(--space-lg);
    width: 60px;
    height: 60px;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 999;
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

/* ── TOUCH-FRIENDLY BUTTONS ── */
.btn-touch {
    min-width: 44px;
    min-height: 44px;
    padding: 12px 20px;
}

/* ── SWIPE INDICATOR ── */
.swipe-indicator {
    display: none;
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    z-index: 1000;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════ */

/* ── PHONE: 480px and below ── */
@media (max-width: 480px) {
    /* Layout */
    body {
        padding: 0;
        padding-bottom: 70px; /* Space for bottom nav */
    }

    .app-container {
        border-radius: 0;
        box-shadow: none;
    }

    /* Header */
    .app-header {
        padding: var(--space-md);
        border-radius: 0;
    }

    .header-brand {
        gap: var(--space-xs);
    }

    .header-title-row {
        gap: var(--space-sm);
    }

    .header-logo {
        width: 40px;
        height: 40px;
    }

    .header-title {
        font-size: var(--font-size-2xl);
        letter-spacing: 0.1em;
    }

    .header-subtitle {
        font-size: var(--font-size-xs);
        text-align: center;
    }

    .header-month-display {
        font-size: var(--font-size-lg);
        min-width: 180px;
    }

    .header-user-info {
        position: static;
        margin-bottom: var(--space-sm);
        text-align: center;
    }

    .header-actions {
        gap: var(--space-xs);
    }

    .btn-nav {
        padding: 8px 16px;
        font-size: var(--font-size-xs);
    }

    .btn-action {
        padding: 6px 10px;
        font-size: 10px;
    }

    /* Hide desktop tabs, show bottom nav */
    .tab-nav {
        display: none !important;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-top: 2px solid var(--color-border);
        padding: var(--space-xs) 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        justify-content: space-around;
        align-items: center;
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px;
        background: transparent;
        border: none;
        color: var(--color-text-secondary);
        font-size: 9px;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--transition-fast);
        min-height: 56px; /* Touch target */
        text-align: center;
        max-width: 70px; /* Limit width for 6 tabs */
    }

    .bottom-nav-item__icon {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .bottom-nav-item__label {
        font-size: 9px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .bottom-nav-item.active {
        color: var(--color-accent);
    }

    .bottom-nav-item:active {
        background: var(--color-surface-alt);
    }

    /* Content */
    .content-area {
        padding: var(--space-sm);
    }

    /* Hero Metric */
    .hero-metric {
        margin: 0 var(--space-sm) var(--space-md);
        padding: var(--space-lg);
    }

    .hero-metric__label {
        font-size: var(--font-size-sm);
    }

    .hero-metric__subtitle {
        font-size: var(--font-size-sm);
    }

    /* Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }

    /* Stat Cards */
    .stat-card {
        padding: var(--space-md);
    }

    .stat-card__label {
        font-size: 10px;
    }

    .stat-card__value {
        font-size: var(--font-size-xl);
    }

    /* Forms - Touch-friendly inputs */
    .form-control {
        padding: 14px var(--space-md);
        font-size: var(--font-size-md);
        min-height: 48px; /* Touch target */
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    /* Buttons - Touch targets 44x44px minimum */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: var(--font-size-sm);
    }

    .btn-danger-sm,
    .btn-edit-sm {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 14px;
        font-size: var(--font-size-md);
    }

    .btn-success-sm {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Section Panels - Mobile Optimized */
    .section-panel {
        padding: var(--space-md);
        margin: 0 var(--space-sm) var(--space-md);
        border-radius: var(--radius-md);
    }

    .section-panel h3,
    .section-panel h2 {
        font-size: var(--font-size-md);
        margin-bottom: var(--space-sm);
    }

    .section-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--space-md);
        padding: 0 var(--space-sm);
    }

    /* Dashboard specific sections */
    #dashboard .section-panel {
        background: var(--color-surface);
        box-shadow: var(--shadow-sm);
    }

    /* Health score section header */
    .section-panel > div:first-child {
        margin-bottom: var(--space-sm);
    }

    /* List Items */
    .list-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .list-item__actions {
        width: 100%;
        justify-content: flex-end;
        gap: var(--space-sm);
    }

    /* Charts - Mobile Optimized with Scroll Snap */
    .chart-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: var(--space-sm);
        padding: var(--space-md);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-behavior: smooth;
        /* Scroll snap for better alignment */
        scroll-snap-type: x proximity;
        align-items: center;
        background: var(--color-surface-alt);
        border-radius: var(--radius-md);
        margin: 0 0 var(--space-md);
    }

    .chart-tabs::-webkit-scrollbar {
        display: none;
        height: 0;
    }

    .chart-tab {
        padding: 10px 20px;
        font-size: var(--font-size-xs);
        min-width: fit-content;
        white-space: nowrap;
        flex-shrink: 0;
        flex-grow: 0;
        border-radius: var(--radius-full);
        background: transparent;
        border: 2px solid transparent;
        transition: all 0.2s ease;
        font-weight: 600;
        color: var(--color-text-secondary);
        /* Scroll snap point */
        scroll-snap-align: start;
    }

    .chart-tab:hover {
        background: rgba(26, 26, 46, 0.05);
    }

    .chart-tab.active {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
        box-shadow: 0 2px 8px rgba(26, 26, 46, 0.2);
        transform: translateY(-1px);
    }

    .chart-container {
        min-height: 280px;
        padding: var(--space-sm);
        background: var(--color-surface);
        border-radius: var(--radius-md);
        margin: 0 var(--space-sm);
    }

    .chart-panel {
        display: none;
    }

    .chart-panel.active {
        display: block;
        animation: fadeInChart 0.3s ease;
    }

    .chart-panel canvas {
        max-height: 250px !important;
        width: 100% !important;
    }

    /* Chart box on mobile */
    .chart-box {
        padding: var(--space-sm);
        margin: 0;
    }

    .chart-box h3 {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-sm);
    }

    /* Tables - Horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: var(--font-size-xs);
    }

    th, td {
        padding: 8px;
    }

    /* Credit Cards */
    .credit-card {
        padding: var(--space-md);
    }

    .credit-card__stats {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    /* Health Grid - Mobile Optimized */
    .health-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .health-score {
        padding: var(--space-md) 0;
    }

    .health-score__number {
        font-size: 2.5rem;
        margin-bottom: var(--space-xs);
    }

    .health-score__label {
        font-size: var(--font-size-sm);
    }

    .health-bar {
        margin-bottom: var(--space-sm);
    }

    .health-bar__header {
        font-size: var(--font-size-xs);
    }

    /* Recommendations on mobile */
    .section-panel .inner-card {
        padding: var(--space-sm);
        margin-bottom: var(--space-sm);
    }

    .section-panel .inner-card h4 {
        font-size: var(--font-size-md);
        margin-bottom: var(--space-xs);
    }

    .section-panel .inner-card p {
        font-size: var(--font-size-sm);
        line-height: 1.5;
    }

    /* Wizard — mobile */
    .wizard-brand-panel   { display: none; }
    .wizard-content       { padding: 14px 16px; }
    .wizard-choice-buttons { grid-template-columns: 1fr; }
    .wizard-amount-field  { font-size: 1.5rem; }

    /* Sidebar progress panel — mobile: max-width adjustment */
    .progress-panel { width: 240px; }

    /* Toast Notifications */
    .toast-container {
        top: var(--space-sm);
        right: var(--space-sm);
        left: var(--space-sm);
    }

    .toast {
        max-width: 100%;
    }

    /* Show FAB */
    .fab {
        display: flex;
        bottom: 76px; /* Above bottom nav */
    }

    /* Grid helpers */
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    /* Progress bars on mobile */
    .progress {
        height: 10px;
    }

    /* Alert boxes */
    .alert {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-xs);
        margin-bottom: var(--space-md);
    }

    /* Empty states */
    .empty-state {
        padding: var(--space-lg) var(--space-md);
    }

    .empty-state-icon {
        font-size: 48px;
    }

    .empty-state-title {
        font-size: var(--font-size-md);
    }

    .empty-state-message {
        font-size: var(--font-size-sm);
    }

    /* Summary totals */
    .summary-total {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    .summary-row {
        font-size: var(--font-size-sm);
        padding: var(--space-xs) 0;
    }

    /* Month end panel */
    .month-end-panel {
        padding: var(--space-lg) var(--space-md);
        margin: var(--space-md) var(--space-sm);
    }

    .month-end-panel h3 {
        font-size: var(--font-size-md);
    }

    .month-end-panel ul {
        font-size: var(--font-size-sm);
        margin-left: var(--space-md);
    }

    /* Profile progress indicator */
    .profile-progress {
        margin: 0 var(--space-sm) var(--space-md);
    }

    .profile-progress-header {
        font-size: var(--font-size-xs);
    }

    .profile-progress-percentage {
        font-size: var(--font-size-md);
    }
}

/* ── TABLET: 481px to 768px ── */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: var(--space-md);
    }

    .app-header {
        padding: var(--space-lg) var(--space-md);
    }

    .header-title {
        font-size: var(--font-size-3xl);
    }

    .content-area {
        padding: var(--space-lg);
    }

    /* Tabs - horizontal scroll */
    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
        min-width: 100px;
    }

    /* Dashboard Grid - 2 columns */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .stat-card__value {
        font-size: var(--font-size-2xl);
    }

    /* Touch-friendly buttons */
    .btn-danger-sm,
    .btn-edit-sm {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 14px;
    }

    /* Forms */
    .form-control {
        min-height: 44px;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .health-grid {
        grid-template-columns: 1fr 1.5fr;
    }

    /* Credit card stats */
    .credit-card__stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── DESKTOP: 769px to 1024px (Small Desktop) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card__value {
        font-size: var(--font-size-2xl);
    }

}

/* ══════════════════════════════════════════════════════════
   CUSTOM MODAL SYSTEM (replacing alert/confirm/prompt)
   ══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    padding: var(--space-md);
}

.modal-container {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.modal-header {
    background: var(--color-bg);
    padding: var(--space-lg);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.modal-header--danger {
    background: var(--color-danger-bg);
    border-bottom-color: var(--color-danger-border);
}

.modal-icon {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-sm);
}

.modal-icon--loading {
    animation: modal-icon-pulse 1.5s ease-in-out infinite;
}

@keyframes modal-icon-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0;
}

.modal-body {
    padding: var(--space-xl);
}

.modal-message {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin: 0;
    text-align: center;
}

.modal-input {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    margin-top: var(--space-md);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    transition: border-color var(--transition-base);
}

.modal-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.modal-footer {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.modal-footer .btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
    min-height: 38px;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

.modal-loading {
    background: var(--color-surface);
    padding: var(--space-2xl);
    text-align: center;
    max-width: 300px;
    border: none;
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: modal-spinner-spin 0.8s linear infinite;
    margin: var(--space-md) auto 0;
}

@keyframes modal-spinner-spin {
    to { transform: rotate(360deg); }
}

/* Modal Animations */
.modal-fade-in {
    animation: modal-fade-in 0.2s ease-out;
}

.modal-fade-out {
    animation: modal-fade-out 0.2s ease-in;
}

.modal-scale-in {
    animation: modal-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modal-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ══════════════════════════════════════════════════════════
   UNDO TOAST (5 second timer)
   ══════════════════════════════════════════════════════════ */

.toast-undo {
    position: fixed;
    bottom: 80px;
    right: var(--space-lg);
    background: var(--color-surface-dark);
    color: var(--color-text-inverse);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    z-index: calc(var(--z-toast) + 1);
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.toast-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.toast-timer {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gold);
    font-variant-numeric: tabular-nums;
    min-width: 28px;
}

.toast-undo-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-display);
}

.toast-undo-btn:hover {
    background: var(--color-accent-hover);
    transform: scale(1.05);
}

.toast-undo-btn:active {
    transform: scale(0.98);
}

.toast-slide-in {
    animation: toast-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-slide-out {
    animation: toast-slide-out 0.2s ease-in;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ══════════════════════════════════════════════════════════
   SKELETON LOADERS
   ══════════════════════════════════════════════════════════ */

.skeleton-container {
    opacity: 0.6;
}

.skeleton {
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    to { left: 100%; }
}

.skeleton-card {
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.skeleton-header {
    height: 24px;
    background: var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    width: 60%;
}

.skeleton-line {
    height: 16px;
    background: var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.skeleton-line--short {
    width: 40%;
}

.skeleton-list {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    background: var(--color-border);
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-text {
    flex: 1;
}

.skeleton-text .skeleton-line {
    width: 100%;
}

.skeleton-text .skeleton-line--short {
    width: 60%;
}

/* ══════════════════════════════════════════════════════════
   TAB TRANSITIONS (fade/slide instead of instant swap)
   ══════════════════════════════════════════════════════════ */

.tab-content {
    animation: tab-fade-in 0.3s ease-out;
}

@keyframes tab-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart tab transitions */
.chart-panel {
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.chart-panel:not(.active) {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

.chart-panel.active {
    opacity: 1;
    transform: scale(1);
    animation: chart-panel-fade-in 0.3s ease-out;
}

@keyframes chart-panel-fade-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ══════════════════════════════════════════════════════════
   PULL-TO-REFRESH (Mobile)
   ══════════════════════════════════════════════════════════ */

.pull-to-refresh {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    pointer-events: none;
}

.pull-to-refresh.visible {
    transform: translateX(-50%) translateY(var(--space-lg));
    opacity: 1;
}

.pull-to-refresh.loading {
    animation: pull-to-refresh-spin 1s linear infinite;
}

@keyframes pull-to-refresh-spin {
    to { transform: translateX(-50%) translateY(var(--space-lg)) rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════
   ENHANCED BUTTON FEEDBACK
   ══════════════════════════════════════════════════════════ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.98);
}

/* ── LARGE DESKTOP: 1025px and above ── */
@media (min-width: 1025px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Full-width hero metric */
    .hero-metric {
        grid-column: 1 / -1;
    }

    /* Hide undo toast on desktop (move to top-right) */
    .toast-undo {
        bottom: auto;
        top: 80px;
    }
}

/* ══════════════════════════════════════════════════════════
   MOBILE ADJUSTMENTS for Modal & Toast
   ══════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .modal-container {
        margin: 0 var(--space-md);
        max-width: calc(100% - var(--space-lg) * 2);
    }

    .modal-footer {
        flex-direction: column-reverse;
        padding: var(--space-md);
    }

    .modal-footer .btn {
        width: 100%;
        padding: 8px 16px;
        font-size: 13px;
        min-height: 38px;
        line-height: 1.4;
    }

    .modal-body {
        padding: var(--space-lg) var(--space-md);
    }

    .modal-message {
        font-size: var(--font-size-sm);
    }

    .toast-undo {
        right: var(--space-sm);
        left: var(--space-sm);
        max-width: calc(100% - var(--space-md));
        bottom: 70px; /* Above bottom nav */
    }
}

/* ══════════════════════════════════════════════════════════
   FINANCIAL CALENDAR
   ══════════════════════════════════════════════════════════ */

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
}

.calendar-header h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0;
    text-transform: capitalize;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: var(--space-lg);
}

.calendar-day-header {
    text-align: center;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    padding: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    min-height: 100px;
    padding: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.calendar-day--empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.calendar-day--empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day--today {
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
    box-shadow: var(--shadow-sm);
}

.calendar-day-number {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.calendar-day--today .calendar-day-number {
    color: var(--color-accent);
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.calendar-event {
    font-size: 10px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: var(--font-weight-semibold);
}

.calendar-event--success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-left: 3px solid var(--color-success);
}

.calendar-event--danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-left: 3px solid var(--color-danger);
}

.calendar-event--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-left: 3px solid var(--color-warning);
}

.calendar-event--info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border-left: 3px solid var(--color-info);
}

.calendar-event-more {
    font-size: 10px;
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
    margin-top: 2px;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
}

/* Upcoming Events List */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.upcoming-item {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.upcoming-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.upcoming-item--success {
    border-left: 6px solid var(--color-success);
}

.upcoming-item--danger {
    border-left: 6px solid var(--color-danger);
}

.upcoming-item--warning {
    border-left: 6px solid var(--color-warning);
}

.upcoming-item--info {
    border-left: 6px solid var(--color-info);
}

.upcoming-item-date {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upcoming-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.upcoming-item-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.upcoming-item-amount {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
}

/* Mobile Adjustments for Calendar */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        min-height: 80px;
        padding: 6px;
    }

    .calendar-day-number {
        font-size: var(--font-size-sm);
    }

    .calendar-event {
        font-size: 9px;
        padding: 3px 4px;
    }

    .calendar-header {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .calendar-header h3 {
        font-size: var(--font-size-lg);
    }

    .upcoming-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .legend-item {
        font-size: var(--font-size-xs);
    }

    .legend-color {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }

    .calendar-day-header {
        font-size: 10px;
        padding: 4px;
    }

    .calendar-event {
        font-size: 8px;
        padding: 2px 3px;
    }

    .calendar-day-number {
        font-size: 12px;
    }
}

/* ══════════════════════════════════════════════════════════
   PRIVACY MODE - Ocultar montos sensibles
   ══════════════════════════════════════════════════════════ */

/* Text is replaced with ***.** by privacy.js — no blur needed */
body.privacy-active .money-amount,
body.privacy-active .stat-card-saas__value,
body.privacy-active .em-kpi-value,
body.privacy-active .em-formula-value,
body.privacy-active .em-gauge-pct,
body.privacy-active .mfe-hero__amount,
body.privacy-active .mfe-metric__value,
body.privacy-active .dist-row-value,
body.privacy-active .dist-total-value,
body.privacy-active .mdb-metric__value {
    user-select: none;
    letter-spacing: 0.04em;
}

/* Privacy indicator */
body.privacy-active::before {
    content: '🔒 Modo Privacidad Activo';
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(79, 70, 229, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: privacy-pulse 2s ease-in-out infinite;
}

@keyframes privacy-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    body.privacy-active::before {
        bottom: 80px;
        right: 10px;
        font-size: 10px;
        padding: 6px 12px;
    }
}

/* ══════════════════════════════════════════════════════════
   SETTINGS DROPDOWN MENU - Nordic Calm Style
   ══════════════════════════════════════════════════════════ */

.settings-menu-container {
    position: relative;
    display: inline-block;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    cursor: pointer;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.dropdown-content {
    position: fixed !important;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 240px;
    z-index: 99999 !important;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.dropdown-content.hidden {
    display: none;
}

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

.dropdown-group {
    padding: 4px 0;
}

.dropdown-label {
    display: block;
    padding: 8px 16px 4px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════
   PREMIUM DROPDOWN ITEMS
   ══════════════════════════════════════════════════════════ */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: var(--font-primary);
    font-weight: 500;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 2px 8px;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.dropdown-item:hover {
    background: var(--color-surface-alt);
    padding-left: 20px;
}

.dropdown-item:hover::before {
    height: 70%;
}

.dropdown-item:active {
    background: var(--color-surface-dark);
    transform: scale(0.98);
}

.dropdown-icon {
    font-size: 18px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 8px 12px;
}

.dropdown-item.text-danger {
    color: var(--accent-danger);
}

.dropdown-item.text-danger::before {
    background: var(--accent-danger);
}

.dropdown-item.text-danger:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.danger-zone {
    margin-top: 4px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dropdown-content {
        right: -10px;
        min-width: 200px;
    }
}

/* ══════════════════════════════════════════════════════════
   HAMBURGER MENU (Esquina Superior Izquierda)
   ══════════════════════════════════════════════════════════ */

.hamburger-menu-container {
    position: absolute;
    top: 15px;
    left: 20px;
    z-index: 1100;

}

.hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.hamburger-btn:active {
    transform: scale(0.98);
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

/* Dropdown alineado a la izquierda */
.dropdown-left {
    /* Position handled by JavaScript */
}

/* ══════════════════════════════════════════════════════════
   USER MENU (Esquina Superior Derecha)
   ══════════════════════════════════════════════════════════ */

.user-menu-container {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1100;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.user-menu-btn:active {
    transform: translateY(0);
}

.user-menu-btn svg {
    flex-shrink: 0;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown alineado a la derecha */
.dropdown-right {
    /* Position handled by JavaScript */
}

/* User info inside dropdown */
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface-alt);
    border-radius: 8px;
    margin: 4px 8px 8px;
}

.dropdown-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dropdown-user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-user-email {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .hamburger-menu-container {
        top: 10px;
        left: 10px;
    }

    .user-menu-container {
        top: 10px;
        right: 10px;
    }

    .user-menu-btn {
        padding: 6px 12px;
        font-size: var(--font-size-xs);
    }

    .user-name {
        max-width: 80px;
    }

    .dropdown-user-info {
        padding: 10px 12px;
    }
}


/* ══════════════════════════════════════════════════════════
   PRIVACY TOGGLE BUTTON (En Hero Metric)
   ══════════════════════════════════════════════════════════ */

.privacy-toggle-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    z-index: 10;
}

.privacy-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.privacy-toggle-btn:active {
    transform: scale(0.95);
}

body.privacy-active .privacy-toggle-btn {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

body.privacy-active .privacy-toggle-btn svg {
    opacity: 0.5;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .privacy-toggle-btn {
        width: 36px;
        height: 36px;
        top: 12px;
        right: 12px;
    }

    .privacy-toggle-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ══════════════════════════════════════════════════════════
   MONTH NAVIGATION STICKY BAR - Nordic Calm
   ══════════════════════════════════════════════════════════ */

.month-nav-sticky {
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--bg-card);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.month-nav-sticky::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    pointer-events: none;
}

.month-nav-btn {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.month-nav-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.month-nav-btn:active {
    transform: scale(0.95);
}

.month-nav-btn svg {
    width: 20px;
    height: 20px;
}

.month-nav-display {
    position: relative;
    z-index: 1;
    background: var(--gradient-primary);
    padding: 10px 32px;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
}

.month-nav-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    text-align: center;
    display: block;
    min-width: 180px;
}

/* Scroll effect - reduce size when scrolling */
.month-nav-sticky.scrolled {
    padding: 8px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.month-nav-sticky.scrolled .month-nav-btn {
    width: 36px;
    height: 36px;
}

.month-nav-sticky.scrolled .month-nav-display {
    padding: 8px 24px;
}

.month-nav-sticky.scrolled .month-nav-text {
    font-size: var(--font-size-lg);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .month-nav-sticky {
        padding: 10px 16px;
        gap: var(--space-md);
    }

    .month-nav-btn {
        width: 36px;
        height: 36px;
    }

    .month-nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .month-nav-display {
        padding: 8px 20px;
    }

    .month-nav-text {
        font-size: var(--font-size-lg);
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .month-nav-sticky {
        padding: 8px 12px;
    }

    .month-nav-btn {
        width: 32px;
        height: 32px;
    }

    .month-nav-display {
        padding: 6px 16px;
    }

    .month-nav-text {
        font-size: var(--font-size-md);
        min-width: 120px;
    }
}

/* ══════════════════════════════════════════════════════════
   BUTTON LAYOUT IMPROVEMENTS - Task 11
   Better positioning and reduced full-width usage
   ══════════════════════════════════════════════════════════ */

/* Button Groups - Horizontal layouts */
.button-group {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.button-group--end {
    justify-content: flex-end;
}

.button-group--center {
    justify-content: center;
}

.button-group--space-between {
    justify-content: space-between;
}

/* Form Actions - Better positioning */
.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

.form-actions .btn:not(.btn-block) {
    min-width: 120px;
}

/* Reduce full-width buttons - use auto width by default in forms */
.section-panel .btn:not(.btn-block),
.inner-card .btn:not(.btn-block) {
    width: auto;
    min-width: 100px;
}

/* ══════════════════════════════════════════════════════════
   FINSMART MINIMALISM - Tasks 12 & 13
   Cleaner, more spacious, professional design
   ══════════════════════════════════════════════════════════ */


.inner-card {
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
}

.inner-card:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

/* Credit card visual improvements */
.credit-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.credit-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Subtle, professional badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Clean form inputs */
.form-control {
    border: 2px solid var(--color-border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    background: var(--color-surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Professional table styling */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    background: var(--color-surface-alt);
    padding: var(--space-md);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
}

table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

table tr:hover td {
    background: var(--color-surface-alt);
}

/* List items with better spacing */
.list-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-fast);
}

.list-item:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-border);
}

/* Cleaner section headers */
.section-panel h3 {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-border-light);
    font-size: var(--font-size-xl);
    color: var(--color-text);
}

/* Professional progress bars */
.progress {
    height: 8px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress__fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Minimal empty states */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.6;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state-message {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    max-width: 400px;
    margin: 0 auto var(--space-lg);
}

/* ══════════════════════════════════════════════════════════
   CALENDAR ENHANCEMENTS - Task 14
   Auto-mark past events as paid
   ══════════════════════════════════════════════════════════ */

.calendar-event--past {
    opacity: 0.5;
    text-decoration: line-through;
    font-weight: normal;
}

.calendar-day--past {
    opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════
   MODERN INCOME SECTION STYLES
   Clean, minimal design inspired by Many Healthy Finance
   ══════════════════════════════════════════════════════════ */

/* Income Header */
.income-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--color-success-bg) 0%, var(--color-success-bg-alt, #d1fae5) 100%);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-success);
}

.income-header__title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.income-header__total {
    text-align: right;
}

.income-total-card {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.income-total-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.income-total-card__value {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--color-success);
    line-height: 1;
}

/* Modern Panel */
.section-panel-modern {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.panel-modern__header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.panel-modern__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.panel-modern__title .material-symbols-outlined {
    font-size: 24px;
    color: var(--color-accent);
}

.panel-modern__body {
    padding: var(--space-lg);
}

/* Modern Form Grid */
.form-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label-modern {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label-modern .material-symbols-outlined {
    color: var(--color-accent);
}

.form-control-modern {
    width: 100%;
    padding: 12px 14px;
    font-size: var(--font-size-base);
    font-family: inherit;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    transition: all var(--transition-base);
}

.form-control-modern:hover {
    border-color: var(--color-accent-light);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 99, 102, 241), 0.1);
}

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

/* Modern Checkbox */
.form-check-modern {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-check-input-modern {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.form-check-input-modern:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.form-check-label-modern {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-check-label-modern .material-symbols-outlined {
    color: var(--color-info);
}

/* Modern Buttons */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.btn-modern .material-symbols-outlined {
    font-size: 20px;
}

.btn-modern--primary {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-modern--primary:hover {
    background: var(--color-accent-dark);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb, 99, 102, 241), 0.25);
    transform: translateY(-1px);
}

.btn-modern--primary:active {
    transform: translateY(0);
}

/* Modern Empty State */
.empty-state-modern {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--color-text-muted);
}

.empty-state-modern__icon {
    font-size: 64px;
    color: var(--color-text-muted);
    opacity: 0.5;
    margin-bottom: var(--space-md);
}

.empty-state-modern__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state-modern__message {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    max-width: 450px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

/* Income Item Cards */
.income-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-base);
}

.income-item-card:hover {
    background: var(--color-surface-hover, #f9fafb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.income-item-card__content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.income-item-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--color-success-bg);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.income-item-card__icon .material-symbols-outlined {
    font-size: 24px;
    color: var(--color-success);
}

.income-item-card__info {
    flex: 1;
}

.income-item-card__name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: 4px;
}

.income-item-card__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-modern--info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-modern--success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.income-item-card__actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.income-item-card__amount {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--color-success);
    margin-right: var(--space-sm);
}

.income-item-card__buttons {
    display: flex;
    gap: 6px;
}

/* Icon Buttons */
.btn-icon-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    background: transparent;
}

.btn-icon-modern .material-symbols-outlined {
    font-size: 20px;
}

.btn-icon-modern--info {
    color: var(--color-info);
}

.btn-icon-modern--info:hover {
    background: var(--color-info-bg);
    transform: scale(1.05);
}

.btn-icon-modern--danger {
    color: var(--color-danger);
}

.btn-icon-modern--danger:hover {
    background: var(--color-danger-bg);
    transform: scale(1.05);
}

.btn-icon-modern:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .income-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .income-header__total {
        width: 100%;
    }

    .income-total-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .income-total-card__label {
        text-align: left;
    }

    .form-grid-modern {
        grid-template-columns: 1fr;
    }

    .income-item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .income-item-card__actions {
        width: 100%;
        justify-content: space-between;
    }

    .income-item-card__amount {
        margin-right: 0;
    }
}

/* Dark mode adjustments (if needed) */
@media (prefers-color-scheme: dark) {
    .income-item-card:hover {
        background: var(--color-surface-hover, #1e293b);
    }
}

/* PROFESSIONAL SAAS INCOME DESIGN */

/* ══════════════════════════════════════════════════════════
   PROFESSIONAL SAAS INCOME DESIGN
   Table-based layout with sidebar stats
   ══════════════════════════════════════════════════════════ */

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.breadcrumb-item {
    color: var(--color-text-muted);
}

.breadcrumb-item--active {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.breadcrumb-separator {
    color: var(--color-text-muted);
    opacity: 0.5;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2xl);
    gap: var(--space-lg);
}

.page-header__content {
    flex: 1;
}

.page-title {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.page-description {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
}

.page-header__actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Modern Buttons */
.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary-modern:hover {
    background: var(--color-surface);
    border-color: var(--color-accent);
}

.btn-dark-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: white;
    background: var(--color-neutral-900, #0f172a);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-dark-modern:hover {
    background: var(--color-neutral-800, #1e293b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-text-modern {
    padding: 8px 12px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-accent);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-text-modern:hover {
    background: var(--color-accent-bg, #eef2ff);
}

/* Income Layout Grid */
.income-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-xl);
}

.income-table-container {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

/* Horizontal Tabs */
.tabs-horizontal {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    padding: 0 var(--space-lg);
}

.tab-horizontal {
    padding: 14px 20px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.tab-horizontal:hover {
    color: var(--color-text);
    background: var(--color-surface-hover, #f9fafb);
}

.tab-horizontal.active {
    color: var(--color-text);
    border-bottom-color: var(--color-text);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface, #f9fafb);
    border-bottom: 1px solid var(--color-border);
}

.filter-select {
    padding: 8px 12px;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-select:hover {
    border-color: var(--color-accent);
}

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

/* Table */
.data-table {
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead th {
    padding: 12px var(--space-lg);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-surface, #f9fafb);
    border-bottom: 1px solid var(--color-border);
}
.table-modern thead th.text-center { text-align: center; }
.table-modern thead th.text-right  { text-align: right; }

.table-modern tbody td {
    padding: 16px var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.table-row-hover {
    transition: background var(--transition-base);
}

.table-row-hover:hover {
    background: var(--color-surface-hover, #f9fafb);
}

.table-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

.table-description {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-description strong {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: var(--font-size-xs);
    color: var(--color-info);
    background: var(--color-info-bg);
    border-radius: 4px;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: 12px;
}

.category-badge--salary {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.category-badge--extra {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.table-amount {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
}

.table-amount--positive {
    color: var(--color-success);
}

.table-amount--negative {
    color: var(--color-danger);
}

.table-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.btn-icon-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-icon-table:hover {
    color: var(--color-accent);
    background: var(--color-surface);
}

.btn-icon-minimal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-icon-minimal:hover {
    background: var(--color-surface);
}

/* Stats Sidebar */
.income-stats-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.stat-card-saas {
    padding: var(--space-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.stat-card-saas--secondary {
    background: var(--color-surface, #f9fafb);
}

.stat-card-saas__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-card-saas__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

.stat-card-saas__badge {
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    border-radius: 12px;
}

.stat-card-saas__badge--success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.stat-card-saas__badge--danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.stat-card-saas__value {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    line-height: 1.2;
}

.stat-card-saas__value--small {
    font-size: 24px;
}

/* Text alignment utilities */
.text-right {
    text-align: right;
}

/* Responsive */
@media (max-width: 1024px) {
    .income-layout {
        grid-template-columns: 1fr;
    }

    .income-stats-sidebar {
        order: -1;
        flex-direction: row;
        overflow-x: auto;
    }

    .stat-card-saas {
        min-width: 250px;
    }
}

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

    .page-header__actions {
        width: 100%;
        justify-content: stretch;
    }

    .page-header__actions button {
        flex: 1;
    }

    .tabs-horizontal {
        overflow-x: auto;
        padding: 0;
    }

    .tab-horizontal {
        white-space: nowrap;
    }

    .filters-bar {
        flex-wrap: wrap;
    }

    .income-stats-sidebar {
        flex-direction: column;
    }

    .stat-card-saas {
        min-width: auto;
    }
}

/* ══════════════════════════════════════════════════════════
   IMPROVED ACTION BUTTONS (Edit/Delete)
   ══════════════════════════════════════════════════════════ */

.btn-action-edit,
.btn-action-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-display);
}

.btn-action-edit {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.btn-action-edit:hover {
    background: var(--color-info);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-action-delete {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.btn-action-delete:hover {
    background: var(--color-danger);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-action-edit .material-symbols-outlined,
.btn-action-delete .material-symbols-outlined {
    font-size: 18px;
    margin-right: 4px;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════════
   SAVINGS MODULE - Two-column layout
   ══════════════════════════════════════════════════════════ */

.sv-layout {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 28px;
    align-items: start;
}

.sv-col-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.sv-col-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}

.sv-goal-card {
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.sv-goal-card:hover {
    border-color: var(--color-primary) !important;
    box-shadow: var(--shadow-md) !important;
}

.sv-add-card {
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.sv-add-card:hover {
    box-shadow: var(--shadow-sm) !important;
}

@media (max-width: 1100px) {
    .sv-layout {
        grid-template-columns: 1fr;
    }

    .sv-col-sidebar {
        position: static;
    }
}

/* Responsive: Hide text on mobile, show icon only */
@media (max-width: 768px) {
    .btn-action-edit,
    .btn-action-delete {
        font-size: 0; /* Hide text */
        padding: 8px;
        min-width: 36px;
        justify-content: center;
    }

    .btn-action-edit .material-symbols-outlined,
    .btn-action-delete .material-symbols-outlined {
        font-size: 18px;
        margin-right: 0;
    }
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION LAYOUT
   Left-rail navigation matching the template aesthetic.
   ══════════════════════════════════════════════════════════ */

/* Top-level flex shell */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg);
}

/* ─── Sidebar ─────────────────────────────────────────── */
.nav-sidebar {
    width: 232px;
    min-width: 232px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow: hidden;
    z-index: 200;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
}
.nav-sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.sidebar-logo-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sidebar-brand-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: 0.05em;
    font-family: var(--font-display);
    line-height: 1;
}
.sidebar-brand-sub {
    font-size: 9.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

/* Nav items list */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

/* Override horizontal .tab styles for sidebar */
.sidebar-tab.tab {
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 9px 12px !important;
    border-radius: 9px !important;
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    color: var(--color-text-secondary) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: left !important;
    white-space: nowrap !important;
    transition: background 0.13s, color 0.13s !important;
    min-width: 0 !important;
    position: static !important;
}
.sidebar-tab.tab .material-symbols-outlined {
    font-size: 19px !important;
    flex-shrink: 0 !important;
    font-variation-settings: 'wght' 300 !important;
    transition: font-variation-settings 0.13s;
}
.sidebar-tab.tab::before { display: none !important; }
.sidebar-tab.tab:hover {
    background: var(--color-surface-alt) !important;
    color: var(--color-primary) !important;
}
.sidebar-tab.tab:hover .material-symbols-outlined {
    font-variation-settings: 'wght' 400 !important;
}
.sidebar-tab.tab.active {
    background: rgba(79,70,229,0.09) !important;
    color: var(--color-primary) !important;
    font-weight: 600 !important;
    border-bottom: none !important;
}
.sidebar-tab.tab.active .material-symbols-outlined {
    font-variation-settings: 'wght' 500 !important;
}

/* Sidebar footer */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Month navigation */
.sidebar-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 0;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 9px;
    gap: 4px;
}
.sidebar-month-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background 0.1s, color 0.1s;
    flex-shrink: 0;
}
.sidebar-month-btn:hover {
    background: var(--color-surface-dark);
    color: var(--color-primary);
}
.sidebar-month-label {
    flex: 1;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-text);
    font-family: var(--font-numeric);
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Settings button row */
.sidebar-action-row { position: relative; }
.sidebar-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-primary);
    transition: background 0.13s, color 0.13s;
}
.sidebar-action-btn .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-action-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

/* User section — first in footer so it's always visible */
.sidebar-user-section {
    border-bottom: 1px solid var(--color-border);
    padding: 4px 6px;
    flex-shrink: 0;
}
.sidebar-user-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 9px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.13s;
}
.sidebar-user-btn:hover { background: var(--color-surface-alt); }
.sidebar-user-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-text-secondary);
}
.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    font-family: var(--font-primary);
}

/* ─── Main content wrapper ─────────────────────────────── */
.main-wrapper {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
.main-wrapper .content-area {
    flex: 1;
    padding: var(--space-xl);
    max-width: 1440px;
    width: 100%;
}

/* Mobile top bar */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 150;
    box-shadow: var(--shadow-sm);
}
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text);
    flex-shrink: 0;
    transition: background 0.1s;
}
.mobile-menu-btn:hover { background: var(--color-surface-dark); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 800px) {
    .nav-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 300;
        box-shadow: 4px 0 24px rgba(0,0,0,0.13);
    }
    .nav-sidebar.sidebar--open {
        transform: translateX(0);
    }
    .mobile-topbar {
        display: flex;
    }
    .main-wrapper .content-area {
        padding: var(--space-md) var(--space-md) var(--space-xl);
    }
}

/* Dark-mode sidebar */
[data-theme="dark"] .nav-sidebar,
body.dark .nav-sidebar {
    background: var(--color-surface);
    border-right-color: var(--color-border);
}
[data-theme="dark"] .sidebar-tab.tab.active,
body.dark .sidebar-tab.tab.active {
    background: rgba(99,102,241,0.15) !important;
}

/* Mobile sidebar closes via JS Navigation.showTab() on tab click */

/* ══════════════════════════════════════════════════════════
   GUIDED TOUR
   ══════════════════════════════════════════════════════════ */

/* Tooltip card */
.tour-tooltip {
    position: fixed;
    width: 340px;
    max-width: calc(100vw - 36px);
    background: var(--color-bg, #fff);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
    padding: 22px 22px 18px;
    z-index: 9999;
    border: 1px solid var(--color-border, #e5e7eb);
    animation: tourFadeIn .25s ease;
}

@keyframes tourFadeIn {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header row: icon + counter */
.tour-tooltip__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tour-tooltip__iconbox {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(234,88,12,.1);
    color: var(--color-primary, #ea580c);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-tooltip__iconbox .material-symbols-outlined {
    font-size: 20px;
}

.tour-tooltip__counter {
    font-family: var(--font-numeric, 'Space Grotesk', monospace);
    font-size: 13px;
    font-weight: 800;
    color: var(--color-text, #111);
    letter-spacing: -.02em;
}

/* Title & description */
.tour-tooltip__title {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-text, #111);
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.tour-tooltip__desc {
    font-size: 13px;
    color: var(--color-text-secondary, #555);
    line-height: 1.55;
    margin: 0 0 16px;
}

/* Progress dots */
.tour-dots {
    display: flex;
    gap: 5px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-border, #e5e7eb);
    transition: all .2s;
    flex-shrink: 0;
}

.tour-dot.active {
    width: 20px;
    border-radius: 4px;
    background: var(--color-primary, #ea580c);
}

.tour-dot.done {
    background: rgba(234,88,12,.35);
}

/* Action row */
.tour-tooltip__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tour-btn-exit {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--color-text-muted, #888);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s;
}
.tour-btn-exit:hover { color: var(--color-text, #111); }

.tour-btn-prev {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-surface-alt, #f9fafb);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text, #111);
    transition: all .15s;
}
.tour-btn-prev:hover { background: var(--color-border, #e5e7eb); }

.tour-btn-next {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: none;
    background: var(--color-primary, #ea580c);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
    white-space: nowrap;
}
.tour-btn-next:hover { opacity: .88; }

/* Dark mode support */
[data-theme="dark"] .tour-tooltip,
body.dark .tour-tooltip {
    background: var(--color-surface, #1e1e2e);
    border-color: var(--color-border, #2a2a3a);
    box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.3);
}

[data-theme="dark"] .tour-tooltip__desc,
body.dark .tour-tooltip__desc {
    color: var(--color-text-muted, #aaa);
}

/* ─── MOBILE TOUR — Bottom sheet ─── */
.tour-tooltip--mobile {
    position: fixed !important;
    bottom: calc(var(--mobile-nav-h, 64px) + var(--safe-bottom, 0px)) !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 20px !important;
    padding: 20px !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,.18), 0 8px 32px rgba(0,0,0,.12) !important;
    z-index: 9998;
    animation: tourSheetUp .28s cubic-bezier(.4,0,.2,1);
}

@keyframes tourSheetUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Progress bar at top of mobile sheet */
.tour-mobile__progress {
    height: 3px;
    background: var(--color-border, #e5e7eb);
    border-radius: 999px;
    margin-bottom: 18px;
    overflow: hidden;
}
.tour-mobile__progress-bar {
    height: 100%;
    background: var(--color-primary, #ea580c);
    border-radius: 999px;
    transition: width .35s ease;
}

/* Tour trigger button (in dropdown) */
.tour-trigger-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text, #111);
    border-radius: 8px;
    transition: background .15s;
    text-align: left;
}
.tour-trigger-item:hover {
    background: var(--color-surface-alt, #f5f5f5);
}

/* ══════════════════════════════════════════════════════════
   EMERGENCY FUND — Redesigned UI Components
   Accent: Emerald #10b981 · Primary: Indigo #4f46e5
   ══════════════════════════════════════════════════════════ */

.em-form-panel { border-left:4px solid #4f46e5;margin-bottom:20px; }
.em-panel-title { display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:var(--font-size-lg);font-weight:700; }
.em-panel-desc  { font-size:var(--font-size-sm);color:var(--color-text-muted);margin:0 0 16px; }
.em-goal-preview {
    display:flex;align-items:center;justify-content:space-between;
    padding:14px 16px;background:rgba(79,70,229,0.06);
    border:1px dashed rgba(79,70,229,0.30);border-radius:12px;margin-bottom:4px;
}

/* Hero Card — white card, subtle emerald tint */
.em-hero-card {
    border-radius:20px;padding:36px 40px;margin-bottom:14px;
    background:var(--color-surface);
    border:1px solid var(--color-border);
    box-shadow:0 2px 8px rgba(0,0,0,0.05);
    background-image:linear-gradient(180deg,rgba(16,185,129,0.05) 0%,transparent 50%);
}
.em-hero-inner { display:flex;align-items:center;gap:48px; }

/* Gauge — 192 × 192, emerald stroke on light track */
.em-gauge-wrap   { position:relative;width:192px;height:192px;flex-shrink:0; }
.em-gauge-svg    { width:100%;height:100%; }
.em-gauge-center { position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center; }
.em-gauge-pct    { font-size:36px;font-weight:800;color:var(--color-text);line-height:1;font-family:var(--font-numeric);letter-spacing:-0.02em; }
.em-gauge-label  { font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--color-text-muted);margin-top:4px; }

/* Hero info — dark text on white card */
.em-hero-info   { flex:1;min-width:0; }
.em-status-badge {
    display:inline-flex;align-items:center;gap:5px;
    font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;
    background:rgba(16,185,129,0.08);border:1px solid rgba(16,185,129,0.18);
    padding:4px 12px;border-radius:999px;margin-bottom:14px;color:#10b981;
}
.em-status-title { font-size:1.25rem;font-weight:800;margin:0 0 8px;color:var(--color-text);letter-spacing:-0.01em;line-height:1.3; }
.em-status-sub   { font-size:13px;color:var(--color-text-muted);margin:0 0 20px;line-height:1.6; }

/* Formula row — pill card inside hero */
.em-formula-row {
    display:flex;align-items:center;gap:16px;flex-wrap:wrap;
    background:var(--color-surface-alt);border-radius:14px;
    padding:16px 20px;margin-bottom:16px;
}
.em-formula-cell  { text-align:left; }
.em-formula-label { display:block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--color-text-muted);margin-bottom:3px; }
.em-formula-value { font-size:16px;font-weight:600;color:var(--color-text);font-family:var(--font-numeric); }
.em-formula-value--accent { color:#10b981;font-weight:700; }
.em-formula-op    { font-size:18px;color:var(--color-text-muted); }

/* Progress bar */
.em-progress-labels { display:flex;justify-content:space-between;font-size:12px;color:var(--color-text-muted);margin-bottom:7px; }
.em-progress-labels strong { color:var(--color-text); }
.em-progress-track { height:6px;background:var(--color-border);border-radius:999px;overflow:hidden; }
.em-progress-fill  { height:100%;background:#10b981;border-radius:999px;transition:width .9s cubic-bezier(.4,0,.2,1); }

/* KPI Row */
.em-kpi-row  { display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px; }
.em-kpi-card {
    background:var(--color-surface);border:1px solid var(--color-border);
    border-radius:16px;padding:20px;display:flex;align-items:center;gap:16px;
    box-shadow:0 1px 3px rgba(0,0,0,0.04);transition:box-shadow .2s;
}
.em-kpi-card:hover { box-shadow:0 4px 14px rgba(0,0,0,0.07); }
.em-kpi-icon  { width:44px;height:44px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.em-kpi-body  { flex:1;min-width:0; }
.em-kpi-value { font-size:22px;font-weight:800;color:var(--color-text);margin:0;font-family:var(--font-numeric);line-height:1.1;letter-spacing:-0.01em; }
.em-kpi-label { font-size:10px;color:var(--color-text-muted);margin:4px 0 0;font-weight:600;text-transform:uppercase;letter-spacing:.05em; }

/* Scenarios */
.em-scenarios-header {
    display:flex;align-items:center;justify-content:space-between;
    padding:20px 24px;border-bottom:1px solid var(--color-border);
}
.em-add-btn {
    display:flex;align-items:center;gap:4px;padding:5px 12px;
    border:none;border-radius:8px;background:transparent;
    cursor:pointer;color:#10b981;font-size:12px;font-weight:700;
    font-family:var(--font-display);transition:background .15s;
}
.em-add-btn:hover { background:rgba(16,185,129,0.08); }

/* History */
.em-history-header {
    display:flex;align-items:center;justify-content:space-between;
    padding:18px 20px;border-bottom:1px solid var(--color-border);
}
.em-hist-item {
    display:flex;align-items:center;justify-content:space-between;
    padding:10px 8px;border-radius:10px;transition:background .15s;
}
.em-hist-item:hover { background:var(--color-surface-alt); }
.em-hist-actions { opacity:0;transition:opacity .15s;display:flex;align-items:center;gap:2px; }
.em-hist-item:hover .em-hist-actions { opacity:1; }

/* Tip card */
.em-tip-card {
    border-radius:16px;padding:24px;
    background:linear-gradient(135deg,#059669 0%,#10b981 100%);
    color:#fff;position:relative;overflow:hidden;
}
.em-tip-blob {
    position:absolute;width:120px;height:120px;
    background:rgba(255,255,255,0.08);border-radius:50%;
    bottom:-30px;right:-30px;filter:blur(20px);
}
.em-tip-icon-wrap {
    width:38px;height:38px;background:rgba(255,255,255,0.2);
    border-radius:10px;display:flex;align-items:center;justify-content:center;
    margin-bottom:12px;
}
.em-tip-title { font-weight:700;font-size:var(--font-size-base);margin:0 0 8px;color:#fff; }
.em-tip-body  { font-size:12px;opacity:0.9;line-height:1.65;margin:0;color:#fff; }

/* Mobile */
@media (max-width: 640px) {
    .em-hero-card  { padding:24px 20px;border-radius:16px; }
    .em-hero-inner { flex-direction:column;gap:24px;align-items:center;text-align:center; }
    .em-gauge-wrap { width:160px;height:160px; }
    .em-formula-row { justify-content:center;gap:12px; }
    .em-kpi-row { grid-template-columns:1fr 1fr; }
    .em-kpi-row .em-kpi-card:last-child { grid-column:span 2; }
    .em-status-badge { margin:0 auto 12px; }
}
@media (max-width: 380px) {
    .em-kpi-row { grid-template-columns:1fr; }
    .em-kpi-row .em-kpi-card:last-child { grid-column:auto; }
}

/* ══════════════════════════════════════════════════════════
   DISTRIBUTION TAB — Fintech redesign
   Accent: Teal #14b8a6
   ══════════════════════════════════════════════════════════ */

/* Allocation card grid — 4 columns on desktop */
.dist-alloc-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:24px;
}

/* dist-page-header migrated to .page-header standard */
.dist-btn-save {
    display:flex;align-items:center;gap:7px;
    padding:9px 20px;border-radius:10px;border:none;cursor:pointer;
    background:linear-gradient(135deg,#0d9488,#14b8a6);
    color:#fff;font-weight:700;font-size:13px;
    font-family:var(--font-display);
    box-shadow:0 4px 14px rgba(20,184,166,0.3);
    transition:opacity .15s,transform .1s;
}
.dist-btn-save:hover  { opacity:.9; }
.dist-btn-save:active { transform:scale(0.97); }

/* Confirmation / action panels */
.dist-confirm-panel { border-left:4px solid #f59e0b;margin-bottom:20px; }
.dist-confirm-title {
    display:flex;align-items:center;gap:8px;
    margin:0 0 10px;font-size:var(--font-size-base);font-weight:700;
}

/* Panel header bar (title + ghost action button) */
.dist-panel-header {
    display:flex;align-items:center;justify-content:space-between;
    padding:14px 20px;border-bottom:1px solid var(--color-border);
    background:var(--color-surface-alt);
}
.dist-panel-icon {
    width:36px;height:36px;border-radius:10px;
    display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.dist-ghost-btn {
    display:flex;align-items:center;gap:5px;padding:5px 12px;
    border:1px solid var(--color-border);border-radius:8px;
    background:transparent;cursor:pointer;
    color:var(--color-text-muted);font-size:12px;font-weight:700;
    font-family:var(--font-display);
    transition:background .15s,border-color .15s;
}
.dist-ghost-btn:hover {
    background:var(--color-surface-alt);
    border-color:var(--color-text-muted);
}

/* Total footer row */
.dist-total-row {
    display:flex;align-items:center;justify-content:space-between;
    margin-top:12px;padding-top:12px;
    border-top:1px solid var(--color-border);
}
.dist-total-label {
    font-size:var(--font-size-sm);font-weight:700;
    text-transform:uppercase;letter-spacing:.05em;
    color:var(--color-text-muted);
}
.dist-total-value {
    font-size:1.25rem;font-weight:900;
    color:var(--color-text);font-family:var(--font-numeric);
}

/* Breakdown sections */
.dist-breakdown-section {
    padding:16px 0;
    border-bottom:1px solid var(--color-border);
}
.dist-breakdown-heading {
    display:flex;align-items:center;gap:8px;
    font-size:12px;font-weight:700;text-transform:uppercase;
    letter-spacing:.06em;margin-bottom:12px;
}
.dist-breakdown-icon {
    width:28px;height:28px;border-radius:8px;
    display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.dist-breakdown-rows { display:flex;flex-direction:column;gap:2px; }

/* Individual breakdown row */
.dist-row {
    display:flex;align-items:center;justify-content:space-between;
    padding:7px 10px;border-radius:8px;
}
.dist-row-label { font-size:13px;color:var(--color-text-muted); }
.dist-row-value { font-size:13px;font-weight:700;font-family:var(--font-numeric); }

.dist-row--accent {
    margin-top:4px;border:1px solid transparent;
}
.dist-row--progress {
    display:block;padding:10px 10px 8px;
}

/* Tip card */
.dist-tip-card {
    border-radius:16px;padding:24px;margin-top:14px;
    background:linear-gradient(135deg,#0d9488,#14b8a6);
    color:#fff;position:relative;overflow:hidden;
}
.dist-tip-blob {
    position:absolute;width:130px;height:130px;
    background:rgba(255,255,255,0.08);border-radius:50%;
    bottom:-40px;right:-30px;filter:blur(20px);
}
.dist-tip-icon {
    width:40px;height:40px;background:rgba(255,255,255,0.2);
    border-radius:10px;display:flex;align-items:center;justify-content:center;
    margin-bottom:12px;
}
.dist-tip-title { font-weight:700;font-size:var(--font-size-base);margin:0 0 14px;color:#fff; }
.dist-tip-rules { display:flex;flex-direction:column;gap:8px; }
.dist-tip-rule  { display:flex;align-items:center;gap:10px; }
.dist-tip-pct {
    font-size:16px;font-weight:900;color:#fff;
    font-family:var(--font-numeric);min-width:40px;
}
.dist-tip-name { font-size:12px;color:rgba(255,255,255,0.85);font-weight:500; }

/* Month status badge */
#distMonthStatus .dist-status-badge {
    display:inline-flex;align-items:center;gap:6px;
    padding:5px 12px;border-radius:999px;font-size:12px;font-weight:700;
    margin-bottom:14px;
}

/* Mobile */
@media (max-width: 640px) {
    .dist-alloc-grid { grid-template-columns:1fr 1fr; }
    .dist-page-header { flex-direction:column;align-items:flex-start; }
    .dist-btn-save { width:100%;justify-content:center; }
}
@media (max-width: 380px) {
    .dist-alloc-grid { grid-template-columns:1fr; }
}

/* ════════════════════════════════════════════════════════
   DARK MODE — Comprehensive Element Overrides
   Fixes all hardcoded white/light colors that bypass CSS variables
   ════════════════════════════════════════════════════════ */

/* ── Body & Layout ── */
[data-theme="dark"] body,
body.dark {
    background: var(--color-bg);
    color: var(--color-text);
}

/* ── Inputs, Selects, Textareas ── */
[data-theme="dark"] .form-control,
[data-theme="dark"] select,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-theme="dark"] textarea,
body.dark .form-control,
body.dark select,
body.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body.dark textarea {
    background: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
body.dark .form-control:focus,
body.dark select:focus,
body.dark input:focus,
body.dark textarea:focus {
    background: var(--color-surface-alt) !important;
    border-color: var(--color-primary) !important;
}

[data-theme="dark"] ::placeholder,
body.dark ::placeholder {
    color: var(--color-text-muted) !important;
    opacity: 1;
}

/* ── Alerts ── */
[data-theme="dark"] .alert-success,
body.dark .alert-success { color: #6ee7b7 !important; }
[data-theme="dark"] .alert-warning,
body.dark .alert-warning { color: #fcd34d !important; }
[data-theme="dark"] .alert-danger,
body.dark .alert-danger  { color: #fca5a5 !important; }
[data-theme="dark"] .alert-info,
body.dark .alert-info    { color: #93c5fd !important; }

/* ── Login Screen — Right Panel ── */
[data-theme="dark"] .login-panel-right,
body.dark .login-panel-right {
    background: var(--color-surface) !important;
}

[data-theme="dark"] .login-welcome-title,
body.dark .login-welcome-title {
    color: var(--color-text) !important;
}

[data-theme="dark"] .login-welcome-subtitle,
body.dark .login-welcome-subtitle {
    color: var(--color-text-muted) !important;
}

[data-theme="dark"] .btn-google-modern,
body.dark .btn-google-modern {
    background: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
    box-shadow: var(--shadow-sm) !important;
}

[data-theme="dark"] .btn-google-modern:hover,
body.dark .btn-google-modern:hover {
    background: var(--color-surface-dark) !important;
    border-color: var(--color-primary) !important;
}

[data-theme="dark"] .login-divider-line,
body.dark .login-divider-line { background: var(--color-border) !important; }

[data-theme="dark"] .login-divider-text,
body.dark .login-divider-text { color: var(--color-text-muted) !important; }

[data-theme="dark"] .login-info-card,
body.dark .login-info-card {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-secondary) !important;
}

[data-theme="dark"] .login-info-card:hover,
body.dark .login-info-card:hover { background: var(--color-surface-alt) !important; }

[data-theme="dark"] .login-help,
body.dark .login-help {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
}

[data-theme="dark"] .login-help p,
[data-theme="dark"] .login-help strong,
body.dark .login-help p,
body.dark .login-help strong { color: var(--color-text-secondary) !important; }

/* ── Navigation & Dropdowns ── */
[data-theme="dark"] .dropdown-content,
body.dark .dropdown-content {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    box-shadow: var(--shadow-xl) !important;
}

[data-theme="dark"] .dropdown-item,
body.dark .dropdown-item { color: var(--color-text) !important; }

[data-theme="dark"] .dropdown-item:hover,
body.dark .dropdown-item:hover { background: var(--color-surface-alt) !important; }

[data-theme="dark"] .dropdown-label,
body.dark .dropdown-label { color: var(--color-text-muted) !important; }

/* ── Tables ── */
[data-theme="dark"] table td,
body.dark table td { color: var(--color-text) !important; }

[data-theme="dark"] table thead,
body.dark table thead { background: var(--color-surface-alt) !important; }

/* ── Wizard / Onboarding ── */
[data-theme="dark"] .wizard-brand-step.active .wizard-brand-step-icon,
body.dark .wizard-brand-step.active .wizard-brand-step-icon {
    background: var(--color-primary) !important;
    color: #fff !important;
}

/* ── Toast notifications ── */
[data-theme="dark"] .toast,
body.dark .toast {
    background: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

/* ── Section panels with inline white backgrounds ── */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
body.dark [style*="background:#fff"],
body.dark [style*="background: #fff"],
body.dark [style*="background:white"],
body.dark [style*="background: white"] {
    background: var(--color-surface) !important;
}

[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background:#f3f4f6"],
body.dark [style*="background:#f9fafb"],
body.dark [style*="background:#f8fafc"],
body.dark [style*="background:#f1f5f9"],
body.dark [style*="background:#f3f4f6"] {
    background: var(--color-surface-alt) !important;
}

/* ── Dashboard — KPI cards & sections ── */
[data-theme="dark"] .db-wrap h1,
[data-theme="dark"] .db-wrap h2,
[data-theme="dark"] .db-wrap p,
body.dark .db-wrap h1,
body.dark .db-wrap h2,
body.dark .db-wrap p { color: var(--color-text) !important; }

[data-theme="dark"] #healthScore,
body.dark #healthScore { color: var(--color-text) !important; }

/* KPI amounts (color:#1e293b inline) */
[data-theme="dark"] .db-kpi-card [style*="color:#1e293b"],
[data-theme="dark"] .db-card [style*="color:#1e293b"],
body.dark .db-kpi-card [style*="color:#1e293b"],
body.dark .db-card [style*="color:#1e293b"] { color: var(--color-text) !important; }

/* Icon pill backgrounds (light pastel → dark surface) */
[data-theme="dark"] .db-kpi-card [style*="background:#d1fae5"],
[data-theme="dark"] .db-kpi-card [style*="background:#fee2e2"],
[data-theme="dark"] .db-kpi-card [style*="background:#ede9fe"],
[data-theme="dark"] .db-kpi-card [style*="background:#dbeafe"],
[data-theme="dark"] .db-card [style*="background:#ede9fe"],
[data-theme="dark"] .db-card [style*="background:#dbeafe"],
body.dark .db-kpi-card [style*="background:#d1fae5"],
body.dark .db-kpi-card [style*="background:#fee2e2"],
body.dark .db-kpi-card [style*="background:#ede9fe"],
body.dark .db-kpi-card [style*="background:#dbeafe"],
body.dark .db-card [style*="background:#ede9fe"],
body.dark .db-card [style*="background:#dbeafe"] {
    background: var(--color-surface-alt) !important;
}

/* Progress track backgrounds */
[data-theme="dark"] .db-card [style*="background:#f1f5f9"],
body.dark .db-card [style*="background:#f1f5f9"] {
    background: var(--color-surface-alt) !important;
}

/* healthLabel badge */
[data-theme="dark"] #healthLabel,
body.dark #healthLabel {
    background: var(--color-surface-alt) !important;
    color: var(--color-text-secondary) !important;
    border-color: var(--color-border) !important;
}

/* Emergency progress badge */
[data-theme="dark"] [style*="background:#dbeafe"][style*="color:#2563eb"],
body.dark [style*="background:#dbeafe"][style*="color:#2563eb"] {
    background: rgba(37,99,235,0.15) !important;
}

/* recsCountBadge */
[data-theme="dark"] #recsCountBadge,
body.dark #recsCountBadge {
    background: rgba(124,58,237,0.15) !important;
    border-color: var(--color-border) !important;
}

/* Gauge SVG track stroke */
[data-theme="dark"] .db-card path[stroke="#f1f5f9"],
body.dark .db-card path[stroke="#f1f5f9"] { stroke: var(--color-surface-alt) !important; }

/* ── Specific hardcoded text colors common in light mode ── */
[data-theme="dark"] [style*="color:#374151"],
[data-theme="dark"] [style*="color:#1f2937"],
[data-theme="dark"] [style*="color:#111827"],
[data-theme="dark"] [style*="color:var(--color-text)"],
body.dark [style*="color:#374151"],
body.dark [style*="color:#1f2937"],
body.dark [style*="color:#111827"] {
    color: var(--color-text) !important;
}

/* ════════════════════════════════════════════════════════════
   COMMAND BAR — Ctrl+K / Cmd+K  (Spotlight / Linear style)
   ════════════════════════════════════════════════════════════ */

.cmd-overlay {
    position: fixed;
    inset: 0;
    z-index: 9900;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(60px, 15vh, 160px);
}

.cmd-container {
    width: 100%;
    max-width: 580px;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 24px 60px rgba(0,0,0,.2), 0 4px 20px rgba(0,0,0,.1);
    overflow: hidden;
    animation: cmdIn .14s cubic-bezier(.4,0,.2,1);
}

@keyframes cmdIn {
    from { opacity:0; transform:scale(0.95) translateY(-8px); }
    to   { opacity:1; transform:scale(1)    translateY(0);    }
}

/* Input row */
.cmd-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}

.cmd-search-icon {
    font-size: 20px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.cmd-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    color: var(--color-text);
    outline: none;
    min-width: 0;
}
.cmd-input::placeholder { color: var(--color-text-muted); font-weight: 400; }

.cmd-esc-hint {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2px 7px;
    flex-shrink: 0;
    letter-spacing: .04em;
    font-family: var(--font-numeric, 'Space Grotesk', monospace);
}

/* Results list */
.cmd-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.cmd-results::-webkit-scrollbar       { width: 4px; }
.cmd-results::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

/* Groups */
.cmd-group { padding: 4px 0; }
.cmd-group + .cmd-group {
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding-top: 4px;
}
.cmd-group-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 6px 14px 4px;
}

/* Items */
.cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background .08s;
}
.cmd-item:hover,
.cmd-item.selected { background: var(--color-surface-alt); }
.cmd-item.selected { background: rgba(234,88,12,.06); }
.cmd-item.selected .cmd-item__label { color: var(--color-primary); }

/* Icon wrap */
.cmd-item__icon-wrap {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cmd-item__icon-wrap--nav    { background: rgba(99,102,241,.1); }
.cmd-item__icon-wrap--action { background: rgba(234,88,12,.1);  }
.cmd-item__icon-wrap--data   { background: rgba(16,185,129,.1); }

.cmd-item__icon { font-size: 17px; line-height: 1; }
.cmd-item__icon-wrap--nav    .cmd-item__icon { color: #6366f1; }
.cmd-item__icon-wrap--action .cmd-item__icon { color: var(--color-primary, #ea580c); }
.cmd-item__icon-wrap--data   .cmd-item__icon { color: #10b981; }

/* Text */
.cmd-item__text {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.cmd-item__label {
    font-size: 13.5px; font-weight: 600; color: var(--color-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .08s;
}
.cmd-item__subtitle {
    font-size: 11px; color: var(--color-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Type badge */
.cmd-item__badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 20px;
    letter-spacing: .03em; flex-shrink: 0;
    white-space: nowrap; text-transform: capitalize;
}
.cmd-item__badge--nav    { background: rgba(99,102,241,.12);  color: #6366f1; }
.cmd-item__badge--action { background: rgba(234,88,12,.12);   color: var(--color-primary, #ea580c); }
.cmd-item__badge--data   { background: rgba(16,185,129,.12);  color: #10b981; }

/* Empty state */
.cmd-empty {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 28px 16px;
    color: var(--color-text-muted); font-size: 13px;
}
.cmd-empty .material-symbols-outlined { font-size: 20px; }

/* Sidebar ⌘K hint */
.cmd-shortcut-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 12px 4px;
    padding: 9px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1px dashed var(--color-border);
    cursor: pointer;
    width: calc(100% - 24px);
    box-sizing: border-box;
    transition: background .15s, border-color .15s;
}
.cmd-shortcut-hint:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary);
    border-style: solid;
}
.cmd-shortcut-hint__text {
    flex: 1;
    font-size: 12px; color: var(--color-text-muted); font-weight: 500;
}
.cmd-shortcut-hint__kbd {
    font-size: 11px; font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 5px; padding: 1px 6px;
    font-family: var(--font-numeric, monospace);
}

/* Dark mode */
[data-theme="dark"] .cmd-container,
body.dark .cmd-container {
    box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 4px 20px rgba(0,0,0,.3);
}

/* Mobile — bottom sheet */
@media (max-width: 800px) {
    .cmd-overlay {
        align-items: flex-end;
        padding-top: 0;
    }
    .cmd-container {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 75vh;
        animation: cmdSheetUp .2s cubic-bezier(.4,0,.2,1);
    }
    .cmd-results { max-height: 55vh; }
    .cmd-overlay  { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@keyframes cmdSheetUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
