/* ============================================ */
/*  Immigration Report Manager v2.0             */
/*  Light: White-Blue (office/reading)          */
/*  Dark:  Material Design 3                     */
/* ============================================ */

/* ============ DESIGN TOKENS ============ */
:root {
    /* ── Light Mode (default) ── */
    --bg-body: #f0f4f8;
    --bg-surface: #ffffff;
    --bg-surface-variant: #f6f8fb;
    --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --bg-sidebar-flat: #0f172a;
    --bg-sidebar-hover: rgba(255,255,255,0.08);
    --bg-sidebar-active: rgba(56,139,253,0.2);
    --bg-topbar: rgba(255,255,255,0.85);
    --bg-input: #f6f8fb;
    --bg-muted: #edf2f7;
    --bg-hover: #f0f6ff;
    --bg-overlay: rgba(15,23,42,0.4);

    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-active: #2563eb;

    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --text-sidebar: rgba(255,255,255,0.7);
    --text-sidebar-active: #ffffff;

    /* Primary — Blue */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37,99,235,0.1);
    --primary-lighter: rgba(37,99,235,0.05);
    --primary-glow: rgba(37,99,235,0.25);

    /* Semantic Colors */
    --green: #059669;
    --green-bg: #ecfdf5;
    --green-border: #a7f3d0;
    --orange: #d97706;
    --orange-bg: #fffbeb;
    --orange-border: #fde68a;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --red-border: #fecaca;
    --blue: #2563eb;
    --blue-bg: #eff6ff;
    --blue-border: #bfdbfe;
    --purple: #7c3aed;
    --purple-bg: #f5f3ff;
    --purple-border: #ddd6fe;
    --teal: #0d9488;
    --teal-bg: #f0fdfa;

    /* Sizing */
    --sidebar-width: 256px;
    --topbar-height: 62px;
    --help-width: 380px;
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 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: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --shadow-glow: 0 0 20px rgba(37,99,235,0.15);
    --shadow-card-hover: 0 8px 25px rgba(37,99,235,0.12);

    /* Animation */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition: 0.2s var(--ease);
    --transition-slow: 0.35s var(--ease);

    /* Chart colors */
    --chart-1: #2563eb;
    --chart-2: #7c3aed;
    --chart-3: #059669;
    --chart-4: #d97706;
    --chart-5: #dc2626;
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
    --bg-body: #111318;
    --bg-surface: #1c1f26;
    --bg-surface-variant: #22252d;
    --bg-sidebar: linear-gradient(180deg, #0d1017 0%, #161a22 100%);
    --bg-sidebar-flat: #0d1017;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(130,177,255,0.15);
    --bg-topbar: rgba(28,31,38,0.9);
    --bg-input: #22252d;
    --bg-muted: #262930;
    --bg-hover: rgba(130,177,255,0.06);
    --bg-overlay: rgba(0,0,0,0.6);

    --border: #2d3139;
    --border-strong: #3d424d;
    --border-active: #6d9cf7;

    --text-primary: #e4e6eb;
    --text-secondary: #9aa0a6;
    --text-muted: #6b7280;
    --text-inverse: #1a2332;
    --text-sidebar: rgba(255,255,255,0.6);
    --text-sidebar-active: #ffffff;

    --primary: #8ab4f8;
    --primary-hover: #aecbfa;
    --primary-light: rgba(138,180,248,0.12);
    --primary-lighter: rgba(138,180,248,0.06);
    --primary-glow: rgba(138,180,248,0.2);

    --green: #34d399;
    --green-bg: rgba(52,211,153,0.1);
    --green-border: rgba(52,211,153,0.25);
    --orange: #fbbf24;
    --orange-bg: rgba(251,191,36,0.1);
    --orange-border: rgba(251,191,36,0.25);
    --red: #f87171;
    --red-bg: rgba(248,113,113,0.1);
    --red-border: rgba(248,113,113,0.25);
    --blue: #8ab4f8;
    --blue-bg: rgba(138,180,248,0.1);
    --blue-border: rgba(138,180,248,0.2);
    --purple: #c4b5fd;
    --purple-bg: rgba(196,181,253,0.1);
    --purple-border: rgba(196,181,253,0.2);
    --teal: #5eead4;
    --teal-bg: rgba(94,234,212,0.1);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(138,180,248,0.15);
    --shadow-card-hover: 0 8px 25px rgba(138,180,248,0.1);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.4s var(--ease), color 0.3s var(--ease);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ LOADING SCREEN ============ */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px;
    background: var(--bg-body);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-screen.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text { font-size: 13px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounce {
    0% { transform: scale(0) }
    60% { transform: scale(1.12) }
    100% { transform: scale(1) }
}
@keyframes pulse {
    0%, 100% { opacity: 1 }
    50% { opacity: 0.6 }
}
@keyframes shimmer {
    0% { background-position: -200% 0 }
    100% { background-position: 200% 0 }
}
@keyframes gradientShift {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

/* ============ LOGIN ============ */
.login-screen { display: none; height: 100vh; }
.login-screen.active-screen { display: flex; }

.login-bg {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(-45deg, #1e3a5f, #2563eb, #1d4ed8, #3b82f6, #1e40af);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    position: relative;
}
.login-bg::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
}
.login-bg::after {
    content: ''; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h80v80H0z' fill='none'/%3E%3Ccircle cx='40' cy='40' r='1' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E");
}

[data-theme="dark"] .login-bg {
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #172554, #1e293b, #312e81);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-xl);
    padding: 48px 44px;
    width: 440px; max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 1;
    animation: fadeUp 0.6s var(--ease);
}
[data-theme="dark"] .login-card {
    background: rgba(28,31,38,0.9);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon {
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(37,99,235,0.3);
    transition: transform 0.3s var(--ease-bounce);
}
.logo-icon:hover { transform: scale(1.05) rotate(-2deg); }
.logo-icon svg { width: 28px; height: 28px; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; font-weight: 400; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-primary); }
.input-group input {
    width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    outline: none; font-family: inherit;
}
.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-surface);
}
.input-group input::placeholder { color: var(--text-muted); }

.btn-login {
    width: 100%; padding: 13px; border: none; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-top: 8px; position: relative; overflow: hidden;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}
.btn-login:active { transform: translateY(0); }

.login-footer { text-align: center; margin-top: 28px; }
.secure-badge {
    color: var(--text-muted); font-size: 12px;
    display: inline-flex; align-items: center; gap: 4px;
}

/* ============ MAIN LAYOUT ============ */
.main-app { display: none; height: 100vh; }
.main-app.active-screen { display: flex; }

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width); height: 100vh;
    background: var(--bg-sidebar);
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: width 0.3s var(--ease);
    position: relative; z-index: 10;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-title { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-icon { margin-right: 0; font-size: 20px; }

.sidebar-header {
    padding: 18px 20px; height: var(--topbar-height);
    display: flex; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo { display: flex; align-items: center; gap: 11px; }
.sidebar-logo span { font-size: 17px; font-weight: 800; color: white; letter-spacing: -0.3px; }
.sidebar-logo small {
    font-size: 10px; color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1); padding: 2px 7px;
    border-radius: 5px; font-weight: 600;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-title {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: rgba(255,255,255,0.3);
    padding: 18px 12px 8px; user-select: none;
}
.nav-item {
    display: flex; align-items: center; padding: 10px 14px;
    border-radius: var(--radius-sm); color: var(--text-sidebar);
    text-decoration: none; transition: all 0.2s var(--ease);
    margin-bottom: 2px; font-size: 13.5px; font-weight: 500;
    position: relative;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: rgba(255,255,255,0.95); }
.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { margin-right: 12px; font-size: 17px; opacity: 0.6; width: 22px; text-align: center; transition: opacity 0.2s; }
.nav-badge {
    margin-left: auto; font-size: 10px; padding: 2px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white; font-weight: 700;
}
.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 12px 12px; }

.sidebar-footer { padding: 14px 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-profile { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: white; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: white; }
.user-role { display: block; font-size: 11px; color: rgba(255,255,255,0.4); }
.btn-logout {
    background: none; border: none; color: rgba(255,255,255,0.3); cursor: pointer;
    font-size: 16px; padding: 7px; border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
}
.btn-logout:hover { color: var(--red); background: rgba(220,38,38,0.15); }

/* ============ CONTENT ============ */
.content {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; min-width: 0;
    transition: background 0.3s var(--ease);
}

/* ============ TOPBAR ============ */
.topbar {
    height: var(--topbar-height); padding: 0 28px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0; background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
    z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-left h2 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.breadcrumb { font-size: 12px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--primary); }
.btn-menu {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    font-size: 18px; cursor: pointer; padding: 6px 10px; line-height: 1;
    border-radius: var(--radius-sm); transition: all 0.2s var(--ease);
}
.btn-menu:hover { background: var(--bg-muted); color: var(--text-primary); border-color: var(--border-strong); }

.topbar-right { display: flex; align-items: center; gap: 6px; }
.global-search { position: relative; display: flex; align-items: center; }
.global-search .search-icon { position: absolute; left: 14px; font-size: 14px; color: var(--text-muted); }
.global-search input {
    padding: 9px 14px 9px 38px; border-radius: var(--radius);
    border: 1.5px solid var(--border); background: var(--bg-muted);
    color: var(--text-primary); font-size: 13px; width: 240px;
    transition: all 0.3s var(--ease); outline: none; font-family: inherit;
}
.global-search input:focus {
    border-color: var(--primary); background: var(--bg-surface);
    width: 320px; box-shadow: 0 0 0 3px var(--primary-light);
}
.global-search input::placeholder { color: var(--text-muted); }

.btn-topbar {
    background: none; border: 1px solid var(--border); cursor: pointer;
    padding: 8px 10px; border-radius: var(--radius-sm); transition: all 0.2s var(--ease);
    font-size: 15px; line-height: 1; position: relative; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-topbar:hover { background: var(--bg-muted); border-color: var(--border-strong); color: var(--text-primary); }
.btn-topbar.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.notif-dot {
    position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
    border-radius: 50%; background: var(--red);
    border: 1.5px solid var(--bg-surface);
    animation: pulse 2s infinite;
}
.btn-help-label { font-size: 12px; font-weight: 600; margin-left: 2px; }

/* ── Theme Toggle ── */
.theme-toggle {
    background: none; border: 1px solid var(--border); cursor: pointer;
    padding: 8px 10px; border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
    font-size: 15px; line-height: 1; color: var(--text-secondary);
    display: inline-flex; align-items: center;
}
.theme-toggle:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { transition: transform 0.3s var(--ease); }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

/* ============ PAGES ============ */
.page {
    display: none; padding: 28px;
    overflow-y: auto; flex: 1;
    min-height: 0;
    animation: fadeUp 0.35s var(--ease);
}
.page.active-page { display: block; }

/* ============ SECTION HEADERS ============ */
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.section-header h3 {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}

/* ============ KPI CARDS ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.kpi-card {
    background: var(--bg-surface); border-radius: var(--radius-lg); padding: 22px 20px;
    display: flex; justify-content: space-between; align-items: flex-start;
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: transparent;
}
.kpi-label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 0.4px; margin-bottom: 8px;
}
.kpi-value {
    display: block; font-size: 32px; font-weight: 800;
    letter-spacing: -1px; line-height: 1.1;
}
.kpi-change {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; margin-top: 10px; padding: 3px 10px;
    border-radius: 6px; font-weight: 600;
}
.kpi-change.up { color: var(--green); background: var(--green-bg); }
.kpi-change.warn { color: var(--orange); background: var(--orange-bg); }
.kpi-icon {
    font-size: 38px; opacity: 0.12;
    transition: transform 0.3s var(--ease), opacity 0.3s;
}
.kpi-card:hover .kpi-icon { transform: scale(1.15); opacity: 0.2; }

.kpi-blue::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.kpi-blue .kpi-value { color: var(--blue); }
.kpi-green::before { background: linear-gradient(90deg, #059669, #34d399); }
.kpi-green .kpi-value { color: var(--green); }
.kpi-orange::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.kpi-orange .kpi-value { color: var(--orange); }
.kpi-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.kpi-purple .kpi-value { color: var(--purple); }

/* ============ CHARTS ============ */
.charts-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 28px; }
.chart-card {
    background: var(--bg-surface); border-radius: var(--radius-lg); padding: 22px;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
    min-height: 340px;
}
.chart-card canvas {
    display: block;
    height: 260px !important;
    width: 100% !important;
    max-height: 260px;
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.chart-header h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.chart-filter {
    background: var(--bg-muted); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 5px 12px; border-radius: var(--radius-sm);
    font-size: 12px; outline: none; cursor: pointer; font-family: inherit;
    transition: border-color 0.2s;
}
.chart-filter:focus { border-color: var(--primary); }
.link-all { color: var(--primary); text-decoration: none; font-size: 12px; font-weight: 600; transition: color 0.15s; }
.link-all:hover { text-decoration: underline; }

/* ============ ALERT LIST ============ */
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1px solid transparent; transition: all 0.25s var(--ease);
    cursor: pointer;
}
.alert-item:hover { transform: translateX(4px); }
.alert-item.danger { background: var(--red-bg); border-color: var(--red-border); }
.alert-item.danger .alert-badge { animation: pulse 2.5s infinite; }
.alert-item.warning { background: var(--orange-bg); border-color: var(--orange-border); }
.alert-item.info { background: var(--blue-bg); border-color: var(--blue-border); }
.alert-info strong { display: block; font-size: 13px; color: var(--text-primary); font-weight: 600; }
.alert-info span { font-size: 11.5px; color: var(--text-secondary); }
.alert-badge {
    font-size: 11px; font-weight: 700; padding: 4px 12px;
    border-radius: 6px; white-space: nowrap;
}
.alert-badge.danger { background: var(--red); color: white; }
.alert-badge.warning { background: var(--orange); color: white; }
.alert-badge.info { background: var(--blue); color: white; }
[data-theme="dark"] .alert-badge.danger { background: rgba(248,113,113,0.2); color: var(--red); }
[data-theme="dark"] .alert-badge.warning { background: rgba(251,191,36,0.2); color: var(--orange); }
[data-theme="dark"] .alert-badge.info { background: rgba(138,180,248,0.2); color: var(--blue); }

/* ============ BUTTONS ============ */
.btn {
    padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px;
    font-weight: 600; cursor: pointer; border: 1.5px solid transparent;
    transition: all 0.2s var(--ease);
    display: inline-flex; align-items: center; gap: 6px;
    line-height: 1.4; font-family: inherit;
    position: relative; overflow: hidden;
}
.btn-primary {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(37,99,235,0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--bg-surface); color: var(--text-primary); border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.btn-outline {
    background: transparent; color: var(--text-secondary); border-color: var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 32px; font-size: 15px; border-radius: var(--radius); }

/* ============ PAGE ACTIONS ============ */
.page-actions {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
    padding: 14px 18px; background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.actions-left, .actions-right { display: flex; gap: 8px; align-items: center; }
.filter-group { display: flex; gap: 8px; }
.filter-select {
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--bg-surface);
    color: var(--text-primary); font-size: 13px; outline: none;
    cursor: pointer; font-family: inherit;
    transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--primary); }

/* ============ DATA TABLE ============ */
.data-table-wrapper {
    overflow-x: auto; border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-muted); }
.data-table th {
    padding: 12px 18px; text-align: left; font-size: 11px;
    font-weight: 700; color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 0.6px; white-space: nowrap;
    border-bottom: 2px solid var(--border);
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-muted);
}
.data-table td {
    padding: 12px 18px; border-bottom: 1px solid var(--border);
    font-size: 13.5px; white-space: nowrap; color: var(--text-primary);
}
.data-table tbody tr {
    transition: background 0.15s var(--ease);
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.tag {
    padding: 3px 10px; border-radius: 6px; font-size: 11px;
    font-weight: 700; border: 1px solid; display: inline-block;
}
.tag-green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.tag-blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.tag-orange { background: var(--orange-bg); color: var(--orange); border-color: var(--orange-border); }
.tag-red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.tag-purple { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-border); }

