/* ================================================================
   VIRALEARN — Global Stylesheet
   Vanilla CSS (No framework dependencies)
   ================================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ================================================================
   1. CSS VARIABLES / DESIGN TOKENS
   ================================================================ */
:root {
    --sidebar-width: 280px;
    --topbar-height: 72px;

    /* Brand Colors */
    --vl-primary: #6366f1;
    --vl-primary-hover: #4f46e5;
    --vl-accent: #8b5cf6;
    --vl-success: #10b981;
    --vl-warning: #f59e0b;
    --vl-danger: #ef4444;
    --vl-info: #06b6d4;

    /* Layout */
    --vl-bg: #f1f5f9;
    --vl-card-bg: #ffffff;
    --vl-sidebar-bg: #ffffff;
    --vl-topbar-bg: rgba(255, 255, 255, 0.75);
    --vl-border: #e2e8f0;
    --vl-border-hover: var(--vl-primary);
    --vl-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --vl-card-shadow-hover: 0 25px 40px rgba(0, 0, 0, 0.12);

    /* Typography */
    --vl-text: #0f172a;
    --vl-text-muted: #64748b;
    --vl-text-secondary: #94a3b8;
    --vl-tertiary-bg: #f1f5f9;
    --vl-secondary-bg: #e2e8f0;

    /* Radius & Transitions */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition: all 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --vl-bg: #0f172a;
    --vl-card-bg: #1e293b;
    --vl-sidebar-bg: #1e293b;
    --vl-topbar-bg: rgba(15, 23, 42, 0.75);
    --vl-border: #334155;
    --vl-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --vl-card-shadow-hover: 0 25px 40px rgba(0, 0, 0, 0.5);
    --vl-text: #f8fafc;
    --vl-text-muted: #94a3b8;
    --vl-text-secondary: #64748b;
    --vl-tertiary-bg: #1e293b;
    --vl-secondary-bg: #334155;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--vl-bg);
    color: var(--vl-text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--vl-text);
}

