/* ============================================
   AI Trading Bot - Design System v2.0
   Premium Dark Theme
   ============================================ */

/* ===== CSS VARIABLES - DESIGN TOKENS ===== */
:root {
    /* Primary - Cyan (Trading Theme) */
    --primary: #00d4ff;
    --primary-hover: #00b8e0;
    --primary-subtle: rgba(0, 212, 255, 0.12);
    --primary-border: rgba(0, 212, 255, 0.40);

    /* Accent - Gold */
    --accent-primary: #F0B429;
    --accent-primary-hover: #F5C34A;
    --accent-primary-subtle: rgba(240, 180, 41, 0.12);

    /* Semantic Colors */
    --success: #22c55e;
    --success-subtle: rgba(34, 197, 94, 0.15);
    --success-text: #4ade80;
    --error: #ef4444;
    --error-subtle: rgba(239, 68, 68, 0.15);
    --error-text: #f87171;
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --warning-text: #fbbf24;
    --info: #3b82f6;
    --info-subtle: rgba(59, 130, 246, 0.15);
    --info-text: #60a5fa;

    /* Background Hierarchy */
    --bg-primary: #0a0e17;
    --bg-surface: #0f1628;
    --bg-surface-light: #1a1f3a;
    --bg-surface-hover: #252d4a;
    --bg-elevated: #2d3654;

    /* Text Hierarchy */
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;

    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(0, 212, 255, 0.40);

    /* Font Stacks */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

    /* Type Scale (Perfect Fourth - 1.333) */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */
    --text-5xl: 3rem;      /* 48px */
    --text-6xl: 3.75rem;   /* 60px */

    /* Spacing Scale (4px base) */
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */

    /* Component Tokens */
    --nav-height: 64px;
    --sidebar-width: 280px;
    --container-max: 1280px;
    --container-narrow: 720px;
    --container-wide: 1440px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);

    /* Timing */
    --duration-fast: 100ms;
    --duration-normal: 150ms;
    --duration-slow: 250ms;
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* Legacy Compatibility */
    --primary-color: #00d4ff;
    --primary-hover: #00b8e0;
    --secondary-color: #71717A;
    --success-color: #10B981;
    --danger-color: #F43F5E;
    --warning-color: #F59E0B;
    --background: #09090B;
    --surface: #0F0F12;
    --border-color: rgba(255, 255, 255, 0.10);
    --accent-color: #00d4ff;
    --accent-primary: #00d4ff;
    --accent-primary-hover: #00b8e0;
    --accent-primary-subtle: rgba(0, 212, 255, 0.12);
    --profit: #10B981;
    --loss: #F43F5E;
    --footer-bg: #09090B;
    --footer-text: #D4D4D8;
    --bg-secondary: #0F0F12;
    --bg-tertiary: #18181B;
    --bg-quaternary: #27272A;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration-normal) var(--ease-out);
}

a:hover {
    color: var(--primary-hover);
}

/* Monospace for data/numbers */
.mono, .stat-value, .value, .price, .balance, .profit,
[class*="price"], [class*="balance"], [class*="profit"] {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Labels */
.label, .stat-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.container-wide {
    max-width: var(--container-wide);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Primary Button - Cyan Gradient */
.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #00b8e0 0%, #00d4ff 100%);
    box-shadow: var(--shadow-glow);
    color: #FFFFFF;
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    padding: var(--space-2) var(--space-3);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Danger Button */
.btn-danger {
    background: var(--error-subtle);
    color: var(--error);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.5);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-full {
    width: 100%;
}

/* Navigation Buttons (page header bars) */
.btn-nav {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
}

.btn-nav-outline {
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.5);
    background: transparent;
}

.btn-nav-outline:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    color: #00d4ff;
}

.btn-nav-primary {
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    color: #0a0e27;
    border: none;
}

.btn-nav-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
    color: #0a0e27;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    background: var(--bg-surface-light);
    border-top: 1px solid var(--border-subtle);
}

/* Stat Card */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: border-color var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
    border-color: var(--border-default);
}

.stat-card .stat-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.stat-card .stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 500;
    margin-top: var(--space-2);
}

.stat-card .stat-trend.positive {
    color: var(--success);
}

.stat-card .stat-trend.negative {
    color: var(--error);
}

/* Feature Card */
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--duration-slow) var(--ease-out);
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-border);
    box-shadow: var(--shadow-lg);
}

.feature-card .feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.feature-card .feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.feature-card h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.feature-card p {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface-hover) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    transition: all var(--duration-normal) var(--ease-out);
    -webkit-text-fill-color: var(--text-primary) !important;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-subtle);
    background: var(--bg-surface-light) !important;
}

/* Autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-surface-hover) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border: 1px solid var(--primary) !important;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

/* Large Input */
.form-input-lg {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-lg);
    height: 48px;
}

/* Input with Icon */
.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--duration-normal) var(--ease-out);
}

.input-wrapper input {
    padding-left: 2.75rem;
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--primary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    transition: background var(--duration-normal) var(--ease-out);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform var(--duration-normal) var(--ease-out);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    padding: 0 var(--space-8);
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Animated blue light sweep — applies to ALL nav bars across the app */
nav::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 80, 255, 0.15) 8%,
        rgba(0, 120, 255, 0.3) 18%,
        rgba(0, 160, 255, 0.5) 30%,
        rgba(0, 200, 255, 0.75) 42%,
        rgba(0, 212, 255, 0.95) 48%,
        rgba(120, 230, 255, 1) 50%,
        rgba(0, 212, 255, 0.95) 52%,
        rgba(0, 200, 255, 0.75) 58%,
        rgba(0, 160, 255, 0.5) 70%,
        rgba(0, 120, 255, 0.3) 82%,
        rgba(0, 80, 255, 0.15) 92%,
        transparent 100%
    );
    border-radius: 1px;
    filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.9))
            drop-shadow(0 0 10px rgba(0, 180, 255, 0.5))
            drop-shadow(0 0 20px rgba(0, 150, 255, 0.3));
    animation: nav-light-sweep 3.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes nav-light-sweep {
    0% {
        left: -100%;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        left: 120%;
        opacity: 0;
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* AI Trading Bot Logo - Image */
.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
}

.nav-logo-img.logo-sm {
    height: 40px;
}

.nav-logo-img.logo-lg {
    height: 80px;
}

.brand-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-title-row h1 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.version-badge {
    background: var(--primary-subtle);
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    border: 1px solid var(--primary-border);
}

.status-badge {
    background: var(--success-subtle);
    color: var(--success);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.brand-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
}

.developer-credit {
    color: var(--text-tertiary);
    font-weight: 500;
}

.meta-divider {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}

.update-date {
    color: var(--text-muted);
}

.nav-menu {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.nav-menu a.active {
    color: var(--primary);
    background: var(--primary-subtle);
}

/* User Dropdown */
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-surface-light);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.nav-user:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
}

.nav-user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, #0066ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    color: white;
}

.nav-user-name {
    font-weight: 600;
}

.nav-user-arrow {
    font-size: var(--text-xs);
    opacity: 0.6;
    margin-left: var(--space-1);
}

.user-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: var(--space-2);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn var(--duration-fast) var(--ease-out);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform var(--duration-fast) var(--ease-out);
}

.dropdown-item:hover {
    background: var(--bg-surface-light);
    color: var(--text-primary);
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

.dropdown-item.logout-item {
    color: var(--error);
}

.dropdown-item.logout-item::before {
    background: var(--error);
}

.dropdown-item.admin-item {
    color: var(--warning);
}

.dropdown-item.admin-item::before {
    background: var(--warning);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-2) 0;
}

.dropdown-icon {
    width: 18px;
    text-align: center;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-6) 0;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-section {
    padding: 0 var(--space-4);
    margin-bottom: var(--space-6);
}

.sidebar-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 var(--space-4);
    margin-bottom: var(--space-3);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-subtle);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.sidebar-link.active svg {
    opacity: 1;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface-light);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-default);
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: background var(--duration-fast) var(--ease-out);
}

.table tbody tr:hover {
    background: var(--bg-surface-light);
}

.table .mono {
    font-family: var(--font-mono);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.badge-primary {
    background: var(--primary-subtle);
    color: var(--primary-hover);
}

.badge-success {
    background: var(--success-subtle);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-subtle);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--error-subtle);
    color: var(--error-text);
}

.badge-info {
    background: var(--info-subtle);
    color: var(--info-text);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn var(--duration-fast) var(--ease-out);
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--duration-slow) var(--ease-out);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: var(--text-lg);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    background: var(--bg-surface-light);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* Custom Modal (legacy support) */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.custom-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--duration-slow) var(--ease-out);
}

.custom-modal-header {
    background: var(--primary-subtle);
    border-bottom: 1px solid var(--primary-border);
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.custom-modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: var(--text-lg);
    font-weight: 600;
}

.custom-modal-body {
    padding: var(--space-6);
    color: var(--text-secondary);
    line-height: 1.6;
}

.custom-modal-body p {
    margin: 0;
}

.custom-modal-footer {
    background: var(--bg-surface-light);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-4) var(--space-6);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ===== INACTIVITY TIMEOUT MODAL ===== */
.inactivity-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.inactivity-modal-content {
    background: var(--bg-surface);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-xl);
    max-width: 420px;
    width: 90%;
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.15), var(--shadow-xl);
    animation: slideUp var(--duration-slow) var(--ease-out);
    text-align: center;
}

