/* ==========================================================================
   SchoolManager Unified Design System (Bootstrap 5.3 Standard)
   Palette: Sapphire Blue & Refined Slate
   Single Source of Truth for Tokens, Utilities & Reusable UI Components
   ========================================================================== */

:root {
    /* --- 1. CORE BRAND PALETTE --- */
    --sm-primary: #0f52ba;
    --sm-primary-rgb: 15, 82, 186;
    --sm-primary-dark: #0a2e6e;
    --sm-primary-light: #e0ecff;
    --sm-primary-subtle: #eff6ff;

    --sm-accent: #f59e0b;
    --sm-accent-hover: #d97706;
    --sm-accent-light: #fef3c7;

    --sm-success: #10b981;
    --sm-success-dark: #059669;
    --sm-success-subtle: #ecfdf5;

    --sm-warning: #f59e0b;
    --sm-warning-dark: #d97706;
    --sm-warning-subtle: #fffbeb;

    --sm-danger: #ef4444;
    --sm-danger-dark: #dc2626;
    --sm-danger-subtle: #fef2f2;

    --sm-info: #0ea5e9;
    --sm-info-dark: #0284c7;
    --sm-info-subtle: #f0f9ff;

    /* --- 2. NEUTRAL & SURFACE TOKENS --- */
    --sm-bg: #f8fafc;
    --sm-bg-body: #f8fafc;
    --sm-surface: #ffffff;
    --sm-bg-card: #ffffff;
    --sm-surface-muted: #f1f5f9;
    --sm-border: #e2e8f0;
    --sm-border-color: #e2e8f0;
    --sm-border-strong: #cbd5e1;

    --sm-text: #0f172a;
    --sm-text-main: #0f172a;
    --sm-text-secondary: #334155;
    --sm-muted: #64748b;
    --sm-text-muted: #64748b;

    --sm-hero-gradient: linear-gradient(135deg, #0a2e6e 0%, #0f52ba 55%, #2563eb 100%);

    /* --- 3. TYPOGRAPHY & GEOMETRY --- */
    --sm-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sm-font-heading: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, sans-serif;
    --sm-font-body: var(--sm-font-sans);
    --sm-font: var(--sm-font-sans);

    --sm-radius-xs: 0.375rem;
    --sm-radius-sm: 0.5rem;
    --sm-radius-md: 0.75rem;
    --sm-radius-lg: 1rem;
    --sm-radius-xl: 1.25rem;

    --sm-shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
    --sm-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.045);
    --sm-shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
    --sm-shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.16);
    --sm-shadow: var(--sm-shadow-sm);

    /* --- 4. BOOTSTRAP 5.3 ROOT OVERRIDES --- */
    --bs-primary: #0f52ba;
    --bs-primary-rgb: 15, 82, 186;
    --bs-font-sans-serif: var(--sm-font-sans);
    --bs-body-font-family: var(--sm-font-sans);
    --bs-body-bg: var(--sm-bg);
    --bs-body-color: var(--sm-text);
    --bs-border-color: var(--sm-border);

    /* --- 5. BACKWARD-COMPATIBLE ALIASES (FOR LEGACY VIEWS) --- */
    --school-primary: var(--sm-primary);
    --school-secondary: var(--sm-accent);
    --brand-primary: var(--sm-primary);
    --brand-secondary: var(--sm-muted);
    --brand-bg: var(--sm-bg);
    --student-primary: var(--sm-primary);
    --student-bg: var(--sm-bg);
    --app-primary: var(--sm-primary);
    --app-primary-light: var(--sm-primary-light);
    --app-bg-body: var(--sm-bg);
    --app-text-muted: var(--sm-muted);
    --ts-primary: var(--sm-primary);
    --ts-primary-dark: var(--sm-primary-dark);
    --ts-primary-light: var(--sm-primary-light);
    --ts-accent: var(--sm-accent);
    --ts-success: var(--sm-success);
    --ts-surface: var(--sm-surface);
    --ts-bg: var(--sm-bg);
    --ts-text: var(--sm-text);
    --ts-muted: var(--sm-muted);
    --kpi-primary: var(--sm-primary);
    --kpi-surface: var(--sm-surface);
    --kpi-bg: var(--sm-bg);
}

/* ==========================================================================
   GLOBAL TYPOGRAPHY & BUTTONS
   ========================================================================== */

body {
    font-family: var(--sm-font-sans);
    background-color: var(--sm-bg);
    color: var(--sm-text);
    -webkit-font-smoothing: antialiased;
}

/* Extra-small button utility (missing in Bootstrap 5, heavily used across views) */
.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.76rem;
    line-height: 1.3;
    border-radius: var(--sm-radius-xs);
}

