/**
 * ══════════════════════════════════════════════════════════════════════════════
 * ILLUMINATE AI — Unified Design System
 * 
 * This is the primary stylesheet containing all design tokens and base styles.
 * It provides a cohesive visual language across the entire application.
 * 
 * STRUCTURE:
 * 1. CSS Variables (color, typography, spacing, shadows)
 * 2. CSS Reset
 * 3. Base Typography
 * 4. Core Components (buttons, cards, badges, forms)
 * 5. Layout & Grid
 * 6. Animations & Keyframes
 * 7. UI Components (modals, toasts, tabs)
 * 8. Modern 2026 Enhancements (bento, glass, hover effects)
 * 9. Page Components (stats, headers, call UI)
 * 10. Utility Classes
 * 
 * DEPENDENCIES:
 * - ./variables.css (CSS custom properties)
 * - Google Fonts: Clash Display, Satoshi (loaded via @import)
 * 
 * USAGE:
 * <link rel="stylesheet" href="css/design-system.css">
 * 
 * IMPORTANT:
 * Color variables are synced with canonical colors defined in variables.css
 * ══════════════════════════════════════════════════════════════════════════════
 */

@import url('https://api.fontshare.com/v2/css?f[]=clash-display@200,300,400,500,600,700&f[]=satoshi@300,400,500,700,900&display=swap');
@import './variables.css';

/* ── OVERRIDE CONFLICTING VARIABLES with Canonical Colors ── */
:root {
    /* Canonical Colors - MUST match index.html */
    --primary: var(--accent);
    --primary-dark: var(--accent-hover);
    --primary-hover: var(--accent-hover);
    --primary-light: var(--accent-light);
    --primary-muted: var(--accent-light);
    --primary-glow: var(--accent-glow);
    --primary-rgb: 92, 98, 252;

    /* Accent is the PRIMARY - secondary accent uses --accent-2 */
    --accent: #5c62fc;
    --accent-hover: #4f55e0;
    --accent-light: rgba(92, 98, 252, 0.15);
    --accent-muted: rgba(92, 98, 252, 0.25);
    --accent-glow: rgba(92, 98, 252, 0.35);

    /* Secondary */
    --secondary: #6366F1;
    --secondary-dark: #4338CA;
    --secondary-light: rgba(92, 98, 252, 0.15);

    /* Semantic Colors - Canonical */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --success-dark: #059669;
    --danger: #ef4444;
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.15);
    --error-dark: #dc2626;
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --warning-dark: #d97706;
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.15);
    --info-dark: #2563eb;

    /* Backgrounds & Surfaces - Canonical */
    --bg: #030303;
    --bg-primary: #030303;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-elevated: rgba(26, 26, 26, 0.8);
    --bg-card: #111111;
    --bg-card-solid: #111111;
    --app-bg: #030303;
    --surface: #111111;
    --surface-variant: #1a1a1a;
    --surface-muted: #222222;
    --surface-tint: rgba(92, 98, 252, 0.05);

    /* Borders */
    --border: #3f3f46;
    --border-default: #3f3f46;
    --border-subtle: rgba(63, 63, 70, 0.4);
    --border-light: #27272a;
    --border-strong: #52525b;

    /* Text */
    --text: #fafafa;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #71717a;
    --text-dim: #52525b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #5c62fc 0%, #9d50ff 100%);
    --gradient-accent: linear-gradient(135deg, #9d50ff 0%, #b06fff 100%);
    --gradient-medical: linear-gradient(135deg, #4338ca 0%, #5c62fc 100%);
    --gradient-glow: radial-gradient(circle at top, rgba(92, 98, 252, 0.05) 0%, transparent 70%);
    --gradient-success: linear-gradient(135deg, #22c55e, #16a34a);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-error: linear-gradient(135deg, #ef4444, #dc2626);

    /* Glassmorphism */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-bg: rgba(24, 24, 27, 0.95);
    --glass-bg-strong: rgba(39, 39, 42, 0.95);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-blur: 16px;

    /* Typography */
    --font-display: 'Clash Display', 'Satoshi', sans-serif;
    --font-body: 'Satoshi', system-ui, sans-serif;
    --font-sans: 'Satoshi', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-glow-primary: 0 0 30px var(--primary-glow);
    --shadow-glow-accent: 0 0 30px var(--accent-glow);

    /* Transitions */
    --transition: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --max-width: 1200px;
    --page-padding: clamp(1rem, 5vw, 2rem);
    --nav-height: 64px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    
    /* Surfaces */
    --surface-2: #27272a;
    --surface-3: #3f3f46;
}

/* ── Light Theme ── */
[data-theme="light"] {
    --bg: #F8FAFC;
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    --bg-card: #FFFFFF;
    --bg-card-solid: #FFFFFF;
    --app-bg: linear-gradient(180deg, #F8FAFC 0%, #EFF6F5 100%);
    --surface: #FFFFFF;
    --surface-variant: #F8FAFC;
    --surface-muted: #F1F5F9;
    --surface-tint: rgba(92, 98, 252, 0.05);
    --border: #E2E8F0;
    --border-subtle: rgba(226, 232, 240, 0.8);
    --border-default: rgba(203, 213, 225, 0.8);
    --border-light: #F1F5F9;
    --border-strong: #CBD5E1;
    --text: #0F172A;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-muted: #94A3B8;
    --text-dim: #CBD5E1;
    --glass: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-bg-strong: rgba(255, 255, 255, 0.98);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(0, 0, 0, 0.12);
    --gradient-glow: radial-gradient(circle at top, rgba(228, 168, 83, 0.05) 0%, transparent 70%);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.2);
}

/* ── CSS Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--app-bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

::selection {
    background: var(--primary);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); }
h4 { font-size: 1.125rem; }

/* ── Noise Overlay ── */
.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px var(--primary-glow);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-2) var(--space-3);
}

