/* ═══════════════════════════════════════════════════════════════════════
   CAPPA Africa LMS - Design System & Modern Theme Variables (Light/Dark)
   ═══════════════════════════════════════════════════════════════════════ */

:root,
[data-theme="light"],
[data-bs-theme="light"] {
    --color-scheme: light;

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-surface-muted: #f1f5f9;
    --bg-surface-hover: #f8fafc;
    --bg-overlay: rgba(15, 23, 42, 0.4);

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --text-inverted: #ffffff;

    /* Borders */
    --border-color: #e2e8f0;
    --border-color-subtle: #f1f5f9;
    --border-color-focus: #F7941D;

    /* Brand Accent Colors */
    --brand-primary: #F7941D;
    --brand-hover: #ea580c;
    --brand-subtle: rgba(247, 148, 29, 0.08);
    --brand-glow: rgba(247, 148, 29, 0.25);
    --brand-text: #c2410c;

    /* Functional Accents */
    --accent-success: #10b981;
    --accent-success-subtle: #ecfdf5;
    --accent-success-border: #a7f3d0;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-danger-subtle: #fef2f2;
    --accent-info: #0284c7;

    /* Shadows */
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --card-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    --dropdown-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);

    /* Component Spec */
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-border: rgba(226, 232, 240, 0.8);
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
}

[data-theme="dark"],
[data-bs-theme="dark"],
html.dark {
    --color-scheme: dark;

    /* Backgrounds */
    --bg-body: #0b0f17;
    --bg-surface: #131b2e;
    --bg-surface-elevated: #1a243b;
    --bg-surface-muted: #1c263f;
    --bg-surface-hover: #22304d;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --text-inverted: #0f172a;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-subtle: rgba(255, 255, 255, 0.05);
    --border-color-focus: #fb923c;

    /* Brand Accent Colors */
    --brand-primary: #fb923c;
    --brand-hover: #f97316;
    --brand-subtle: rgba(247, 148, 29, 0.18);
    --brand-glow: rgba(251, 146, 60, 0.35);
    --brand-text: #fdba74;

    /* Functional Accents */
    --accent-success: #34d399;
    --accent-success-subtle: rgba(16, 185, 129, 0.15);
    --accent-success-border: rgba(16, 185, 129, 0.3);
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;
    --accent-danger-subtle: rgba(239, 68, 68, 0.15);
    --accent-info: #38bdf8;

    /* Shadows */
    --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 14px 34px -4px rgba(0, 0, 0, 0.65), 0 6px 14px -2px rgba(0, 0, 0, 0.45);
    --dropdown-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.75), 0 6px 16px -2px rgba(0, 0, 0, 0.5);

    /* Component Spec */
    --header-bg: rgba(15, 23, 42, 0.95);
    --header-border: rgba(255, 255, 255, 0.08);
    --sidebar-bg: #131b2e;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Legacy backend variable overrides */
    --darkColor: #f8fafc;
    --whiteColor: #131b2e;
    --grayColor: #cbd5e1;
}

/* ═══════════════════════════════════════════════════════════════════════
   Smooth Transitions & Global Base Resets
   ═══════════════════════════════════════════════════════════════════════ */
body {
    background-color: var(--bg-body) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Base Headings & Text */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Headings in cards, panels, and standard layout containers default to primary text */
.ol-card h1, .ol-card h2, .ol-card h3, .ol-card h4, .ol-card h5, .ol-card h6,
.dash-panel h1, .dash-panel h2, .dash-panel h3, .dash-panel h4, .dash-panel h5, .dash-panel h6,
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.ol-body-content h1, .ol-body-content h2, .ol-body-content h3, .ol-body-content h4, .ol-body-content h5, .ol-body-content h6 {
    color: var(--text-primary);
}

p, span, li, small {
    transition: color 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════
   Modern Header & Navigation
   ═══════════════════════════════════════════════════════════════════════ */
.header-area {
    background: var(--header-bg) !important;
    border-bottom: 1px solid var(--header-border) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.header-area.sticky-header {
    box-shadow: var(--card-shadow) !important;
}

.primary-menu li a {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.primary-menu li a:hover,
.primary-menu li a.active {
    color: var(--brand-primary) !important;
}

/* Header Dropdown Menus */
.mega-dropdown-menu,
.dropdown-menu {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--dropdown-shadow) !important;
    color: var(--text-primary) !important;
    border-radius: 14px !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-surface-muted) !important;
    color: var(--brand-primary) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Modern Theme Switcher Toggle Button
   ═══════════════════════════════════════════════════════════════════════ */
.theme-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    outline: none;
    user-select: none;
    transition: transform 0.2s ease;
    margin: 0 8px;
}

.theme-toggle-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--brand-primary);
    border-radius: 50px;
}