.text-danger { color: var(--red); }
.text-warning { color: var(--orange); }
.text-info { color: var(--blue); }

.btn-action {
    background: none; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
    padding: 5px 8px; border-radius: 6px; transition: all 0.2s var(--ease); margin: 0 1px;
    font-size: 13px;
}
.btn-action:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

.group-header td {
    background: var(--bg-muted) !important; padding: 10px 18px !important;
    border-bottom: 2px solid var(--border) !important; font-size: 13px;
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px; padding: 8px 4px;
}
.page-info { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.page-controls { display: flex; gap: 4px; }
.page-btn {
    padding: 7px 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-surface);
    color: var(--text-secondary); font-size: 13px; cursor: pointer;
    transition: all 0.2s var(--ease); font-weight: 500; font-family: inherit;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 2px 6px var(--primary-glow);
}

/* ============ IMPORT WIZARD ============ */
.import-wizard { max-width: 940px; margin: 0 auto; }
.wizard-steps {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 28px; background: var(--bg-surface); padding: 18px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.wizard-step {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 18px; border-radius: 24px;
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    transition: all 0.3s var(--ease);
}
.wizard-step.active { background: var(--primary-light); color: var(--primary); }
.wizard-step.done { color: var(--green); }
.step-num {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-muted); font-size: 13px; font-weight: 700;
    border: 2px solid var(--border);
    transition: all 0.3s var(--ease);
}
.wizard-step.active .step-num {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.wizard-step.done .step-num { background: var(--green); color: white; border-color: var(--green); }
.wizard-connector {
    width: 52px; height: 2px; background: var(--border);
    border-radius: 2px; transition: background 0.4s var(--ease);
}

.wizard-content { animation: fadeUp 0.35s var(--ease); }
.wizard-content.hidden { display: none; }

.upload-zone {
    border: 2px dashed var(--border-strong); border-radius: var(--radius-xl);
    padding: 60px 40px; text-align: center;
    transition: all 0.3s var(--ease); cursor: pointer;
    background: var(--bg-surface);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-lighter); }
