/* ============================================================
   PlugMetrics — Premium Design System
   ============================================================ */

/* 
 * PlugMetrics - Premium Dashboard Stylesheet
 * =========================================
 * Variables, Reset, and Core Typography
 */
:root {
    /* Core Palette */
    --bg-body: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-surface-hover: #fafbfc;
    --bg-sidebar: #0f1225;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(99, 102, 241, 0.15);

    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #94a3b8;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #e0e7ff;
    --text-white: #ffffff;

    /* Brand Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-glow: rgba(99, 102, 241, 0.25);

    --accent: #8b5cf6;
    --accent-light: rgba(139, 92, 246, 0.1);

    /* Semantic */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);

    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.1);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-brand-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    --gradient-sidebar: linear-gradient(180deg, #0f1225 0%, #1a1d3a 100%);
    --gradient-card-shine: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.25);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 10px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme='dark'] {
    --bg-body: #0a0c10;
    --bg-surface: #12151d;
    --bg-surface-hover: #1a1e28;
    --text-main: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ---- Unified Feedback Card ---- */
.feedback-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}
.feedback-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-glow); }
.feedback-card .user-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.feedback-card .user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.feedback-card .content { color: var(--text-secondary); font-size: 0.935rem; line-height: 1.6; margin-bottom: 20px; }
.feedback-card .card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }

/* ---- SVG Line Chart ---- */
/* ---- Premium Bar Chart ---- */
.chart-bar { fill: var(--primary); opacity: 0.8; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.chart-bar:hover { opacity: 1; filter: drop-shadow(0 0 10px var(--primary-glow)); transform: translateY(-3px); }
.chart-container:hover .chart-bar:not(:hover) { opacity: 0.4; }

.chart-filters { display: flex; gap: 8px; background: var(--bg-body); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.chart-filter-btn { padding: 6px 16px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); border: none; background: transparent; cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px; }
.chart-filter-btn:hover { color: var(--text-main); }
.chart-filter-btn.active { background: var(--bg-surface); color: var(--primary); box-shadow: var(--shadow-sm); }
html.no-scroll .content-area, body.no-scroll .content-area { overflow: hidden !important; height: 100% !important; }

/* ---- Content Loader ---- */
.content-loader {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s var(--transition-smooth), visibility 0.4s;
    backdrop-filter: blur(8px);
}

.content-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: loaderPulse 2s ease-in-out infinite;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px var(--primary-glow);
}

.loader-logo {
    width: 64px;
    height: 64px;
    background: var(--gradient-brand);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    margin-bottom: 10px;
}

.loader-text {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

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

@keyframes loaderPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

.chart-tooltip {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    pointer-events: none;
    display: none;
    z-index: 1000;
    font-size: 0.8rem;
    color: var(--text-main);
    transform: translate(-50%, -120%);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
}
.chart-tooltip .tooltip-date { font-weight: 500; color: var(--text-muted); margin-bottom: 4px; font-family: 'Sora', sans-serif; }
.chart-tooltip .tooltip-val { font-weight: 800; color: var(--primary); font-size: 1.1rem; display: flex; align-items: baseline; gap: 4px; }

.chart-tracker { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.chart-container:hover .chart-tracker { opacity: 0.5; }

/* ---- Theme Toggle ---- */
.theme-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-secondary); cursor: pointer; transition: var(--transition-base); display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { background: var(--bg-surface-hover); color: var(--primary); transform: scale(1.05); }

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    font-size: 14px;
}

/* Heading font */
h1, h2, h3, h4, h5, h6,
.page-title,
.card-title,
.stat-value,
.sidebar-header h2,
.login-card h1 {
    font-family: 'Sora', 'Outfit', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ---- Utility Classes ---- */
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.hidden { display: none !important; }

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

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.p-6 { padding: 24px; }
.p-4 { padding: 16px; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ---- Badges ---- */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.badge.success {
    background: var(--success-light);
    color: #059669;
}
.badge.neutral {
    background: #f1f5f9;
    color: var(--text-muted);
}
.badge.warning {
    background: var(--warning-light);
    color: #d97706;
}
.badge.info {
    background: var(--info-light);
    color: #2563eb;
}
.badge.danger {
    background: var(--danger-light);
    color: #dc2626;
}

/* ---- Login View ---- */
#login-view {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-sidebar);
    position: relative;
    overflow: hidden;
}

#login-view::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: floatOrb 15s ease-in-out infinite;
}
#login-view::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: floatOrb 20s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 80px rgba(99, 102, 241, 0.08);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideUp 0.6s var(--transition-smooth) both;
}

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

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 28px;
}

