/* ============================================
   ComptaFlow - Elite Dashboard Design
   Inspired by Stripe, Linear, Vercel, Notion
   ============================================ */

:root {
    /* Neutral Scale - Refined */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --gray-950: #0a0a0a;

    /* Semantic Colors - Vibrant */
    --violet-50: #f5f3ff;
    --violet-100: #ede9fe;
    --violet-200: #ddd6fe;
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;

    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;

    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;

    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;

    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;

    --red-400: #f87171;
    --red-500: #ef4444;

    /* Theme Tokens */
    --bg-base: #0c0c0c;
    --bg-surface: #141414;
    --bg-elevated: #1c1c1c;
    --bg-subtle: rgba(255, 255, 255, 0.02);
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-active: rgba(255, 255, 255, 0.06);

    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);

    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;

    /* Accents */
    --accent: var(--violet-500);
    --accent-hover: var(--violet-400);
    --accent-subtle: rgba(139, 92, 246, 0.1);

    /* Spacing - 4px base */
    --sp-0: 0;
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;

    /* Font Sizes */
    --text-xs: 0.6875rem;
    --text-sm: 0.8125rem;
    --text-base: 0.875rem;
    --text-lg: 1rem;
    --text-xl: 1.125rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 120ms;
    --duration-base: 180ms;
    --duration-slow: 280ms;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.7);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.2);
    --shadow-glow-lg: 0 0 40px rgba(139, 92, 246, 0.3);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;

    /* Legacy */
    --color-success: var(--emerald-500);
    --color-warning: var(--amber-500);
    --color-danger: var(--red-500);
    --color-info: var(--blue-500);
    --color-cyan: #06b6d4;
    --color-error: var(--red-500);
}

[data-theme="light"] {
    --bg-base: #f8f8f8;
    --bg-surface: #ffffff;
    --bg-elevated: #f5f5f5;
    --bg-subtle: rgba(0, 0, 0, 0.02);
    --bg-hover: rgba(0, 0, 0, 0.03);
    --bg-active: rgba(0, 0, 0, 0.05);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-default: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-muted: #737373;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }

/* ============================================
   Layout - Sidebar
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--violet-500), var(--blue-500));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: white;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-3) 0;
}

.sidebar-section { margin-bottom: var(--sp-2); }

.sidebar-section-title {
    padding: var(--sp-3) var(--sp-5);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-4);
    margin: 2px var(--sp-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease);
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--accent-subtle);
    color: var(--violet-400);
}

.sidebar-nav-item i {
    width: 16px;
    font-size: var(--text-sm);
    opacity: 0.7;
    transition: opacity var(--duration-fast);
}
.sidebar-nav-item:hover i,
.sidebar-nav-item.active i { opacity: 1; }
.sidebar-nav-item .badge { margin-left: auto; }

.badge {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.01em;
}
.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--emerald-400); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--amber-400); }

.sidebar-footer {
    padding: var(--sp-3);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-lg);
    transition: background var(--duration-fast) var(--ease);
}
.user-card:hover { background: var(--bg-hover); }

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--violet-500), var(--rose-500));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: var(--text-sm); font-weight: 600; }
.user-email {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    background: transparent;
    border: none;
    transition: all var(--duration-fast) var(--ease);
    flex-shrink: 0;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.1); color: var(--red-400); }

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--sp-6) var(--sp-8);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--sp-4);
    left: var(--sp-4);
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle { display: flex; }
    .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--duration-base); }
    .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
    .sidebar { transform: translateX(-100%); transition: transform var(--duration-slow) var(--ease); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: var(--sp-4); padding-top: 72px; }
}

/* ============================================
   Dashboard - Elite Design
   ============================================ */

.dash {
    max-width: 1360px;
    margin: 0 auto;
}

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-6);
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
}

.dash-greeting-time {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-greeting h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.dash-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--sp-1);
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.dash-date {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
}

.dash-actions {
    display: flex;
    gap: var(--sp-2);
}

