/* ═══════════════════════════════════════════════════════════════
   PREMIUM DESIGN SYSTEM
   Inspired by Stripe, Linear, Vercel
   
   Единый файл стилей для всех страниц бизнес-панели
   ═══════════════════════════════════════════════════════════════ */

/* Inter Font - если не подключён через HTML */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────────────────────────
   CSS VARIABLES - Design Tokens (Plulo Brand Colors)
   ───────────────────────────────────────────────────────────────── */
:root {
    /* Primary Palette - Фиолетовый Plulo */
    --primary-50: #faf5ff;
    --primary-100: #f3e8ff;
    --primary-200: #e9d5ff;
    --primary-300: #d8b4fe;
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --primary-700: #7e22ce;
    
    /* Accent - Зеленый лайм для акцентов */
    --accent-400: #a3e635;
    --accent-500: #84cc16;
    --accent-600: #65a30d;
    
    /* Success - Изумрудный */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    
    /* Warning - Янтарный */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    
    /* Danger - Красный/Розовый */
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    
    /* Info - Циан */
    --info-50: #ecfeff;
    --info-500: #06b6d4;
    --info-600: #0891b2;
    
    /* Neutral - Сланцевый */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    
    /* Градиенты - Plulo Brand */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --gradient-plulo: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    --gradient-cool: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, hsla(270,80%,70%,0.15) 0px, transparent 50%),
                    radial-gradient(at 80% 0%, hsla(280,85%,65%,0.12) 0px, transparent 50%),
                    radial-gradient(at 0% 50%, hsla(260,90%,75%,0.1) 0px, transparent 50%);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.08);
    
    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

 .plulo-section-card {
     background: white;
     padding: 64px 32px;
     border-radius: 24px;
     box-shadow: var(--shadow-card);
 }

 .business-funnel .plulo-section-card {
     padding: 32px 32px;
 }

 .business-funnel .section-title {
     margin-bottom: 20px;
 }

 .business-funnel .section-subtitle {
     margin-bottom: 28px;
 }

 @media (max-width: 768px) {
     .plulo-section-card {
         padding: 48px 20px;
     }

     .business-funnel .plulo-section-card {
         padding: 28px 20px;
     }

     .business-funnel .section-title {
         margin-bottom: 16px;
     }
 }

 .plulo-qr-thumb {
     width: 140px;
     height: 140px;
     border-radius: 16px;
     background: rgba(255, 255, 255, 0.92);
     padding: 8px;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
     object-fit: contain;
     cursor: pointer;
 }

 .plulo-qr-thumb--sm {
     width: 56px;
     height: 56px;
     border-radius: 12px;
     padding: 6px;
 }

 .plulo-qr-thumb--md {
     width: 156px;
     height: 156px;
 }

 .plulo-qr-thumb--lg {
     width: 200px;
     height: 200px;
 }

 .plulo-qr-thumb:focus {
     outline: 2px solid rgba(255, 255, 255, 0.8);
     outline-offset: 3px;
 }

 .qr-modal {
     position: fixed;
     inset: 0;
     display: none;
     z-index: 9999;
 }

 .qr-modal.is-open {
     display: block;
 }

 .qr-modal-backdrop {
     position: absolute;
     inset: 0;
     background: rgba(0, 0, 0, 0.6);
     backdrop-filter: blur(6px);
 }

 .qr-modal-content {
     position: absolute;
     left: 50%;
     top: 50%;
     transform: translate(-50%, -50%);
     width: min(92vw, 420px);
     border-radius: 20px;
     background: white;
     padding: 18px;
     box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
 }

 .qr-modal-img {
     width: 100%;
     height: auto;
     display: block;
     border-radius: 14px;
 }

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

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

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

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

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

/* Animation utility classes */
.animate-fadeInUp {
    animation: fadeInUp 0.6s var(--ease-out-expo);
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

/* Staggered animation delay */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ─────────────────────────────────────────────────────────────────
   CONTENT AREA
   ───────────────────────────────────────────────────────────────── */
.content {
    background: var(--gradient-mesh), var(--gray-50);
    min-height: 100vh;
    padding: var(--spacing-xl);
}

/* ─────────────────────────────────────────────────────────────────
   PAGE HEADER
   ───────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    animation: fadeInUp 0.6s var(--ease-out-expo);
}

.page-header-content {
    flex: 1;
    min-width: 300px;
}

.page-header-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.page-header-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-header-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke: white;
}

.page-title {
    font-family: var(--font-sans);
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--gray-500);
    margin: 4px 0 0 0;
    line-height: 1.6;
    font-weight: 500;
}

/* Live indicator badge */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: var(--radius-full);
    border: 1px solid rgba(16, 185, 129, 0.15);
    height: fit-content;
}

.live-indicator-dot {
    width: 8px;
    height: 8px;
    background: var(--success-500);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.live-indicator-text {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--success-600);
}

/* ─────────────────────────────────────────────────────────────────
   FILTER BAR - Glassmorphism
   ───────────────────────────────────────────────────────────────── */
.filter-bar {
    font-family: var(--font-sans);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.6s var(--ease-out-expo) 0.1s both;
}

.filter-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    font-family: var(--font-sans);
    padding: 10px 40px 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: var(--gray-800);
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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 12px center;
}

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

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

/* Search input */
.search-input {
    font-family: var(--font-sans);
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: var(--gray-800);
    transition: all 0.2s var(--ease-out-expo);
}

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