.theme-toggle-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 62px;
    height: 32px;
    background: var(--bg-surface-muted);
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    padding: 0 6px;
    box-sizing: border-box;
    transition: background 0.25s ease, border-color 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
    z-index: 2;
}

.theme-toggle-btn.is-dark .theme-toggle-thumb {
    transform: translateX(30px);
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.theme-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    z-index: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.theme-toggle-icon.icon-sun {
    color: #f59e0b;
}

.theme-toggle-icon.icon-moon {
    color: #94a3b8;
}

.theme-toggle-btn.is-dark .theme-toggle-icon.icon-moon {
    color: #38bdf8;
}

.theme-toggle-btn.is-dark .theme-toggle-icon.icon-sun {
    color: #64748b;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════════
   Modern Student Left Sidebar
   ═══════════════════════════════════════════════════════════════════════ */
.student-sidebar-card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    padding: 24px !important;
    box-shadow: var(--card-shadow) !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.student-profile-header {
    text-align: center;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 20px;
}

.student-avatar-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #ea580c 100%);
    box-shadow: 0 8px 24px var(--brand-glow);
}

.student-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-surface);
    border: 2.5px solid var(--bg-surface);
}

.student-avatar-upload {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border: 2px solid var(--bg-surface);
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.student-avatar-upload:hover {
    transform: scale(1.1);
    background: var(--brand-hover);
}

.student-profile-name {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin: 0 0 6px 0;
}

.student-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--brand-subtle);
    color: var(--brand-primary);
    border: 1px solid rgba(247, 148, 29, 0.25);
    margin-bottom: 6px;
}

.student-profile-email {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    margin: 0;
}

/* Sidebar Navigation Items */
.student-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.student-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    color: var(--text-secondary) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent;
}

.student-nav-link:hover {
    background: var(--bg-surface-muted) !important;
    color: var(--text-primary) !important;
    transform: translateX(3px);
}

.student-nav-link.active {
    background: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
    border-color: rgba(247, 148, 29, 0.2) !important;
    box-shadow: 0 2px 8px var(--brand-subtle);
}

.student-nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--bg-surface-muted);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.student-nav-link:hover .student-nav-icon {
    background: var(--bg-surface-hover);
    color: var(--brand-primary);
}