a {
    color: var(--vl-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

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

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

/* ================================================================
   3. UTILITY CLASSES
   ================================================================ */
.text-muted {
    color: var(--vl-text-muted) !important;
}

.text-primary {
    color: var(--vl-primary) !important;
}

.text-success {
    color: var(--vl-success) !important;
}

.text-warning {
    color: var(--vl-warning) !important;
}

.text-danger {
    color: var(--vl-danger) !important;
}

.text-info {
    color: var(--vl-info) !important;
}

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

.fw-bold {
    font-weight: 700 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.fs-1 {
    font-size: 2.5rem;
}

.fs-5 {
    font-size: 1.1rem;
}

.fs-6 {
    font-size: 0.95rem;
}

.small {
    font-size: 0.85rem;
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none !important;
}

.d-inline-flex {
    display: inline-flex;
}

.flex-column {
    flex-direction: column;
}

.flex-grow-1 {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-5 {
    gap: 20px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 32px;
}

.mt-auto {
    margin-top: auto;
}

.ms-auto {
    margin-left: auto;
}

.me-1 {
    margin-right: 4px;
}

.me-2 {
    margin-right: 8px;
}

.me-3 {
    margin-right: 12px;
}

.me-4 {
    margin-right: 16px;
}

.p-0 {
    padding: 0;
}

.p-3 {
    padding: 12px;
}

.p-4 {
    padding: 16px;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-fixed {
    position: fixed;
}

.overflow-hidden {
    overflow: hidden;
}

.rounded-circle {
    border-radius: 50%;
}

.rounded-pill {
    border-radius: 50rem;
}

.border-0 {
    border: none;
}

.border-top {
    border-top: 1px solid var(--vl-border);
}

.border-bottom {
    border-bottom: 1px solid var(--vl-border);
}

.opacity-75 {
    opacity: 0.75;
}

.opacity-50 {
    opacity: 0.5;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.cursor-pointer {
    cursor: pointer;
}

/* ================================================================
   4. LAYOUT: SIDEBAR + MAIN CONTENT
   ================================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1045;
    background-color: var(--vl-sidebar-bg);
    border-right: 1px solid var(--vl-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    overflow-y: auto;
}

/* --- SIDEBAR BRAND --- */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--vl-primary), var(--vl-accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--vl-text);
    letter-spacing: -0.03em;
}

.brand-name span {
    color: var(--vl-primary);
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: 1px solid var(--vl-border);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--vl-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    background-color: var(--vl-tertiary-bg);
}

/* --- SIDEBAR NAV --- */
.sidebar-nav {
    flex: 1;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--vl-text-secondary);
    padding: 8px 12px;
    margin-top: 16px;
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    color: var(--vl-text-muted);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--vl-tertiary-bg);
    color: var(--vl-text);
    transform: translateX(3px);
}

.nav-link.active {
    background-color: var(--vl-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.nav-link.active:hover {
    background-color: var(--vl-primary-hover);
    transform: translateX(3px);
}

/* --- SIDEBAR USER FOOTER --- */
.sidebar-footer {
    border-top: 1px solid var(--vl-border);
    padding-top: 16px;
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card:hover {
    background-color: var(--vl-tertiary-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--vl-primary);
    object-fit: cover;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--vl-text);
}

.user-email {
    font-size: 0.78rem;
    color: var(--vl-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 8px;
    right: 8px;
    background-color: var(--vl-card-bg);
    border: 1px solid var(--vl-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: var(--transition);
    z-index: 1050;
    overflow: hidden;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--vl-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--vl-tertiary-bg);
}

.dropdown-item.danger {
    color: var(--vl-danger);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--vl-border);
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin 0.3s ease;
    flex: 1;
}

/* ================================================================
   5. TOPBAR
   ================================================================ */
.topbar {
    height: var(--topbar-height);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: var(--vl-topbar-bg);
    border-bottom: 1px solid var(--vl-border);
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 32px;
    gap: 16px;
    transition: background-color 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Mobile sidebar toggle */
.sidebar-toggle-btn {
    display: none;
    background: none;
    border: 1px solid var(--vl-border);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--vl-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle-btn:hover {
    background-color: var(--vl-tertiary-bg);
}

/* --- SEARCH BOX --- */
.search-wrapper {
    position: relative;
    max-width: 320px;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vl-text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 50px;
    border: 1px solid var(--vl-border);
    background-color: var(--vl-tertiary-bg);
    color: var(--vl-text);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--vl-primary);
    background-color: var(--vl-card-bg);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-input::placeholder {
    color: var(--vl-text-secondary);
}

/* --- TOOLBAR BUTTONS --- */
.toolbar-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--vl-card-bg);
    color: var(--vl-text);
    border: 1px solid var(--vl-border);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    flex-shrink: 0;
    position: relative;
    text-decoration: none;
}

.toolbar-btn:hover {
    background-color: var(--vl-primary);
    color: white;
    border-color: var(--vl-primary);
    transform: scale(1.08);
}

.toolbar-btn .notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 9px;
    height: 9px;
    background-color: var(--vl-danger);
    border-radius: 50%;
    border: 2px solid var(--vl-card-bg);
}

/* ================================================================
   6. PAGE CONTENT
   ================================================================ */
.page-content {
    flex: 1;
    padding: 32px 40px;
}

/* Page sections (routed view containers) */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* ================================================================
   7. CARDS & COMPONENTS
   ================================================================ */

/* --- GENERIC CARD --- */
.card {
    background-color: var(--vl-card-bg);
    border: 1px solid var(--vl-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--vl-card-shadow);
    transition: var(--transition);
}

.card-body {
    padding: 24px;
}

/* --- STAT CARD --- */
.stat-card {
    background: var(--vl-card-bg);
    border: 1px solid var(--vl-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--vl-primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--vl-success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--vl-warning);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--vl-danger);
}

.stat-icon.info {
    background: rgba(6, 182, 212, 0.12);
    color: var(--vl-info);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--vl-text);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--vl-text-muted);
}

/* --- QUIZ CARD --- */
.quiz-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    background-color: var(--vl-card-bg);
    box-shadow: var(--vl-card-shadow);
    border: 1px solid var(--vl-border);
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    height: 100%;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--vl-primary), var(--vl-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 2;
}

.quiz-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--vl-card-shadow-hover);
    border-color: var(--vl-primary);
    color: inherit;
}

.quiz-card:hover::before {
    transform: scaleX(1);
}

.quiz-card-cover {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.quiz-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.quiz-card:hover .quiz-card-cover img {
    transform: scale(1.06);
}

.quiz-card-cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.quiz-badge-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.quiz-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.quiz-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--vl-text);
}

.quiz-card-desc {
    font-size: 0.85rem;
    color: var(--vl-text-muted);
    flex: 1;
    margin-bottom: 12px;
    line-height: 1.5;
}

.quiz-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--vl-border);
    padding-top: 12px;
}

.quiz-card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--vl-text-muted);
    font-weight: 500;
}

/* --- PROGRESS BAR (Quiz) --- */
.progress-quiz {
    height: 6px;
    border-radius: 10px;
    background-color: var(--vl-secondary-bg);
    overflow: hidden;
}