.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    transition: all var(--duration-fast) var(--ease);
}

.dash-btn-primary {
    background: var(--violet-500);
    color: white;
    box-shadow: var(--shadow-xs);
}
.dash-btn-primary:hover {
    background: var(--violet-400);
    box-shadow: var(--shadow-sm), var(--shadow-glow);
    transform: translateY(-1px);
}

.dash-btn-ghost {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: var(--sp-2);
    width: 36px;
    height: 36px;
}
.dash-btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

/* Metrics */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

@media (max-width: 1200px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .metrics { grid-template-columns: 1fr; } }

.metric {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--sp-5);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    transition: all var(--duration-base) var(--ease);
    overflow: hidden;
}

.metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.metric:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-alert {
    border-color: rgba(245, 158, 11, 0.25);
    background: linear-gradient(135deg, var(--bg-surface), rgba(245, 158, 11, 0.02));
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.metric-icon-violet { background: var(--accent-subtle); color: var(--violet-400); }
.metric-icon-emerald { background: rgba(16, 185, 129, 0.1); color: var(--emerald-400); }
.metric-icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--blue-400); }
.metric-icon-amber { background: rgba(245, 158, 11, 0.1); color: var(--amber-400); }
.metric-icon-rose { background: rgba(244, 63, 94, 0.1); color: var(--rose-400); }

.metric-body { flex: 1; min-width: 0; }

.metric-value {
    display: block;
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.metric-value small {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--sp-1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.metric-trend-up { background: rgba(16, 185, 129, 0.1); color: var(--emerald-400); }

.metric-chart {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.metric-donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.metric-donut-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 3;
}
.metric-donut-fill {
    fill: none;
    stroke: var(--emerald-400);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray var(--duration-slow) var(--ease);
}

.metric-badge {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    flex-shrink: 0;
}
.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--emerald-400);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.metric-action {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--amber-400);
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    transition: gap var(--duration-fast) var(--ease);
    flex-shrink: 0;
}
.metric-action:hover { gap: var(--sp-2); }

.metric-status {
    font-size: var(--text-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex-shrink: 0;
}
.metric-status-ok { color: var(--emerald-400); }

/* Dashboard Grid - FIX: align-items start prevents stretching */
.dash-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: var(--sp-5);
    align-items: start;
}

@media (max-width: 1024px) { .dash-grid { grid-template-columns: 1fr; } }

/* Panels - FIX: explicit height management */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-large { grid-column: 1; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.panel-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--violet-400);
    flex-shrink: 0;
}
.panel-icon-amber { background: rgba(245, 158, 11, 0.1); color: var(--amber-400); }
.panel-icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--blue-400); }
.panel-icon-emerald { background: rgba(16, 185, 129, 0.1); color: var(--emerald-400); }

.panel-title h2 {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.panel-title p {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.panel-link {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--violet-400);
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    transition: gap var(--duration-fast) var(--ease);
}
.panel-link:hover { gap: var(--sp-2); }
.panel-link i { font-size: 9px; }

.panel-body {
    padding: var(--sp-5);
    flex-shrink: 0;
}

/* Finance Grid */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-3);
}

@media (max-width: 768px) { .finance-grid { grid-template-columns: 1fr; } }

.finance-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    transition: all var(--duration-base) var(--ease);
}
.finance-card:hover {
    border-color: var(--border-default);
    background: var(--bg-hover);
}

.finance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-2);
}

.finance-card-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.finance-card-icon {
    width: 22px;
    height: 22px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}

.finance-card-debit .finance-card-icon { color: var(--blue-400); }
.finance-card-credit .finance-card-icon { color: var(--rose-400); }
.finance-card-positive .finance-card-icon { color: var(--emerald-400); }
.finance-card-negative .finance-card-icon { color: var(--red-400); }

.finance-card-value {
    display: block;
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin-bottom: var(--sp-3);
}