.btn-ghost:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-full { width: 100%; }

/* ── Cards ── */
.card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--glass-border-hover);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--secondary-light); color: var(--secondary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--error-muted); color: var(--danger); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-info { background: var(--info-light); color: var(--info); }

/* ── Forms ── */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input,
.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    transition: all var(--transition-base);
}

.form-input:focus,
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.input::placeholder {
    color: var(--text-muted);
}

textarea.form-input,
textarea.input {
    min-height: 100px;
    resize: vertical;
}

select.form-input,
select.input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-10);
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

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

.table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--surface-muted);
}

/* ── Progress Bars ── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* ── Avatar ── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }

/* ── Grid System ── */
.grid {
    display: grid;
    gap: var(--space-4);
}

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

/* ── Flex Utilities ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── Text Utilities ── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

/* ── Spacing Utilities ── */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.5s ease forwards; }
.animate-fade-in-right { animation: fadeInRight 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s ease forwards; }

/* Legacy animation classes from existing pages */
.fade-up { animation: fadeInUp 0.5s ease forwards; }
.fade-up-delay-1 { animation-delay: 0.1s; }
.fade-up-delay-2 { animation-delay: 0.2s; }
.fade-up-delay-3 { animation-delay: 0.3s; }
.fade-up-delay-4 { animation-delay: 0.4s; }
.animate-in { animation: fadeIn 0.4s ease forwards; }

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-variant) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-variant) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius-sm);
    height: 14px;
}

.skeleton-circle {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-variant) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

/* Skeleton size utilities */
.h-xl { height: 24px; }
.h-lg { height: 20px; }
.h-sm { height: 10px; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }
.w-80 { width: 80%; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
}

.empty-state .material-symbols-outlined {
    font-size: 2.5rem;
    opacity: 0.4;
    display: block;
    margin-bottom: var(--space-3);
}

.empty-state p {
    font-size: 0.875rem;
}