.student-nav-link.active .student-nav-icon {
    background: var(--brand-primary);
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Student Dashboard Cards & Controls
   ═══════════════════════════════════════════════════════════════════════ */
.student-dashboard-area {
    background-color: var(--bg-body) !important;
    transition: background-color 0.25s ease;
}

.student-header-bar {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 18px !important;
    box-shadow: var(--card-shadow) !important;
    padding: 22px 28px !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.student-page-title {
    color: var(--text-primary) !important;
    font-size: 22px !important;
    font-weight: 800 !important;
}

.student-category-select,
.form-control,
.form-select {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.student-category-select:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px var(--brand-subtle) !important;
    color: var(--text-primary) !important;
}

/* Course Cards in Grid */
.course-card,
.my-course-card,
.card {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: 18px !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

.course-card:hover,
.my-course-card:hover {
    box-shadow: var(--card-shadow-hover) !important;
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════════════
   Admin / Instructor Portal Dark Mode Support
   ═══════════════════════════════════════════════════════════════════════ */
.ol-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border) !important;
}

.ol-header {
    background-color: var(--header-bg) !important;
    border-bottom: 1px solid var(--header-border) !important;
    backdrop-filter: blur(12px) !important;
}

.ol-body-content {
    background-color: var(--bg-body) !important;
}

.ol-card {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: 16px !important;
}

.ol-sidebar .main-menu-ul li a {
    color: var(--text-secondary) !important;
}

.ol-sidebar .main-menu-ul li a:hover,
.ol-sidebar .main-menu-ul li a.active {
    background-color: var(--brand-subtle) !important;
    color: var(--brand-primary) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Backend Course Management & Curriculum (Dark Mode)
   Fixes unreadable black text and bright backgrounds in dark mode
   ═══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .header-title-menubar .page-title p,
html.dark .header-title-menubar .page-title p {
    color: #94a3b8 !important;
}

/* Course Edit Sidebar Tabs (Basic, Live Class, Assignment, Info, Media, SEO, Drip Content) */
[data-theme="dark"] .ol-sidebar-tab .nav-link,
html.dark .ol-sidebar-tab .nav-link {
    background: #1a243b !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .ol-sidebar-tab .nav-link span,
html.dark .ol-sidebar-tab .nav-link span,
[data-theme="dark"] .ol-sidebar-tab .nav-link span::before,
html.dark .ol-sidebar-tab .nav-link span::before {
    color: #94a3b8 !important;
}

[data-theme="dark"] .ol-sidebar-tab .nav-link:hover,
html.dark .ol-sidebar-tab .nav-link:hover,
[data-theme="dark"] .ol-sidebar-tab .nav-link.active,
html.dark .ol-sidebar-tab .nav-link.active {
    background: #F7941D !important;
    color: #ffffff !important;
    border-color: #F7941D !important;
}

[data-theme="dark"] .ol-sidebar-tab .nav-link:hover span,
html.dark .ol-sidebar-tab .nav-link:hover span,
[data-theme="dark"] .ol-sidebar-tab .nav-link:hover span::before,
html.dark .ol-sidebar-tab .nav-link:hover span::before,
[data-theme="dark"] .ol-sidebar-tab .nav-link.active span,
html.dark .ol-sidebar-tab .nav-link.active span,
[data-theme="dark"] .ol-sidebar-tab .nav-link.active span::before,
html.dark .ol-sidebar-tab .nav-link.active span::before {
    color: #ffffff !important;
}

/* Action Buttons (Add section, Add lesson, Add quiz, Sort Section) */
[data-theme="dark"] .ol-btn-light,
html.dark .ol-btn-light {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .ol-btn-light:hover,
html.dark .ol-btn-light:hover {
    background: #334155 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="dark"] .btn-outline-gray-small,
html.dark .btn-outline-gray-small {
    background: #1a243b !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .btn-outline-gray-small:hover,
html.dark .btn-outline-gray-small:hover {
    background: #F7941D !important;
    color: #ffffff !important;
    border-color: #F7941D !important;
}

/* Secondary Outlined Buttons (Frontend View, Course Player, Back, Help) */
[data-theme="dark"] .ol-btn-outline-secondary,
html.dark .ol-btn-outline-secondary {
    color: #f8fafc !important;
    border: 1px solid #F7941D !important;
    background: transparent !important;
}

[data-theme="dark"] .ol-btn-outline-secondary span,
[data-theme="dark"] .ol-btn-outline-secondary i,
html.dark .ol-btn-outline-secondary span,
html.dark .ol-btn-outline-secondary i {
    color: #f8fafc !important;
}

[data-theme="dark"] .ol-btn-outline-secondary:hover,
html.dark .ol-btn-outline-secondary:hover {
    background: #F7941D !important;
    color: #ffffff !important;
    border-color: #F7941D !important;
}

[data-theme="dark"] .ol-btn-outline-secondary:hover span,
[data-theme="dark"] .ol-btn-outline-secondary:hover i,
html.dark .ol-btn-outline-secondary:hover span,
html.dark .ol-btn-outline-secondary:hover i {
    color: #ffffff !important;
}

/* Editing Badge in Course Edit Header */
[data-theme="dark"] .edit-badge,
html.dark .edit-badge {
    background: rgba(247, 148, 29, 0.15) !important;
    border: 1px solid #F7941D !important;
    color: #F7941D !important;
}

/* Curriculum Accordion (Sections & Lessons) */
[data-theme="dark"] .single-accor-item,
html.dark .single-accor-item {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #131b2e !important;
    border-radius: 8px !important;
}

[data-theme="dark"] .accordion-btn-wrap,
html.dark .accordion-btn-wrap {
    background: #1a243b !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
}

[data-theme="dark"] .single-accor-item.active-accor .accordion-btn-wrap,
html.dark .single-accor-item.active-accor .accordion-btn-wrap {
    background: #202c46 !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .accordion-btn-title .title,
html.dark .accordion-btn-title .title {
    color: #f8fafc !important;
}

[data-theme="dark"] .accordion-button-buttons .edit,
[data-theme="dark"] .accordion-button-buttons .delete,
html.dark .accordion-button-buttons .edit,
html.dark .accordion-button-buttons .delete {
    background: #131b2e !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .accordion-button-buttons .edit span,
[data-theme="dark"] .accordion-button-buttons .delete span,
html.dark .accordion-button-buttons .edit span,
html.dark .accordion-button-buttons .delete span {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .accoritem-body,
html.dark .accoritem-body {
    background: #131b2e !important;
}

[data-theme="dark"] .list-group-3 li,
html.dark .list-group-3 li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Lesson titles in curriculum (Play 2, Play Video, Take Quiz) */
[data-theme="dark"] .list-group-3 li .title,
[data-theme="dark"] .list-group-3 li h4,
[data-theme="dark"] .list-group-3 li a,
[data-theme="dark"] .list-group-3 li,
html.dark .list-group-3 li .title,
html.dark .list-group-3 li h4,
html.dark .list-group-3 li a,
html.dark .list-group-3 li {
    color: #f1f5f9 !important;
    font-weight: 500 !important;
}

[data-theme="dark"] .list-group-3 li .buttons .edit-delete,
html.dark .list-group-3 li .buttons .edit-delete {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .list-group-3 li .buttons .edit-delete span::before,
html.dark .list-group-3 li .buttons .edit-delete span::before {
    color: #94a3b8 !important;
}

[data-theme="dark"] .list-group-3 li .buttons .edit-delete:hover span::before,
html.dark .list-group-3 li .buttons .edit-delete:hover span::before {
    color: #F7941D !important;
}

/* General Backend Headings & Form Text in Dark Mode */
[data-theme="dark"] .title,
[data-theme="dark"] .sub-title,
[data-theme="dark"] .ol-card-body h1,
[data-theme="dark"] .ol-card-body h2,
[data-theme="dark"] .ol-card-body h3,
[data-theme="dark"] .ol-card-body h4,
[data-theme="dark"] .ol-card-body h5,
[data-theme="dark"] .ol-card-body h6,
[data-theme="dark"] .ol-form-label,
html.dark .title,
html.dark .sub-title,
html.dark .ol-card-body h1,
html.dark .ol-card-body h2,
html.dark .ol-card-body h3,
html.dark .ol-card-body h4,
html.dark .ol-card-body h5,
html.dark .ol-card-body h6,
html.dark .ol-form-label {
    color: #f8fafc !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Dashboard Hero & Welcome Banners (Admin, Instructor, Student)
   Ensures text and pill indicators are 100% visible & contrasting in ALL modes
   ═══════════════════════════════════════════════════════════════════════ */
.dash-welcome-banner {
    position: relative;
    border-radius: 16px;
    padding: 24px 28px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Light Mode: Elegant Deep Navy Hero with High-Contrast Typography */
:root:not([data-theme="dark"]) .dash-welcome-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.1) !important;
}

/* Dark Mode: Stealth Dark Slate Hero */
[data-theme="dark"] .dash-welcome-banner {
    background: linear-gradient(135deg, #090d16 0%, #111827 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.45) !important;
}

/* Force Crisp White Titles in both Light & Dark modes */
.dash-welcome-banner,
.dash-welcome-banner h1,
.dash-welcome-banner h2,
.dash-welcome-banner h3,
.dash-welcome-banner h4,
.dash-welcome-banner .dash-welcome-title,
.dash-welcome-banner .welcome-title {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Subtitle */
.dash-welcome-banner p,
.dash-welcome-banner .dash-welcome-subtitle,
.dash-welcome-banner .welcome-subtitle {
    color: #cbd5e1 !important;
}

/* Live Sync Indicator Pill */
.dash-welcome-banner .dash-realtime-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 6px 14px !important;
    border-radius: 30px !important;
    background: rgba(16, 185, 129, 0.22) !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    color: #10b981 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    backdrop-filter: blur(8px) !important;
}

.dash-welcome-banner .dash-realtime-pill span {
    color: #10b981 !important;
}

/* Live Sync Timestamp text: Always crisp and bright in both Light & Dark modes */
.dash-welcome-banner .dash-realtime-pill #realtime-last-sync,
.dash-welcome-banner .dash-realtime-pill .realtime-sync-time,
.dash-welcome-banner .dash-realtime-pill .text-muted {
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    opacity: 0.95 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.dash-welcome-banner .dash-realtime-pill .live-sync-btn {
    color: #10b981 !important;
}

.dash-welcome-banner .dash-realtime-pill .live-sync-btn:hover {
    color: #ffffff !important;
}

/* Calendar Date Pill */
.dash-welcome-banner .dash-date-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    border-radius: 30px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #f8fafc !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    backdrop-filter: blur(8px) !important;
}

/* Quick Add Button */
.dash-welcome-banner .dash-quick-btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, #F7941D 0%, #ea580c 100%) !important;
    box-shadow: 0 4px 14px rgba(247, 148, 29, 0.4) !important;
}

/* Responsive banner padding on mobile screens */
@media (max-width: 767px) {
    .dash-welcome-banner {
        padding: 18px 18px !important;
    }
    .dash-welcome-banner .dash-welcome-title {
        font-size: 19px !important;
    }
    .dash-welcome-banner .dash-welcome-subtitle {
        font-size: 13px !important;
    }
    .dash-welcome-banner .dash-realtime-pill,
    .dash-welcome-banner .dash-date-pill {
        font-size: 12px !important;
        padding: 5px 12px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Dashboard Stat Cards & Panels (Admin & Instructor)
   ═══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .dash-stat-card {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .dash-stat-value {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dash-stat-label {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .dash-panel {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .dash-panel-header {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .dash-panel-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dash-panel-subtitle {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .status-legend-item {
    background: var(--bg-surface-muted) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .status-legend-item:hover {
    background: var(--bg-surface) !important;
    border-color: var(--brand-primary) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Student Dashboard & Profile Panels
   ═══════════════════════════════════════════════════════════════════════ */
.my-panel {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow) !important;
    transition: background-color 0.25s ease, border-color 0.25s ease !important;
}

.my-panel .g-title {
    color: var(--text-primary) !important;
}

.my-panel ul li {
    color: var(--text-secondary) !important;
}

.my-panel ul li svg path {
    fill: var(--text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Course Player Theming (Desktop & Mobile)
   ═══════════════════════════════════════════════════════════════════════ */
.playing-header-section {
    background: var(--header-bg) !important;
    border-bottom: 1px solid var(--header-border) !important;
    backdrop-filter: blur(12px) !important;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.course-playing-header {
    background: transparent !important;
    border: none !important;
}

.playing-video-title .title {
    color: var(--text-primary) !important;
}

.video-zoom-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 9px !important;
    background: var(--bg-surface-muted) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.video-zoom-btn svg {
    width: 22px !important;
    height: 22px !important;
    color: var(--text-primary) !important;
}

.video-zoom-btn svg path {
    stroke: var(--text-primary) !important;
}

.video-zoom-btn:hover {
    background: var(--bg-surface-hover) !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

.video-zoom-btn:hover svg {
    color: var(--brand-primary) !important;
}

.video-zoom-btn:hover svg path {
    stroke: var(--brand-primary) !important;
}

[data-theme="dark"] .course-video-navtab {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .player-nav-pills {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .player-nav-pills .nav-link {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .player-nav-pills .nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-surface-muted) !important;
}

[data-theme="dark"] .player-nav-pills .nav-link.active {
    color: var(--brand-primary) !important;
    background: var(--brand-subtle) !important;
}

[data-theme="dark"] .lesson-summary-text,
[data-theme="dark"] .lesson-summary-text p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .course-content-playlist {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .curriculum-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .curriculum-progress-text {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .curriculum-progress-track {
    background: var(--bg-surface-muted) !important;
}

[data-theme="dark"] .course-playlist-accordion .accordion-button {
    background: var(--bg-surface-muted) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .course-playlist-accordion .accordion-button:not(.collapsed) {
    background: var(--brand-subtle) !important;
    border-color: rgba(247, 148, 29, 0.3) !important;
    color: var(--brand-primary) !important;
}

[data-theme="dark"] .course-playlist-item.normal {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .course-playlist-item.normal .playlist-item-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .course-playlist-item.normal .playlist-item-duration {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .course-playlist-item.normal:hover {
    background: var(--bg-surface-muted) !important;
}