.finance-card-positive .finance-card-value { color: var(--emerald-400); }
.finance-card-negative .finance-card-value { color: var(--red-400); }

.finance-card-bar {
    height: 3px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.finance-card-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease);
}
.finance-card-debit .finance-card-bar-fill { background: linear-gradient(90deg, var(--blue-500), var(--blue-400)); }
.finance-card-credit .finance-card-bar-fill { background: linear-gradient(90deg, var(--rose-500), var(--rose-400)); }

/* Actions List - FIX: constrained height */
.actions-list {
    padding: var(--sp-2);
}

.action-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast) var(--ease);
}
.action-item:hover { background: var(--bg-hover); }
.action-item:hover .action-arrow { opacity: 1; transform: translateX(2px); }
.action-item:hover .action-icon { transform: scale(1.05); }

.action-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--violet-400);
    transition: transform var(--duration-fast) var(--ease);
    flex-shrink: 0;
}
.action-icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--blue-400); }
.action-icon-emerald { background: rgba(16, 185, 129, 0.1); color: var(--emerald-400); }
.action-icon-rose { background: rgba(244, 63, 94, 0.1); color: var(--rose-400); }

.action-content { flex: 1; min-width: 0; }
.action-title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
}
.action-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.action-arrow {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0;
    transition: all var(--duration-fast) var(--ease);
    flex-shrink: 0;
}

/* Activity List - FIX: max-height with scroll */
.activity-list {
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--duration-fast) var(--ease);
    animation: fadeInUp 0.4s var(--ease) backwards;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-hover); }

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

.activity-icon {
    width: 38px;
    height: 38px;
    background: var(--accent-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--violet-400);
    flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }
.activity-title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.activity-dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-amounts {
    text-align: right;
    font-size: var(--text-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.activity-debit { display: block; color: var(--emerald-400); }
.activity-credit { color: var(--rose-400); }

/* Nav Grid - FIX: constrained */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
    padding: var(--sp-3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-2);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--duration-fast) var(--ease);
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item:hover i { color: var(--violet-400); transform: scale(1.1); }

.nav-item i {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease);
}
.nav-item span {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Empty State */
.empty {
    padding: var(--sp-10) var(--sp-6);
    text-align: center;
}
.empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto var(--sp-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--text-muted);
}
.empty h3 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--sp-2);
}
.empty p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-5);
}

/* ============================================
   Global Components
   ============================================ */

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-4);
    border: 1px solid;
    animation: fadeInUp 0.3s var(--ease);
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.15); color: var(--emerald-400); }
.alert-danger { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.15); color: var(--red-400); }
.alert-warning { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.15); color: var(--amber-400); }
.alert-info { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.15); color: var(--blue-400); }
.alert-close { margin-left: auto; background: none; border: none; color: inherit; opacity: 0.6; transition: opacity var(--duration-fast); flex-shrink: 0; }
.alert-close:hover { opacity: 1; }

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
}
.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.page-title i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--violet-500), var(--blue-500));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    color: white;
    flex-shrink: 0;
}
.page-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: var(--sp-5);
    overflow: hidden;
    contain: layout style;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
}
.card-title {
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.card-title i { color: var(--violet-400); font-size: var(--text-sm); }
.card-body { padding: var(--sp-5); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    white-space: nowrap;
}
.btn-primary {
    background: var(--violet-500);
    color: white;
    box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
    background: var(--violet-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm), var(--shadow-glow);
}
.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--emerald-500); color: white; }
.btn-success:hover { background: var(--emerald-400); }
.btn-danger { background: var(--red-500); color: white; }
.btn-danger:hover { background: var(--red-400); }
.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size: var(--text-base); }

/* Forms */
.form-group { margin-bottom: var(--sp-5); }
.form-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--sp-2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-control {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--duration-fast) var(--ease);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
    border-color: var(--violet-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.form-text { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--sp-2); }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5cf6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--sp-4); }
.form-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }

/* Tables - FIX: no height expansion */
.table-responsive, .table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.table th, .table td {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: 1;
}
.table tbody tr { transition: background var(--duration-fast) var(--ease); }
.table tbody tr:hover { background: var(--bg-hover); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.amount-positive { color: var(--emerald-400); font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-negative { color: var(--rose-400); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Legacy Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
    contain: layout style;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--sp-5);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    min-height: 0;
    contain: content;
}
.stat-header { display: contents; }
.stat-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: var(--violet-400);
    flex-shrink: 0;
}
.stat-card.success .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--emerald-400); }
.stat-card.info .stat-icon { background: rgba(59, 130, 246, 0.1); color: var(--blue-400); }
.stat-card.warning .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--amber-400); }
.stat-card.error .stat-icon { background: rgba(239, 68, 68, 0.1); color: var(--red-400); }
.stat-card.cyan .stat-icon { background: rgba(6, 182, 212, 0.1); color: #22d3ee; }
.stat-value { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat-label { font-size: var(--text-sm); color: var(--text-muted); }

/* Legacy Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--sp-3);
    padding: var(--sp-4);
}
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--duration-fast) var(--ease);
}
.quick-action:hover { background: var(--bg-hover); }
.quick-action-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--violet-500), var(--violet-600));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    color: white;
    flex-shrink: 0;
}
.quick-action-text { font-size: var(--text-xs); font-weight: 500; color: var(--text-secondary); }

/* Legacy Empty */
.empty-state { padding: var(--sp-10); text-align: center; }
.empty-state-icon, .empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: var(--sp-4); opacity: 0.5; }
.empty-state-title, .empty-state h3 { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--sp-2); }
.empty-state-text, .empty-state p { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--sp-5); }

/* Auth */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    background: var(--bg-base);
}
.auth-page .main-content { margin-left: 0; padding: 0; }
.auth-container { width: 100%; max-width: 400px; }
.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: var(--sp-8);
}
.auth-logo { text-align: center; margin-bottom: var(--sp-6); }
.auth-logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--sp-4);
    background: linear-gradient(135deg, var(--violet-500), var(--blue-500));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: white;
}
.auth-title { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; margin-bottom: var(--sp-2); }
.auth-subtitle { color: var(--text-secondary); font-size: var(--text-sm); }
.auth-form { margin-top: var(--sp-6); }
.auth-footer { text-align: center; margin-top: var(--sp-5); }
.auth-footer p { font-size: var(--text-sm); color: var(--text-muted); }
.auth-footer a { color: var(--violet-400); font-weight: 500; }

/* Upload */
.upload-zone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--sp-10);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease);
    background: var(--bg-subtle);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--violet-500);
    background: rgba(139, 92, 246, 0.04);
}
.upload-zone input[type="file"] { display: none; }
.upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--sp-4);
    background: var(--accent-subtle);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--violet-400);
}
.upload-title { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--sp-2); }
.upload-desc { font-size: var(--text-sm); color: var(--text-muted); }

/* Badges */
.badge-primary { background: rgba(139, 92, 246, 0.12); color: var(--violet-400); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--red-400); }
.badge-secondary { background: var(--bg-elevated); color: var(--text-secondary); }

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: var(--sp-5);
    border-top: 1px solid var(--border-subtle);
}
.pagination { display: flex; gap: var(--sp-1); }
.pagination-item {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease);
}
.pagination-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination-item.active { background: var(--violet-500); border-color: var(--violet-500); color: white; }

