/* ============================================================
   Wonderful Writers LMS — Brand Override v2.0
   Aligns LMS colors, fonts, and logo with the main website
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── LIGHT MODE — WW Brand ─────────────────────────────────── */
:root {
    --primary:          #FF7E2D;
    --primary-dark:     #e56520;
    --primary-light:    #fff3ec;
    --primary-glow:     rgba(255,126,45,0.20);
    --accent:           #FFD166;
    --accent-coral:     #EE5C5C;
    --accent-green:     #06D6A0;
    --success:          #06D6A0;
    --danger:           #EE5C5C;
    --warning:          #FFD166;
    --info:             #3b82f6;
    --purple:           #7c3aed;

    /* Backgrounds */
    --bg:               #F7F8FC;
    --bg-alt:           #ffffff;
    --bg-card:          #ffffff;
    --bg-card2:         #fef9f5;
    --surface:          #FFF3EC;

    /* Text */
    --text:             #1a1200;
    --text-muted:       #6b7280;
    --text-light:       #9ca3af;

    /* Borders & Shadows */
    --border:           #e5e7eb;
    --border-light:     rgba(255,126,45,0.10);
    --shadow-sm:        0 1px 3px rgba(255,126,45,0.06);
    --shadow:           0 4px 16px rgba(255,126,45,0.10);
    --shadow-lg:        0 10px 40px rgba(255,126,45,0.15);
    --shadow-xl:        0 20px 60px rgba(255,126,45,0.18);
    --shadow-card:      0 4px 24px rgba(255,126,45,0.08);

    /* Sidebar */
    --bg-sidebar:       linear-gradient(180deg, #1a0f00 0%, #2d1500 100%);
    --sidebar-accent:   rgba(255,126,45,0.15);
    --sidebar-text:     rgba(255,255,255,0.85);
    --sidebar-active-bg:rgba(255,126,45,0.20);

    /* Glass */
    --glass-bg:         rgba(255,255,255,0.80);
    --glass-border:     rgba(255,126,45,0.15);
    --glass-blur:       14px;

    /* Shape */
    --radius:           12px;
    --radius-lg:        16px;
    --radius-xl:        20px;
    --radius-pill:      50px;
    --sidebar-width:    260px;
    --topbar-height:    64px;
    --transition:       0.22s cubic-bezier(0.4,0,0.2,1);
    --transition-slow:  0.40s cubic-bezier(0.4,0,0.2,1);
}

/* ── DARK MODE — WW Brand ──────────────────────────────────── */
[data-theme="dark"] {
    --primary:          #FF7E2D;
    --primary-dark:     #e56520;
    --primary-light:    rgba(255,126,45,0.15);
    --primary-glow:     rgba(255,126,45,0.25);
    --accent:           #FFD166;

    --bg:               #1a0f00;
    --bg-alt:           #221500;
    --bg-card:          #2a1a00;
    --bg-card2:         #221200;
    --surface:          #3a2200;

    --text:             #f3f4f6;
    --text-muted:       #9ca3af;
    --text-light:       #6b7280;

    --border:           #4a2e0a;
    --border-light:     rgba(255,126,45,0.12);
    --shadow:           0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:        0 10px 40px rgba(0,0,0,0.6);

    --bg-sidebar:       linear-gradient(180deg, #0f0700 0%, #1a0c00 100%);
    --sidebar-accent:   rgba(255,126,45,0.20);

    --glass-bg:         rgba(42,26,0,0.85);
    --glass-border:     rgba(255,126,45,0.15);
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
body {
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif !important;
}
h1,h2,h3,h4,h5,h6,
.font-display,
.sidebar-brand .brand-text strong,
.page-title,
.card-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
}

/* ── SIDEBAR BRAND — WW Logo (img tag in header.php) ────────── */
.sidebar-brand {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
}
.brand-logo {
    display: none !important; /* hide any icon fallback */
}
/* Remove ::before pseudo-element — header.php uses <img> directly */
.sidebar-brand::before {
    display: none !important;
}
.brand-text strong  { color: #fff; font-size: 1rem; }
.brand-text span    { color: rgba(255,255,255,0.5); font-size: 0.72rem; }

/* ── SIDEBAR NAV ─────────────────────────────────────────────── */
.sidebar {
    background: var(--bg-sidebar) !important;
}
.nav-link {
    color: var(--sidebar-text) !important;
    border-radius: var(--radius) !important;
    margin: 1px 6px !important;
    padding: 10px 14px !important;
    transition: background var(--transition), color var(--transition) !important;
}
.nav-link:hover,
.nav-link.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--accent) !important;
}
.nav-link.active {
    border-left: 3px solid var(--primary) !important;
}
.nav-section-title {
    color: rgba(255,255,255,0.35) !important;
    font-size: 0.68rem !important;
    letter-spacing: 1px !important;
    padding: 14px 20px 4px !important;
}

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
}
.topbar-btn {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-radius: var(--radius) !important;
}
.topbar-btn:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn-primary, .btn-brand {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 14px rgba(255,126,45,0.30) !important;
}
.btn-primary:hover, .btn-brand:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(255,126,45,0.40) !important;
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