.upload-icon { font-size: 52px; margin-bottom: 14px; }
.upload-zone h3 { font-size: 17px; margin-bottom: 6px; color: var(--text-primary); font-weight: 700; }
.upload-zone a { color: var(--primary); text-decoration: none; font-weight: 600; }
.upload-hint { color: var(--text-muted); font-size: 12px; margin-top: 10px; }
.upload-options {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px;
    background: var(--bg-surface); padding: 18px; border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.option-group label {
    display: block; font-size: 11px; font-weight: 700;
    margin-bottom: 7px; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.4px;
}

/* Mapping */
.mapping-info {
    display: flex; justify-content: space-between; padding: 13px 18px;
    background: var(--bg-muted); border-radius: var(--radius-sm);
    margin-bottom: 18px; border: 1px solid var(--border);
}
.mapping-file { font-weight: 700; color: var(--text-primary); }
.mapping-meta { color: var(--text-secondary); font-size: 13px; }
.mapping-grid { display: flex; flex-direction: column; gap: 5px; }
.mapping-header {
    display: grid; grid-template-columns: 1fr 40px 1fr 120px;
    padding: 8px 14px; font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.6px;
}
.mapping-row {
    display: grid; grid-template-columns: 1fr 40px 1fr 120px;
    padding: 11px 16px; border-radius: var(--radius-sm); align-items: center;
    background: var(--bg-surface); border: 1.5px solid var(--border);
    transition: border-color 0.2s;
}
.mapping-row.matched { border-left: 4px solid var(--green); }
.mapping-row.unmatched { border-left: 4px solid var(--orange); background: var(--orange-bg); }
.excel-col { font-size: 13px; font-weight: 600; }
.mapping-arrow { text-align: center; color: var(--text-muted); font-weight: bold; font-size: 16px; }
.mapping-select {
    padding: 7px 10px; border-radius: 6px; border: 1.5px solid var(--border);
    background: var(--bg-muted); color: var(--text-primary); font-size: 12px; width: 100%;
    font-family: inherit;
}
.mapping-status { font-size: 12px; text-align: right; font-weight: 600; }
.mapping-summary {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px; padding: 12px 16px; background: var(--green-bg);
    border: 1px solid var(--green-border); border-radius: var(--radius-sm);
}
.matched-count { color: var(--green); font-weight: 700; font-size: 13px; }
.save-template { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Preview */
.preview-bar {
    display: flex; justify-content: space-between; padding: 13px 18px;
    background: var(--blue-bg); border: 1px solid var(--blue-border);
    border-radius: var(--radius-sm); margin-bottom: 18px; align-items: center;
}
.conflict-summary { display: flex; gap: 18px; font-size: 13px; font-weight: 600; }
.preview-table .row-update { background: var(--orange-bg); }
.preview-table .row-error { background: var(--red-bg); }
.status-tag { padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 1px solid; }
.status-tag.new { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.status-tag.update { background: var(--orange-bg); color: var(--orange); border-color: var(--orange-border); }
.status-tag.error { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

.conflict-options {
    margin-top: 18px; background: var(--bg-surface); padding: 18px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.conflict-options h4 { font-size: 14px; margin-bottom: 12px; font-weight: 700; }
.radio-option {
    display: block; padding: 11px 16px; border-radius: var(--radius-sm);
    margin-bottom: 6px; cursor: pointer; transition: all 0.2s var(--ease);
    font-size: 13px; border: 1.5px solid var(--border); background: var(--bg-surface);
}
.radio-option.selected { background: var(--primary-light); border-color: var(--primary); }
.radio-option:hover { background: var(--bg-muted); }

/* Import Result */
.import-result {
    text-align: center; padding: 52px 0;
    background: var(--bg-surface); border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.result-icon { font-size: 68px; margin-bottom: 18px; }
.result-icon.success { animation: bounce 0.6s var(--ease); }
.import-result h2 { font-size: 26px; margin-bottom: 6px; color: var(--green); font-weight: 800; }
.result-stats { display: flex; justify-content: center; gap: 48px; margin: 32px 0; }
.result-stat { text-align: center; }
.stat-num { display: block; font-size: 38px; font-weight: 800; line-height: 1.1; }
.stat-num.green { color: var(--green); }
.stat-num.yellow { color: var(--orange); }
.stat-num.red { color: var(--red); }
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

/* ============ SEARCH ============ */
.search-hero { text-align: center; padding: 40px 0 28px; }
.search-hero h2 {
    font-size: 28px; margin-bottom: 8px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .search-hero h2 {
    background: linear-gradient(135deg, var(--primary), #c4b5fd);
    -webkit-background-clip: text; background-clip: text;
}
.search-hero p { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }
.search-bar-large { display: flex; max-width: 640px; margin: 0 auto; gap: 10px; }
.search-bar-large input {
    flex: 1; padding: 14px 20px; border-radius: var(--radius);
    border: 2px solid var(--border); background: var(--bg-surface);
    color: var(--text-primary); font-size: 15px; outline: none;
    transition: all 0.3s var(--ease); font-family: inherit;
}
.search-bar-large input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-md);
}
.search-bar-large .btn { padding: 14px 28px; font-size: 15px; border-radius: var(--radius); }

.search-stats-bar {
    padding: 13px 18px; background: var(--bg-muted); border-radius: var(--radius-sm);
    margin-bottom: 18px; font-size: 14px; border: 1px solid var(--border);
}
.search-stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-mini-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px; text-align: center;
    box-shadow: var(--shadow-xs);
    transition: all 0.25s var(--ease);
}
.stat-mini-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-mini-num { display: block; font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-mini-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }

.search-result-list { display: flex; flex-direction: column; gap: 8px; }
.search-result-item {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 18px; background: var(--bg-surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: all 0.25s var(--ease);
}
.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateX(4px);
}
.result-type {
    font-size: 22px; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-muted); border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.result-body { flex: 1; }
.result-body h4 { font-size: 14px; margin-bottom: 3px; font-weight: 600; }
.result-body p { font-size: 12px; color: var(--text-secondary); }
.result-body mark {
    background: rgba(250,204,21,0.3); color: var(--text-primary);
    padding: 1px 4px; border-radius: 3px; font-weight: 600;
}
[data-theme="dark"] .result-body mark {
    background: rgba(250,204,21,0.2);
}

/* ============ REPORT BUILDER ============ */
.report-builder {
    display: grid; grid-template-columns: 290px 1fr; gap: 18px;
    height: calc(100vh - var(--topbar-height) - 56px);
}
.builder-sidebar {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px;
    overflow-y: auto; box-shadow: var(--shadow-sm);
}
.builder-sidebar h3 {
    font-size: 15px; font-weight: 700; margin-bottom: 20px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.builder-section { margin-bottom: 22px; }
.builder-section > label {
    display: block; font-size: 10px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 8px;
}

.column-checklist { display: flex; flex-direction: column; gap: 2px; }
.column-checklist label {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 9px; border-radius: 6px; font-size: 13px; cursor: pointer;
    transition: background 0.15s var(--ease); font-weight: 500;
}
.column-checklist label:hover { background: var(--bg-muted); }

.filter-rules { display: flex; flex-direction: column; gap: 8px; }
.filter-rule { display: grid; grid-template-columns: 1fr 48px 1fr; gap: 4px; }
.filter-sm {
    padding: 7px 9px; border-radius: 6px; border: 1.5px solid var(--border);
    background: var(--bg-muted); color: var(--text-primary); font-size: 12px;
    outline: none; width: 100%; font-family: inherit;
    transition: border-color 0.2s;
}
.filter-sm:focus { border-color: var(--primary); }

.builder-actions {
    display: flex; flex-direction: column; gap: 8px; margin-top: 22px;
    padding-top: 18px; border-top: 1px solid var(--border);
}

.builder-preview { overflow-y: auto; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.preview-header h3 { font-size: 15px; font-weight: 700; }
.preview-count {
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    background: var(--bg-muted); padding: 5px 14px; border-radius: 6px;
}

.saved-templates { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.saved-templates h4 { font-size: 14px; margin-bottom: 14px; font-weight: 700; }
.template-list { display: flex; flex-direction: column; gap: 8px; }
.template-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; background: var(--bg-surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: all 0.25s var(--ease);
}
.template-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.template-name { flex: 1; font-weight: 600; font-size: 13px; }
.template-meta { font-size: 11px; color: var(--text-muted); }
.template-actions { display: flex; gap: 6px; }

/* ============ ADMIN ============ */
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.admin-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 30px 22px; text-align: center;
    cursor: pointer; transition: all 0.3s var(--ease);
    box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.admin-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: linear-gradient(90deg, var(--primary), #6366f1);
    opacity: 0; transition: opacity 0.3s var(--ease);
}
.admin-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}
.admin-card:hover::before { opacity: 1; }
.admin-icon {
    font-size: 38px; margin-bottom: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    transition: all 0.3s var(--ease);
}
.admin-card:hover .admin-icon {
    background: var(--primary-light);
    transform: scale(1.05);
}
.admin-card h3 { font-size: 14px; margin-bottom: 4px; font-weight: 700; }
.admin-card p { font-size: 12px; color: var(--text-secondary); }

/* ============ HELP PANEL ============ */
.help-overlay {
    display: none; position: fixed; inset: 0; z-index: 999;
}
.help-overlay.open { display: flex; justify-content: flex-end; }
.help-backdrop { position: absolute; inset: 0; background: var(--bg-overlay); }
.help-panel {
    position: relative; width: var(--help-width); height: 100vh;
    background: var(--bg-surface);
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
    animation: slideIn 0.3s var(--ease);
    z-index: 1;
}
@keyframes slideIn { from { transform: translateX(100%) } to { transform: translateX(0) } }

.help-header {
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.help-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.btn-close-help {
    background: none; border: 1px solid var(--border); cursor: pointer;
    font-size: 18px; padding: 5px 10px; border-radius: var(--radius-sm);
    color: var(--text-secondary); transition: all 0.2s var(--ease); line-height: 1;
}
.btn-close-help:hover { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }

.help-body { flex: 1; overflow-y: auto; padding: 22px; }
.help-section { margin-bottom: 24px; }
.help-section h4 {
    font-size: 14px; font-weight: 700; color: var(--primary);
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.help-section p, .help-section li { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.help-section ul { padding-left: 18px; margin-top: 4px; }
.help-section li { margin-bottom: 5px; }
.help-section .help-tip {
    background: var(--blue-bg); border: 1px solid var(--blue-border);
    border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 10px;
    font-size: 12.5px; color: var(--blue);
}
.help-section .help-shortcut {
    display: flex; justify-content: space-between; padding: 7px 0;
    font-size: 13px; border-bottom: 1px solid var(--border);
}
.help-section .help-shortcut:last-child { border-bottom: none; }
.help-section kbd {
    background: var(--bg-muted); border: 1px solid var(--border);
    padding: 2px 9px; border-radius: 5px; font-size: 11px; font-weight: 600;
    font-family: 'Inter', monospace;
}

.help-tab-bar {
    display: flex; border-bottom: 1px solid var(--border); padding: 0 22px;
    flex-shrink: 0; gap: 0;
}
.help-tab {
    padding: 11px 18px; font-size: 12px; font-weight: 600; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    color: var(--text-muted); transition: all 0.2s var(--ease);
    background: none; border-top: none; border-left: none; border-right: none;
    font-family: inherit;
}
.help-tab:hover { color: var(--text-primary); }
.help-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.help-content { display: none; }
.help-content.active { display: block; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: repeat(2, 1fr); }
    .search-stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; z-index: 100; transition: left 0.3s var(--ease); }
    .sidebar.mobile-open { left: 0; }
    .kpi-grid { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr 1fr; }
    .report-builder { grid-template-columns: 1fr; }
    .search-stat-cards { grid-template-columns: repeat(2, 1fr); }
    .global-search { display: none; }
    .page { padding: 18px; }
    .topbar { padding: 0 16px; }
    .login-card { padding: 36px 28px; }
}