@media (max-width: 575.98px) {
    .btn-xs {
        min-width: 36px;
        min-height: 36px;
        padding: 0.25rem 0.55rem;
        font-size: 0.8rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==========================================================================
   STANDARDIZED UI COMPONENTS (HERO, SUBNAV, KPI CARDS, ICON BOXES, FILTERS)
   ========================================================================== */

/* 1. Executive / Module Hero Banner */
.sm-hero-banner,
.hoso-hero-card,
.kpi-hero,
.bg-gradient-header {
    background: linear-gradient(135deg, #0a2e6e 0%, #0f52ba 55%, #2563eb 100%);
    border-radius: var(--sm-radius-lg);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(15, 82, 186, 0.25), 0 8px 10px -6px rgba(15, 82, 186, 0.18);
    position: relative;
    overflow: hidden;
}

.sm-hero-banner::after,
.hoso-hero-card::after,
.kpi-hero::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* 2. Sub-navigation Pill Bar */
.sm-subnav-pills,
.hoso-nav-pills {
    display: flex;
    gap: 0.5rem;
    background: var(--sm-surface);
    padding: 0.5rem;
    border-radius: 0.85rem;
    box-shadow: var(--sm-shadow-sm);
    border: 1px solid var(--sm-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sm-subnav-pills::-webkit-scrollbar,
.hoso-nav-pills::-webkit-scrollbar {
    display: none;
}

.sm-subnav-item,
.hoso-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    border-radius: 0.65rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--sm-text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
}

.sm-subnav-item:hover,
.hoso-nav-item:hover {
    color: var(--sm-primary);
    background-color: var(--sm-surface-muted);
    transform: translateY(-1px);
}

.sm-subnav-item.active,
.hoso-nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--sm-primary), #1d4ed8);
    box-shadow: 0 4px 12px rgba(15, 82, 186, 0.3);
}

.sm-subnav-item i,
.hoso-nav-item i {
    font-size: 1.1rem;
}

.sm-subnav-item .nav-badge,
.hoso-nav-item .nav-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}

/* 3. KPI Metric Cards & Icon Boxes */
.sm-kpi-card {
    background: var(--sm-surface);
    border-radius: 0.85rem;
    border: 1px solid var(--sm-border);
    box-shadow: var(--sm-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sm-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sm-shadow-md);
}

.sm-kpi-card.accent-left-primary {
    border-left: 4px solid var(--sm-primary) !important;
}

.sm-kpi-card.accent-left-success {
    border-left: 4px solid var(--sm-success) !important;
}

.sm-kpi-card.accent-left-warning {
    border-left: 4px solid var(--sm-warning) !important;
}

.sm-kpi-card.accent-left-danger {
    border-left: 4px solid var(--sm-danger) !important;
}

.sm-icon-box {
    width: 46px;
    height: 46px;
    border-radius: var(--sm-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

/* 4. Filter Bar & Workspace Panel Cards */
.sm-filter-bar,
.kpi-filter-bar {
    background: var(--sm-surface);
    border-radius: var(--sm-radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--sm-border);
    box-shadow: var(--sm-shadow-xs);
}

.sm-panel-card,
.hoso-panel-card {
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius-md);
    background: var(--sm-surface);
    padding: 1rem;
    margin-bottom: 0.875rem;
    box-shadow: var(--sm-shadow-xs);
}

.sm-panel-card-header,
.hoso-panel-card-header {
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sm-text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--sm-surface-muted);
}

/* 5. Interactive Quick-Filter Cards & Pills */
.stat-quick-card,
.kpi-filter-card {
    cursor: pointer;
    transition: all 0.15s ease;
}

.stat-quick-card:hover,
.kpi-filter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.stat-quick-card.active {
    outline: 2px solid var(--sm-primary);
    box-shadow: 0 2px 8px rgba(15, 82, 186, 0.18);
}

/* 6. Tree View & Interactive List Utilities */
.sm-hover-row,
.archive-tree-node,
.tree-row {
    transition: background-color 0.15s ease;
}

.sm-hover-row:hover,
.archive-tree-node:hover,
.tree-row:hover {
    background-color: var(--sm-bg);
}

.sm-hover-card-item,
.archive-doc-item {
    transition: all 0.15s ease;
}

.sm-hover-card-item:hover,
.archive-doc-item:hover {
    border-color: #93c5fd !important;
    background-color: var(--sm-info-subtle) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.transition-icon {
    transition: transform 0.2s ease;
}

/* 7. Rich Content Normalization (Tables & Images inside Article/Document Bodies) */
.sm-content-body img,
.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--sm-radius-xs);
}