/* ── Spinner ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg { width: 48px; height: 48px; border-width: 4px; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    z-index: 9999;
    animation: fadeInRight 0.3s ease;
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }
.toast-info { border-color: var(--info); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--space-4);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ── Theme Toggle ── */
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Responsive Grid ── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* ── Scrollbar Styling ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Data List Items (used across dashboards) ── */
.data-list {
    display: flex;
    flex-direction: column;
}

.data-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
}

.data-item:hover {
    background: var(--surface-muted);
}

.data-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.data-item-icon.primary { background: var(--primary-light); color: var(--primary); }
.data-item-icon.accent { background: var(--accent-light); color: var(--accent); }
.data-item-icon.success { background: var(--success-light); color: var(--success); }
.data-item-icon.warning { background: var(--warning-light); color: var(--warning); }
.data-item-icon.info { background: var(--info-light); color: var(--info); }
.data-item-icon.danger { background: var(--error-muted); color: var(--danger); }
.data-item-icon.secondary { background: var(--secondary-light); color: var(--secondary); }

.data-item-info { flex: 1; min-width: 0; }
.data-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.data-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Stat Cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--glass-border-hover);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.secondary { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.danger { background: var(--error-muted); color: var(--danger); }

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--space-1);
}

/* ── Grid Stats (legacy) ── */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ── Auth Container ── */
.auth-container {
    max-width: 420px;
    margin: 10vh auto;
    padding: var(--space-8);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-container .logo-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-container .logo-inline .logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.message {
    margin-top: var(--space-4);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    display: none;
    font-size: 0.875rem;
    text-align: center;
}

.message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    display: block;
}

.message.error {
    background: var(--error-muted);
    color: var(--danger);
    border: 1px solid var(--danger);
    display: block;
}

/* ── Atmosphere Background ── */
.atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--gradient-glow);
}

/* ═══════════════════════════════════════════════════════════════
   MODERN 2026 DESIGN ENHANCEMENTS
   Bento grids, micro-interactions, spring easing, ambient glows
   ═══════════════════════════════════════════════════════════════ */

/* ── Spring Easing Curves ── */
:root {
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring-smooth: cubic-bezier(0.22, 1.2, 0.36, 1);
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quint: cubic-bezier(0.83, 0, 0.17, 1);
}

/* ── Bento Grid Layouts ── */
.bento-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(120px, auto);
}

.bento-span-3 { grid-column: span 3; }
.bento-span-4 { grid-column: span 4; }
.bento-span-6 { grid-column: span 6; }
.bento-span-8 { grid-column: span 8; }
.bento-span-12 { grid-column: span 12; }
.bento-row-2 { grid-row: span 2; }

@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(6, 1fr); }
    .bento-span-3, .bento-span-4 { grid-column: span 3; }
    .bento-span-6, .bento-span-8 { grid-column: span 6; }
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-span-3, .bento-span-4, .bento-span-6,
    .bento-span-8, .bento-span-12 { grid-column: span 1; }
    .bento-row-2 { grid-row: span 1; }
}

/* ── Micro-Interaction Hover Effects ── */
.hover-lift {
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.hover-glow:hover {
    box-shadow: var(--shadow-glow-primary);
    border-color: var(--primary);
}

.hover-scale {
    transition: transform 0.25s var(--ease-spring);
}
.hover-scale:hover {
    transform: scale(1.03);
}

.hover-border {
    transition: border-color 0.3s ease, background 0.3s ease;
}
.hover-border:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ── Floating Card Effect ── */
.card-float {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.4s var(--ease-spring-smooth),
                box-shadow 0.4s ease;
}
.card-float:hover {
    transform: translateY(-6px) rotateX(2deg) rotateY(-1deg);
    box-shadow: var(--shadow-xl), 0 0 40px var(--primary-glow);
}

/* ── Glass Reflection ── */
.glass-reflect {
    position: relative;
    overflow: hidden;
}
.glass-reflect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.04) 0%,
        transparent 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* ── Ambient Glow Orbs ── */
