/* Charte CO d'Octodure : fond gris clair, gris anthracite, bleu du logo */
:root {
  --fond: #fafafa; --carte: #ffffff; --texte: #4a4a4a; --titre: #555555;
  --bleu: #0195e3; --bleu-fonce: #0065a9; --ligne: #d9d9d9;
  --rouge: #c62828; --rouge-fond: #fdecea; --orange: #e67e00; --orange-fond: #fff4e0;
  --bleu-fond: #e6f4fc; --vert: #2e7d32; --vert-fond: #e8f5e9;
  --police: "DIN Next LT Pro", "DIN Pro", "DIN", "Barlow", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-weight: 400;
       font-size: 16px; line-height: 1.45; letter-spacing: .01em; }
a { color: var(--bleu-fonce); }
h1, h2, h3 { font-weight: 300; color: var(--titre); letter-spacing: .02em; margin: .2em 0 .5em; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }

/* En-tete */
.tete { display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto;
        padding: 22px 24px 10px; }
.tete .titre { font-size: 2.3rem; font-weight: 300; color: var(--titre); letter-spacing: .03em; line-height: 1.1;
               text-shadow: 0 3px 6px rgba(0,0,0,.18); }
.tete .sous-titre { font-size: 1.6rem; font-weight: 300; color: var(--bleu-fonce); text-shadow: 0 3px 6px rgba(0,0,0,.15); }
.tete .logo { height: 64px; }

/* Onglets : trait fin en haut, trait epais bleu pour l'onglet actif */
.onglets { display: flex; flex-wrap: wrap; gap: 0 28px; align-items: flex-start; max-width: 1240px; margin: 0 auto 18px;
           padding: 0 24px; }
.onglets a { display: block; min-width: 120px; padding: 10px 14px 4px; border-top: 1px solid #555; text-align: center;
             text-decoration: none; color: var(--texte); font-size: 1.05rem; letter-spacing: .04em; }
.onglets a:hover { color: var(--bleu-fonce); }
.onglets a.actif { border-top: 5px solid var(--bleu-fonce); padding-top: 6px; color: var(--bleu-fonce); }
.tete .droite { text-align: right; }
.tete .util { font-size: .9rem; margin-top: 4px; }
.tete .util a { color: var(--texte); text-decoration: none; }
.tete .util button.lien { padding: 0; font-size: .9rem; }
@media (max-width: 1100px) { .onglets { gap: 0 12px; } .onglets a { min-width: 0; } }

main { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; }
.centre main { max-width: 480px; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 4px; padding: 18px 20px; margin-bottom: 18px; }
.etroite { max-width: 460px; margin: 30px auto; }
.grille2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .grille2 { grid-template-columns: 1fr; } .tete .titre { font-size: 1.7rem; } .tete .logo { height: 44px; } }
.titre-ligne { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Formulaires */
label { display: block; margin: 0 0 12px; font-size: .92rem; color: var(--titre); }
label.case { display: flex; gap: 8px; align-items: center; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #bdbdbd; border-radius: 3px; background: #fff; color: var(--texte); }
label > input:not([type=checkbox]), label > select { display: block; width: 100%; margin-top: 4px; }
button, .bouton { font: inherit; background: var(--bleu-fonce); color: #fff; border: 1px solid var(--bleu-fonce); border-radius: 3px;
                  padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-block; letter-spacing: .03em; }
button:hover, .bouton:hover { background: var(--bleu); border-color: var(--bleu); }
button.sec, .bouton.sec { background: #fff; color: var(--bleu-fonce); }
button.sec:hover, .bouton.sec:hover { background: var(--bleu-fond); }
button.danger { color: var(--rouge); border-color: var(--rouge); }
button.lien { background: none; border: none; color: var(--texte); padding: 10px 6px 4px; font-size: .95rem; }
button.lien:hover { color: var(--bleu-fonce); background: none; }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
.ligne-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ligne-form label { margin-bottom: 0; }
.actions form { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.actions button, .actions select, .actions input { padding: 4px 8px; font-size: .85rem; }
.motif { width: 110px; }

/* Messages */
.flash { padding: 10px 14px; border-radius: 3px; margin-bottom: 14px; }
.flash.ok { background: var(--vert-fond); border-left: 4px solid var(--vert); }
.flash.err { background: var(--rouge-fond); border-left: 4px solid var(--rouge); }
.alerte { padding: 10px 14px; border-radius: 3px; margin-bottom: 14px; }
.alerte.n1 { background: var(--rouge-fond); border-left: 5px solid var(--rouge); }
.alerte.n2 { background: var(--orange-fond); border-left: 5px solid var(--orange); }
.alerte.n3 { background: var(--bleu-fond); border-left: 5px solid var(--bleu); }
.petit { font-size: .85rem; color: #777; }
.rouge { color: var(--rouge); }
.cle-totp { font-family: Consolas, monospace; font-size: 1.3rem; letter-spacing: .12em; background: #f1f1f1; padding: 10px; text-align: center; border-radius: 3px; }
.pastille { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #eee; font-size: .85rem; }
.pastille.ok { background: var(--vert-fond); color: var(--vert); }

/* Badges allergies / regimes : 1 rouge, 2 orange, 3 bleu */
.badge { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 3px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.badge.n1 { background: var(--rouge); color: #fff; }
.badge.n2 { background: var(--orange); color: #fff; }
.badge.n3 { background: var(--bleu-fond); color: var(--bleu-fonce); border: 1px solid var(--bleu); }
.badge small { font-weight: 400; }

/* Tableaux */
table.liste { width: 100%; border-collapse: collapse; }
.liste th { text-align: left; font-weight: 400; color: #777; border-bottom: 2px solid var(--ligne); padding: 6px 8px; font-size: .9rem; }
.liste td { border-bottom: 1px solid #eee; padding: 6px 8px; vertical-align: top; }
.liste tr.annule td { text-decoration: line-through; color: #aaa; }
.liste tr.annule td.actions { text-decoration: none; }
.liste tr.termine td { color: #aaa; }
.liste tr.ligne-n1 td:first-child { box-shadow: inset 4px 0 var(--rouge); }
.liste tr.ligne-n2 td:first-child { box-shadow: inset 4px 0 var(--orange); }

/* Ecran cuisine (tablette) */
.cuisine main { max-width: 1400px; }
.compteur { font-size: 1.2rem; }
.attention { background: var(--rouge-fond); border: 2px solid var(--rouge); border-radius: 4px; padding: 12px 16px; margin-bottom: 16px; }
.attention h2 { color: var(--rouge); font-weight: 600; margin-top: 0; }
.att-ligne { padding: 6px 0; border-bottom: 1px solid #f3c6c2; font-size: 1.1rem; }
.att-ligne:last-child { border-bottom: none; }
.aide { color: #777; }
.grille-eleves { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tuile { background: #fff; color: var(--texte); border: 2px solid var(--ligne); border-radius: 6px; padding: 12px; text-align: left;
         min-height: 92px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.tuile:hover { background: #fff; border-color: var(--bleu); }
.tuile .nom { font-size: 1.1rem; font-weight: 600; }
.tuile .classe { font-size: .85rem; color: #888; }
.tuile .etat { font-weight: 700; color: var(--rouge); }
.tuile.bord-n1 { border-left: 8px solid var(--rouge); }
.tuile.bord-n2 { border-left: 8px solid var(--orange); }
.tuile.absent { background: #eee; opacity: .75; }
.tuile.absent .nom { text-decoration: line-through; }
.tuile.envoi { opacity: .5; }
.onglets-service { display: flex; gap: 6px; }
.valider { margin-top: 22px; text-align: center; }
button.gros { font-size: 1.2rem; padding: 16px 28px; background: var(--vert); border-color: var(--vert); }
button.gros:hover { background: #388e3c; }

/* Impression */
.impression { background: #fff; padding: 10px 20px; font-size: 12px; }
.impression h1 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.cadre-attention { border: 2px solid #000; padding: 6px 10px; margin: 8px 0; }
.page { page-break-after: always; }
@media print {
  .non-imprime { display: none; }
  .badge.n1 { border: 1px solid #000; }
}

/* ================= Salle des Alambics ================= */
.pastille.attention { background: var(--orange-fond); color: var(--orange); }
.vert { color: var(--vert); }
.petit.rouge, td.rouge { color: var(--rouge); }
.centre-texte { text-align: center; }
h2.inline { display: inline; }
summary { cursor: pointer; }
textarea { width: 100%; margin-top: 4px; }
textarea.mono { font-family: Consolas, "Courier New", monospace; font-size: .92rem; }
.champs4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 10px; }
@media (max-width: 700px) { .champs4 { grid-template-columns: 1fr 1fr; } }
.droite-bas { text-align: right; margin-top: 10px; }
body.evenement .grille2 { grid-template-columns: 3fr 2fr; }
table.classes input, table.classes select { width: 100%; padding: 4px 6px; font-size: .88rem; }
table.classes input.court { width: 58px; } table.classes input.moyen { width: 92px; }
table.classes td { padding: 4px; vertical-align: middle; }

/* Plan */
.plan-zone { display: grid; grid-template-columns: 1fr 270px; gap: 18px; align-items: start; }
@media (max-width: 1150px) { .plan-zone { grid-template-columns: 1fr; } }
.salle { overflow-x: auto; padding: 14px 10px; }
label.case > input[type=radio], label.case > input[type=checkbox] { display: inline-block; width: auto; margin: 0; flex: none; }
.scene { text-align: center; background: #555; color: #fff; letter-spacing: .4em; padding: 6px; border-radius: 0 0 40% 40% / 0 0 18px 18px;
         margin: 0 auto 14px; max-width: 70%; font-size: .9rem; }
.rang { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.rang .lettre { width: 18px; text-align: center; font-weight: 600; color: #888; flex: none; }
.rang .sieges { display: flex; justify-content: center; gap: 2px; flex: 1; }
.rang .sieges > .vide { width: 36px; flex: none; }
.impr-plan .rang .sieges > .vide { width: 30px; }
.couloir { height: 14px; margin: 4px 24px; background: #9e9e9e; border-radius: 2px; }
.impr-plan .couloir { height: 8px; margin: 3px 16px; }
.scene-bas { border-radius: 40% 40% 0 0 / 18px 18px 0 0; margin: 14px auto 0; }
.rang.rang-libre .siege:not([class*=" c-"]) { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #eee 3px, #eee 6px); }
.siege { width: 36px; height: 30px; padding: 1px; border: 1px solid #bbb; border-radius: 4px 4px 2px 2px; background: #fff; color: #999;
         display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; cursor: pointer; flex: none; }
.siege:hover { border-color: var(--bleu-fonce); background-color: inherit; filter: brightness(.95); }
.siege .nu { font-size: 13px; font-weight: 600; color: #333; }
.siege[class*=" c-"] { border-color: rgba(0,0,0,.35); }
.siege.prof { box-shadow: inset 0 0 0 2px #333; }
.siege.prof .nu { color: #000; }
.siege.verrou { border: 3px solid #000; }
.siege.inactif { opacity: .25; cursor: not-allowed; }
.siege.choisi { outline: 3px solid var(--bleu); outline-offset: 1px; }
.siege.envoi { opacity: .5; }
.outils .modes label { margin-bottom: 6px; }
.outils .sous-mode { display: flex; gap: 6px; margin: 0 0 8px 24px; }
.outils .sous-mode select { padding: 4px; font-size: .9rem; }
.legende { list-style: none; padding: 0; margin: 0 0 14px; }
.legende li { margin-bottom: 8px; font-size: .92rem; }
.pastille-couleur { display: inline-block; width: 14px; height: 14px; border: 1px solid rgba(0,0,0,.35); border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* Impression du plan (A4 paysage) */
.impression-plan { background: #fff; padding: 10px 16px; font-size: 11px; color: #222; }
.impr-tete { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #333; margin-bottom: 8px; }
.impr-tete h1 { font-size: 20px; font-weight: 600; margin: 0; color: #222; }
.impr-sous { margin: 2px 0 6px; font-size: 12px; }
.impr-infos { text-align: right; font-size: 12px; }
.impr-corps { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.impr-plan .siege { width: 30px; height: 17px; cursor: default; border-radius: 3px 3px 1px 1px; }
.impr-plan .siege .nu { font-size: 10px; }
.impr-plan .rang { margin-bottom: 1px; gap: 3px; } .impr-plan .rang .lettre { width: 12px; font-size: 10px; }
.impr-plan .scene { font-size: 10px; padding: 3px; margin-bottom: 8px; }
.impr-legende table { border-collapse: collapse; width: 100%; }
.impr-legende th { text-align: left; border-bottom: 1px solid #333; padding: 2px 4px; font-weight: 600; }
.impr-legende td { border-bottom: 1px solid #ddd; padding: 2px 4px; vertical-align: top; }
.impr-legende h2 { font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: #222; }
.impr-texte { font-size: 10.5px; }
@page { size: A4 landscape; margin: 8mm; }
@media print {
  .impression-plan { padding: 0; }
  .siege, .pastille-couleur { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Bandeau du nom des classes entre les rangees */
.rang.bandeau { margin: 6px 0 2px; }
.rang.bandeau .vide { width: 36px; flex: none; }
.etiquette-classe { flex: none; display: block; text-align: center; font-weight: 700; font-size: 14px; letter-spacing: .03em; color: #222;
  padding: 2px 4px; border-radius: 4px; border: 1px solid rgba(0,0,0,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.impr-plan .rang.bandeau { margin: 2px 0 1px; } .impr-plan .rang.bandeau .vide { width: 30px; }
.impr-plan .etiquette-classe { font-size: 10px; padding: 0 3px; line-height: 13px; }
@media print { .etiquette-classe { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.span-1 { width: 36px; } .impr-plan .span-1 { width: 30px; }
.span-2 { width: 74px; } .impr-plan .span-2 { width: 62px; }
.span-3 { width: 112px; } .impr-plan .span-3 { width: 94px; }
.span-4 { width: 150px; } .impr-plan .span-4 { width: 126px; }
.span-5 { width: 188px; } .impr-plan .span-5 { width: 158px; }
.span-6 { width: 226px; } .impr-plan .span-6 { width: 190px; }
.span-7 { width: 264px; } .impr-plan .span-7 { width: 222px; }
.span-8 { width: 302px; } .impr-plan .span-8 { width: 254px; }
.span-9 { width: 340px; } .impr-plan .span-9 { width: 286px; }
.span-10 { width: 378px; } .impr-plan .span-10 { width: 318px; }
.span-11 { width: 416px; } .impr-plan .span-11 { width: 350px; }
.span-12 { width: 454px; } .impr-plan .span-12 { width: 382px; }
.span-13 { width: 492px; } .impr-plan .span-13 { width: 414px; }
.span-14 { width: 530px; } .impr-plan .span-14 { width: 446px; }
.span-15 { width: 568px; } .impr-plan .span-15 { width: 478px; }
.span-16 { width: 606px; } .impr-plan .span-16 { width: 510px; }
.span-17 { width: 644px; } .impr-plan .span-17 { width: 542px; }
.span-18 { width: 682px; } .impr-plan .span-18 { width: 574px; }
.span-19 { width: 720px; } .impr-plan .span-19 { width: 606px; }
.span-20 { width: 758px; } .impr-plan .span-20 { width: 638px; }
.span-21 { width: 796px; } .impr-plan .span-21 { width: 670px; }
tr.autres-adultes td { border-bottom: 2px solid var(--ligne); padding-top: 0; }
.adulte { display: inline-flex; gap: 4px; align-items: center; margin: 2px 12px 2px 0; }
table.classes .adulte input { width: 170px; } table.classes .adulte select { width: auto; }
.adulte label.case { margin: 0; }
.adulte.ajout { color: #888; }
table.classes td:nth-child(4) input { min-width: 150px; }
.impr-legende td { font-size: 10px; }
img.illustration { display: block; max-width: 100%; max-height: 220px; border-radius: 4px; border: 1px solid var(--ligne); margin: 4px 0 6px; }
.liste td.actions .bouton { padding: 5px 10px; font-size: .88rem; margin: 1px 0; }
.liste td.actions form.inline button { padding: 5px 10px; font-size: .88rem; }

/* ================= Module Enseignants ================= */
.champs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.etroite.large { max-width: 640px; }
fieldset.jours { border: 1px solid var(--ligne); border-radius: 3px; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; }
fieldset.jours label { margin: 0; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
label.inline input { width: auto; display: inline-block; margin: 0; }
.alerte { padding: 10px 14px; border-radius: 3px; margin-bottom: 14px; }
.alerte.n1 { background: var(--rouge-fond); border-left: 4px solid var(--rouge); }
table.semaine { table-layout: fixed; }
table.semaine th { text-align: center; }
table.semaine th.gauche { text-align: left; width: 150px; color: var(--titre); font-weight: 600; }
table.semaine th.aujourdhui { color: var(--bleu-fonce); font-weight: 700; }
table.semaine td.cellule { padding: 4px; }
a.etude { display: block; padding: 8px 10px; border-radius: 4px; text-decoration: none; color: var(--texte); background: var(--vert-fond);
          border-left: 4px solid var(--vert); line-height: 1.3; }
a.etude:hover { filter: brightness(.96); }
a.etude .h { display: block; font-size: .78rem; color: #777; }
a.etude strong { display: block; }
a.etude .petit { display: block; }
a.etude.remplace { background: var(--bleu-fond); border-left-color: var(--bleu-fonce); }
a.etude.annule { background: #eee; border-left-color: #999; }
a.etude.a_trouver, a.etude.sans_titulaire { background: var(--rouge-fond); border-left-color: var(--rouge); }
.liste tr.ligne-n1 td:first-child { box-shadow: inset 4px 0 var(--rouge); }
table.decompte td.nb, table.decompte th.nb { text-align: right; white-space: nowrap; }
table.decompte tfoot th { border-top: 2px solid var(--ligne); padding: 8px; color: var(--titre); font-weight: 700; }
@media print { .onglets, .tete .util, .non-imprime, form.inline { display: none !important; } }

/* ================= Fiche de paiement des surveillances ================= */
.fiche-paie { max-width: 760px; margin: 0 auto; background: #fff; padding: 24px 28px; border: 1px solid #ddd; }
.fiche-tete { display: flex; justify-content: space-between; border-bottom: 1px solid #333; padding-bottom: 4px; margin-bottom: 18px; }
.fiche-paie h1 { text-align: center; text-decoration: underline; font-size: 1.35rem; margin: 6px 0 4px; }
.fiche-nom { text-align: center; margin: 0 0 16px; }
.fiche-paie h2 { text-decoration: underline; font-size: 1.1rem; margin: 18px 0 6px; }
.fiche-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fiche-table td, .fiche-table th { padding: 3px 6px; border-bottom: 1px solid #eee; text-align: left; }
.fiche-table .nb { text-align: right; white-space: nowrap; }
.fiche-table tfoot th { border-top: 1px solid #333; border-bottom: none; }
.fiche-total { margin-top: 20px; font-size: 1rem; }
.fiche-total tr.fort th { border-top: 2px solid #333; border-bottom: 3px double #333; font-size: 1.05rem; }
.fiche-visa { margin-top: 36px; font-size: .9rem; color: #444; }
@media print {
  body.fiche .tete, body.fiche .onglets, body.fiche .flash { display: none; }
  .fiche-paie { border: none; padding: 0; max-width: none; }
}

/* ================= Personnel : anniversaires et affiche ================= */
.anniv-semaine { border-left: 6px solid #f4a261; }
ul.colonnes { columns: 2; padding-left: 18px; }
.affiche-outils { margin-bottom: 12px; }
.affiche-page { background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.15); max-width: 1100px; margin: 0 auto; }
.affiche-svg { display: block; width: 100%; height: auto; }
.aff-titre { font-family: "Segoe Print", "Comic Sans MS", "Chalkboard SE", cursive; font-size: 120px; font-weight: 700; }
.aff-nom { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; font-weight: 700; }
.aff-date { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; font-size: 46px; font-weight: 600; }
.aff-msg { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; font-size: 34px; font-style: italic; }
.aff-pied { font-family: Arial, sans-serif; font-size: 18px; }
@media print {
  @page { size: A4 landscape; margin: 6mm; }
  body.affiche .tete, body.affiche .onglets, body.affiche .flash { display: none; }
  body.affiche main { padding: 0; margin: 0; max-width: none; }
  .affiche-page { box-shadow: none; max-width: none; }
  .affiche-svg { width: 100%; height: 190mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.aff-ballon { font-family: "Segoe Script", "Brush Script MT", "Comic Sans MS", cursive; font-size: 30px; font-weight: 700; }
.aff-c-date { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 110px; }
.aff-c-titre { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 118px; font-weight: 700; }
.aff-c-nom { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-weight: 700; }
.aff-c-date.periode { font-size: 62px; }
a.tel { white-space: nowrap; }
.contact-rapide { font-size: 1.15rem; margin: 0 0 14px; }

.sous-onglets { display: flex; flex-wrap: wrap; gap: 4px 6px; max-width: 1240px; margin: -8px auto 18px; padding: 0 0 10px; border-bottom: 1px solid #ddd; }
.sous-onglets a { padding: 5px 12px; border-radius: 14px; text-decoration: none; color: #333; background: #f0f2f5; font-size: .92rem; }
.sous-onglets a:hover { background: #e2e8f0; }
.sous-onglets a.actif { background: var(--bleu-fonce); color: #fff; }
@media print { .sous-onglets { display: none !important; } }
body.fiche .sous-onglets, body.affiche .sous-onglets { display: none; }

.retour { font-size: .88rem; color: #2e6b3a; white-space: nowrap; }
.retour.inconnu { color: #b35c00; font-weight: 600; }
label.case { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
label.case input { width: auto; margin-top: 3px; }
.pre { white-space: pre-line; }
.grille-inscr td { vertical-align: top; }
.inscr-ok { font-weight: 700; }
.inscr-non { color: #888; }
.grille-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.carte.chiffre { display: flex; flex-direction: column; gap: 4px; }
.carte.chiffre strong { font-size: 1.6rem; color: var(--bleu-fonce); }
tr.prevu td { color: #777; }
tr.a-suivre td { background: #fff4f2; }
a.colle { color: #c0392b; font-weight: 600; }
.bon-versement h1 { font-size: 1.3rem; }
.bon-lignes { list-style: '- '; margin: 6px 0 6px 18px; }
.bon-total { margin: 8px 0; }
.fiche-table.semestre th, .fiche-table.semestre td { border: 1px solid #999; padding: 4px 6px; text-align: center; }
.fiche-table.semestre td:first-child, .fiche-table.semestre th:first-child { text-align: left; }
.fiche-table.coord td { padding: 3px 6px; border-bottom: 1px dotted #aaa; }
p.centre { text-align: center; }
.defile { overflow-x: auto; }
table.recap th.nb { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .85em; padding: 6px 2px; vertical-align: bottom; }
table.recap td.nb { text-align: center; min-width: 1.6em; }
@media print { table.recap { font-size: 9pt; } }

/* ---------- Remplacements de cours ---------- */
.mois-choix a { display: inline-block; padding: 3px 9px; margin: 0 2px 4px 0; border: 1px solid var(--ligne); border-radius: 3px; text-decoration: none; color: var(--texte); background: #fff; }
.mois-choix a.actif { background: var(--bleu-fonce); color: #fff; border-color: var(--bleu-fonce); }
.mois-choix form.inline { margin-left: 10px; }
.liste tr.mois-titre td { background: var(--bleu-fond); color: var(--bleu-fonce); font-weight: 600; }
.petit-bouton { padding: 3px 10px; font-size: .8rem; }
button.pastille { border: none; cursor: pointer; }
.kpi { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.kpi > div { background: var(--bleu-fond); border-radius: 4px; padding: 8px 14px; min-width: 110px; font-size: .85rem; color: #555; }
.kpi b { display: block; font-size: 1.5rem; color: var(--bleu-fonce); font-weight: 600; }
.mono { font-family: Consolas, "Courier New", monospace; }
.defile { overflow-x: auto; }
table.horaire { border-collapse: collapse; width: 100%; table-layout: fixed; margin-bottom: 8px; }
table.horaire th, table.horaire td { border: 1px solid #999; padding: 3px 4px; vertical-align: top; font-size: .8rem; }
table.horaire thead th { text-align: center; font-weight: 400; background: #f5f5f5; }
table.horaire th.jour { width: 34px; font-size: 1.1rem; text-align: center; vertical-align: middle; background: #f5f5f5; }
table.horaire .per { font-weight: 600; }
table.horaire td.cours { height: 62px; background: #fff; }
table.horaire td.libre { background: #fafafa; }
table.horaire td span { display: block; line-height: 1.25; }
table.horaire td .g { float: left; font-weight: 600; }
table.horaire td .s { text-align: right; color: #555; }
table.horaire td .b { clear: both; font-size: 1.05rem; font-weight: 600; padding: 2px 0; }
table.horaire td .c { font-size: .7rem; color: #555; word-break: break-all; }
label.case-cours { display: block; cursor: pointer; margin: 0; font-weight: 400; }
label.case-cours input { float: right; width: auto; margin: 0 0 0 4px; }
table.horaire td.hachure { background: repeating-linear-gradient(45deg, #fff, #fff 5px, #9e9e9e 5px, #9e9e9e 7px); }
table.horaire td.hachure span { background: rgba(255,255,255,.85); }
/* saisie des grilles : un clic ajoute / enleve une periode */
table.saisie-horaire td.case-h { position: relative; height: 92px; min-width: 96px; padding: 0; background: #fafafa; }
table.saisie-horaire td.case-h:hover { background: #eef5fc; }
.case-h .bascule { position: absolute; inset: 0; margin: 0; cursor: pointer; }
.case-h .bascule .tog { position: absolute; opacity: 0; width: 1px; height: 1px; }
.case-h .etat-case { position: absolute; right: 5px; top: 3px; font-size: 1.1rem; color: #bbb; }
.case-h .etat-case::after { content: "+"; }
.case-h:has(.tog:checked) { background: #cfe3f5; }
.case-h:has(.tog:checked) .etat-case { color: var(--bleu-fonce); }
.case-h:has(.tog:checked) .etat-case::after { content: "✓"; }
.case-h:has(.tog:focus-visible) { outline: 2px solid var(--bleu-fonce); outline-offset: -2px; }
.case-h .details { display: none; position: relative; z-index: 1; padding: 20px 4px 4px; }
.case-h:has(.tog:checked) .details { display: block; }
.case-h .details input { width: 100%; padding: 2px 4px; margin-bottom: 2px; font-size: .78rem; }
.colonnes-noms { columns: 4 200px; column-gap: 20px; }
.colonnes-noms a { display: block; padding: 3px 0; text-decoration: none; color: var(--texte); break-inside: avoid; }
.colonnes-noms a .petit { display: block; }
.colonnes-noms a.sans { color: #aaa; }
.case-signature { min-width: 150px; }
/* fiche du remplacant */
.fiche-rempl { background: #fff; }
.fiche-tete { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.fiche-tete .logo { height: 56px; }
.fiche-titre { font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; color: #777; }
.fiche-nom { font-size: 1.6rem; font-weight: 600; color: var(--bleu-fonce); }
.fiche-blocs { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin: 12px 0; }
.fiche-bloc { border: 2px solid #333; border-radius: 4px; padding: 8px 10px; }
.fiche-bloc h3 { margin: 0 0 6px; font-size: .95rem; }
.signature { margin-top: 18px; border-top: 1px solid #999; padding-top: 10px; }
.sig-ligne { display: flex; justify-content: space-between; margin-top: 22px; }
.liste-eleves td:nth-child(n+3) { border-left: 1px solid #ddd; min-width: 60px; }
@media print {
  .onglets, .sous-onglets, .tete .util, .non-imprime, .flash { display: none !important; }
  .impression-fiche .tete { display: none; }
  table.horaire td.hachure, .kpi > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-avant { page-break-before: always; }
  .registre-cles td { padding: 10px 6px; }
}
@page paysage { size: A4 landscape; margin: 10mm; }
.fiche-rempl, .registre-cles { page: paysage; }

/* ---------- Notes de la direction (remplacants) ---------- */
.note-dir { border-left: 3px solid var(--bleu); padding: 4px 10px; margin-bottom: 8px; background: #fafcff; }
.pastille.avis-ok { background: var(--vert-fond); color: var(--vert); }
.pastille.avis-attention { background: var(--orange-fond); color: var(--orange); }
.pastille.avis-non { background: var(--rouge-fond); color: var(--rouge); }

/* Grille d'un remplacement : clic = cours remplace (bleu) */
table.horaire td.case-r { position: relative; cursor: pointer; background: #fff; }
table.horaire td.case-r:hover { background: #eef5fc; }
table.horaire td.case-r label.case-cours { position: static; }
table.horaire td.case-r label.case-cours::before { content: ""; position: absolute; inset: 0; }
table.horaire td.case-r .tog-r { position: absolute; opacity: 0; width: 1px; height: 1px; }
table.horaire td.case-r:has(.tog-r:checked) { background: #9cc8ee; }
table.horaire td.case-r:has(.tog-r:checked) span { color: #0b3a66; }
table.horaire td.case-r:has(.tog-r:focus-visible) { outline: 2px solid var(--bleu-fonce); outline-offset: -2px; }
table.horaire th.jour-bascule { cursor: pointer; }
table.horaire th.jour-bascule:hover { background: #cfe3f5; }

/* ---------- Module Salles ---------- */
table.occupation { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .75rem; }
table.occupation th, table.occupation td { border: 1px solid #ccc; padding: 3px 4px; vertical-align: top; overflow: hidden; }
table.occupation thead th { background: #f5f5f5; font-weight: 400; text-align: center; }
table.occupation th.salle-nom { width: 120px; text-align: left; background: #fafafa; font-weight: 600; }
table.occupation th.salle-nom a { color: var(--bleu-fonce); text-decoration: none; }
table.occupation td { height: 34px; line-height: 1.2; }
.occ-cours { background: #dbe9f7; }
.occ-externe { background: #fde2c2; }
.occ-intervention { background: #d4efd0; }
.occ-libre { background: #fff; }
td.occ-conflit, span.occ-conflit { box-shadow: inset 0 0 0 2px var(--rouge); }
.legende-occ span { display: inline-block; padding: 2px 10px; margin-right: 6px; border: 1px solid #ccc; border-radius: 3px; font-size: .8rem; }
label.inline-case { display: inline-flex; margin-right: 8px; }
.resa { border-left: 3px solid var(--orange); padding: 4px 10px; margin-bottom: 10px; }
.recap-occ { margin-bottom: 14px; }
.recap-occ h3 { margin: 6px 0 2px; font-size: 1.05rem; }
.recap-occ ul { margin: 4px 0; }
.seulement-imprime { display: none; }
option.gras { font-weight: 700; }
table.planning td.libre { background: #fff; }
table.planning td.suite-interv { background: #eef6ec; }
table.planning .creneau { font-size: .85rem; margin-bottom: 2px; }
.planning-entete { font-size: 1rem; }
@media print {
  .seulement-imprime { display: block; }
  .occ-cours, .occ-externe, .occ-intervention, table.planning td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .planning-semaine { page-break-inside: avoid; }
}

/* ---- Module Agenda ---- */
.large main { max-width: none; }
.seulement-imprime { display: none; }
table.ag-annee { border-collapse: collapse; font-size: .72rem; width: 100%; table-layout: fixed; margin-bottom: 18px; }
table.ag-annee th, table.ag-annee td { border: 1px solid #c9d3df; padding: 1px 3px; vertical-align: top; line-height: 1.2; }
table.ag-annee th.ag-mois { background: #0f5ea8; color: #fff; font-size: .85rem; text-transform: capitalize; }
table.ag-annee th.ag-mom { font-weight: normal; color: #555; background: #eef3f8; }
table.ag-annee td.ag-num { width: 1.9em; text-align: right; color: #333; }
table.ag-annee td.ag-dow { width: 1.7em; color: #666; }
table.ag-annee td.ag-case { overflow: hidden; word-wrap: break-word; }
table.ag-annee td.ag-case a { color: inherit; text-decoration: none; }
table.ag-annee td.ag-case a:hover { text-decoration: underline; }
table.ag-annee .ag-ajout { display: block; color: transparent !important; text-align: center; }
table.ag-annee td.ag-case:hover .ag-ajout { color: #0f5ea8 !important; }
table.ag-annee .ag-we { background: #e3e3e3; }
table.ag-annee .ag-vac { background: repeating-linear-gradient(45deg, #f1f1f1, #f1f1f1 4px, #dcdcdc 4px, #dcdcdc 8px); }
table.ag-annee td.ag-vide { background: #fafafa; border-color: #eee; }
table.ag-annee td.ag-auj { background: #0f5ea8; color: #fff; font-weight: bold; }
.ag-legende { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ag-filtre { display: inline-block; padding: 2px 9px; border: 1px solid #bbb; border-radius: 3px; font-size: .85rem; color: #222; text-decoration: none; }
.ag-filtre.actif { outline: 2px solid #0f5ea8; outline-offset: 1px; font-weight: bold; }
.ag-filtre.ag-vac { background: repeating-linear-gradient(45deg, #f1f1f1, #f1f1f1 4px, #dcdcdc 4px, #dcdcdc 8px); }
.ag-choix { padding: 2px 8px; border-radius: 3px; border: 1px solid #ccc; margin: 2px 0; }
.ag-c-jaune { background: #ffff00; } .ag-c-orange { background: #ffc000; } .ag-c-bleu { background: #0070c0; color: #fff !important; }
.ag-c-bleu a { color: #fff !important; }
.ag-c-rose { background: #ff99ff; } .ag-c-bleu-clair { background: #9dc3e6; } .ag-c-vert { background: #92d050; }
.ag-c-peche { background: #f8cbad; } .ag-c-ciel { background: #c9e4f8; } .ag-c-magenta { background: #f11bb9; color: #fff !important; }
.ag-c-magenta a { color: #fff !important; }
.ag-c-violet { background: #c9b3e6; } .ag-c-gris { background: #d0cece; } .ag-c-rouge { background: #ff7c80; }
.ag-c-vert-clair { background: #c6efce; } .ag-c-beige { background: #fff2cc; } .ag-c-blanc { background: #fff; }
.ag-b-jaune { box-shadow: inset 5px 0 0 #ffff00; } .ag-b-orange { box-shadow: inset 5px 0 0 #ffc000; } .ag-b-bleu { box-shadow: inset 5px 0 0 #0070c0; }
.ag-b-rose { box-shadow: inset 5px 0 0 #ff99ff; } .ag-b-bleu-clair { box-shadow: inset 5px 0 0 #9dc3e6; } .ag-b-vert { box-shadow: inset 5px 0 0 #92d050; }
.ag-b-peche { box-shadow: inset 5px 0 0 #f8cbad; } .ag-b-ciel { box-shadow: inset 5px 0 0 #9fcdef; } .ag-b-magenta { box-shadow: inset 5px 0 0 #f11bb9; }
.ag-b-violet { box-shadow: inset 5px 0 0 #a585d4; } .ag-b-gris { box-shadow: inset 5px 0 0 #a6a6a6; } .ag-b-rouge { box-shadow: inset 5px 0 0 #ff4f55; }
.ag-b-vert-clair { box-shadow: inset 5px 0 0 #8fd19e; } .ag-b-beige { box-shadow: inset 5px 0 0 #f2d888; }
.ag-statut { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .85rem; background: #eef3f8; }
.ag-statut.ag-st-a_planifier { background: #fde2c2; } .ag-statut.ag-st-planifie { background: #dbe9f7; } .ag-statut.ag-st-fait { background: #d4efd0; }
table.ag-taches tr.ag-st-fait td { color: #888; } table.ag-taches tr.ag-st-fait strong { text-decoration: line-through; }
table.ag-taches tr.ag-st-a_planifier td:first-child { box-shadow: inset 4px 0 0 #f0a050; }
table.ag-taches tr.ag-st-planifie td:first-child { box-shadow: inset 4px 0 0 #0f5ea8; }
input.court { width: 4.5em; }
@page paysage { size: A4 landscape; margin: 8mm; }
@media print {
  .ag-bloc { page: paysage; page-break-after: always; }
  .seulement-imprime { display: block; font-size: 12pt; margin: 0 0 4px; }
  table.ag-annee { font-size: 6.5pt; }
  table.ag-annee .ag-ajout { display: none; }
  .ag-c-jaune, .ag-c-orange, .ag-c-bleu, .ag-c-rose, .ag-c-bleu-clair, .ag-c-vert, .ag-c-peche, .ag-c-ciel, .ag-c-magenta, .ag-c-violet, .ag-c-gris,
  .ag-c-rouge, .ag-c-vert-clair, .ag-c-beige, .ag-we, .ag-vac, th.ag-mois, [class*="ag-b-"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .large main { padding: 0; }
}

/* ---- Agenda v2 / seances ---- */
table.ag-annee td.ag-case { white-space: nowrap; text-overflow: ellipsis; max-width: 0; }
.sal-alerte { color: #b00020; }