.sm-content-body table,
.content-body table {
    width: 100% !important;
    margin-bottom: 1rem;
    color: var(--sm-text);
    border-collapse: collapse;
}

/* ==========================================================================
   SHARED GLOBAL WIDGETS (CHATBOT AI, JUDGE DEMO BAR, LMS QUICK NAV, SHARE MODAL)
   ========================================================================== */

/* --- 8. LMS Quick Navigation Bar (_LmsQuickNav.cshtml) --- */
.lms-nav {
    border-bottom: 1px solid var(--sm-border);
}

.lms-nav .nav-link {
    color: var(--sm-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.6rem 0.9rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    white-space: nowrap;
}

.lms-nav .nav-link:hover {
    color: var(--sm-primary);
}

.lms-nav .nav-link.active {
    color: var(--sm-primary);
    border-bottom-color: var(--sm-primary);
    background: transparent;
}

.lms-nav .nav-link i {
    margin-right: 0.35rem;
}

.lms-nav-scroll {
    overflow-x: auto;
    scrollbar-width: none;
}

.lms-nav-scroll::-webkit-scrollbar {
    display: none;
}

/* --- 9. Scoped Share Modal (_ShareModal.cshtml) --- */
#shareModal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#shareModal .modal-footer button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 16px;
    line-height: 1.5;
    height: 40px;
    box-sizing: border-box;
    border: 1px solid transparent;
}

/* --- 10. School AI Chatbot Widget (_ChatbotPartial.cshtml) --- */
.school-ai-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    height: 56px;
    padding: 0 20px 0 16px;
    background: linear-gradient(135deg, var(--sm-primary), var(--sm-primary-dark));
    color: #ffffff;
    border-radius: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(15, 82, 186, 0.35);
    cursor: pointer;
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

.school-ai-fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(15, 82, 186, 0.45);
    color: #ffffff;
}

.school-ai-fab .fab-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.school-ai-fab .fab-pulse {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #20c997;
    box-shadow: 0 0 0 0 rgba(32, 201, 151, 0.7);
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(32, 201, 151, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(32, 201, 151, 0); }
    100% { box-shadow: 0 0 0 0 rgba(32, 201, 151, 0); }
}

.school-ai-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--sm-surface);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
    z-index: 1055;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.school-ai-window.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.school-ai-header {
    background: linear-gradient(135deg, var(--sm-primary) 0%, var(--sm-primary-dark) 100%);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.school-ai-header .title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.school-ai-header .ai-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.school-ai-header .header-text h6 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.school-ai-header .header-text small {
    font-size: 0.75rem;
    opacity: 0.85;
}

.school-ai-header .header-actions {
    display: flex;
    gap: 6px;
}

.school-ai-header .header-actions button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.school-ai-header .header-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.school-ai-chips {
    padding: 10px 14px 8px;
    background: var(--sm-bg);
    border-bottom: 1px solid #eef2f6;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.school-ai-chips::-webkit-scrollbar {
    display: none;
}

.school-ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--sm-surface);
    border: 1px solid #dee2e6;
    border-radius: 14px;
    font-size: 0.78rem;
    color: var(--sm-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.school-ai-chip:hover {
    background: var(--sm-primary-subtle);
    border-color: var(--sm-primary);
    color: var(--sm-primary);
}

.school-ai-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.school-ai-msg {
    display: flex;
    gap: 8px;
    max-width: 86%;
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
}

.school-ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.school-ai-msg.bot {
    align-self: flex-start;
}

.school-ai-bubble {
    padding: 10px 14px;
    border-radius: 16px;
}

.school-ai-msg.user .school-ai-bubble {
    background: var(--sm-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.school-ai-msg.bot .school-ai-bubble {
    background: var(--sm-surface);
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
}

.school-ai-bubble p { margin-bottom: 0.5rem; }
.school-ai-bubble p:last-child { margin-bottom: 0; }
.school-ai-bubble ul, .school-ai-bubble ol { margin: 0 0 0.5rem 1rem; padding: 0; }

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 6px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--sm-muted);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.school-ai-footer {
    padding: 10px 14px;
    background: var(--sm-surface);
    border-top: 1px solid #eef2f6;
}

.school-ai-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.school-ai-input {
    flex: 1;
    border: 1px solid var(--sm-border-strong);
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.school-ai-input:focus {
    border-color: var(--sm-primary);
    box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.12);
}

.school-ai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sm-primary);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.school-ai-send-btn:hover {
    background: var(--sm-primary-dark);
}

@media (max-width: 576px) {
    .school-ai-fab {
        bottom: 16px;
        right: 16px;
        padding: 0 14px 0 12px;
        height: 48px;
        font-size: 0.88rem;
    }
    .school-ai-window {
        bottom: 72px;
        right: 16px;
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
    }
}

/* --- 11. Judge Demo Bar (_JudgeDemoBar.cshtml) --- */
.judge-mini-fab {
    position: fixed;
    bottom: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(11, 61, 145, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 212, 59, 0.85);
    color: #ffd43b;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    z-index: 1090;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
    opacity: 0.72;
}

.judge-mini-fab:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(11, 61, 145, 0.92);
}