.progress-quiz-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--vl-primary), var(--vl-accent));
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* ================================================================
   8. BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-brand {
    background-color: var(--vl-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-brand:hover {
    background-color: var(--vl-primary-hover);
    color: #fff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-outline:hover {
    background-color: var(--vl-tertiary-bg);
}

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

.btn-outline-primary:hover {
    background-color: var(--vl-primary);
    color: white;
}

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

.btn-outline-success:hover {
    background-color: var(--vl-success);
    color: white;
}

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

.btn-outline-danger:hover {
    background-color: var(--vl-danger);
    color: white;
}

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

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

.btn-dark {
    background-color: #1e293b;
    color: white;
}

[data-theme="dark"] .btn-dark {
    background-color: #475569;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-pill {
    border-radius: 50rem;
}

.btn-full {
    width: 100%;
}

.btn-full:hover {
    transform: translateY(-2px);
}

/* ================================================================
   9. FORM ELEMENTS
   ================================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vl-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--vl-border);
    background-color: var(--vl-tertiary-bg);
    color: var(--vl-text);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--vl-primary);
    background-color: var(--vl-card-bg);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: var(--vl-text-secondary);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-icon {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background-color: var(--vl-tertiary-bg);
    border: 1px solid var(--vl-border);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--vl-text-muted);
    transition: var(--transition);
}

.input-group .form-control {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.form-text {
    font-size: 0.8rem;
    color: var(--vl-text-muted);
    margin-top: 6px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: var(--vl-primary);
    cursor: pointer;
}

/* Toggle Switch */
.switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--vl-border);
}

.switch-label h6 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.switch-label p {
    font-size: 0.82rem;
    color: var(--vl-text-muted);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: var(--vl-secondary-bg);
    border-radius: 50rem;
    transition: 0.3s;
    cursor: pointer;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--vl-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 36px;
}

/* ================================================================
   10. BADGES
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-pill {
    border-radius: 50rem;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--vl-primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--vl-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--vl-warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--vl-danger);
}

.badge-info {
    background: rgba(6, 182, 212, 0.12);
    color: var(--vl-info);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.12);
    color: var(--vl-text-muted);
}

.badge-solid-success {
    background: var(--vl-success);
    color: white;
}

.badge-solid-danger {
    background: var(--vl-danger);
    color: white;
}

/* ================================================================
   11. GRID SYSTEM
   ================================================================ */
.grid {
    display: grid;
    gap: 24px;
}

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

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

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

.grid-1-3 {
    grid-template-columns: 1fr 3fr;
}

.grid-3-1 {
    grid-template-columns: 3fr 1fr;
}

/* ================================================================
   12. NOTIFICATIONS STYLES
   ================================================================ */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--vl-border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: var(--vl-tertiary-bg);
    transform: translateX(4px);
}

.notification-item.unread {
    border-left: 4px solid var(--vl-primary);
    background-color: rgba(99, 102, 241, 0.03);
}

.notif-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notif-dot {
    width: 10px;
    height: 10px;
    background: var(--vl-primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 20px;
    border-radius: 50rem;
    border: 1px solid var(--vl-border);
    background: none;
    color: var(--vl-text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.filter-tab:hover {
    background-color: var(--vl-tertiary-bg);
}

.filter-tab.active {
    background-color: var(--vl-primary);
    color: white;
    border-color: var(--vl-primary);
}

/* ================================================================
   13. PILL TABS (My Quizzes, Settings)
   ================================================================ */
.pill-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.pill-tab {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: none;
    color: var(--vl-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pill-tab:hover {
    background-color: var(--vl-tertiary-bg);
}

.pill-tab.active {
    background-color: var(--vl-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ================================================================
   14. ANALYTICS CHART
   ================================================================ */
.chart-container {
    height: 250px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding-top: 20px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--vl-border);
    position: relative;
    margin-bottom: 16px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--vl-primary), var(--vl-accent));
    border-radius: 6px 6px 0 0;
    position: relative;
    min-height: 10px;
    opacity: 0.85;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chart-bar:hover {
    opacity: 1;
}

.chart-bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: var(--vl-text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.chart-tooltip {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    white-space: nowrap;
}

.chart-bar:hover .chart-tooltip {
    opacity: 1;
}

.mastery-progress {
    height: 10px;
    border-radius: 5px;
    background-color: var(--vl-secondary-bg);
    overflow: hidden;
    margin-top: 6px;
}

.mastery-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease;
}

/* ================================================================
   15. AUTH LAYOUT
   ================================================================ */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--vl-bg) 0%, var(--vl-secondary-bg) 100%);
    position: relative;
    overflow: hidden;
    padding: 40px 16px;
}

.auth-bg-shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    z-index: 0;
}

.auth-bg-shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.4);
    top: -100px;
    left: -100px;
}

