/* Mode nuit (29/10/2026, plan b, style 2 « Nuit » choisi par Ayoub) : theme_nuit.py pose data-theme sur <html> (jour | nuit | auto).
   Ecran seulement : les impressions (bons, fiches de paie, bulletins, avis) gardent le fond blanc.
   1. les couleurs de base (variables de base.html et de l'accueil style 19) ; 2. les blancs ecrits en dur dans schoolpilot.css et accueil19.css ;
   3. les couleurs ecrites dans les gabarits (style="...") les plus courantes. */
@media screen{
:root[data-theme=nuit]{color-scheme:dark;--fd:#0b1117;--bd:#233140;--sf:#141d26;--tx:#e6edf3;--mu:#8b9bab;--nu:#111a22;--rg:#f87171;--rgf:#3a1717;--ok:#4ade80;--okf:#123123;--at:#fbbf24;--atf:#33270f;
  --lk-n:#5eead4;--te-tx:#5eead4;--ombre:none;--foc:#5eead4;--sf2:#1b2733;--bo:#14b8a6;--ac:#5eead4;--fond2:#1b2733}
}
/* « auto » : actions.js remplace data-theme=auto par nuit quand l'appareil est en sombre (avant l'affichage, script charge dans <head>). */
@media screen{
:root[data-theme=nuit] body{background:var(--fd);color:var(--tx)}
:where(:root[data-theme=nuit]) a{color:var(--lk-n)}   /* :where : un lien avec sa propre classe (bouton plein) garde sa couleur */
:root[data-theme=nuit] .btn,:root[data-theme=nuit] .btn:visited{color:#0b1117;background:var(--lk-n)}
:root[data-theme=nuit] .btn.sec,:root[data-theme=nuit] .btn.danger,:root[data-theme=nuit] .btn.sec.danger{background:var(--sf);color:var(--tx);border-color:var(--bd)}
:root[data-theme=nuit] .btn.danger,:root[data-theme=nuit] .btn.sec.danger{color:var(--rg);border-color:var(--rg)}
:root[data-theme=nuit] .carte{border-color:var(--bd)}
:root[data-theme=nuit] .jours a,:root[data-theme=nuit] .choix span,:root[data-theme=nuit] .recherche input,:root[data-theme=nuit] nav.bas,:root[data-theme=nuit] .champ,
:root[data-theme=nuit] .haut kbd,:root[data-theme=nuit] .haut form.q:focus-within,:root[data-theme=nuit] input,:root[data-theme=nuit] select,:root[data-theme=nuit] textarea{background:var(--sf);color:var(--tx);border-color:var(--bd)}
:root[data-theme=nuit] .jours a{color:var(--tx)}
:root[data-theme=nuit] .haut{background:var(--nu);border-color:var(--bd)}
:root[data-theme=nuit] .haut nav.sous{background:var(--sf);border-color:var(--bd)}
:root[data-theme=nuit] .haut nav.esp a.on,:root[data-theme=nuit] .haut .r2 nav a.on{background:#13302f;color:var(--lk-n)}
:root[data-theme=nuit] .haut nav.sous a[aria-current],:root[data-theme=nuit] .pill[aria-current],:root[data-theme=nuit] .ob-l a[aria-current],:root[data-theme=nuit] .ob-pied a[aria-current],
:root[data-theme=nuit] .haut .dd .lgs a[aria-current],:root[data-theme=nuit] .puces a.etat.ok,:root[data-theme=nuit] .cg-puce[aria-pressed=true]{background:var(--lk-n);border-color:var(--lk-n);color:#0b1117}
:root[data-theme=nuit] .haut nav.sous a[aria-current] em{background:#0b1117;color:var(--lk-n)}
:root[data-theme=nuit] nav.onglets{background:var(--sf);border-color:var(--bd)}
:root[data-theme=nuit] nav.onglets a[aria-current]{color:var(--lk-n)}
:root[data-theme=nuit] nav.onglets a[aria-current] i{background:#13302f}
:root[data-theme=nuit] .av{background:#13302f;color:var(--lk-n)}
:root[data-theme=nuit] .av.v{background:#241c3d;color:#c4a7ff}
:root[data-theme=nuit] .ac-ic{color:#e6edf3}
:root[data-theme=nuit] .ac-ic::before{filter:brightness(.42) saturate(1.3)}
:root[data-theme=nuit] .seance .h{color:var(--lk-n)}
:root[data-theme=nuit] table,:root[data-theme=nuit] th,:root[data-theme=nuit] td{border-color:var(--bd)}
:root[data-theme=nuit] .q-sug,:root[data-theme=nuit] .dd,:root[data-theme=nuit] details>div,:root[data-theme=nuit] dialog{background:var(--sf);color:var(--tx);border-color:var(--bd)}
/* couleurs ecrites dans les gabarits */
:root[data-theme=nuit] [style*="background:#fff"],:root[data-theme=nuit] [style*="background: #fff"],:root[data-theme=nuit] [style*="background:white"]{background:var(--sf)!important}
:root[data-theme=nuit] [style*="background:#f1f1f1"],:root[data-theme=nuit] [style*="background:#e9ebef"],:root[data-theme=nuit] [style*="background:#f7f7f7"],:root[data-theme=nuit] [style*="background:#fafafa"]{background:var(--sf2)!important}
:root[data-theme=nuit] [style*="color:#111"],:root[data-theme=nuit] [style*="color:#000"],:root[data-theme=nuit] [style*="color:#22171a"],:root[data-theme=nuit] [style*="color:#1b212c"]{color:var(--tx)!important}
:root[data-theme=nuit] [style*="color:#555"],:root[data-theme=nuit] [style*="color:#64748b"],:root[data-theme=nuit] [style*="color:#5b6b7c"]{color:var(--mu)!important}
:root[data-theme=nuit] [style*="background:#e6f4ec"]{background:var(--okf)!important}
:root[data-theme=nuit] [style*="background:#fdf0de"]{background:var(--atf)!important}
:root[data-theme=nuit] [style*="background:#fbe7e7"]{background:var(--rgf)!important}
:root[data-theme=nuit] [style*="background:#ece6f7"]{background:#241c3d!important}
:root[data-theme=nuit] [style*="color:#4b3a8a"]{color:#c4a7ff!important}
:root[data-theme=nuit] [style*="color:#1d6b3a"]{color:var(--ok)!important}
:root[data-theme=nuit] [style*="color:#8f1d1d"],:root[data-theme=nuit] [style*="color:#b42318"]{color:var(--rg)!important}
/* accueil style 19 */
:root[data-theme=nuit] body.v19{background:var(--fd)}
:root[data-theme=nuit] .r19,:root[data-theme=nuit] .r19-liste{--r19-fd:#0b1117;--r19-carte:#141d26;--r19-bd:#233140;--r19-ln:#1f2b38;--r19-tx:#e6edf3;--r19-mu:#8b9bab;--r19-cap:#a9b7c4}
:root[data-theme=nuit] .r19-side{border-color:var(--bd)}
:root[data-theme=nuit] .r19-sb:hover,:root[data-theme=nuit] .r19-sb:focus-visible{background:#1b2733}
:root[data-theme=nuit] .r19-sb.on,:root[data-theme=nuit] .r19-dd,:root[data-theme=nuit] .r19-sug,:root[data-theme=nuit] .r19-it,:root[data-theme=nuit] .r19-b,
:root[data-theme=nuit] .r19-dlg .dlg-b summary.btn,:root[data-theme=nuit] .r19-sub2>div,:root[data-theme=nuit] .r19-filtre,:root[data-theme=nuit] .r19-tb td,
:root[data-theme=nuit] .r19-lists a,:root[data-theme=nuit] .r19-unp>*,:root[data-theme=nuit] .r19-tb tr,:root[data-theme=nuit] .r19-rac a{background:var(--sf);color:var(--tx);border-color:var(--bd)}
:root[data-theme=nuit] .r19-sug a[aria-selected=true],:root[data-theme=nuit] .r19-sug a:hover,:root[data-theme=nuit] .r19-sq{background:#1b2733}
:root[data-theme=nuit] .r19-hero{border-color:var(--bd);background:radial-gradient(ellipse 60% 70% at 30% 0%,rgba(94,234,212,.10),transparent 70%),linear-gradient(180deg,#111a22,#0b1117)}
:root[data-theme=nuit] .r19-q{background:linear-gradient(#141d26,#141d26) padding-box,linear-gradient(90deg,#1f4a46,#5eead4,#1f4a46) border-box;box-shadow:none}
:root[data-theme=nuit] .r19-campus select,:root[data-theme=nuit] .r19-chips a{background:#141d26;border-color:var(--bd);color:var(--tx)}
:root[data-theme=nuit] .r19-gauge{background:linear-gradient(180deg,#12231c,#141d26)}
:root[data-theme=nuit] .r19-note{background:#1b2733;border-color:var(--bd)}
:root[data-theme=nuit] .r19-ok,:root[data-theme=nuit] .r19-chip.ok{background:var(--okf);color:var(--ok)}
:root[data-theme=nuit] .r19-chip.pe{background:var(--atf);color:var(--at)}
:root[data-theme=nuit] .r19-chip.ur{background:var(--rgf);color:var(--rg)}
:root[data-theme=nuit] .r19-chip.ne{background:#1b2733;color:var(--mu)}
:root[data-theme=nuit] .r19-b.p,:root[data-theme=nuit] .r19-lgs a[aria-current]{background:var(--lk-n);border-color:var(--lk-n);color:#0b1117}
:root[data-theme=nuit] .r19-va{color:var(--at)}
:root[data-theme=nuit] a.r19-kpi:hover{border-color:var(--lk-n)}
:root[data-theme=nuit] .ap-ic a{background:var(--sf);border-color:var(--bd);color:var(--tx)}
}
/* blancs des feuilles de style propres aux pages (fiche eleve, absences, journaux, outils) ; les QR codes et logos restent sur blanc */
@media screen{
:root[data-theme=nuit] .fe-sec,:root[data-theme=nuit] .au-sec,:root[data-theme=nuit] .au-seg,:root[data-theme=nuit] .box,:root[data-theme=nuit] .vide,:root[data-theme=nuit] .opt span,
:root[data-theme=nuit] .he-ty span,:root[data-theme=nuit] .jx-f input,:root[data-theme=nuit] .jx-f select,:root[data-theme=nuit] .outils a,:root[data-theme=nuit] .outils button,
:root[data-theme=nuit] .outils input,:root[data-theme=nuit] .outils select,:root[data-theme=nuit] .outils .mdl,:root[data-theme=nuit] .v19-prof .l,:root[data-theme=nuit] .apg-go.sec,
:root[data-theme=nuit] .mode a.on,:root[data-theme=nuit] .tk,:root[data-theme=nuit] .rc .lien-donne,:root[data-theme=nuit] kbd{background:var(--sf);color:var(--tx);border-color:var(--bd)}
:root[data-theme=nuit] .fe-sec h2,:root[data-theme=nuit] .fe-sec h3{color:var(--tx)}
}
@media screen{
:root[data-theme=nuit] .fr-flt input:checked+label{background:var(--lk-n);border-color:var(--lk-n);color:#0b1117}
:root[data-theme=nuit] .fr-kpi:hover,:root[data-theme=nuit] .fr-kpi:focus-visible{border-color:var(--lk-n)}
}
/* 29/10/2026 (tour de tous les roles) : bloc « mes pointages » de l'enseignant (_pointages19.html), bouton d'appel */
@media screen{
:root[data-theme=nuit] .v19-prof{background:var(--sf);border-color:var(--bd)}
:root[data-theme=nuit] .v19-prof h2{color:var(--mu)}
:root[data-theme=nuit] .v19-prof .l{background:var(--sf2);border-color:var(--bd);color:var(--tx)}
:root[data-theme=nuit] .v19-prof .ok{background:var(--okf);color:var(--ok)}:root[data-theme=nuit] .v19-prof .ur{background:var(--rgf);color:var(--rg)}:root[data-theme=nuit] .v19-prof .pe{background:var(--atf);color:var(--at)}
:root[data-theme=nuit] .apg-go{color:#0b1117;background:var(--lk-n)}
:root[data-theme=nuit] .fr-flt input:checked+label,:root[data-theme=nuit] .btn{color:#0b1117}
}
@media screen{:root[data-theme=nuit] .og a[aria-current]{background:var(--lk-n);color:#0b1117}}