.input-group {
    margin-bottom: 18px;
    text-align: left;
}
.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    outline: none;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    background: #fafbfc;
}
.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #fff;
}
.input-group input::placeholder {
    color: #c1c9d4;
}

.btn-primary {
    width: auto;
    min-width: 140px;
    background: var(--gradient-brand);
    color: white;
    border: none;
    padding: 13px 24px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    text-decoration: none;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover::before {
    opacity: 1;
}
.btn-primary:active {
    transform: translateY(0);
}

/* ---- Dashboard Layout ---- */
#dashboard-view {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 272px;
    min-width: 272px;
    background: var(--gradient-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth);
    z-index: 40;
    position: relative;
    overflow: hidden;
}

/* Subtle noise texture feel */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.sidebar-header {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
}
.sidebar-logo::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-md) + 2px);
    background: var(--gradient-brand);
    z-index: -1;
    opacity: 0.3;
    filter: blur(6px);
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    padding: 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    background: none;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-brand);
    border-radius: 0 4px 4px 0;
    transition: height var(--transition-smooth);
}

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

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}
.nav-item.active::before {
    height: 24px;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-body);
}

/* ---- Topbar ---- */
.topbar {
    height: 72px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
    animation: pulse 2s ease-in-out infinite;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-left: 8px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color var(--transition-fast);
}
.avatar:hover {
    border-color: var(--primary);
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Content Area ---- */
.content-area {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    position: relative; /* Needed for absolute loader */
}

/* ---- Stat Grid ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-smooth);
    border: 1px solid transparent;
    cursor: default;
}

/* Gradient top line */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
}

/* Soft glow on hover */
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: var(--gradient-brand-subtle);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(99, 102, 241, 0.12);
}
.stat-card:hover::before {
    transform: scaleX(1);
}
.stat-card:hover::after {
    opacity: 1;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.stat-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}
.stat-card:hover .stat-icon {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    letter-spacing: -0.04em;
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 1;
}
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ---- Card Component ---- */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition-base);
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

/* ---- Middle Grid ---- */
.middle-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

/* ---- Chart ---- */
.chart-container {
    padding: 24px;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 260px;
    gap: 10px;
}
.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}
.chart-bar {
    width: 100%;
    max-width: 36px;
    background: #f1f5f9;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all var(--transition-smooth);
    cursor: pointer;
}
.chart-bar.fill {
    background: var(--gradient-brand);
    box-shadow: 0 -4px 12px rgba(99, 102, 241, 0.15);
    animation: barGrow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes barGrow {
    from {
        transform: scaleY(0);
        transform-origin: bottom;
    }
    to {
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

.chart-bar-wrap:nth-child(1) .chart-bar { animation-delay: 0.05s; }
.chart-bar-wrap:nth-child(2) .chart-bar { animation-delay: 0.1s; }
.chart-bar-wrap:nth-child(3) .chart-bar { animation-delay: 0.15s; }
.chart-bar-wrap:nth-child(4) .chart-bar { animation-delay: 0.2s; }
.chart-bar-wrap:nth-child(5) .chart-bar { animation-delay: 0.25s; }
.chart-bar-wrap:nth-child(6) .chart-bar { animation-delay: 0.3s; }
.chart-bar-wrap:nth-child(7) .chart-bar { animation-delay: 0.35s; }

.chart-bar:hover {
    filter: brightness(1.1);
    transform: scaleX(1.1);
}
.chart-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    border-radius: 6px 6px 0 0;
    pointer-events: none;
}

.chart-label {
    margin-top: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Quick Stats Card ---- */
.quick-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-fast);
}
.quick-stat-item:last-child {
    border-bottom: none;
}
.quick-stat-item:hover {
    padding-left: 8px;
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
td {
    padding: 12px 16px;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    transition: background var(--transition-fast);
}

.plugin-name-wrap {
    white-space: normal;
    line-height: 1.3;
    max-width: 180px;
    font-weight: 700;
}
tr {
    transition: background var(--transition-fast);
}
tr:hover td {
    background: var(--bg-surface-hover);
}
tr:last-child td {
    border-bottom: none;
}

.plugin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.plugin-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all var(--transition-fast);
}
tr:hover .plugin-icon {
    background: var(--gradient-brand);
    color: white;
}

.table-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.table-action-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}
.badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Event Specific Badges */
.badge-event {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-block;
}