.search-input::placeholder {
    color: var(--gray-400);
}

/* ─────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────── */
.btn {
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    text-decoration: none;
}

.btn-primary {
    background: var(--gray-900);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

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

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

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

.btn-danger:hover {
    background: var(--danger-600);
}

.btn-icon {
    padding: 10px;
}

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

/* ─────────────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────────────── */
.card {
    font-family: var(--font-sans);
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-card);
    transition: all 0.3s var(--ease-out-expo);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-body {
    padding: var(--spacing-lg);
}

/* Stat Card - Alias for metric-card for consistency */
.stat-card {
    font-family: var(--font-sans);
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-100);
    transition: all 0.3s var(--ease-out-expo);
    animation: fadeInUp 0.6s var(--ease-out-expo) backwards;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent, var(--gradient-primary));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-spring);
}

.stat-card:hover .stat-icon-wrapper {
    transform: scale(1.08) rotate(-3deg);
}

.stat-icon-wrapper svg {
    width: 26px;
    height: 26px;
    color: white;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 2px;
}

.stat-sublabel {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
}

/* Metric Card */
.metric-card {
    font-family: var(--font-sans);
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: flex-start;
    gap: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-100);
    transition: all 0.3s var(--ease-out-expo);
    animation: fadeInUp 0.6s var(--ease-out-expo) calc(var(--i, 0) * 0.05s + 0.2s) both;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent, var(--gradient-primary));
    opacity: 0;
    transition: opacity 0.3s;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon-wrapper {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-spring);
}

.metric-card:hover .metric-icon-wrapper {
    transform: scale(1.08) rotate(-3deg);
}

.metric-icon {
    width: 26px;
    height: 26px;
    color: white;
}

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

.metric-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 2px;
}

.metric-sublabel {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-top: 8px;
}

.metric-change.trend-up {
    color: var(--success-600);
    background: var(--success-50);
}

.metric-change.trend-down {
    color: var(--danger-600);
    background: var(--danger-50);
}

.metric-change.trend-neutral {
    color: var(--gray-500);
    background: var(--gray-100);
}

/* Chart Card */
.chart-card {
    font-family: var(--font-sans);
    background: white;
    padding: 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gray-100);
    transition: all 0.3s var(--ease-out-expo);
    animation: fadeInUp 0.6s var(--ease-out-expo) 0.4s both;
}

.chart-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.chart-card-title {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.chart-card-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary-500);
}

/* ─────────────────────────────────────────────────────────────────
   SECTION
   ───────────────────────────────────────────────────────────────── */
.section {
    font-family: var(--font-sans);
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--gray-100);
    animation: fadeInUp 0.6s var(--ease-out-expo) 0.5s both;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 28px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
    letter-spacing: -0.01em;
}

.section-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary-500);
}

/* ─────────────────────────────────────────────────────────────────
   GRIDS
   ───────────────────────────────────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: var(--spacing-xl);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

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

/* ─────────────────────────────────────────────────────────────────
   SKELETON LOADERS
   ───────────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-50) 50%, var(--gray-100) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 32px;
    width: 100px;
    display: inline-block;
}

.skeleton-text-sm {
    height: 20px;
    width: 80px;
}

.skeleton-text-lg {
    height: 40px;
    width: 120px;
}

.skeleton-chart {
    height: 280px;
    width: 100%;
    border-radius: var(--radius-md);
}

.skeleton-image {
    height: 100px;
    width: 100%;
    border-radius: var(--radius-md);
}

.skeleton-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

/* ─────────────────────────────────────────────────────────────────
   BADGES & TAGS
   ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-success {
    background: var(--success-100);
    color: var(--success-600);
}

.badge-warning {
    background: var(--warning-100);
    color: var(--warning-600);
}

.badge-danger {
    background: var(--danger-100);
    color: var(--danger-600);
}

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ─────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────────── */
.toast {
    font-family: var(--font-sans);
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: fadeInUp 0.3s var(--ease-out-expo);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.toast-success {
    background: var(--success-500);
    color: white;
}

.toast-error {
    background: var(--danger-500);
    color: white;
}

.toast-info {
    background: var(--gray-800);
    color: white;
}

/* ─────────────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    font-family: var(--font-sans);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s var(--ease-out-expo);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

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

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ─────────────────────────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-family: var(--font-sans);
}

.form-input {
    font-family: var(--font-sans);
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--gray-800);
    transition: all 0.2s var(--ease-out-expo);
}

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

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:disabled {
    background: var(--gray-50);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}

.table {
    font-family: var(--font-sans);
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--gray-50);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-100);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    font-size: 14px;
}

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

.table tr:hover td {
    background: var(--gray-50);
}

/* ─────────────────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────────────────── */
.empty-state {
    font-family: var(--font-sans);
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ─────────────────────────────────────────────────────────────────
   ERROR STATE
   ───────────────────────────────────────────────────────────────── */
.error {
    font-family: var(--font-sans);
    background: var(--danger-50);
    border: 1px solid var(--danger-100);
    color: var(--danger-600);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.error a {
    color: var(--danger-600);
    font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .metric-value {
        font-size: 28px;
    }
}

/* ─────────────────────────────────────────────────────────────────
   CHART.JS DEFAULT STYLES
   ───────────────────────────────────────────────────────────────── */
.chart-container {
    position: relative;
    height: 280px;
}

.chart-container canvas {
    height: 100% !important;
}