.auth-bg-shape-2 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.3);
    bottom: -150px;
    right: -100px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background-color: var(--vl-card-bg);
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--vl-border);
    padding: 40px;
    transition: var(--transition);
}

.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--vl-text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--vl-border);
}

/* --- Auth Brand & Header --- */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-brand .brand-icon {
    width: 56px;
    height: 56px;
    font-size: 1.8rem;
}

.auth-brand .brand-name {
    font-size: 1.8rem;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--vl-text);
}

.auth-subtitle {
    color: var(--vl-text-muted);
    font-size: 1.05rem;
}

/* --- Input Fields with Icons --- */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 16px;
    color: var(--vl-text-muted);
    font-size: 1.15rem;
    pointer-events: none;
    transition: var(--transition);
    z-index: 2;
}

.input-icon-wrap .form-control {
    padding-left: 48px;
    padding-right: 48px;
    height: 54px;
}

.input-icon-wrap .form-control:focus+.input-icon {
    color: var(--vl-primary);
}

.input-icon-right {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--vl-text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition);
    z-index: 3;
}

/* Hide default browser reveal button (MS Edge/IE) */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}


.input-icon-right:hover {
    color: var(--vl-primary);
}

.form-label-link {
    float: right;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--vl-primary);
}

/* --- Auth Primary Button --- */
.btn-auth-primary {
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, var(--vl-primary), var(--vl-accent));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-auth-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.45);
    filter: brightness(1.1);
}

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

.btn-auth-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- Auth Footer --- */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.95rem;
    color: var(--vl-text-muted);
}

.auth-link {
    color: var(--vl-primary);
    font-weight: 700;
    margin-left: 4px;
    transition: var(--transition);
}

.auth-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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


/* ================================================================
   16. QUIZ TAKE STYLES
   ================================================================ */
.quiz-take-container {
    max-width: 900px;
    margin: 0 auto;
}

.option-card {
    border: 2px solid var(--vl-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--vl-card-bg);
    position: relative;
}

.option-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background-color: rgba(99, 102, 241, 0.04);
}

.option-card.selected {
    border-color: var(--vl-primary);
    background-color: rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.option-card.correct-answer {
    border-color: var(--vl-success);
    background-color: rgba(16, 185, 129, 0.08);
}

.option-card.wrong-answer {
    border-color: var(--vl-danger);
    background-color: rgba(239, 68, 68, 0.08);
}

.custom-radio {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--vl-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.custom-radio::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--vl-primary);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.option-card.selected .custom-radio {
    border-color: var(--vl-primary);
}

.option-card.selected .custom-radio::after {
    transform: scale(1);
}

.option-card.correct-answer .custom-radio {
    border-color: var(--vl-success);
}

.option-card.correct-answer .custom-radio::after {
    background-color: var(--vl-success);
    transform: scale(1);
}

.option-card.wrong-answer .custom-radio {
    border-color: var(--vl-danger);
}

.timer-display {
    font-family: 'Inter', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.1rem;
}

/* ================================================================
   17. QUIZ RESULT STYLES
   ================================================================ */
.score-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.score-ring {
    fill: none;
    stroke: var(--vl-secondary-bg);
    stroke-width: 12;
}

.score-progress-ring {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 66;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    animation: fillScoreRing 1.5s ease-out forwards;
}

@keyframes fillScoreRing {
    from {
        stroke-dashoffset: 440;
    }

    to {
        stroke-dashoffset: 66;
    }
}

.score-value-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 3.2rem;
    line-height: 1;
    background: linear-gradient(45deg, var(--vl-primary), var(--vl-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-text {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vl-text-muted);
}

/* XP Card */
.xp-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--radius-xl);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.xp-icon-box {
    width: 72px;
    height: 72px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-size: 2rem;
}

.xp-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--vl-primary);
    line-height: 1;
}

/* ================================================================
   18. QUIZ REVIEW
   ================================================================ */
.review-container {
    max-width: 900px;
    margin: 0 auto;
}