.badge-event.activation { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; box-shadow: 0 1px 2px rgba(22, 101, 52, 0.05); }
.badge-event.deactivation { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; box-shadow: 0 1px 2px rgba(153, 27, 27, 0.05); }
.badge-event.update { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; box-shadow: 0 1px 2px rgba(3, 105, 161, 0.05); }
.badge-event.uninstall { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; box-shadow: 0 1px 2px rgba(146, 64, 14, 0.05); }
.badge-event.optin-yes { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; box-shadow: 0 1px 2px rgba(15, 118, 110, 0.05); }
.badge-event.optin-no { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; box-shadow: 0 1px 2px rgba(109, 40, 217, 0.05); }
.badge-event.other { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* ---- Mobile Menu Toggle ---- */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 4px;
}

/* ---- Subpage Layouts ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
}
.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
    font-weight: 500;
}

/* ---- Plugin Grid ---- */
.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.plugin-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.plugin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
}
.plugin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(99, 102, 241, 0.12);
}
.plugin-card:hover::before {
    transform: scaleX(1);
}

/* ---- Review Cards ---- */
.review-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    transition: all var(--transition-smooth);
    position: relative;
}
.review-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 24px;
    bottom: 24px;
    width: 3px;
    background: var(--gradient-brand);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.review-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.1);
}
.review-card:hover::before {
    opacity: 1;
}

.star-rating {
    color: #fbbf24;
    display: flex;
    gap: 2px;
}

/* ---- Search Bar ---- */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    width: 320px;
    transition: all var(--transition-fast);
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-main);
}
.search-bar input::placeholder {
    color: var(--text-muted);
}

/* ---- Ticket Rows ---- */
.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-fast);
}
.ticket-row:last-child {
    border-bottom: none;
}
.ticket-row:hover {
    background: var(--bg-surface-hover);
    padding-left: 28px;
}

/* ---- Buttons ---- */
.btn-secondary {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-strong);
    color: var(--text-main);
    padding: 9px 20px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-premium {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-premium:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-premium i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* ---- Staggered Fade-In Animations ---- */
.fade-in {
    animation: fadeInUp 0.5s var(--transition-smooth) both;
}
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }
.fade-in:nth-child(6) { animation-delay: 0.3s; }

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

/* ---- Section Titles ---- */
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 2px;
}