.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    animation: ambientFloat 20s ease-in-out infinite;
}

.ambient-orb-primary {
    width: 400px;
    height: 400px;
    background: var(--primary);
}

.ambient-orb-accent {
    width: 350px;
    height: 350px;
    background: var(--accent);
    animation-delay: -7s;
}

.ambient-orb-secondary {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    animation-delay: -14s;
}

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

/* ── Mesh Gradient Backgrounds ── */
.mesh-bg {
    background:
        radial-gradient(at 20% 20%, var(--primary-light) 0%, transparent 50%),
        radial-gradient(at 80% 20%, var(--accent-light) 0%, transparent 50%),
        radial-gradient(at 50% 80%, var(--secondary-light) 0%, transparent 50%),
        var(--bg);
}

.mesh-bg-subtle {
    background:
        radial-gradient(at 0% 0%, rgba(13, 148, 136, 0.06) 0%, transparent 50%),
        radial-gradient(at 100% 0%, rgba(228, 168, 83, 0.04) 0%, transparent 50%),
        radial-gradient(at 50% 100%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        var(--bg);
}

/* ── Stagger Animation Utilities ── */
.stagger > * {
    animation: fadeInUp 0.5s var(--ease-out-expo) both;
}
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }
.stagger > *:nth-child(11) { animation-delay: 0.55s; }
.stagger > *:nth-child(12) { animation-delay: 0.6s; }

/* ── Shimmer Loading (Modern) ── */
.shimmer {
    background: linear-gradient(
        90deg,
        var(--surface) 0%,
        var(--surface-variant) 20%,
        var(--surface-muted) 40%,
        var(--surface-variant) 60%,
        var(--surface) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s var(--ease-smooth) infinite;
}

/* ── Pill Navigation ── */
.pill-nav {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    overflow-x: auto;
    scrollbar-width: none;
}
.pill-nav::-webkit-scrollbar { display: none; }

.pill-nav-item {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
    white-space: nowrap;
    border: none;
    background: transparent;
}
.pill-nav-item:hover {
    color: var(--text-primary);
    background: var(--surface-variant);
}
.pill-nav-item.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ── Modern Input Group ── */
.input-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-group .input {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: var(--space-2) var(--space-3);
}
.input-group .input:focus {
    box-shadow: none;
}

/* ── Floating Action Button ── */
.fab {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    cursor: pointer;
    z-index: 90;
    transition: all 0.3s var(--ease-spring);
}
.fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 50px var(--primary-glow);
}
.fab:active {
    transform: scale(0.95);
}

/* ── Tooltip ── */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    background: var(--surface);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s var(--ease-spring);
    z-index: 100;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ── Modern Tag / Chip ── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--surface-variant);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}
.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-4) 0;
    border: none;
}

.divider-vertical {
    width: 1px;
    background: var(--border-light);
    align-self: stretch;
}

/* ── Modern Toggle Switch ── */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--surface-muted);
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    padding: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease-spring);
}
.toggle-switch.active {
    background: var(--primary);
}
.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ═══════════════════════════════════════════════════════════════
   REUSABLE PAGE COMPONENTS
   Standardized UI patterns for consistent design across all pages
   ═══════════════════════════════════════════════════════════════ */

/* ── Page Header ── */
.page-header {
    margin-bottom: var(--space-6);
}
.page-breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.page-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.page-header-icon .material-symbols-outlined {
    font-size: 1.25rem;
}
.page-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}
.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: var(--space-1) 0 0;
}
.page-header-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* ── Section Header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.section-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.section-icon {
    font-size: 1.25rem;
    color: var(--primary-light);
}
.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin: 0;
}
.section-header-actions {
    display: flex;
    gap: var(--space-2);
}

