/*
 * Mode nuit automatique (05/11/2026) — classe.oluno.fr.
 * Suit le réglage de l'appareil : includes/layout.php pose data-bs-theme="dark" sur <html> quand l'iPad est en
 * mode sombre (Tabler assombrit alors cartes, tableaux, formulaires), et cette feuille repasse les couleurs maison
 * de classe.css et theme.css. Chargée après elles, elle ne fait que redéfinir. Aucun interrupteur à l'écran.
 * Ce qui garde un fond clair, volontairement : les figures (règle, quadrillage, droite graduée), le pixel art,
 * le tableau de conversion, les pictogrammes et les documents scannés.
 */
[data-bs-theme=dark] {
    --nuit-fond: #0e1722;          /* page */
    --nuit-surface: #182433;       /* cartes, sections */
    --nuit-surface-2: #1f2d3f;     /* champs, puces, fonds secondaires */
    --nuit-trait: #2f3f55;         /* bordures */
    --nuit-texte: #e6ebf1;
    --nuit-encre: #f5f7fa;
    --nuit-muted: #9aa6b5;
    --nuit-bleu: #8ec2ed;          /* remplace #1d4f91 / #206bc4 en texte */
    --nuit-vert: #86efac;
    --nuit-orange: #fdba74;
    --nuit-ambre: #ffd8a8;
    --nuit-rouge: #fca5a5;
    --nuit-teal: #63e6be;

    --tc-accent: #8ec2ed;
    --tc-accent-clair: #1b3350;
    --tc-surligne: rgba(250, 204, 21, .32);

    /* theme.css : jetons du thème « cartable » */
    --encre: var(--nuit-encre);
    --texte: var(--nuit-texte);
    --fond: var(--nuit-fond);
    --trait: var(--nuit-trait);
    --relief: 0 3px 0 rgba(0, 0, 0, .35);
    --marque: #3b7dd8;
    --marque-fonce: #9cc3f0;       /* lu comme couleur de texte ; les usages en fond/ombre sont repris plus bas */
    --m-fonce: #9cc3f0;
    --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface));
}
/* Une couleur par matière : la teinte « foncée » devient claire (c'est du texte sur fond sombre) */
[data-bs-theme=dark] .m-francais { --m-fonce: #93c5fd; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-maths    { --m-fonce: #fdba74; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-histoire { --m-fonce: #86efac; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-geographie { --m-fonce: #bef264; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-sciences { --m-fonce: #5eead4; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-anglais  { --m-fonce: #f9a8d4; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-emc      { --m-fonce: #fcd34d; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-tice     { --m-fonce: #67e8f9; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .m-autre    { --m: #64748b; --m-fonce: #cbd5e1; --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }
[data-bs-theme=dark] .prenom { --m-clair: color-mix(in srgb, var(--m) 24%, var(--nuit-surface)); }

/* ---------- Commun ---------- */
[data-bs-theme=dark] body { background-color: var(--nuit-fond); }
[data-bs-theme=dark] .barre-prof { background: var(--nuit-surface); border-bottom-color: var(--nuit-trait); }
[data-bs-theme=dark] .espace-prof .barre-prof .navbar-brand { color: #9cc3f0; }
[data-bs-theme=dark] .texte-eleve, [data-bs-theme=dark] .espace-eleve .texte-eleve, [data-bs-theme=dark] .travail-objectif, [data-bs-theme=dark] .espace-eleve .travail-objectif,
[data-bs-theme=dark] .matiere-compte, [data-bs-theme=dark] .sous-titre-diapo, [data-bs-theme=dark] .espace-eleve .sous-titre-diapo, [data-bs-theme=dark] .date-naissance label,
[data-bs-theme=dark] .etat-sauvegarde, [data-bs-theme=dark] .astuce-dictee, [data-bs-theme=dark] .aide-mode, [data-bs-theme=dark] .recap-enonce, [data-bs-theme=dark] .credit-picto,
[data-bs-theme=dark] .note-bas, [data-bs-theme=dark] .espace-eleve .note-bas, [data-bs-theme=dark] .aide-surlignage, [data-bs-theme=dark] .source-texte p, [data-bs-theme=dark] .ecran-eleve,
[data-bs-theme=dark] .domaine-eleve, [data-bs-theme=dark] .cases-titre, [data-bs-theme=dark] .panneau-mode-emploi, [data-bs-theme=dark] .panneau-mode-emploi-simple,
[data-bs-theme=dark] .legende-tuiles, [data-bs-theme=dark] .tuile .t-info, [data-bs-theme=dark] .carte-semaine .jour, [data-bs-theme=dark] .cellule-absent,
[data-bs-theme=dark] .legende-visuel, [data-bs-theme=dark] .meles-compteur, [data-bs-theme=dark] .mot-corpus sup, [data-bs-theme=dark] .croises-numero, [data-bs-theme=dark] .position-ecran { color: var(--nuit-muted); }
[data-bs-theme=dark] .espace-eleve .aide-surlignage, [data-bs-theme=dark] .espace-eleve .limite-surlignage, [data-bs-theme=dark] .espace-eleve .plusieurs-reponses,
[data-bs-theme=dark] .espace-eleve .meles-compteur, [data-bs-theme=dark] .espace-eleve .position-ecran { color: var(--m-fonce); }
[data-bs-theme=dark] .texte-replie > summary, [data-bs-theme=dark] .audio-titre, [data-bs-theme=dark] .vignette-son, [data-bs-theme=dark] .mot-corpus, [data-bs-theme=dark] .limite-surlignage,
[data-bs-theme=dark] .apercu-nombre, [data-bs-theme=dark] .signe-rangement, [data-bs-theme=dark] .diapo-num, [data-bs-theme=dark] .seance-num, [data-bs-theme=dark] .mode-tablette-badge { color: var(--nuit-bleu); }
[data-bs-theme=dark] .attendre, [data-bs-theme=dark] .espace-eleve .attendre, [data-bs-theme=dark] .alerte-recopie, [data-bs-theme=dark] .ecran-eleve.en-retard, [data-bs-theme=dark] .cellule-en-cours,
[data-bs-theme=dark] .ouvert-depuis, [data-bs-theme=dark] .entraide-direct, [data-bs-theme=dark] .tuile.t-main .t-etat, [data-bs-theme=dark] .tuile.t-retard .t-etat,
[data-bs-theme=dark] .tuile.t-entraide .t-etat, [data-bs-theme=dark] .tuile.t-aidant .t-etat, [data-bs-theme=dark] .mode-ecoute-badge, [data-bs-theme=dark] .reglage-eleve.hors-defaut .form-label { color: var(--nuit-orange); }
[data-bs-theme=dark] .verifier-erreur, [data-bs-theme=dark] .ouvert-depuis.longtemps, [data-bs-theme=dark] .etat-sauvegarde.erreur { color: var(--nuit-rouge); }
[data-bs-theme=dark] .etat-sauvegarde.ok, [data-bs-theme=dark] .espace-eleve .etat-sauvegarde.ok, [data-bs-theme=dark] .fiche-reussie .bilan-fiche, [data-bs-theme=dark] .question.juste .exo-trou,
[data-bs-theme=dark] .question.juste .op-res, [data-bs-theme=dark] .tuile.t-termine .t-etat, [data-bs-theme=dark] .termine { color: var(--nuit-vert); }
[data-bs-theme=dark] .suite-direct, [data-bs-theme=dark] .tuile.t-suite .t-etat, [data-bs-theme=dark] .text-teal { color: var(--nuit-teal) !important; }
[data-bs-theme=dark] .bg-teal-lt { background: #0f3b31 !important; color: var(--nuit-teal) !important; }

/* Surfaces : tout ce qui était blanc ou gris très clair */
[data-bs-theme=dark] .carte-eleve, [data-bs-theme=dark] .travail section, [data-bs-theme=dark] .espace-eleve .travail section, [data-bs-theme=dark] .contenu-diapo, [data-bs-theme=dark] .questions-diapo,
[data-bs-theme=dark] .espace-eleve .contenu-diapo .texte-diapo, [data-bs-theme=dark] .espace-eleve .bloc-questions .question, [data-bs-theme=dark] .navigation-diapos, [data-bs-theme=dark] .espace-eleve .navigation-diapos,
[data-bs-theme=dark] .recap-diapo, [data-bs-theme=dark] .espace-eleve .recap-diapo, [data-bs-theme=dark] .barre-ecoute, [data-bs-theme=dark] .travail-carte, [data-bs-theme=dark] .espace-eleve .travail-carte,
[data-bs-theme=dark] .texte-replie, [data-bs-theme=dark] .diapo-ligne, [data-bs-theme=dark] .document-ligne, [data-bs-theme=dark] .dialogue, [data-bs-theme=dark] .menu-details-liste, [data-bs-theme=dark] .dater-lot-form,
[data-bs-theme=dark] .barre-fiche, [data-bs-theme=dark] .tuile, [data-bs-theme=dark] .panneau-outil, [data-bs-theme=dark] .date-du-jour, [data-bs-theme=dark] .espace-eleve .travail > .btn-link,
[data-bs-theme=dark] .espace-eleve .travail > a.btn.btn-link, [data-bs-theme=dark] .operation-wrapper, [data-bs-theme=dark] .texte-surlignage, [data-bs-theme=dark] .pastille-ceinture,
[data-bs-theme=dark] .table-resultats tbody td:first-child, [data-bs-theme=dark] .espace-eleve .matiere:hover, [data-bs-theme=dark] .espace-eleve .matiere:focus { background: var(--nuit-surface); color: var(--nuit-texte); }
[data-bs-theme=dark] .carte-eleve, [data-bs-theme=dark] .travail section, [data-bs-theme=dark] .contenu-diapo, [data-bs-theme=dark] .questions-diapo, [data-bs-theme=dark] .recap-diapo, [data-bs-theme=dark] .barre-ecoute,
[data-bs-theme=dark] .travail-carte, [data-bs-theme=dark] .texte-replie, [data-bs-theme=dark] .diapo-ligne, [data-bs-theme=dark] .document-ligne, [data-bs-theme=dark] .menu-details-liste, [data-bs-theme=dark] .dater-lot-form,
[data-bs-theme=dark] .barre-fiche, [data-bs-theme=dark] .navigation-diapos, [data-bs-theme=dark] .vignette, [data-bs-theme=dark] .visuels-diapo img, [data-bs-theme=dark] .tuile, [data-bs-theme=dark] .intrus-serie,
[data-bs-theme=dark] .bloc-questions .question, [data-bs-theme=dark] .recap-question, [data-bs-theme=dark] .operation-wrapper, [data-bs-theme=dark] .texte-surlignage { border-color: var(--nuit-trait); }
[data-bs-theme=dark] .prenom, [data-bs-theme=dark] .espace-eleve .prenom, [data-bs-theme=dark] .matiere, [data-bs-theme=dark] .choix, [data-bs-theme=dark] .espace-eleve .choix, [data-bs-theme=dark] .tuile,
[data-bs-theme=dark] .travail-carte, [data-bs-theme=dark] .menu-details-liste .dropdown-item, [data-bs-theme=dark] .dialogue { color: var(--nuit-texte); }
[data-bs-theme=dark] .prenom, [data-bs-theme=dark] .espace-eleve .prenom, [data-bs-theme=dark] .choix, [data-bs-theme=dark] .espace-eleve .reponse, [data-bs-theme=dark] .espace-eleve textarea.form-control,
[data-bs-theme=dark] .espace-eleve .reponse:focus, [data-bs-theme=dark] .espace-eleve .exo-ligne, [data-bs-theme=dark] .exo-ligne, [data-bs-theme=dark] .exo-opt, [data-bs-theme=dark] .exo-chip,
[data-bs-theme=dark] .tuile-nombre, [data-bs-theme=dark] .rangement-reserve, [data-bs-theme=dark] .espace-eleve .rangement-reserve, [data-bs-theme=dark] .exo-trou, [data-bs-theme=dark] .banque-trou,
[data-bs-theme=dark] .lettre, [data-bs-theme=dark] .nombre-consigne, [data-bs-theme=dark] .compte-champ, [data-bs-theme=dark] .div-q, [data-bs-theme=dark] .div-r, [data-bs-theme=dark] .compte-nombre,
[data-bs-theme=dark] .croises-indice, [data-bs-theme=dark] .meles-case, [data-bs-theme=dark] .espace-eleve .meles-case, [data-bs-theme=dark] .choix-edit, [data-bs-theme=dark] .editeur-riche .ql-toolbar,
[data-bs-theme=dark] .ql-snow .ql-picker-options, [data-bs-theme=dark] .table-resultats thead th, [data-bs-theme=dark] .ligne-reussite th, [data-bs-theme=dark] .table-competences .matiere-tete,
[data-bs-theme=dark] .table-competences tfoot th, [data-bs-theme=dark] .minuteur-direct, [data-bs-theme=dark] .sommaire-fiche a:hover, [data-bs-theme=dark] .menu-details-liste .dropdown-item:hover,
[data-bs-theme=dark] .diapo-recap, [data-bs-theme=dark] .question.verifie .op-case, [data-bs-theme=dark] .espace-eleve .btn-outline-primary, [data-bs-theme=dark] .espace-eleve .btn-lire,
[data-bs-theme=dark] .espace-eleve .btn-dire, [data-bs-theme=dark] .btn-lire, [data-bs-theme=dark] .btn-dire, [data-bs-theme=dark] .travail[data-consultation] textarea.reponse,
[data-bs-theme=dark] .correction-carte { background: var(--nuit-surface-2); color: var(--nuit-texte); }
[data-bs-theme=dark] .prenom, [data-bs-theme=dark] .espace-eleve .prenom, [data-bs-theme=dark] .matiere, [data-bs-theme=dark] .choix, [data-bs-theme=dark] .espace-eleve .choix, [data-bs-theme=dark] .espace-eleve .reponse,
[data-bs-theme=dark] .espace-eleve textarea.form-control, [data-bs-theme=dark] .exo-ligne, [data-bs-theme=dark] .espace-eleve .exo-ligne, [data-bs-theme=dark] .exo-opt, [data-bs-theme=dark] .exo-chip,
[data-bs-theme=dark] .espace-eleve .exo-opt, [data-bs-theme=dark] .espace-eleve .exo-chip, [data-bs-theme=dark] .croises-indice, [data-bs-theme=dark] .compte-champ, [data-bs-theme=dark] .div-q, [data-bs-theme=dark] .div-r,
[data-bs-theme=dark] .pastille-ceinture, [data-bs-theme=dark] .rangement-reponse, [data-bs-theme=dark] .sommaire-fiche a, [data-bs-theme=dark] .espace-eleve .champ-code,
[data-bs-theme=dark] .espace-eleve .date-naissance input, [data-bs-theme=dark] .espace-eleve .carte-eleve { border-color: var(--nuit-trait); }
[data-bs-theme=dark] .sommaire-fiche a { color: var(--nuit-muted); }
[data-bs-theme=dark] .espace-eleve .matiere { background: var(--m-clair); }
[data-bs-theme=dark] .espace-eleve .btn-outline-primary, [data-bs-theme=dark] .espace-eleve .travail > .btn-link, [data-bs-theme=dark] .espace-eleve .travail > a.btn.btn-link, [data-bs-theme=dark] .date-du-jour { color: var(--marque-fonce); }
[data-bs-theme=dark] .espace-eleve .btn-outline-primary:hover { background: var(--m-clair); }
[data-bs-theme=dark] .espace-eleve .btn-lire, [data-bs-theme=dark] .espace-eleve .btn-dire { color: var(--m-fonce); }
[data-bs-theme=dark] .espace-eleve .btn-lire:hover, [data-bs-theme=dark] .espace-eleve .btn-lire:active, [data-bs-theme=dark] .espace-eleve .btn-dire:hover { background: var(--m); color: #fff; }
[data-bs-theme=dark] .espace-eleve .btn-dire.btn-dire-phrase, [data-bs-theme=dark] .espace-eleve .btn-dictee { background: var(--m); color: #fff; }
[data-bs-theme=dark] .btn-dire.btn-dire-phrase { background: #206bc4; color: #fff; }
/* Boutons « à relief » : l'ombre et le survol restent foncés (la teinte « foncée » est devenue claire pour le texte) */
[data-bs-theme=dark] .espace-eleve .btn-primary { box-shadow: 0 4px 0 #1e3f6e; }
[data-bs-theme=dark] .espace-eleve .btn-primary:hover { background: #2f6bc2; border-color: #2f6bc2; }
[data-bs-theme=dark] .espace-eleve .btn-dire.btn-dire-phrase, [data-bs-theme=dark] .espace-eleve .btn-dictee, [data-bs-theme=dark] .espace-eleve #suivant { box-shadow: 0 4px 0 rgba(0, 0, 0, .45); }
[data-bs-theme=dark] .espace-eleve .barre-eleve .btn-outline-secondary:hover { color: #14213d; }
[data-bs-theme=dark] .espace-eleve .titre-eleve, [data-bs-theme=dark] .espace-eleve .travail-titre, [data-bs-theme=dark] .espace-eleve .question .paragraphe .lisible, [data-bs-theme=dark] .espace-eleve .recap-reponse { color: var(--nuit-encre); }
[data-bs-theme=dark] .espace-eleve .objectif, [data-bs-theme=dark] .objectif { color: var(--nuit-texte); }
[data-bs-theme=dark] .espace-eleve .lisible { color: var(--nuit-texte); }
[data-bs-theme=dark] .espace-eleve .choix.coche { color: var(--nuit-encre); }
[data-bs-theme=dark] .espace-eleve .exo-ligne.fait { background: var(--m-clair); }
[data-bs-theme=dark] .espace-eleve .tuile-nombre { color: var(--nuit-encre); }
[data-bs-theme=dark] .espace-eleve .tuile-nombre.placee { background: var(--m-clair); }
[data-bs-theme=dark] .exo-opt.actif, [data-bs-theme=dark] .exo-chip.actif { background: #1b3350; color: var(--nuit-encre); }
[data-bs-theme=dark] .espace-eleve .exo-opt.actif, [data-bs-theme=dark] .espace-eleve .exo-chip.actif { background: var(--m); color: #fff; }
[data-bs-theme=dark] .exo-trou:focus, [data-bs-theme=dark] .banque-trou.rempli { background: #1b3350; }
[data-bs-theme=dark] .espace-eleve .rangement-reserve { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .espace-eleve .consigne-cahier { background: var(--m-clair); color: var(--m-fonce); }
[data-bs-theme=dark] .consigne-cahier { background: var(--tc-accent-clair); color: var(--tc-accent); }
[data-bs-theme=dark] .espace-eleve .travail-retard { background: #2e1d10; }
[data-bs-theme=dark] .travail-ferme { border-left-color: #64748b; }
[data-bs-theme=dark] .espace-eleve .travail-pastille { color: var(--m-fonce); }
[data-bs-theme=dark] .espace-eleve .termine { background: #0f3b22; color: #86efac; }
[data-bs-theme=dark] .consigne-recap, [data-bs-theme=dark] .espace-eleve .consigne-recap { background: #3a2a05; color: var(--nuit-ambre); }
[data-bs-theme=dark] .audio-document { background: #14263d; border-color: #1e3a5f; }
[data-bs-theme=dark] .vignette-son { background: #14263d; }
[data-bs-theme=dark] .page-document img { background: #fff; border-color: var(--nuit-trait); }

/* Alertes et bandeaux de l'élève */
[data-bs-theme=dark] .alerte-eleve.fermee { background: #3b1111; color: var(--nuit-rouge); }
[data-bs-theme=dark] .alerte-eleve.rouvert { background: #142a4d; color: #bfdbfe; }
[data-bs-theme=dark] .alerte-eleve.message { background: #3a2a05; color: var(--nuit-ambre); }
[data-bs-theme=dark] .alerte-eleve.prive { background: #0c2d48; color: #bae6fd; }
[data-bs-theme=dark] .alerte-eleve.suite { background: #0f3b31; color: var(--nuit-teal); }
[data-bs-theme=dark] .alerte-eleve.entraide { background: #3a2a05; color: var(--nuit-ambre); }
[data-bs-theme=dark] .minuteur-eleve { border: 1px solid #475569; }
[data-bs-theme=dark] .espace-eleve .alert-warning { color: var(--tblr-warning-text-emphasis, #faa46a); }

/* Correction par l'élève */
[data-bs-theme=dark] .correction-carte.juste { background: #0f3b22; border-left-color: #16a34a; }
[data-bs-theme=dark] .correction-carte.faux { background: #3a2a05; border-left-color: #d97706; }
[data-bs-theme=dark] .exo-chip.barre { background: #3a2a05; }
[data-bs-theme=dark] .question.verifie .exo-trou { color: inherit; }

/* Textes surlignés et sélections jaunes : le texte reste foncé dessus */
[data-bs-theme=dark] .texte-surlignage .mot.surligne, [data-bs-theme=dark] .meles-case.selection, [data-bs-theme=dark] .espace-eleve .meles-case.selection, [data-bs-theme=dark] .lettre.actif,
[data-bs-theme=dark] .compte-cible, [data-bs-theme=dark] .liste-mots-aide li { color: #1f2937; }
[data-bs-theme=dark] .lisible.en-lecture, [data-bs-theme=dark] .en-lecture { background: var(--tc-surligne); }
[data-bs-theme=dark] .lisible-choix.en-lecture { background: var(--tc-surligne); }

/* Opération posée : grille sombre, chiffres clairs */
[data-bs-theme=dark] .operation-table .label-row td { color: var(--nuit-muted); }
[data-bs-theme=dark] .operation-table .symbole-cell { color: var(--nuit-orange); }
[data-bs-theme=dark] .operation-table .chiffre { background: var(--nuit-fond); color: var(--nuit-encre); border-color: #94a3b8; }
[data-bs-theme=dark] .op-case { background: var(--nuit-fond); color: var(--nuit-encre); border-color: #7fa6dc; }
[data-bs-theme=dark] .op-terme { border-color: #fb923c; background: #2a1d14; }
[data-bs-theme=dark] .op-res { border-color: #7fa6dc; }
[data-bs-theme=dark] .op-retenue { background: #2a2410; color: #fcd34d; border-color: #b45309; }
[data-bs-theme=dark] .operation-table .trait-separateur { background: #cbd5e1; }
[data-bs-theme=dark] .question.verifie .op-case { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .exo-division { color: var(--nuit-texte); }

/* Grilles : mots croisés, mots mêlés, sudoku, pyramide */
[data-bs-theme=dark] .croises-case { background: var(--nuit-fond); border-color: #94a3b8; }
[data-bs-theme=dark] .croises-case.mot-courant, [data-bs-theme=dark] .espace-eleve .croises-case.mot-courant { background: #3a3310; }
[data-bs-theme=dark] .croises-lettre { color: var(--nuit-encre); }
[data-bs-theme=dark] .croises-indice.actif, [data-bs-theme=dark] .espace-eleve .croises-indice.actif { background: #1b3350; border-color: #8ec2ed; }
[data-bs-theme=dark] .meles-case { background: var(--nuit-surface-2); color: var(--nuit-encre); }
[data-bs-theme=dark] .meles-mot.trouve { color: #64748b; }
[data-bs-theme=dark] .sudoku-grille { border-color: #cbd5e1; }
[data-bs-theme=dark] .sudoku-case { background: var(--nuit-fond); color: var(--nuit-bleu); border-color: #64748b; }
[data-bs-theme=dark] .sudoku-case.donne { background: var(--nuit-surface-2); color: var(--nuit-encre); }
[data-bs-theme=dark] .sudoku-case.bord-d { border-right-color: #cbd5e1; }
[data-bs-theme=dark] .sudoku-case.bord-b { border-bottom-color: #cbd5e1; }
[data-bs-theme=dark] .sudoku-correction .sudoku-case { color: var(--nuit-encre); }
[data-bs-theme=dark] .pyramide-case { background: var(--nuit-fond); color: var(--nuit-encre); border-color: #64748b; }
[data-bs-theme=dark] .pyramide-case.donne { background: var(--nuit-surface-2); }
[data-bs-theme=dark] input.pyramide-case.donne { color: var(--nuit-encre); }
[data-bs-theme=dark] .pyramide-dessin .pyramide-case.faux { background: #4a3413; border-color: #f59e0b; }
[data-bs-theme=dark] input.pyramide-case.ok { background: #14361f; border-color: #22c55e; color: #bbf7d0; }
[data-bs-theme=dark] input.pyramide-case.a-revoir { background: #4a3413; border-color: #f59e0b; }
[data-bs-theme=dark] .relier-col .exo-chip.lie { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .cases-couleur { border-color: var(--nuit-surface); }
[data-bs-theme=dark] .cases-couleur.actif { box-shadow: 0 0 0 4px #f5f7fa; }
/* Ce qui reste sur fond clair : figures, pixel art, droite graduée, tableau de conversion, pictos */
[data-bs-theme=dark] .droite-svg { background: #fff; border-radius: 10px; }
[data-bs-theme=dark] .table-conversion th, [data-bs-theme=dark] .table-conversion td, [data-bs-theme=dark] .tc-chiffre { color: #1f2937; }
[data-bs-theme=dark] .picto, [data-bs-theme=dark] .apercu-picto { background: #fff; border-radius: 10px; }
[data-bs-theme=dark] .panneau-rappel { color: var(--nuit-texte); }
[data-bs-theme=dark] .liste-mots-aide li { background: #fffbeb; }
[data-bs-theme=dark] .btn-aide-outil.actif { background: var(--nuit-surface); color: #fcd34d; }

/* ---------- Espace enseignant ---------- */
[data-bs-theme=dark] .bg-light, [data-bs-theme=dark] .table-light, [data-bs-theme=dark] .bg-white { background: var(--nuit-surface-2) !important; color: var(--nuit-texte) !important; }
[data-bs-theme=dark] .text-dark { color: var(--nuit-texte) !important; }
[data-bs-theme=dark] .mode-lecture-badge { background: var(--nuit-surface-2); color: var(--nuit-muted); }
[data-bs-theme=dark] .mode-tablette-badge { background: #14263d; }
[data-bs-theme=dark] .mode-ecoute-badge { background: #2e1d10; }
[data-bs-theme=dark] .mode-ecoute_cahier-badge { background: #2a1f3d; color: #d8b4fe; }
[data-bs-theme=dark] .bloc-simplifie { background: #1d1a2e; border-color: #5b4b8a; }
[data-bs-theme=dark] .carte-sequence .card-header { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .carte-sequence.carte-collegue .card-header { background: rgba(34, 197, 94, .12); }
[data-bs-theme=dark] .seance-num { background: #14263d; }
[data-bs-theme=dark] .ligne-aujourdhui { background: #2e2608; }
[data-bs-theme=dark] .table-resultats thead th { box-shadow: inset 0 -1px 0 var(--nuit-trait); }
[data-bs-theme=dark] .table-resultats tbody td:first-child { box-shadow: inset -1px 0 0 var(--nuit-trait); }
[data-bs-theme=dark] .bandeau-main { background: #2e1d10; color: var(--nuit-orange); }
[data-bs-theme=dark] .carte-direct.main-levee { box-shadow: 0 0 0 4px rgba(245, 159, 0, .25); }
[data-bs-theme=dark] .tuile.t-main, [data-bs-theme=dark] .tuile.t-retard { background: #2e1d10; }
[data-bs-theme=dark] .tuile.t-inactif { background: #3b1111; }
[data-bs-theme=dark] .tuile.t-termine { background: #0f3b22; }
[data-bs-theme=dark] .tuile.t-absent { background: var(--nuit-surface-2); border-color: var(--nuit-trait); color: #64748b; }
[data-bs-theme=dark] .tuile.t-absent .t-info { color: #64748b; }
[data-bs-theme=dark] .tuile.t-suite { background: #0f3b31; }
[data-bs-theme=dark] .tuile.t-entraide { background: #2e1d10; }
[data-bs-theme=dark] .tuile.t-aidant { background: var(--nuit-surface); }
[data-bs-theme=dark] .tuile:hover { box-shadow: 0 0 0 3px rgba(142, 194, 237, .3); }
[data-bs-theme=dark] .message-en-cours { background: #3a2a05; color: var(--nuit-ambre); }
[data-bs-theme=dark] .reglage-eleve.hors-defaut { background: #2e1d10; }
[data-bs-theme=dark] .minuteur-direct.bientot { background: #2e1d10; color: var(--nuit-orange); }
[data-bs-theme=dark] .minuteur-direct.urgent, [data-bs-theme=dark] .minuteur-direct.fini { background: #3b1111; color: var(--nuit-rouge); }
[data-bs-theme=dark] .barre-fiche { box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
[data-bs-theme=dark] .menu-details-liste, [data-bs-theme=dark] .dater-lot-form { box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
[data-bs-theme=dark] .diapo-recap { color: var(--nuit-muted); }
/* Éditeur Quill (fiche de séance) : icônes et menus lisibles */
[data-bs-theme=dark] .ql-snow .ql-stroke { stroke: #cbd5e1; }
[data-bs-theme=dark] .ql-snow .ql-fill, [data-bs-theme=dark] .ql-snow .ql-stroke.ql-fill { fill: #cbd5e1; }
[data-bs-theme=dark] .ql-snow .ql-picker, [data-bs-theme=dark] .ql-snow .ql-picker-label { color: #cbd5e1; }
[data-bs-theme=dark] .ql-toolbar.ql-snow, [data-bs-theme=dark] .ql-container.ql-snow { border-color: var(--nuit-trait); }
[data-bs-theme=dark] .ql-snow .ql-picker-options { border-color: var(--nuit-trait); }
[data-bs-theme=dark] .ql-editor.ql-blank::before { color: var(--nuit-muted); }
/* Dispense par élève (06/11/2026) */
[data-bs-theme=dark] .tuile.t-dispense { background: var(--nuit-surface-2); border-color: var(--nuit-trait); color: var(--nuit-muted); }
[data-bs-theme=dark] .ligne-dispense td { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .reglage-eleve.dispense .form-check-label { color: var(--nuit-muted); }
[data-bs-theme=dark] .termines-eleve summary { background: var(--nuit-surface-2); border-color: var(--nuit-trait); }
[data-bs-theme=dark] .termines-eleve[open] summary { background: var(--nuit-surface); }
[data-bs-theme=dark] .termines-eleve summary .sous-titre-eleve { color: var(--nuit-muted); }

/* Cases à cocher, boutons radio et interrupteurs : bord clair et fond un peu plus clair que la page quand ils ne sont pas cochés (07/11/2026) */
[data-bs-theme=dark] .form-check-input:not(:checked) { background-color: var(--nuit-surface-2); border: 2px solid #8fa0b5; }
[data-bs-theme=dark] .form-check-input:not(:checked):hover { border-color: var(--nuit-bleu); }
[data-bs-theme=dark] .form-check-input:checked { border-color: var(--nuit-bleu); }
[data-bs-theme=dark] .groupe-seance.retenu { background: #14263d; border-color: #3b82c4 !important; }
[data-bs-theme=dark] .pastille-tri { background: var(--nuit-surface-2); border-color: var(--nuit-trait); color: var(--nuit-texte, #e2e8f0); }
[data-bs-theme=dark] .pastille-tri .pastille-nb { background: var(--nuit-surface); color: var(--nuit-muted); }
[data-bs-theme=dark] .pastille-tri[aria-pressed="true"] { background: #3b82c4; border-color: #3b82c4; color: #fff; }
[data-bs-theme=dark] .pastille-tri[aria-pressed="true"] .pastille-nb { background: rgba(255, 255, 255, .25); color: #fff; }
[data-bs-theme=dark] .pastille-tri.pastille-retard:not([aria-pressed="true"]) .pastille-nb { background: #3a2412; color: #fdba74; }
[data-bs-theme=dark] .projet-apercu { border-color: var(--nuit-trait); background: var(--nuit-surface-2); }
[data-bs-theme=dark] .projet-vignette { background: var(--nuit-surface); border-color: var(--nuit-trait); }
[data-bs-theme=dark] .projet-etat-sauvegarde { background: var(--nuit-surface-2); color: var(--nuit-texte); }
[data-bs-theme=dark] .projet-etat-sauvegarde.erreur { background: #3b1414; color: #fca5a5; }
[data-bs-theme=dark] .projet-changements { background: #14263d; border-left-color: #3b82c4; }
[data-bs-theme=dark] .projet-changement .avant { color: var(--nuit-muted); }
[data-bs-theme=dark] .projet-case { border-color: var(--nuit-trait); }
[data-bs-theme=dark] .projet-case:has(input:checked) { border-color: #3b82c4; background: #14263d; }
[data-bs-theme=dark] .projet-ligne { border-color: var(--nuit-trait); }
/* Note de l'élève sur sa carte « En direct » (09/11/2026) */
[data-bs-theme=dark] .note-direct.note-bien { background: #0f3b22; color: #8ce99a; }
[data-bs-theme=dark] .note-direct.note-moyen { background: #3d2a12; color: #ffc078; }
[data-bs-theme=dark] .note-direct.note-faible { background: #3b1717; color: #ffa8a8; }

/* Question « photo » (10/11/2026) */
[data-bs-theme=dark] .photo-question .aide-photo { color: var(--nuit-texte); }
[data-bs-theme=dark] .photo-envoyee, [data-bs-theme=dark] .photo-reponse-vignette { border-color: var(--nuit-trait); }
[data-bs-theme=dark] .travail-en-pause-icone { background: var(--nuit-surface-2); color: var(--nuit-texte); }

/* Mes résultats (11/11/2026) */
[data-bs-theme=dark] .domaine-resultat, [data-bs-theme=dark] .seance-resultat { background: var(--nuit-surface); color: var(--nuit-texte); border-color: var(--nuit-trait); }
[data-bs-theme=dark] .progress-domaine { background: var(--nuit-trait); }

/* Images d'exercice (17/11/2026) */
[data-bs-theme=dark] .etiquette-carte { background: var(--nuit-surface-2, #1e293b); border-color: #475569; }
[data-bs-theme=dark] .etiquette-case { background: var(--nuit-fond); color: var(--nuit-encre); border-color: #64748b; }
[data-bs-theme=dark] .etiquette-case.rempli { background: #1b3350; border-color: #8ec2ed; }
[data-bs-theme=dark] .croises-case.croises-secrete { background: #4a2e14; }
[data-bs-theme=dark] .exo-croises .croises-case.croises-secrete.mot-courant { background: #5c3a18; }
[data-bs-theme=dark] .imagier-carte { background: var(--nuit-surface-2, #1e293b); border-color: #475569; color: var(--nuit-encre); }

/* Lots D1 et D2 (20/11/2026) : barre de classe, menus, accueil */
[data-bs-theme=dark] .nav-classe { background: var(--nuit-surface); border-color: var(--nuit-surface-2); }
[data-bs-theme=dark] .nav-classe-sous { background: var(--nuit-fond); }
[data-bs-theme=dark] .nav-classe-nom { color: var(--nuit-texte); border-right-color: var(--nuit-surface-2); }
[data-bs-theme=dark] .nav-classe-lien { color: #a9b8cb; }
[data-bs-theme=dark] .nav-classe-lien:hover { background: var(--nuit-surface-2); color: var(--nuit-texte); }
[data-bs-theme=dark] .nav-classe-lien.actif { background: rgba(77, 148, 219, .22); color: #cfe3fb; }
[data-bs-theme=dark] .nav-classe-lien.inactif, [data-bs-theme=dark] .nav-classe-lien.inactif:hover { color: #5d6f86; background: none; }
[data-bs-theme=dark] .menu-details-liste button.dropdown-item { color: var(--nuit-texte); }
[data-bs-theme=dark] .zone-lot { background: var(--nuit-surface-2); border-bottom-color: var(--nuit-fond); }
[data-bs-theme=dark] .carte-classe-lien:hover { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .restees-classe { border-top-color: var(--nuit-trait); }
@keyframes ligne-retour-nuit { from { background: #4a3d08; } to { background: transparent; } }
[data-bs-theme=dark] .ligne-retour { animation-name: ligne-retour-nuit; }

/* Fiche élève (lot D3) */
[data-bs-theme=dark] .nav-eleve-liste .dropdown-item.actif { background: rgba(77, 148, 219, .22); }
[data-bs-theme=dark] .fiche-ligne { border-top-color: var(--nuit-surface-2); }
[data-bs-theme=dark] tr[id^="eleve-"]:target > td { background: rgba(240, 180, 41, .16); }

/* Déroulement d'une séance (lot D4) */
[data-bs-theme=dark] .deroule { border-top-color: var(--nuit-surface-2); }
[data-bs-theme=dark] .deroule > summary:hover, [data-bs-theme=dark] .deroule[open] > summary { background: var(--nuit-surface-2); }
[data-bs-theme=dark] .deroule-resume { color: var(--nuit-texte); }
[data-bs-theme=dark] .deroule-icone { color: #a9b8cb; }
[data-bs-theme=dark] .deroule.au-defaut .deroule-resume, [data-bs-theme=dark] .deroule.au-defaut .deroule-icone, [data-bs-theme=dark] .deroule-chevron { color: #5d6f86; }

/* Annonces de la classe côté élève (lot D6) */
[data-bs-theme=dark] .annonce { background: #33290d; border-color: #b8860b; color: var(--nuit-texte); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
[data-bs-theme=dark] .annonce-aide { background: #10291a; border-color: #2f9e44; }
[data-bs-theme=dark] .annonce-prive { background: #10233b; border-color: #4d94db; }
[data-bs-theme=dark] .annonce-minuteur { background: var(--nuit-surface); border-color: var(--nuit-surface-2); }
[data-bs-theme=dark] .annonce-origine { color: #8a9bb0; }

/* Page d'une séance côté élève (lot D7) */
[data-bs-theme=dark] .annonces-plus { background: var(--nuit-surface); color: var(--nuit-texte); border-color: var(--nuit-surface-2); }
[data-bs-theme=dark] .tuile .t-limite { color: #fbbf24; background: rgba(240, 180, 41, .16); }

/* Menu de l'élève sous son prénom */
[data-bs-theme=dark] .menu-eleve .menu-details-liste .dropdown-item { color: var(--nuit-texte); }
[data-bs-theme=dark] .menu-eleve .menu-details-liste .dropdown-item + .dropdown-item, [data-bs-theme=dark] .menu-eleve .menu-details-liste form { border-top-color: var(--nuit-surface-2); }