/* ---- Divider ---- */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* ---- Tooltips & Overlays ---- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}
.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        box-shadow: none;
    }
    .sidebar.open {
        left: 0;
        box-shadow: var(--shadow-xl);
    }
    .overlay.active {
        display: block;
    }
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 16px;
    }
    .content-area {
        padding: 20px 16px;
    }
    .chart-bar {
        max-width: 24px;
    }
    .search-bar {
        width: 100%;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .plugin-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Global Utilities & Component Extras ────────────────── */
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-28 { margin-top: 28px; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.p-6 { padding: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.border-t { border-top: 1px solid var(--border); }
.pt-4 { padding-top: 1rem; }
.mr-6 { margin-right: 1.5rem; }
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Accents */
.card-yesterday { border-top: 3px solid #8b5cf6; } /* Purple */
.card-history { border-top: 3px solid #f59e0b; }   /* Orange */
.card-alltime { border-top: 3px solid #3b82f6; }   /* Blue */
.card-active { border-top: 3px solid #10b981; }    /* Green */

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -10px rgba(0,0,0,0.1); }
.card-yesterday:hover { box-shadow: 0 12px 24px -10px rgba(139, 92, 246, 0.15); }
.card-history:hover { box-shadow: 0 12px 24px -10px rgba(245, 158, 11, 0.15); }
.card-alltime:hover { box-shadow: 0 12px 24px -10px rgba(59, 130, 246, 0.15); }
.card-active:hover { box-shadow: 0 12px 24px -10px rgba(16, 185, 129, 0.15); }

/* Dashboard Footer */
.dashboard-footer {
    height: 48px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.dashboard-footer i { margin-right: 4px; }

.slug-text { font-size: 0.7rem; color: var(--text-muted); }
.header-date { font-size: 0.65rem; font-weight: 400; opacity: 0.7; }
.table-empty, .grid-empty { text-align: center; padding: 40px; color: var(--text-muted); }
.table-fetching { text-align: center; color: var(--text-muted); padding: 12px; }
.icon-img { width: 24px; height: 24px; object-fit: contain; }

@keyframes spin { to { transform: rotate(360deg); } }
.loading-spin { 
    display: inline-block; 
    width: 12px; 
    height: 12px; 
    border: 2px solid rgba(255,255,255,0.1); 
    border-top-color: var(--primary); 
    border-radius: 50%; 
    animation: spin 0.6s linear infinite; 
    margin-right: 8px; 
}

.plugin-card .plugin-name { margin-bottom: 8px; font-weight: 700; letter-spacing: -0.02em; }
.plugin-card .plugin-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 20px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plugin-card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 18px; }
.footer-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.footer-value { font-weight: 800; font-size: 1.125rem; margin-top: 2px; color: var(--text-main); }
.footer-value i.lucide-star { color: #fbbf24; fill: #fbbf24; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.2)); }
.footer-value.flex { display: flex; align-items: center; gap: 6px; }

/* Animations & Skeletons */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease forwards; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-pulse {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 12px;
}
.skeleton-bar { height: 160px; width: 100%; background: var(--border); border-radius: 8px; opacity: 0.2; }
.skeleton-text { height: 12px; background: var(--border); border-radius: 4px; opacity: 0.3; }
.skeleton-row { height: 48px; width: 100%; border-bottom: 1px solid var(--border); background: var(--bg-surface); opacity: 0.5; }

/* Dashboard Card brand accents should still show during skeleton state */
.skeleton-pulse.card-yesterday { border-top-color: #8b5cf6; }
.skeleton-pulse.card-history { border-top-color: #f59e0b; }
.skeleton-pulse.card-alltime { border-top-color: #3b82f6; }
.skeleton-pulse.card-active { border-top-color: #10b981; }

/* ---- Rating Bars ---- */
.rating-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}
.rating-label {
    width: 50px;
    color: var(--primary);
    font-weight: 500;
}
.rating-progress-bg {
    flex: 1;
    height: 8px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
}
.rating-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.rating-count {
    width: 30px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Modal System ---- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.active {
    display: flex;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 37, 0.7);
    backdrop-filter: blur(12px);
}
.modal-content {
    position: relative;
    background: var(--bg-surface);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.4s var(--transition-smooth) both;
    border: 1px solid var(--border);
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-body);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.rating-stars-large {
    color: #fbbf24;
    display: flex;
    gap: 4px;
}
.rating-score-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- Pagination ---- */
.card-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}

.pagination-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-body);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-info strong {
    color: var(--text-main);
    font-weight: 700;
}

.pagination-select {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

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

.pagination-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* ---- Filter Modal & Overlay ---- */
#filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#filter-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-modal {
    background: var(--bg-surface);
    width: 100%;
    max-width: 650px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#filter-modal-overlay.active .filter-modal {
    transform: scale(1);
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-body {
    padding: 32px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 24px 32px;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.filter-select {
    background: var(--bg-body);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    width: 100%;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' 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 12px center;
    background-size: 16px;
}

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

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--danger);
}