/* ── CARDS ───────────────────────────────────────────────────── */
.card, .stat-card, .glass-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow) !important;
    transition: transform var(--transition), box-shadow var(--transition) !important;
}
.card:hover { transform: translateY(-2px) !important; box-shadow: var(--shadow-lg) !important; }

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-card .stat-icon {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* ── PROGRESS BARS ───────────────────────────────────────────── */
.progress-bar, .progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge-primary, .badge-success { background: var(--primary) !important; }
.badge-warning                 { background: var(--accent); color:#1a1200 !important; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(255,126,45,0.12) !important;
}

/* ── TABLE HEADERS ───────────────────────────────────────────── */
thead th {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* ── NOTIFICATIONS BADGE ─────────────────────────────────────── */
.notif-badge {
    background: var(--primary) !important;
}

/* ── AUTH PAGES ─────────────────────────────────────────────── */
.auth-page {
    background: linear-gradient(135deg, #1a0f00 0%, #3d1c00 50%, rgba(255,126,45,0.12) 100%) !important;
}
.auth-card {
    background: #ffffff !important;
    border: 1px solid rgba(255,126,45,0.18) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 4px 16px rgba(255,126,45,0.12) !important;
}

/* ── LIGHT MODE — auth card text/inputs must be dark (readable on white card) */
.auth-brand h1 {
    color: #1a1200 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
}
.auth-brand p {
    color: #6b7280 !important;
}
.auth-card .form-label {
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}
.auth-card .form-control {
    background: #f9fafb !important;
    border: 1.5px solid #e5e7eb !important;
    color: #1a1200 !important;
    border-radius: 10px !important;
}
.auth-card .form-control::placeholder {
    color: #9ca3af !important;
}
.auth-card .form-control:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(255,126,45,0.12) !important;
    color: #1a1200 !important;
}
.auth-card .form-control option {
    background: #ffffff !important;
    color: #1a1200 !important;
}
.auth-divider {
    color: #9ca3af !important;
}
.auth-divider::before,
.auth-divider::after {
    background: #e5e7eb !important;
}
.auth-card p {
    color: #6b7280 !important;
}
.auth-card p a {
    color: var(--primary) !important;
    font-weight: 600 !important;
}
.auth-card .alert-danger {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}
.auth-card .alert-success {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

/* ── AUTH BRAND ICON — WW orange gradient ── */
.auth-brand .brand-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(255,126,45,0.35) !important;
    color: #fff !important;
}

/* ── AUTH BRAND LOGO IMAGE (when used instead of icon) ── */
.auth-brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 16px;
}

/* ── DEMO CREDENTIALS BOX — light mode orange theme ── */
.auth-demo-box,
.login-demo-box {
    margin-top: 20px;
    padding: 16px 18px;
    background: #fff8f3 !important;
    border: 1px solid rgba(255,126,45,0.30) !important;
    border-radius: 12px;
    font-size: 12px;
    color: #92400e !important;
}
.auth-demo-box strong,
.login-demo-box strong {
    color: var(--primary) !important;
    display: block;
    margin-bottom: 8px;
    font-size: 13px !important;
}
.auth-demo-box code,
.login-demo-box code {
    background: #1a0f00 !important;
    color: #FFD166 !important;
    padding: 2px 8px !important;
    border-radius: 5px !important;
    font-size: 0.9rem !important;
}

/* ── DARK MODE — auth card overrides ── */
[data-theme="dark"] .auth-card {
    background: #2a1a00 !important;
    border-color: rgba(255,126,45,0.20) !important;
}
[data-theme="dark"] .auth-brand h1   { color: #f3f4f6 !important; }
[data-theme="dark"] .auth-brand p    { color: rgba(255,255,255,0.60) !important; }
[data-theme="dark"] .auth-card .form-label   { color: rgba(255,255,255,0.80) !important; }
[data-theme="dark"] .auth-card .form-control {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.18) !important;
    color: #f3f4f6 !important;
}
[data-theme="dark"] .auth-card .form-control::placeholder { color: rgba(255,255,255,0.35) !important; }
[data-theme="dark"] .auth-card .form-control:focus {
    background: rgba(255,255,255,0.12) !important;
    border-color: var(--primary) !important;
    color: #f3f4f6 !important;
}
[data-theme="dark"] .auth-divider             { color: rgba(255,255,255,0.35) !important; }
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after       { background: rgba(255,255,255,0.12) !important; }
[data-theme="dark"] .auth-card p              { color: rgba(255,255,255,0.60) !important; }
[data-theme="dark"] .auth-card p a            { color: #FFD166 !important; }
[data-theme="dark"] .auth-demo-box,
[data-theme="dark"] .login-demo-box {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(255,126,45,0.20) !important;
    color: rgba(255,255,255,0.60) !important;
}
[data-theme="dark"] .auth-demo-box strong,
[data-theme="dark"] .login-demo-box strong   { color: rgba(255,255,255,0.85) !important; }

/* ── LINKS ───────────────────────────────────────────────────── */
a { color: var(--primary) !important; }
a:hover { color: var(--primary-dark) !important; }
.sidebar a, .sidebar a:hover { color: inherit !important; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar-thumb { background: rgba(255,126,45,0.25) !important; }
::-webkit-scrollbar-thumb:hover { background: var(--primary) !important; }

/* ── THEME TOGGLE INSTANT ────────────────────────────────────── */
html { transition: background-color 0.01s, color 0.01s !important; }

/* ================================================================
   LIGHT MODE — SIDEBAR & PANEL CONTRAST FIXES
   The sidebar uses a dark gradient background in both modes.
   Ensure all text inside is always white/readable regardless of
   the global `a { color: var(--primary) }` override.
   ================================================================ */

/* Sidebar nav links — always white on dark sidebar background */
.sidebar .nav-link,
.sidebar .sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
}
.sidebar .nav-link:hover,
.sidebar .sidebar-nav .nav-link:hover {
    color: #FFD166 !important;
    background: rgba(255, 126, 45, 0.18) !important;
}
.sidebar .nav-link.active,
.sidebar .sidebar-nav .nav-link.active {
    color: #FFD166 !important;
    background: rgba(255, 126, 45, 0.22) !important;
    border-left-color: #FF7E2D !important;
}

/* Section titles inside sidebar */
.sidebar .nav-section-title {
    color: rgba(255, 255, 255, 0.38) !important;
}

/* Brand text inside sidebar — always white */
.sidebar .brand-text strong,
.sidebar .sidebar-brand .brand-text strong {
    color: #ffffff !important;
}
.sidebar .brand-text span,
.sidebar .sidebar-brand .brand-text span {
    color: rgba(255, 255, 255, 0.52) !important;
}

/* Sidebar user info — always white */
.sidebar .sidebar-user .user-info strong {
    color: #ffffff !important;
}
.sidebar .sidebar-user .user-info span {
    color: rgba(255, 255, 255, 0.52) !important;
}

/* Icon colors inside sidebar nav links */
.sidebar .nav-link i {
    color: inherit !important;
}

/* Badge count inside nav links */
.sidebar .nav-link .badge-count {
    background: #FF7E2D !important;
    color: #fff !important;
}

/* Logout button inside sidebar */
.sidebar .logout-btn {
    color: rgba(255, 255, 255, 0.60) !important;
}
.sidebar .logout-btn:hover {
    color: #fff !important;
    background: rgba(220, 38, 38, 0.35) !important;
}

/* ── TOPBAR BUTTON — Improve contrast in light mode ── */
:root .topbar-btn {
    background: #fff3ec !important;
    color: #c85000 !important;
    border: 1.5px solid rgba(255, 126, 45, 0.28) !important;
}
:root .topbar-btn:hover {
    background: #FF7E2D !important;
    color: #ffffff !important;
    border-color: #FF7E2D !important;
}

/* ── CARD BODY TEXT — ensure readability in light mode ── */
:root .card-header,
:root .card-body {
    color: var(--text) !important;
}

/* ── TABLE HEADER — readable in light mode ── */
:root thead th {
    background: #fef0e6 !important;
    color: #c85000 !important;
}

/* ── PAGE HEADER text — always dark in light mode ── */
:root .page-header h2,
:root .page-header p {
    color: var(--text) !important;
}

/* ── STAT CARD — ensure label & value readable in light mode ── */
:root .stat-label {
    color: var(--text-muted) !important;
}
:root .stat-value {
    color: var(--text) !important;
}

/* ── ANNOUNCEMENT / PANEL CONTENT — fix muted text visibility ── */
:root .text-muted,
:root [style*="color:#6b7280"],
:root [style*="color: #6b7280"] {
    color: #555f6d !important;
}

/* Dark mode topbar button overrides */
[data-theme="dark"] .topbar-btn {
    background: rgba(255, 126, 45, 0.15) !important;
    color: #FF7E2D !important;
    border: 1.5px solid rgba(255, 126, 45, 0.25) !important;
}
[data-theme="dark"] .topbar-btn:hover {
    background: #FF7E2D !important;
    color: #fff !important;
}

/* ================================================================
   SP-HERO & SP-KPI DASHBOARD COMPONENTS
   Required by student/dashboard.php and admin/dashboard.php
   ================================================================ */

/* ── Color Token Variables ────────────────────────────────── */
:root {
    --sp-orange:  #FF7E2D;
    --sp-blue:    #4F8EF7;
    --sp-green:   #10b981;
    --sp-purple:  #7c3aed;
    --sp-teal:    #0ea5e9;
}

/* ── HERO BANNER ─────────────────────────────────────────── */
.sp-hero {
    background: linear-gradient(135deg, #1a0f00 0%, #3d1c00 60%, rgba(255,126,45,0.12) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(255,126,45,0.18);
    border: 1px solid rgba(255,126,45,0.15);
    position: relative;
    overflow: hidden;
}
.sp-hero::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,126,45,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.sp-hero-text h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff !important;
    margin-bottom: 6px;
}
.sp-hero-text p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.65) !important;
    margin: 0;
}
.sp-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(255,255,255,0.12);
    color: #ffffff !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.22);
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
}
.sp-hero-action:hover {
    background: rgba(255,126,45,0.35) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* ── KPI CARDS ───────────────────────────────────────────── */
.sp-kpi {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.sp-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.sp-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.sp-kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.sp-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.sp-kpi-icon.blue   { background: rgba(79,142,247,0.15); color: #4F8EF7; }
.sp-kpi-icon.green  { background: rgba(16,185,129,0.15); color: #10b981; }
.sp-kpi-icon.orange { background: rgba(255,126,45,0.15); color: #FF7E2D; }
.sp-kpi-icon.purple { background: rgba(124,58,237,0.15); color: #7c3aed; }
.sp-kpi-icon.red    { background: rgba(234,67,53,0.15);  color: #ea4335; }

.sp-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text) !important;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.sp-kpi-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted) !important;
}
.sp-kpi-trend.up      { color: #10b981 !important; }
.sp-kpi-trend.down    { color: #ef4444 !important; }
.sp-kpi-trend.neutral { color: var(--text-muted) !important; }

.sp-kpi-accent {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
}
.sp-kpi-accent.blue   { background: linear-gradient(90deg,#4F8EF7,#93c5fd); }
.sp-kpi-accent.green  { background: linear-gradient(90deg,#10b981,#6ee7b7); }
.sp-kpi-accent.orange { background: linear-gradient(90deg,#FF7E2D,#ffb77a); }
.sp-kpi-accent.purple { background: linear-gradient(90deg,#7c3aed,#a78bfa); }

/* ── COURSE ROW COMPONENT ─────────────────────────────────── */
.sp-course-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.sp-course-row:last-child { border-bottom: none; }
.sp-course-row:hover { background: var(--bg); }

.sp-course-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(255,126,45,0.12);
    color: var(--sp-orange);
}
.sp-course-info {
    flex: 1;
    min-width: 0;
}
.sp-course-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.sp-course-sub {
    font-size: 12px;
    color: var(--text-muted) !important;
}
.sp-course-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
}

/* ── DARK MODE — KPI & HERO specific fixes ─────────────────── */
[data-theme="dark"] .sp-hero {
    background: linear-gradient(135deg, #0f0700 0%, #1a0c00 60%, rgba(255,126,45,0.10) 100%);
}
[data-theme="dark"] .sp-kpi {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="dark"] .sp-kpi-value {
    color: #f3f4f6 !important;
}
[data-theme="dark"] .sp-course-row:hover {
    background: rgba(255,255,255,0.03);
}

/* ================================================================
   ADMIN CATEGORIES PAGE — DARK MODE LEGIBILITY FIXES
   Fixes hardcoded light-colored styles that become unreadable
   ================================================================ */

/* Fix hardcoded gray text colors in dark mode */
[data-theme="dark"] .lms-table td,
[data-theme="dark"] .lms-table th {
    color: var(--text) !important;
}

/* Fix code element in categories table (slug column) */
[data-theme="dark"] code,
[data-theme="dark"] .lms-table code {
    background: rgba(255,255,255,0.10) !important;
    color: #FFD166 !important;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Fix hardcoded gray description text in categories */
[data-theme="dark"] .lms-table td[style*="color:#6b7280"],
[data-theme="dark"] .lms-table td[style*="color: #6b7280"],
[data-theme="dark"] td[style*="color:#6b7280"],
[data-theme="dark"] td[style*="color: #6b7280"] {
    color: #94a3b8 !important;
}

/* Table header in dark mode */
[data-theme="dark"] thead th {
    background: rgba(255,126,45,0.12) !important;
    color: #FFD166 !important;
    border-color: var(--border) !important;
}

/* Table rows dark mode */
[data-theme="dark"] .lms-table tbody tr:hover {
    background: rgba(255,255,255,0.04) !important;
}

/* Fix card body, card header text in dark mode */
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-body {
    color: var(--text) !important;
    background: var(--bg-card) !important;
}

/* Page header in dark mode */
[data-theme="dark"] .page-header h2,
[data-theme="dark"] .page-header p {
    color: var(--text) !important;
}

/* ================================================================
   TOPBAR TUTORING BUTTON — TEXT LEGIBILITY FIX
   The button uses white text on orange gradient — ensure it's
   always visible and never inherits dark/muted color
   ================================================================ */

/* Target the tutoring platform switch button in topbar */
.topbar a[href*="tutoring"],
.topbar a[href*="tutoring-sso"] {
    color: #ffffff !important;
}
.topbar a[href*="tutoring"] span,
.topbar a[href*="tutoring-sso"] span,
.topbar a[href*="tutoring"] i,
.topbar a[href*="tutoring-sso"] i {
    color: #ffffff !important;
}

/* Dark mode: ensure topbar text links stay readable */
[data-theme="dark"] .topbar a[style*="color:var(--text-muted)"] {
    color: rgba(255,255,255,0.7) !important;
}

/* ================================================================
   GLOBAL INLINE STYLE OVERRIDES FOR DARK MODE READABILITY
   ================================================================ */

/* Any inline style using hardcoded light text should be visible */
[data-theme="dark"] [style*="color:#6b7280"] { color: #94a3b8 !important; }
[data-theme="dark"] [style*="color: #6b7280"] { color: #94a3b8 !important; }
[data-theme="dark"] [style*="color:#374151"] { color: #d1d5db !important; }
[data-theme="dark"] [style*="color: #374151"] { color: #d1d5db !important; }
[data-theme="dark"] [style*="color:#1f2937"] { color: #f1f5f9 !important; }
[data-theme="dark"] [style*="color: #1f2937"] { color: #f1f5f9 !important; }
[data-theme="dark"] [style*="background:#f3f4f6"] { background: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] [style*="background: #f3f4f6"] { background: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] [style*="background:#d1fae5"] { background: rgba(16,185,129,0.18) !important; }
[data-theme="dark"] [style*="background: #d1fae5"] { background: rgba(16,185,129,0.18) !important; }
[data-theme="dark"] [style*="color:#065f46"] { color: #6ee7b7 !important; }
[data-theme="dark"] [style*="color: #065f46"] { color: #6ee7b7 !important; }
[data-theme="dark"] [style*="background:#dbeafe"] { background: rgba(79,142,247,0.18) !important; }
[data-theme="dark"] [style*="background: #dbeafe"] { background: rgba(79,142,247,0.18) !important; }
[data-theme="dark"] [style*="color:#1e40af"] { color: #93c5fd !important; }
[data-theme="dark"] [style*="color: #1e40af"] { color: #93c5fd !important; }
[data-theme="dark"] [style*="background:#fef3c7"] { background: rgba(245,158,11,0.18) !important; }
[data-theme="dark"] [style*="color:#92400e"] { color: #fde68a !important; }
[data-theme="dark"] [style*="background:#fee2e2"] { background: rgba(220,38,38,0.18) !important; }
[data-theme="dark"] [style*="color:#b91c1c"] { color: #fca5a5 !important; }
[data-theme="dark"] [style*="background:#f0fdf4"] { background: rgba(16,185,129,0.10) !important; }