/* ── Stat Card (enhanced) ── */
.stat-card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-base);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--glass-border-hover);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.secondary { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.danger { background: var(--error-muted); color: var(--danger); }
.stat-info { flex: 1; min-width: 0; }
.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--space-1);
}
.stat-trend {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: var(--space-1);
}
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ── Call Controls ── */
.call-controls {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}
.call-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    transition: all 0.2s;
    flex-shrink: 0;
}
.call-btn:hover { background: rgba(255,255,255,0.12); }
.call-btn.call-btn-off { background: rgba(239,68,68,0.2); color: var(--error); }
.call-btn.call-btn-on { background: rgba(99,102,241,0.2); color: var(--secondary); }
.call-btn-end {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-6);
    height: 52px;
    border-radius: 100px;
    background: var(--danger);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 24px rgba(239,68,68,0.3);
    transition: all 0.2s;
}
.call-btn-end:hover { background: var(--error); }
.call-btn-end .material-symbols-outlined { font-size: 1.1rem; }

/* ── Call Header ── */
.call-header {
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.call-header-left { display: flex; align-items: center; gap: var(--space-3); }
.call-header-icon { color: var(--accent); font-size: 1.5rem; }
.call-header-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0;
}
.call-header-subtitle { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.call-header-right { display: flex; align-items: center; gap: var(--space-3); }
.call-duration { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }
.call-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── Video Area ── */
.video-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.video-wrap {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    border-radius: var(--radius-lg);
    background: rgba(10,10,25,0.8);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.video-waiting { text-align: center; color: var(--text-muted); z-index: 1; }
.video-waiting-icon { font-size: 64px; display: block; margin-bottom: var(--space-4); opacity: 0.4; }
.video-waiting-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-secondary);
}
.video-room-id {
    font-size: 0.7rem;
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: none;
}
.video-incall { display: none; position: absolute; inset: 0; }
.video-incall video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-lg); }
.video-remote-label {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: var(--space-2) var(--space-4);
    border-radius: 100px;
    backdrop-filter: blur(8px);
}
.video-remote-label span { font-size: 0.875rem; font-weight: 600; color: #fff; }
.video-self-view {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 140px;
    height: 105px;
    border-radius: var(--radius-md);
    background: rgba(20,20,40,0.8);
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 5;
    flex-direction: column;
    gap: var(--space-1);
}
.video-self-view video { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-md); }
.video-self-view .material-symbols-outlined { color: var(--text-muted); opacity: 0.4; font-size: 2rem; }
.video-self-label { font-size: 0.625rem; color: rgba(255,255,255,0.5); }

/* ── Empty State (enhanced) ── */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
}
.empty-icon {
    font-size: 2.5rem;
    opacity: 0.4;
    display: block;
    margin-bottom: var(--space-3);
}
.empty-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}
.empty-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: var(--space-2) 0 0;
}
.empty-action { margin-top: var(--space-4); }

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}
.filter-group { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-width: 140px; }
.filter-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-input, .filter-select {
    padding: var(--space-2) var(--space-3);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--primary); }

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
}
.page-btn {
    padding: var(--space-2) var(--space-3);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    transition: all 0.2s;
}
.page-btn:hover { border-color: var(--glass-border-hover); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Modal (enhanced) ── */
.modal-title-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}
.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--surface-variant);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close-btn:hover { background: var(--surface-muted); color: var(--text-primary); }

/* ── Stat Grid ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ── Common Utility Classes ── */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.m-auto { margin: auto; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

/* ── Responsive Component Adjustments ── */
@media (max-width: 768px) {
    .page-title { font-size: 1.25rem; }
    .page-header-row { flex-direction: column; align-items: flex-start; }
    .page-header-actions { width: 100%; }
    .call-controls { gap: var(--space-2); }
    .call-btn { width: 44px; height: 44px; }
    .call-btn-end { padding: 0 var(--space-4); height: 44px; font-size: 0.8rem; }
    .video-self-view { width: 100px; height: 75px; }
    .filter-bar { flex-direction: column; }
    .filter-group { min-width: 100%; }
}