/* Bank Connect */
.bank-connect-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-xl);
    padding: var(--sp-8);
    text-align: center;
}
.bank-connect-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--sp-5);
    background: linear-gradient(135deg, var(--violet-500), var(--blue-500));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    color: white;
}
.bank-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-4);
    padding: var(--sp-4);
}
.bank-account-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.bank-account-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-bottom: 1px solid var(--border-subtle);
}
.bank-logo {
    width: 40px;
    height: 40px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bank-logo i { font-size: var(--text-base); color: var(--violet-400); }
.bank-info { flex: 1; min-width: 0; }
.bank-name { font-weight: 600; }
.account-name { font-size: var(--text-xs); color: var(--text-muted); }
.bank-account-body { padding: var(--sp-4); }
.account-balance { display: flex; justify-content: space-between; align-items: center; }
.balance-label { font-size: var(--text-xs); color: var(--text-muted); }
.balance-value { font-size: var(--text-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.balance-value.positive { color: var(--emerald-400); }
.balance-value.negative { color: var(--red-400); }
.bank-account-actions {
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* Financial Sections */
.financial-section { padding: var(--sp-4); border-bottom: 1px solid var(--border-subtle); }
.financial-section:last-child { border-bottom: none; }
.financial-section-title { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--sp-3); }
.financial-row { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-2) 0; }
.financial-row.total { font-weight: 600; padding-top: var(--sp-3); margin-top: var(--sp-2); border-top: 1px solid var(--border-default); }

/* Charts - FIX: constrained height */
.chart-container {
    padding: var(--sp-4);
    height: 300px;
    max-height: 300px;
    position: relative;
}

/* Canvas charts inside cards */
.card canvas {
    display: block;
    max-height: 300px;
    padding: var(--sp-4);
}

/* Filters bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: var(--sp-5);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.filter-group label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-group .form-control {
    min-width: 150px;
}

/* Financial layout */
.financial-label {
    color: var(--text-secondary);
}

.financial-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   AI Chat Interface
   ============================================ */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    max-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.chat-message {
    display: flex;
    gap: var(--sp-3);
    max-width: 85%;
    animation: fadeInUp 0.3s var(--ease);
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    flex-shrink: 0;
}

.chat-message.user .chat-avatar {
    background: linear-gradient(135deg, var(--violet-500), var(--blue-500));
    color: white;
}

.chat-message.assistant .chat-avatar {
    background: var(--bg-elevated);
    color: var(--violet-400);
    border: 1px solid var(--border-subtle);
}

.chat-bubble {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-xl);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: pre-wrap;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--violet-500), var(--violet-600));
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-input-container {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
}

.chat-input {
    flex: 1;
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast */
.toast {
    position: fixed;
    bottom: var(--sp-6);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: var(--sp-4) var(--sp-6);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all var(--duration-base) var(--ease);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-default);
    border-top-color: var(--violet-500);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utilities */
.w-100 { width: 100%; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.ml-2 { margin-left: var(--sp-2); }
.ml-auto { margin-left: auto; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

@media (max-width: 768px) { .hide-mobile { display: none !important; } }
@media (min-width: 769px) { .hide-desktop { display: none !important; } }

/* Scrollbar - Refined */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
* { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
::selection { background: rgba(139, 92, 246, 0.25); }

/* Animations */
.fade-in { animation: fadeInUp 0.3s var(--ease); }

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--violet-500);
    outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--violet-500);
    outline-offset: 2px;
}

/* ============================================
   Auth Page - Enhanced
   ============================================ */

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: var(--sp-3);
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
}

.password-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    margin: var(--sp-5) 0;
    color: var(--text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Auth Features - Hidden by default, shown on larger screens */
.auth-features {
    display: none;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: var(--sp-5);
    right: var(--sp-5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    z-index: 100;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Background Orbs - Decorative animated elements */
.bg-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--violet-500);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--blue-500);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--rose-500);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

/* Fade in up animation for auth card */
.fade-in-up {
    animation: fadeInUp 0.5s var(--ease);
}

/* Auth page responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: var(--sp-6);
    }

    .auth-logo-icon {
        width: 48px;
        height: 48px;
        font-size: var(--text-lg);
    }

    .auth-title {
        font-size: var(--text-xl);
    }

    .theme-toggle {
        top: var(--sp-3);
        right: var(--sp-3);
        width: 36px;
        height: 36px;
    }
}