.q-number-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--vl-primary), var(--vl-accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.review-option {
    border: 2px solid var(--vl-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.review-option.correct {
    border-color: var(--vl-success);
    background-color: rgba(16, 185, 129, 0.05);
}

.review-option.incorrect {
    border-color: var(--vl-danger);
    background-color: rgba(239, 68, 68, 0.05);
}

.status-badge {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge.correct {
    background: rgba(16, 185, 129, 0.12);
    color: var(--vl-success);
}

.status-badge.incorrect {
    background: rgba(239, 68, 68, 0.12);
    color: var(--vl-danger);
}

.discussion-box {
    border-left: 4px solid var(--vl-primary);
    background-color: var(--vl-tertiary-bg);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 20px;
    margin-top: 16px;
}

/* ================================================================
   19. SETTINGS STYLES
   ================================================================ */
.settings-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
}

.settings-nav-card {
    background-color: var(--vl-card-bg);
    border: 1px solid var(--vl-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--vl-text);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid var(--vl-border);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.settings-nav-link:last-child {
    border-bottom: none;
}

.settings-nav-link:hover {
    background-color: var(--vl-tertiary-bg);
}

.settings-nav-link.active {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--vl-primary);
    border-left: 4px solid var(--vl-primary);
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--vl-card-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.78rem;
    cursor: pointer;
}

.avatar-wrapper:hover .avatar-upload-overlay {
    opacity: 1;
}

/* ================================================================
   20. QUIZ DETAIL (Hero Banner)
   ================================================================ */
.detail-hero {
    background: linear-gradient(135deg, var(--vl-primary), var(--vl-accent));
    border-radius: var(--radius-2xl);
    padding: 56px 40px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
    margin-bottom: 40px;
}

.detail-hero::after {
    content: '';
    position: absolute;
    right: -8%;
    top: -15%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.detail-hero>* {
    position: relative;
    z-index: 1;
}

.hero-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ================================================================
   21. SEARCH PAGE HERO
   ================================================================ */
.search-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border-radius: var(--radius-2xl);
    padding: 56px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.search-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--vl-primary) 0%, transparent 70%);
    opacity: 0.08;
    border-radius: 50%;
}

.search-input-hero {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: var(--vl-card-bg);
    border-radius: 50rem;
    border: 1px solid var(--vl-border);
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.search-input-hero:focus-within {
    border-color: var(--vl-primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.search-input-hero input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: 8px 12px;
    outline: none;
    color: var(--vl-text);
}

.search-input-hero input::placeholder {
    color: var(--vl-text-secondary);
}

.filter-pill {
    padding: 8px 18px;
    border-radius: 50rem;
    border: 1px solid var(--vl-border);
    background: var(--vl-card-bg);
    color: var(--vl-text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.filter-pill:hover,
.filter-pill.active {
    background-color: var(--vl-primary);
    color: white;
    border-color: var(--vl-primary);
}

/* ================================================================
   22. NOTIFICATION DETAIL
   ================================================================ */
.highlight-box {
    background-color: var(--vl-tertiary-bg);
    border-left: 4px solid var(--vl-primary);
    padding: 20px 24px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin: 20px 0;
}

/* ================================================================
   23. BOTTOM STICKY BAR (Review Page)
   ================================================================ */
.sticky-bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--vl-border);
    padding: 14px 24px;
}

[data-theme="dark"] .sticky-bottom-bar {
    background: rgba(15, 23, 42, 0.92);
}

/* ================================================================
   24. MOBILE OVERLAY (Sidebar)
   ================================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1044;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ================================================================
   25. KPI / ANALYTICS CARDS
   ================================================================ */
.kpi-card {
    background: var(--vl-card-bg);
    border: 1px solid var(--vl-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* ================================================================
   26. RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-nav-card {
        display: flex;
        overflow-x: auto;
        flex-direction: row;
    }

    .settings-nav-link {
        border-bottom: none;
        border-right: 1px solid var(--vl-border);
        white-space: nowrap;
        flex-shrink: 0;
    }

    .settings-nav-link.active {
        border-left: none;
        border-bottom: 3px solid var(--vl-primary);
    }
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle-btn {
        display: flex;
    }

    .page-content {
        padding: 20px 16px;
    }

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

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

@media (max-width: 640px) {

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

    .grid-3-1,
    .grid-1-3 {
        grid-template-columns: 1fr;
    }

    .detail-hero {
        padding: 32px 20px;
    }

    .auth-card {
        padding: 28px 24px;
    }

    .topbar {
        padding: 0 16px;
    }

    .search-wrapper {
        display: none;
    }
}

/* ================================================================
   27. ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

    100% {
        background-position: -200% 0;
    }
}

/* ================================================================
   28. SCROLLBAR
   ================================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--vl-secondary-bg);
    border-radius: 10px;
}

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