.inactivity-modal-header {
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.inactivity-modal-header h3 {
    margin: 0;
    color: #f59e0b;
    font-size: var(--text-lg);
    font-weight: 600;
}

.inactivity-modal-body {
    padding: var(--space-6);
}

.inactivity-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: #f59e0b;
    margin: var(--space-4) 0;
    line-height: 1;
}

.inactivity-countdown.danger {
    color: #ef4444;
}

.inactivity-modal-footer {
    background: var(--bg-surface-light);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-4) var(--space-6);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--bg-surface-light);
    border-radius: var(--radius-lg);
}

.tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ===== LOADING STATES ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface-light) 25%, var(--bg-surface-hover) 50%, var(--bg-surface-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-circle {
    border-radius: 50%;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ALERTS ===== */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.alert-message {
    font-size: var(--text-sm);
    opacity: 0.9;
}

.alert-success {
    background: var(--success-subtle);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-text);
}

.alert-error {
    background: var(--error-subtle);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--error-text);
}

.alert-warning {
    background: var(--warning-subtle);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning-text);
}

.alert-info {
    background: var(--info-subtle);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--info-text);
}

/* ===== FOOTER ===== */
.app-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-6) var(--space-8);
    margin-top: auto;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    margin: 0;
}

/* Footer Brand */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer Navigation Links */
.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #00d4ff;
}

/* Footer Info (right column) */
.footer-info {
    text-align: right;
}

.footer-info p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

/* ===== TOOLTIPS ===== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: var(--text-xs);
    white-space: nowrap;
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-fast) var(--ease-out);
    z-index: 1000;
    margin-bottom: var(--space-2);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===== PROGRESS BAR ===== */
.progress {
    height: 8px;
    background: var(--bg-surface-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}

.progress-bar.success {
    background: linear-gradient(90deg, var(--success) 0%, #34D399 100%);
}

.progress-bar.warning {
    background: linear-gradient(90deg, var(--warning) 0%, #FBBF24 100%);
}

.progress-bar.danger {
    background: linear-gradient(90deg, var(--error) 0%, #FB7185 100%);
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--error) !important; }
.text-error { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-accent { color: var(--primary) !important; }

.bg-primary { background: var(--bg-primary) !important; }
.bg-surface { background: var(--bg-surface) !important; }
.bg-surface-light { background: var(--bg-surface-light) !important; }
.bg-surface-hover { background: var(--bg-surface-hover) !important; }

.font-mono { font-family: var(--font-mono) !important; }
.font-sans { font-family: var(--font-sans) !important; }

.text-xs { font-size: var(--text-xs) !important; }
.text-sm { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg { font-size: var(--text-lg) !important; }
.text-xl { font-size: var(--text-xl) !important; }
.text-2xl { font-size: var(--text-2xl) !important; }

.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.uppercase { text-transform: uppercase !important; }
.capitalize { text-transform: capitalize !important; }

.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.hidden { display: none !important; }
.grid { display: grid !important; }

.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }

.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-start { justify-content: flex-start !important; }
.justify-end { justify-content: flex-end !important; }

.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; }

.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-6 { gap: var(--space-6) !important; }
.gap-8 { gap: var(--space-8) !important; }

.m-0 { margin: 0 !important; }
.m-1 { margin: var(--space-1) !important; }
.m-2 { margin: var(--space-2) !important; }
.m-4 { margin: var(--space-4) !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: var(--space-2) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-6 { padding: var(--space-6) !important; }
.p-8 { padding: var(--space-8) !important; }
.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }
.px-6 { padding-left: var(--space-6) !important; padding-right: var(--space-6) !important; }
.py-2 { padding-top: var(--space-2) !important; padding-bottom: var(--space-2) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.border { border: 1px solid var(--border-default) !important; }
.border-subtle { border: 1px solid var(--border-subtle) !important; }
.border-strong { border: 1px solid var(--border-strong) !important; }
.border-none { border: none !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }

.z-10 { z-index: 10 !important; }
.z-50 { z-index: 50 !important; }
.z-100 { z-index: 100 !important; }

.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }

.pointer-events-none { pointer-events: none !important; }

.transition { transition: all var(--duration-normal) var(--ease-out) !important; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 var(--space-4);
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--duration-slow) var(--ease-out);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .container {
        padding: 0 var(--space-4);
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }

    .nav-menu {
        display: none;
    }

    .brand-meta {
        display: none;
    }

    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }

    .container {
        padding: 0 var(--space-4);
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-info {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }

    .card-body {
        padding: var(--space-4);
    }

    .stat-card {
        padding: var(--space-4);
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) var(--bg-primary);
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .sidebar,
    .app-footer,
    .btn,
    .modal-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
