/* TIMAH ACADEMY — thème clair/sombre v2
   Le mode sombre suit les maquettes Modern Authority :
   base #000D1D, surfaces bleu nuit, texte #D4E4FB, accents cyan.
   Cette feuille est chargée APRÈS les styles des pages modernes. */

:root {
    --academy-dark-bg: #000D1D;
    --academy-dark-surface: #051424;
    --academy-dark-panel: #001B3D;
    --academy-dark-panel-2: #112131;
    --academy-dark-panel-high: #1C2B3C;
    --academy-dark-panel-highest: #273647;
    --academy-dark-text: #D4E4FB;
    --academy-dark-muted: #C1C7D4;
    --academy-dark-outline: #8B919E;
    --academy-dark-line: rgba(255, 255, 255, .07);
    --academy-dark-primary: #A5C8FF;
    --academy-dark-primary-strong: #4D9EFF;
    --academy-dark-cyan: #00DAF3;
    --academy-dark-cyan-strong: #00E5FF;
    --academy-dark-yellow: #FFDB3C;
    --academy-dark-danger: #FFB4AB;
    --academy-dark-success: #73E6BC;
    --academy-dark-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

html[data-theme='dark'] { color-scheme: dark; background: var(--academy-dark-bg); }
html[data-theme='light'] { color-scheme: light; }

.academy-theme-toggle {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #dce3ec;
    background: #fff;
    color: #001b3d;
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.academy-theme-toggle:hover { transform: translateY(-1px); }
.academy-theme-toggle__icon { font-size: 1rem; line-height: 1; }

html[data-theme='dark'] .academy-theme-toggle {
    background: var(--academy-dark-panel-2);
    border-color: var(--academy-dark-line);
    color: var(--academy-dark-primary);
}
html[data-theme='dark'] .academy-theme-toggle:hover {
    background: var(--academy-dark-panel-high);
    border-color: rgba(0, 218, 243, .30);
}

/* =========================================================
   ESPACE ÉLÈVE
   ========================================================= */
html[data-theme='dark'] body[data-ui-role='student'] {
    background: var(--academy-dark-bg) !important;
    color: var(--academy-dark-text) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-app,
html[data-theme='dark'] body[data-ui-role='student'] .student-main,
html[data-theme='dark'] body[data-ui-role='student'] .student-content {
    background: var(--academy-dark-bg) !important;
    color: var(--academy-dark-text) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-sidebar {
    background: #010F1F !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: 8px 0 30px rgba(0,0,0,.18) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-topbar {
    background: rgba(5, 20, 36, .94) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.18) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .brand__text strong,
html[data-theme='dark'] body[data-ui-role='student'] .student-account strong { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .brand__text span,
html[data-theme='dark'] body[data-ui-role='student'] .student-account span { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .brand__mark,
html[data-theme='dark'] body[data-ui-role='student'] .student-account__avatar {
    background: var(--academy-dark-panel) !important;
    color: var(--academy-dark-cyan) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-link,
html[data-theme='dark'] body[data-ui-role='student'] .student-link--button {
    color: var(--academy-dark-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-link:hover,
html[data-theme='dark'] body[data-ui-role='student'] .student-link--button:hover {
    color: var(--academy-dark-primary) !important;
    background: rgba(255,255,255,.045) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-link.is-active {
    color: #003464 !important;
    background: var(--academy-dark-primary-strong) !important;
    border-color: transparent !important;
    box-shadow: 0 0 20px rgba(77,158,255,.16) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-link.is-active * { color: #003464 !important; }
html[data-theme='dark'] body[data-ui-role='student'] .student-logout {
    background: rgba(147,0,10,.26) !important;
    color: var(--academy-dark-danger) !important;
    border-color: rgba(255,180,171,.14) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .mobile-menu-btn,
html[data-theme='dark'] body[data-ui-role='student'] .theme-btn,
html[data-theme='dark'] body[data-ui-role='student'] .topbar-btn {
    background: var(--academy-dark-panel-2) !important;
    color: var(--academy-dark-primary) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: none !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .topbar-btn--primary {
    background: var(--academy-dark-primary-strong) !important;
    color: #003464 !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-mobile-nav {
    background: rgba(13,28,45,.97) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: 0 -10px 30px rgba(0,0,0,.35) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .student-mobile-nav a { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .student-mobile-nav a.is-active {
    background: var(--academy-dark-primary-strong) !important;
    color: #003464 !important;
}

/* Dashboard élève */
html[data-theme='dark'] body[data-ui-role='student'] .ta-student {
    --ta-navy: var(--academy-dark-text);
    --ta-navy-2: var(--academy-dark-primary);
    --ta-cyan: var(--academy-dark-cyan);
    --ta-cyan-soft: rgba(0,218,243,.10);
    --ta-surface: var(--academy-dark-panel);
    --ta-line: var(--academy-dark-line);
    --ta-muted: var(--academy-dark-muted);
    --ta-text: var(--academy-dark-text);
    --ta-success: var(--academy-dark-success);
    --ta-success-soft: rgba(115,230,188,.10);
    --ta-warning: var(--academy-dark-yellow);
    --ta-warning-soft: rgba(255,219,60,.08);
    --ta-danger: var(--academy-dark-danger);
    --ta-danger-soft: rgba(255,180,171,.10);
    color: var(--academy-dark-text) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-hero h1,
html[data-theme='dark'] body[data-ui-role='student'] .ta-heading h2,
html[data-theme='dark'] body[data-ui-role='student'] .ta-progress-card__top strong,
html[data-theme='dark'] body[data-ui-role='student'] .ta-study-content h3,
html[data-theme='dark'] body[data-ui-role='student'] .ta-priority-card strong,
html[data-theme='dark'] body[data-ui-role='student'] .ta-account-line strong,
html[data-theme='dark'] body[data-ui-role='student'] .ta-shortcut strong { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-hero p,
html[data-theme='dark'] body[data-ui-role='student'] .ta-study-content p,
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-item small,
html[data-theme='dark'] body[data-ui-role='student'] .ta-priority-card span,
html[data-theme='dark'] body[data-ui-role='student'] .ta-account-line span,
html[data-theme='dark'] body[data-ui-role='student'] .ta-shortcut span,
html[data-theme='dark'] body[data-ui-role='student'] .ta-empty { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-eyebrow,
html[data-theme='dark'] body[data-ui-role='student'] .ta-heading a,
html[data-theme='dark'] body[data-ui-role='student'] .ta-progress-card__top span { color: var(--academy-dark-cyan) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .ta-progress-card,
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-stat,
html[data-theme='dark'] body[data-ui-role='student'] .ta-study-card,
html[data-theme='dark'] body[data-ui-role='student'] .ta-card,
html[data-theme='dark'] body[data-ui-role='student'] .ta-shortcut {
    background: rgba(0,27,61,.82) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: var(--academy-dark-shadow) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-progress-track { background: var(--academy-dark-surface) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .ta-progress-fill {
    background: linear-gradient(90deg,var(--academy-dark-primary-strong),var(--academy-dark-cyan-strong)) !important;
    box-shadow: 0 0 8px rgba(0,229,255,.42);
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-study-visual {
    background: radial-gradient(circle at 20% 20%,rgba(0,218,243,.25),transparent 34%),linear-gradient(145deg,#001B3D,#051424) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-study-badge,
html[data-theme='dark'] body[data-ui-role='student'] .ta-item-icon,
html[data-theme='dark'] body[data-ui-role='student'] .ta-shortcut__icon {
    background: rgba(0,218,243,.12) !important;
    color: var(--academy-dark-cyan) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-primary-btn {
    background: var(--academy-dark-primary-strong) !important;
    color: #003464 !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-item { border-color: var(--academy-dark-line) !important; }
html[data-theme='dark'] body[data-ui-role='student'] .ta-student-item:hover,
html[data-theme='dark'] body[data-ui-role='student'] .ta-priority-card {
    background: rgba(5,20,36,.62) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-priority-card.is-warning {
    background: rgba(255,219,60,.07) !important;
    border-color: rgba(255,219,60,.18) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-open {
    background: var(--academy-dark-panel-high) !important;
    color: var(--academy-dark-primary) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] .ta-account-line { border-color: var(--academy-dark-line) !important; }

/* Pages internes élève */
html[data-theme='dark'] body[data-ui-role='student'] .panel,
html[data-theme='dark'] body[data-ui-role='student'] .td-panel,
html[data-theme='dark'] body[data-ui-role='student'] .td-show-panel,
html[data-theme='dark'] body[data-ui-role='student'] .td-card,
html[data-theme='dark'] body[data-ui-role='student'] .td-doc-box,
html[data-theme='dark'] body[data-ui-role='student'] .plan-card,
html[data-theme='dark'] body[data-ui-role='student'] .subscription-card,
html[data-theme='dark'] body[data-ui-role='student'] .message-card,
html[data-theme='dark'] body[data-ui-role='student'] .course-card,
html[data-theme='dark'] body[data-ui-role='student'] .empty-state {
    background: var(--academy-dark-panel) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: var(--academy-dark-shadow) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] h1,
html[data-theme='dark'] body[data-ui-role='student'] h2,
html[data-theme='dark'] body[data-ui-role='student'] h3,
html[data-theme='dark'] body[data-ui-role='student'] h4,
html[data-theme='dark'] body[data-ui-role='student'] label { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='student'] p,
html[data-theme='dark'] body[data-ui-role='student'] small,
html[data-theme='dark'] body[data-ui-role='student'] .muted { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='student'] input,
html[data-theme='dark'] body[data-ui-role='student'] select,
html[data-theme='dark'] body[data-ui-role='student'] textarea {
    background: var(--academy-dark-panel-2) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] table,
html[data-theme='dark'] body[data-ui-role='student'] thead,
html[data-theme='dark'] body[data-ui-role='student'] tbody,
html[data-theme='dark'] body[data-ui-role='student'] tr,
html[data-theme='dark'] body[data-ui-role='student'] th,
html[data-theme='dark'] body[data-ui-role='student'] td {
    background: var(--academy-dark-panel) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='student'] thead th { background: var(--academy-dark-panel-2) !important; color: var(--academy-dark-primary) !important; }

/* =========================================================
   ESPACE ENSEIGNANT
   ========================================================= */
html[data-theme='dark'] body[data-ui-role='teacher'],
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-shell,
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-page,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-subpage-main,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-subpage-content {
    background: var(--academy-dark-bg) !important;
    color: var(--academy-dark-text) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-navbar {
    background: rgba(5,20,36,.96) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.22) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-brand,
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-brand__title,
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-user__name { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-brand__subtitle,
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-user__role { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-brand__logo,
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-user__avatar {
    background: var(--academy-dark-panel) !important;
    color: var(--academy-dark-cyan) !important;
    border: 1px solid var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-user,
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-separator { border-color: var(--academy-dark-line) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-nav__item {
    color: var(--academy-dark-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-nav__item:hover {
    color: var(--academy-dark-primary) !important;
    background: rgba(255,255,255,.045) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-nav__item.is-active {
    color: #003464 !important;
    background: var(--academy-dark-primary-strong) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .resp-nav__item.is-active * { color: #003464 !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-mobile-nav {
    background: rgba(13,28,45,.97) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: 0 -10px 30px rgba(0,0,0,.36) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-mobile-nav a { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-mobile-nav a.is-active {
    background: var(--academy-dark-primary-strong) !important;
    color: #003464 !important;
}

/* Dashboard enseignant */
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-teacher {
    --ta-navy: var(--academy-dark-text);
    --ta-navy-2: var(--academy-dark-primary);
    --ta-cyan: var(--academy-dark-cyan);
    --ta-cyan-soft: rgba(0,218,243,.11);
    --ta-surface: var(--academy-dark-panel);
    --ta-bg: var(--academy-dark-bg);
    --ta-line: var(--academy-dark-line);
    --ta-muted: var(--academy-dark-muted);
    --ta-text: var(--academy-dark-text);
    --ta-success: var(--academy-dark-success);
    --ta-success-soft: rgba(115,230,188,.10);
    --ta-warning: var(--academy-dark-yellow);
    --ta-warning-soft: rgba(255,219,60,.09);
    --ta-danger: var(--academy-dark-danger);
    --ta-danger-soft: rgba(255,180,171,.09);
}
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-hero h1,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-section-title h2,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-class-card h3,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-list-item strong,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-message-card strong,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-message-card h3,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-program-item strong { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-hero p,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-class-card p,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-list-item small,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-message-card p,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-program-item span,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-empty { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-eyebrow,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-link { color: var(--academy-dark-cyan) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-date,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-stat,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-class-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-message-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-program-item {
    background: rgba(0,27,61,.82) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: var(--academy-dark-shadow) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-action--primary {
    background: linear-gradient(135deg,#001B3D,#112131) !important;
    color: var(--academy-dark-text) !important;
    border: 1px solid var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-action--secondary {
    background: linear-gradient(135deg,rgba(77,158,255,.16),rgba(0,218,243,.12)) !important;
    color: var(--academy-dark-primary) !important;
    border-color: rgba(0,218,243,.20) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-list-item { border-color: var(--academy-dark-line) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-list-item:hover,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-class-card:hover,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-message-card:hover { background: var(--academy-dark-panel-2) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-list-icon,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-avatar,
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-badge {
    background: rgba(0,218,243,.11) !important;
    color: var(--academy-dark-cyan) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .ta-list-value { background: var(--academy-dark-panel-high) !important; color: var(--academy-dark-primary) !important; }

/* Pages internes enseignant */
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-subpage-header,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-section,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-panel,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-form-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-stat-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-chat-sidebar,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-chat-window,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-chat-placeholder__box,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-thread-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .td-panel,
html[data-theme='dark'] body[data-ui-role='teacher'] .td-card,
html[data-theme='dark'] body[data-ui-role='teacher'] .td-doc-box,
html[data-theme='dark'] body[data-ui-role='teacher'] .panel {
    background: var(--academy-dark-panel) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: var(--academy-dark-shadow) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] h1,
html[data-theme='dark'] body[data-ui-role='teacher'] h2,
html[data-theme='dark'] body[data-ui-role='teacher'] h3,
html[data-theme='dark'] body[data-ui-role='teacher'] h4,
html[data-theme='dark'] body[data-ui-role='teacher'] label { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] p,
html[data-theme='dark'] body[data-ui-role='teacher'] small,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-muted,
html[data-theme='dark'] body[data-ui-role='teacher'] .muted { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-back-link,
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-btn--ghost {
    background: var(--academy-dark-panel-2) !important;
    color: var(--academy-dark-primary) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-btn--primary,
html[data-theme='dark'] body[data-ui-role='teacher'] button[type='submit']:not(.resp-logout) {
    background: var(--academy-dark-primary-strong) !important;
    color: #003464 !important;
    border-color: transparent !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] input,
html[data-theme='dark'] body[data-ui-role='teacher'] select,
html[data-theme='dark'] body[data-ui-role='teacher'] textarea {
    background: var(--academy-dark-panel-2) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] table,
html[data-theme='dark'] body[data-ui-role='teacher'] thead,
html[data-theme='dark'] body[data-ui-role='teacher'] tbody,
html[data-theme='dark'] body[data-ui-role='teacher'] tr,
html[data-theme='dark'] body[data-ui-role='teacher'] th,
html[data-theme='dark'] body[data-ui-role='teacher'] td {
    background: var(--academy-dark-panel) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='teacher'] thead th { background: var(--academy-dark-panel-2) !important; color: var(--academy-dark-primary) !important; }
html[data-theme='dark'] body[data-ui-role='teacher'] .teacher-thread-card:hover { background: var(--academy-dark-panel-2) !important; }

/* =========================================================
   SITE PUBLIC
   ========================================================= */
html[data-theme='dark'] body[data-ui-role='public'] {
    background: var(--academy-dark-bg) !important;
    color: var(--academy-dark-text) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .public-shell,
html[data-theme='dark'] body[data-ui-role='public'] .public-main,
html[data-theme='dark'] body[data-ui-role='public'] .hero,
html[data-theme='dark'] body[data-ui-role='public'] .section {
    background: var(--academy-dark-bg) !important;
    color: var(--academy-dark-text) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .public-header {
    background: rgba(5,20,36,.96) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.22) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .brand__title,
html[data-theme='dark'] body[data-ui-role='public'] .nav-link,
html[data-theme='dark'] body[data-ui-role='public'] .section-title,
html[data-theme='dark'] body[data-ui-role='public'] .hero-title,
html[data-theme='dark'] body[data-ui-role='public'] .class-card__title,
html[data-theme='dark'] body[data-ui-role='public'] .plan-card h3 { color: var(--academy-dark-text) !important; }
html[data-theme='dark'] body[data-ui-role='public'] .brand__subtitle,
html[data-theme='dark'] body[data-ui-role='public'] .section-subtitle,
html[data-theme='dark'] body[data-ui-role='public'] .hero-text,
html[data-theme='dark'] body[data-ui-role='public'] .class-card__meta,
html[data-theme='dark'] body[data-ui-role='public'] .muted { color: var(--academy-dark-muted) !important; }
html[data-theme='dark'] body[data-ui-role='public'] .nav-link:hover,
html[data-theme='dark'] body[data-ui-role='public'] .nav-link.is-active { color: var(--academy-dark-primary) !important; }
html[data-theme='dark'] body[data-ui-role='public'] .nav-link::after { background: var(--academy-dark-cyan) !important; }
html[data-theme='dark'] body[data-ui-role='public'] .mobile-toggle,
html[data-theme='dark'] body[data-ui-role='public'] .btn--ghost {
    background: var(--academy-dark-panel-2) !important;
    color: var(--academy-dark-primary) !important;
    border-color: var(--academy-dark-line) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .btn--primary,
html[data-theme='dark'] body[data-ui-role='public'] .hero-actions .btn--primary {
    background: var(--academy-dark-primary-strong) !important;
    color: #003464 !important;
    border-color: transparent !important;
    box-shadow: 0 0 18px rgba(77,158,255,.16) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .hero-card,
html[data-theme='dark'] body[data-ui-role='public'] .hero-visual__panel,
html[data-theme='dark'] body[data-ui-role='public'] .hero-mini-card,
html[data-theme='dark'] body[data-ui-role='public'] .stats-panel,
html[data-theme='dark'] body[data-ui-role='public'] .stat-box,
html[data-theme='dark'] body[data-ui-role='public'] .class-card,
html[data-theme='dark'] body[data-ui-role='public'] .plan-card,
html[data-theme='dark'] body[data-ui-role='public'] .subscription-card {
    background: rgba(0,27,61,.78) !important;
    color: var(--academy-dark-text) !important;
    border-color: var(--academy-dark-line) !important;
    box-shadow: var(--academy-dark-shadow) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .plan-card--highlight {
    background: linear-gradient(145deg,#001B3D,#112131) !important;
    border-color: rgba(0,218,243,.24) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .hero-badge,
html[data-theme='dark'] body[data-ui-role='public'] .plan-badge {
    background: rgba(0,218,243,.12) !important;
    color: var(--academy-dark-cyan) !important;
    border-color: rgba(0,218,243,.18) !important;
}
html[data-theme='dark'] body[data-ui-role='public'] .hero-title span,
html[data-theme='dark'] body[data-ui-role='public'] .stat-box__value,
html[data-theme='dark'] body[data-ui-role='public'] .plan-price { color: var(--academy-dark-cyan) !important; }
html[data-theme='dark'] body[data-ui-role='public'] .public-footer {
    background: #010F1F !important;
    border-top: 1px solid var(--academy-dark-line) !important;
}

/* Focus visible commun */
html[data-theme='dark'] body[data-ui-role='student'] :focus-visible,
html[data-theme='dark'] body[data-ui-role='teacher'] :focus-visible,
html[data-theme='dark'] body[data-ui-role='public'] :focus-visible {
    outline: 2px solid var(--academy-dark-cyan) !important;
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .academy-theme-toggle { width: 40px; min-width: 40px; height: 40px; padding: 0; border-radius: 12px; }
    .academy-theme-toggle__label { display: none; }
}