.judge-compact-bar {
    position: fixed;
    bottom: 18px;
    left: 18px;
    z-index: 1090;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 40px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    color: #f8fafc;
    font-size: 0.8rem;
    transition: all 0.25s ease;
}

.judge-compact-bar:hover {
    background: rgba(15, 23, 42, 0.9);
}

.judge-role-pill {
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.judge-role-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.judge-role-pill.active-role {
    background: rgba(255, 212, 59, 0.92);
    color: #0f172a;
    border-color: #ffd43b;
    font-weight: 700;
}

.judge-ctrl-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.judge-ctrl-btn:hover {
    background: rgba(59, 130, 246, 0.65);
    border-color: #60a5fa;
}

.judge-glass-panel {
    position: fixed;
    bottom: 66px;
    left: 18px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
    z-index: 1091;
    display: none;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
}

.judge-glass-header {
    background: rgba(11, 61, 145, 0.65);
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.judge-glass-body {
    padding: 10px 12px;
    overflow-y: auto;
    font-size: 0.81rem;
}

.judge-glass-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 5px;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 500;
}

.judge-glass-link:hover {
    background: rgba(59, 130, 246, 0.38);
    border-color: rgba(147, 197, 253, 0.6);
    color: #ffffff;
    transform: translateX(2px);
}

.judge-glass-link.active-feature {
    background: rgba(37, 99, 235, 0.65);
    border-color: #ffd43b;
    color: #ffffff;
    font-weight: 700;
}

.judge-blocked-banner {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: 640px;
    width: calc(100vw - 32px);
    background: rgba(255, 243, 205, 0.95);
    backdrop-filter: blur(8px);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: #664d03;
    font-weight: 600;
    font-size: 0.88rem;
}

@media (max-width: 991.98px) {
    .judge-mini-fab,
    .judge-compact-bar {
        bottom: 70px;
        left: 10px;
    }
    .judge-glass-panel {
        bottom: 118px;
        left: 10px;
    }
}

/* ==========================================================================
   12. MULTI-THEME SYSTEM (SAPPHIRE, EMERALD, INDIGO, TEAL, DARK MODE)
   Activated via <html data-sm-theme="..."> & persisted in localStorage
   ========================================================================== */

/* Theme 1: Sapphire Blue (Default) */
html[data-sm-theme="sapphire"] {
    --sm-primary: #0f52ba;
    --sm-primary-rgb: 15, 82, 186;
    --sm-primary-dark: #0a2e6e;
    --sm-primary-light: #e0ecff;
    --sm-primary-subtle: #eff6ff;
    --sm-hero-gradient: linear-gradient(135deg, #0a2e6e 0%, #0f52ba 55%, #2563eb 100%);
    --bs-primary: #0f52ba;
    --bs-primary-rgb: 15, 82, 186;
}

/* Theme 2: Emerald Green (Fresh Academic Green) */
html[data-sm-theme="emerald"] {
    --sm-primary: #059669;
    --sm-primary-rgb: 5, 150, 105;
    --sm-primary-dark: #065f46;
    --sm-primary-light: #d1fae5;
    --sm-primary-subtle: #ecfdf5;
    --sm-hero-gradient: linear-gradient(135deg, #064e3b 0%, #059669 55%, #10b981 100%);
    --bs-primary: #059669;
    --bs-primary-rgb: 5, 150, 105;
}

/* Theme 3: Royal Indigo (Modern EdTech Violet-Blue) */
html[data-sm-theme="indigo"] {
    --sm-primary: #4f46e5;
    --sm-primary-rgb: 79, 70, 229;
    --sm-primary-dark: #3730a3;
    --sm-primary-light: #e0e7ff;
    --sm-primary-subtle: #eef2ff;
    --sm-hero-gradient: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #6366f1 100%);
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
}

/* Theme 4: Ocean Teal (Calm Professional Teal) */
html[data-sm-theme="teal"] {
    --sm-primary: #0d9488;
    --sm-primary-rgb: 13, 148, 136;
    --sm-primary-dark: #115e59;
    --sm-primary-light: #ccfbf1;
    --sm-primary-subtle: #f0fdfa;
    --sm-hero-gradient: linear-gradient(135deg, #134e4a 0%, #0d9488 55%, #14b8a6 100%);
    --bs-primary: #0d9488;
    --bs-primary-rgb: 13, 148, 136;
}

/* Theme 5: Dark Slate Mode (Combines with data-bs-theme="dark") */
html[data-sm-theme="dark"] {
    --sm-primary: #3b82f6;
    --sm-primary-rgb: 59, 130, 246;
    --sm-primary-dark: #1e3a8a;
    --sm-primary-light: rgba(59, 130, 246, 0.2);
    --sm-primary-subtle: rgba(59, 130, 246, 0.12);
    --sm-hero-gradient: linear-gradient(135deg, #090d16 0%, #1e293b 55%, #1e3a8a 100%);

    --sm-bg: #0f172a;
    --sm-bg-body: #0f172a;
    --sm-surface: #1e293b;
    --sm-bg-card: #1e293b;
    --sm-surface-muted: #334155;
    --sm-border: #334155;
    --sm-border-color: #334155;
    --sm-border-strong: #475569;

    --sm-text: #f8fafc;
    --sm-text-main: #f8fafc;
    --sm-text-secondary: #cbd5e1;
    --sm-muted: #94a3b8;
    --sm-text-muted: #94a3b8;

    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --bs-body-bg: #0f172a;
    --bs-body-color: #f8fafc;
    --bs-border-color: #334155;
}

html[data-sm-theme="dark"] #wrapper,
html[data-sm-theme="dark"] #content-wrapper,
html[data-sm-theme="dark"] #content {
    background-color: var(--sm-bg) !important;
    color: var(--sm-text) !important;
}

html[data-sm-theme="dark"] ul#accordionSidebar.sidebar-glass,
html[data-sm-theme="dark"] .navbar-nav.sidebar {
    background: linear-gradient(180deg, #090d16 0%, #111827 60%, #1e293b 100%) !important;
    border-right: 1px solid #334155 !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
}

html[data-sm-theme="dark"] ul#accordionSidebar.sidebar-glass .nav-item.active .nav-link,
html[data-sm-theme="dark"] ul#accordionSidebar.sidebar-glass .nav-item .nav-link.active {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

html[data-sm-theme="dark"] ul#accordionSidebar.sidebar-glass .nav-item.active .nav-link i,
html[data-sm-theme="dark"] ul#accordionSidebar.sidebar-glass .nav-item .nav-link.active i,
html[data-sm-theme="dark"] ul#accordionSidebar.sidebar-glass .nav-item .nav-link.active span {
    color: #60a5fa !important;
}

html[data-sm-theme="dark"] .card,
html[data-sm-theme="dark"] .modal-content,
html[data-sm-theme="dark"] .dropdown-menu,
html[data-sm-theme="dark"] .topbar-glass,
html[data-sm-theme="dark"] .public-navbar,
html[data-sm-theme="dark"] .branding-bar,
html[data-sm-theme="dark"] .sm-panel-card,
html[data-sm-theme="dark"] .sm-filter-bar,
html[data-sm-theme="dark"] .sm-kpi-card,
html[data-sm-theme="dark"] .exec-kpi-card,
html[data-sm-theme="dark"] .exec-panel,
html[data-sm-theme="dark"] .dashboard-card {
    background-color: var(--sm-surface) !important;
    color: var(--sm-text) !important;
    border-color: var(--sm-border) !important;
}

html[data-sm-theme="dark"] .exec-kpi-value,
html[data-sm-theme="dark"] .exec-panel-header {
    color: var(--sm-text) !important;
    border-color: var(--sm-border) !important;
}

html[data-sm-theme="dark"] .bg-white,
html[data-sm-theme="dark"] .bg-light,
html[data-sm-theme="dark"] .table-light {
    background-color: var(--sm-surface) !important;
    color: var(--sm-text) !important;
}

html[data-sm-theme="dark"] .text-dark,
html[data-sm-theme="dark"] .text-slate-900,
html[data-sm-theme="dark"] .text-slate-800 {
    color: var(--sm-text) !important;
}

/* Theme Switcher UI Widget */
.sm-theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.sm-theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.sm-theme-option.active {
    background-color: var(--sm-primary-subtle);
    color: var(--sm-primary);
    font-weight: 700;
}

.sm-theme-option .check-mark {
    opacity: 0;
    color: var(--sm-primary);
}

.sm-theme-option.active .check-mark {
    opacity: 1;
}
