/* Cours de théâtre – même organisation que la compta (menu latéral, tableaux denses), teinte bordeaux. */
:root {
  --fond: #f5f4f2;
  --surface: #ffffff;
  --texte: #1f1d1c;
  --discret: #686260;
  --bordure: #e5e1de;
  --accent: #8c1c24;
  --accent-fort: #8c1c24;
  --tete: #8c1c24;
  --tete-texte: #ffffff;
  --vert: #c6efce; --vert-texte: #1d5a2c;
  --orange: #fce4d6; --orange-texte: #8a3d0c;
  --jaune: #fff2cc; --jaune-texte: #6b4e00;
  --gris: #ecebea;
  --alerte: #b4441c;
  --barre: #241c1c; --barre-texte: #ffffff; --barre-doux: #c2b6b4; --barre-actif: #3a2c2c; --barre-trait: #4a3a3a;
  --barre-accent: #e0a36f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #121011; --surface: #1c191a; --texte: #ece7e5; --discret: #a8a09d; --bordure: #2e2829;
    --accent: #e48a8f; --accent-fort: #9a2a33; --tete: #2c2224; --tete-texte: #eadcdb;
    --vert: #1f4d2b; --vert-texte: #bfe8c9; --orange: #5a3a26; --orange-texte: #f6d2b7; --jaune: #4d4118; --jaune-texte: #f3e3b0; --gris: #2a2627;
    --alerte: #f08a5d; --barre: #0b0909; --barre-actif: #2a2022; --barre-trait: #3a2e30;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #121011; --surface: #1c191a; --texte: #ece7e5; --discret: #a8a09d; --bordure: #2e2829;
  --accent: #e48a8f; --accent-fort: #9a2a33; --tete: #2c2224; --tete-texte: #eadcdb;
  --vert: #1f4d2b; --vert-texte: #bfe8c9; --orange: #5a3a26; --orange-texte: #f6d2b7; --jaune: #4d4118; --jaune-texte: #f3e3b0; --gris: #2a2627;
  --alerte: #f08a5d; --barre: #0b0909; --barre-actif: #2a2022; --barre-trait: #3a2e30;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14.5px/1.5 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; }

/* Mise en page : bandeau en haut, toute la largeur pour le tableau. */
.bandeau { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; min-height: 52px;
  padding: 0 16px; background: var(--barre); color: var(--barre-texte); }
.bandeau .marque { display: flex; align-items: center; gap: .5rem; color: var(--barre-texte); text-decoration: none;
  font-weight: 700; font-size: 1.05rem; flex: none; }
.bandeau nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.bandeau nav a { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 8px;
  color: var(--barre-doux); text-decoration: none; white-space: nowrap; }
.bandeau nav a:hover { background: var(--barre-actif); color: var(--barre-texte); }
.bandeau nav a[aria-current="page"] { background: var(--barre-actif); color: var(--barre-texte); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--barre-accent); }
.bandeau .compteur { font-size: .72rem; font-weight: 700; background: #e0912f; color: #1c2129; border-radius: 99px;
  padding: 0 .45rem; min-width: 1.4rem; text-align: center; }
.bandeau .outils { display: flex; align-items: center; gap: .75rem; flex: none; }
.bandeau select { background: var(--barre-actif); color: var(--barre-texte); border: 1px solid var(--barre-trait); padding: .3rem .4rem; }
.menu-utilisateur { position: relative; }
.menu-utilisateur summary { color: var(--barre-doux); cursor: pointer; white-space: nowrap; list-style: none; padding: .4rem .2rem; }
.menu-utilisateur summary::after { content: " ▾"; }
.menu-utilisateur .sous-menu { position: absolute; right: 0; top: 100%; z-index: 40; display: flex; flex-direction: column;
  gap: .55rem; min-width: 240px; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.menu-utilisateur .sous-menu a, .menu-utilisateur .sous-menu button { color: var(--texte); text-align: left; font-size: .92rem; }
.contenu { padding: 1.3rem 1.75rem 3rem; max-width: 1400px; margin: 0 auto; }
.contenu.large { max-width: none; padding-top: .8rem; }
@media (max-width: 700px) {
  .bandeau { gap: .5rem; padding: 0 8px; }
  .bandeau .marque span, .menu-utilisateur summary::after { display: none; }
  .menu-utilisateur summary { max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; }
  .contenu { padding: 1rem 16px 2.5rem; }
}

/* Tableur : onglets des groupes et feuille */
.onglets-groupes { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .6rem;
  border-bottom: 2px solid var(--accent-fort); }
.onglets-groupes a { flex: none; padding: .4rem .8rem; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bordure); border-bottom: 0; white-space: nowrap; font-weight: 500; }
.onglets-groupes a:hover { border-color: var(--accent); }
.onglets-groupes a[aria-current="page"] { background: var(--accent-fort); color: #fff; border-color: var(--accent-fort); }
.onglets-groupes .nb { font-size: .75rem; opacity: .75; margin-left: .15rem; }
.entete-groupe { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem 1.5rem; flex-wrap: wrap; margin-bottom: .7rem; }
.entete-groupe h1 { margin: 0; }
.entete-groupe p { margin: .15rem 0 0; }
.entete-groupe .chiffres { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.feuille-cadre { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--bordure); border-radius: 8px; }
table.feuille { border: 0; font-size: .9rem; }
table.feuille th { position: sticky; top: 0; z-index: 2; white-space: nowrap; }
table.feuille th, table.feuille td { padding: .35rem .55rem; border-right: 1px solid var(--bordure); }
table.feuille td.nom, table.feuille th.nom { position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: nowrap; }
table.feuille th.nom { z-index: 3; background: var(--tete); }
table.feuille td.rn { width: 2.5rem; text-align: center; }
table.feuille td.reglement { white-space: nowrap; }
table.feuille .paiement + .paiement { margin-top: .35rem; }
table.feuille .paiement small { display: block; font-size: .78rem; opacity: .75; }
table.feuille td.remarque { min-width: 14rem; max-width: 26rem; }
table.feuille td.pas-casse { white-space: nowrap; }
table.feuille.modifiable tbody tr { cursor: pointer; }
table.feuille tbody tr:hover td { background-image: linear-gradient(rgba(140, 28, 36, .06), rgba(140, 28, 36, .06)); }
table.feuille tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.feuille tr.regle td.nom, table.feuille tr.regle td.reglement { background-color: var(--vert); color: var(--vert-texte); }
table.feuille tr.partiel td.nom, table.feuille tr.partiel td.reglement { background-color: var(--jaune); color: var(--jaune-texte); }
table.feuille tr.etat-essai_prevu td, table.feuille tr.etat-essai_fait td, table.feuille tr.etat-contact td { color: var(--discret); }
table.feuille tr.etat-abandon td { color: var(--discret); text-decoration: line-through; }
table.feuille tr.regle td.nom a, table.feuille tr.partiel td.nom a { color: inherit; }
table.feuille tfoot td { background: var(--fond); }
table.feuille tfoot input, table.feuille tfoot select { padding: .25rem .4rem; font-size: .85rem; max-width: 10rem; }
.pastille-alerte { display: inline-block; width: 1.1rem; height: 1.1rem; line-height: 1.1rem; text-align: center; border-radius: 50%;
  background: var(--alerte); color: #fff; font-size: .72rem; font-weight: 700; margin-left: .3rem; }

/* Fenêtre d'édition d'une ligne */
dialog.fenetre { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--bordure);
  border-radius: 12px; background: var(--fond); color: var(--texte); }
dialog.fenetre::backdrop { background: rgba(0, 0, 0, .45); }
.fenetre-form { max-width: none !important; padding: 1rem 1.25rem 1.25rem; }
.fenetre-page .fenetre-form { padding: 0; }
.fenetre-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; position: sticky; top: -1rem;
  background: var(--fond); padding: .3rem 0; z-index: 1; }
.fenetre-tete h2 { margin: 0; }
.fenetre-tete .fermer { font-size: 1.3rem; color: var(--discret); }
.sous-titre { font-weight: 600; margin: .8rem 0 .3rem; }

/* Éléments communs */
button, .bouton { display: inline-block; font: inherit; font-weight: 600; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--accent-fort);
  background: var(--accent-fort); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.4; }
button.secondaire, .bouton.secondaire { background: var(--surface); color: var(--accent); border-color: var(--accent); }
button.danger { background: var(--surface); color: var(--alerte); border-color: var(--alerte); }
button.lien { background: none; border: 0; color: var(--accent); padding: 0; font-weight: inherit; }
button.petit, .bouton.petit { padding: .15rem .5rem; font-size: .85rem; font-weight: 500; }
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; padding: 1rem 1.25rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.titre-page { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.titre-page h1 { margin: 0; }
.boutons { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.discret { color: var(--discret); font-size: .85rem; }
.vide { color: var(--discret); }
.message { margin: .4rem 0; padding: .6rem .9rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--bordure); }
.message.success { border-color: #3c8d52; }
.message.error, .message.warning { border-color: var(--alerte); color: var(--alerte); }
.resume { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0 0 1rem; }
.resume div { display: flex; flex-direction: column; }
.resume .etiquette { font-size: .8rem; color: var(--discret); }
.resume strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau-defilant { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--bordure); }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--bordure); vertical-align: top; }
th { background: var(--tete); color: var(--tete-texte); font-weight: 600; font-size: .85rem; }
tr.abandon td { color: var(--discret); text-decoration: line-through; }
tr.regle td.nom { background: var(--vert); color: var(--vert-texte); }
.statut { font-size: .78rem; padding: .08rem .5rem; border-radius: 99px; border: 1px solid var(--bordure); white-space: nowrap; }
.statut.regle { background: var(--vert); color: var(--vert-texte); border-color: transparent; }
.statut.partiel, .statut.a_regler { background: var(--orange); color: var(--orange-texte); border-color: transparent; }
.statut.etat-contact, .statut.etat-essai_prevu, .statut.etat-essai_fait { background: var(--gris); }
.statut.etat-abandon { color: var(--discret); }
.statut.complet { background: var(--gris); font-size: .8rem; vertical-align: middle; font-weight: 600; }
.onglets-groupes .complet { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; opacity: .7; }
.entete-groupe .chiffres form { margin: 0; }
.lettre { display: inline-block; width: 1.4rem; text-align: center; font-size: .75rem; font-weight: 700; border-radius: 4px; background: var(--gris); }
.alerte { color: var(--alerte); }

/* Formulaires */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number],
select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid var(--bordure); border-radius: 6px; background: var(--fond); color: var(--texte); }
form.saisie { display: flex; flex-direction: column; gap: .8rem; max-width: 760px; }
form.saisie .champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem 1rem; }
form.saisie .champ { display: flex; flex-direction: column; gap: .2rem; }
form.saisie .champ.large { grid-column: 1 / -1; }
form.saisie .champ.case { flex-direction: row; align-items: center; gap: .45rem; }
form.saisie label { font-size: .82rem; color: var(--discret); }
form.saisie input, form.saisie select, form.saisie textarea { width: 100%; }
form.saisie input[type=checkbox], form.saisie input[type=radio] { width: auto; }
form.saisie .aide { font-size: .78rem; color: var(--discret); }
form.saisie fieldset { border: 1px solid var(--bordure); border-radius: 10px; padding: .8rem 1rem; background: var(--surface); }
form.saisie legend { font-weight: 600; padding: 0 .3rem; }
form.saisie .actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.errorlist { color: var(--alerte); margin: 0; padding-left: 1rem; font-size: .85rem; }
table.formset td { padding: .3rem .4rem; }
table.formset input, table.formset select { width: 100%; min-width: 90px; }
table.formset input[type=checkbox] { width: auto; min-width: 0; }
.recherche { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.recherche input[type=search] { min-width: 260px; flex: 1; max-width: 420px; }
.onglets { display: flex; gap: .3rem; }
.onglets a { padding: .3rem .7rem; border-radius: 99px; text-decoration: none; border: 1px solid var(--bordure); background: var(--surface); }
.onglets a[aria-current="true"] { background: var(--accent-fort); color: #fff; border-color: var(--accent-fort); }

/* Fiche famille */
.fiche { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 1.2rem; align-items: start; }
@media (max-width: 1000px) { .fiche { grid-template-columns: 1fr; } }
.eleve { margin-bottom: 1rem; }
.eleve h2 { margin: 0 0 .3rem; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
dl.infos { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .5rem 0; }
dl.infos dt { color: var(--discret); font-size: .85rem; }
dl.infos dd { margin: 0; }
.inscription { border-top: 1px solid var(--bordure); padding: .6rem 0; display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; }
.inscription .groupe { font-weight: 600; min-width: 220px; }
.inscription form { display: inline; }
ul.contacts { list-style: none; padding: 0; margin: 0; }
ul.contacts li { padding: .35rem 0; border-top: 1px solid var(--bordure); }
ul.contacts li:first-child { border-top: 0; }

/* Liste d'appel (imprimable) */
table.appel td, table.appel th { border: 1px solid var(--bordure); text-align: center; }
table.appel td.nom, table.appel th.nom { text-align: left; white-space: nowrap; }
table.appel td { height: 2rem; }
@media print {
  .bandeau, .onglets-groupes, .pas-imprime, .message, tfoot { display: none !important; }
  .feuille-cadre { max-height: none; overflow: visible; }
  body { background: #fff; color: #000; font-size: 12px; }
  .contenu { padding: 0; }
  table, th, td { border-color: #999 !important; }
  th { background: #eee !important; color: #000 !important; }
  a { color: #000; text-decoration: none; }
}

/* Fiches en ligne (accueil) */
.statut.fiche-recue { background: var(--jaune); color: var(--jaune-texte); border-color: transparent; }
.statut.fiche-validee { background: var(--vert); color: var(--vert-texte); border-color: transparent; }
.statut.fiche-expiree { color: var(--discret); }
.copie { display: inline-flex; gap: .4rem; align-items: center; }
.copie input { width: 22rem; max-width: 50vw; font-size: .8rem; }
mark { background: var(--jaune); color: var(--jaune-texte); padding: 0 .2rem; border-radius: 3px; }
.pastille-fiche { display: inline-block; margin-left: .3rem; font-size: .72rem; font-weight: 600; padding: 0 .45rem; border-radius: 99px;
  background: var(--jaune); color: var(--jaune-texte); text-decoration: none; white-space: nowrap; }
.pastille-fiche.envoyee { background: var(--gris); color: var(--discret); font-weight: 500; }

/* Pages de la famille : gros caractères, une étape par écran, pensé pour le téléphone */
body.public { font-size: 18px; line-height: 1.5; }
.public-tete { display: flex; align-items: center; gap: .7rem; padding: .7rem 16px; background: var(--barre); color: var(--barre-texte);
  font-weight: 700; font-size: 1.05rem; }
.public-contenu { max-width: 560px; margin: 0 auto; padding: 1.2rem 16px 2rem; }
.public-contenu h1 { font-size: 1.6rem; line-height: 1.25; margin-bottom: .3rem; }
.public-contenu h2 { font-size: 1.35rem; margin: .2rem 0 .6rem; }
.public-sous-titre { color: var(--discret); margin: 0 0 1.2rem; }
.public-pied { max-width: 560px; margin: 0 auto; padding: 0 16px 2rem; color: var(--discret); font-size: .9rem; }
.public-erreur { color: var(--alerte); font-weight: 600; }
.public-note { background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; padding: .7rem 1rem; }
.fiche-publique .etape { background: var(--surface); border: 1px solid var(--bordure); border-radius: 14px; padding: 1.1rem 1.1rem 1.3rem; margin-bottom: 1rem; }
.fiche-publique .progression { margin: 0; font-size: .85rem; color: var(--discret); text-transform: uppercase; letter-spacing: .04em; }
.fiche-publique .aide { color: var(--discret); font-size: .95rem; margin: .2rem 0 .6rem; }
.fiche-publique .question { margin: 0 0 1.1rem; border: 0; padding: 0; min-width: 0; }
.fiche-publique .question > label, .fiche-publique legend { display: block; font-weight: 600; margin-bottom: .3rem; padding: 0; }
.fiche-publique .facultatif { font-weight: 400; color: var(--discret); font-size: .85rem; }
.fiche-publique input[type=text], .fiche-publique input[type=email], .fiche-publique input[type=tel], .fiche-publique input[type=date] {
  width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid var(--bordure); border-radius: 10px; background: var(--fond); color: var(--texte); }
.fiche-publique input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fiche-publique .choix { display: flex; gap: .6rem; flex-wrap: wrap; }
.fiche-publique .choix label { flex: 1 1 8rem; display: flex; gap: .6rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--bordure);
  border-radius: 10px; background: var(--fond); cursor: pointer; font-weight: 500; }
.fiche-publique .choix-liste label { flex-basis: 100%; }
.fiche-publique .choix label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fiche-publique input[type=radio], .fiche-publique input[type=checkbox] { width: 1.3rem; height: 1.3rem; flex: none; accent-color: var(--accent-fort); }
.fiche-publique label.case { display: flex; gap: .7rem; align-items: flex-start; font-weight: 600; }
.fiche-publique .en-erreur input { border-color: var(--alerte); }
.fiche-publique .errorlist { font-size: .95rem; padding: 0; list-style: none; margin-top: .3rem; }
.fiche-publique .rappel { background: var(--fond); border-radius: 10px; padding: .2rem .9rem; margin-bottom: 1rem; font-size: .95rem; }
.fiche-publique .recap { border-top: 1px solid var(--bordure); padding-top: .5rem; }
.fiche-publique .recap h3 { font-size: 1rem; margin: .3rem 0; }
.fiche-publique .recap dl { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .15rem .8rem; margin: 0 0 .6rem; font-size: .95rem; }
.fiche-publique .recap dt { color: var(--discret); }
.fiche-publique .recap dd { margin: 0; overflow-wrap: anywhere; }
.public-boutons { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.2rem; }
.public-boutons button, .public .bouton { font-size: 1.05rem; padding: .85rem 1rem; border-radius: 10px; text-align: center; }
.public-boutons button.lien { padding: .3rem; }

/* Fiche imprimée pour le classeur */
body.impression { background: #fff; color: #000; }
.fiche-papier { max-width: 760px; margin: 1.5rem auto; padding: 0 16px; font-size: 13px; }
.fiche-papier header { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid #8c1c24; padding-bottom: .6rem; margin-bottom: .8rem; }
.fiche-papier h1 { margin: 0; font-size: 1.5rem; }
.fiche-papier header p { margin: .1rem 0 0; }
.fiche-papier h2 { font-size: 1rem; margin: .8rem 0 .3rem; border-bottom: 1px solid #ccc; }
.fiche-papier dl { display: grid; grid-template-columns: 14rem 1fr; gap: .15rem 1rem; margin: 0; }
.fiche-papier dt { color: #555; }
.fiche-papier dd { margin: 0; }
.fiche-papier footer { margin-top: 1.2rem; border-top: 1px solid #ccc; padding-top: .5rem; }

/* Fiche papier imprimée (A4), même mise en page que les fiches actuelles */
body.papier { background: #e9e6e3; color: #000; color-scheme: light; font: 11pt/1.35 "Times New Roman", Times, serif; margin: 0; }
.barre-papier { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: .8rem 16px; margin: 0;
  font: 14px/1.4 "Segoe UI", system-ui, sans-serif; color: #333; }
.papier .page { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto 1.2rem; padding: 10mm 16mm 26mm; background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.entete-fiche { display: grid; grid-template-columns: 34mm 1fr 34mm; align-items: start; gap: 4mm; margin-bottom: 2mm; }
.entete-fiche .logo { width: 32mm; height: auto; }
.entete-fiche .titre { text-align: center; }
.entete-fiche h1 { font-size: 22pt; font-weight: 400; margin: 3mm 0 0; }
.entete-fiche .annee { font-size: 20pt; margin: 0; }
.entete-fiche .public { font: 700 16pt "Calibri", "Segoe UI", sans-serif; color: #c0504d; margin: 1mm 0 0; }
.entete-fiche .photo { width: 30mm; height: 34mm; border: 1px solid #000; display: flex; align-items: flex-end; justify-content: center;
  font-size: 9pt; padding-bottom: 1mm; color: #555; }
.papier p { margin: 0; }
.papier .prof { font: 10.5pt "Calibri", "Segoe UI", sans-serif; margin: 0 0 2mm 4mm; }
.papier .bloc { margin: 0 0 1.5mm 4mm; }
.papier .l { display: flex; align-items: baseline; gap: 1.5mm; min-height: 6.6mm; padding-top: 1mm; }
.papier .pt { flex: 1; min-width: 12mm; border-bottom: 1px dotted #000; padding: 0 1mm; font: 11pt "Segoe Print", "Bradley Hand", cursive; color: #1d3c8f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.papier .pt.court { flex: .8; }
.papier .pt.mini { flex: none; width: 11mm; text-align: center; }
.papier .pt.mini.an { width: 17mm; }
.papier .rempli { font: 11pt "Segoe Print", "Bradley Hand", cursive; color: #1d3c8f; }
.papier .deux { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8mm; }
.papier .gras { font-weight: 700; }
.papier .souhaite { gap: 8mm; margin: 2mm 0 1mm 4mm; }
.papier .retrait { margin-left: 4mm; }
.papier .choix { padding: 0 1.2mm; border: 1.5px solid transparent; border-radius: 50%; }
.papier .choix.entoure { border-color: #1d3c8f; }
.papier .cours { display: grid; grid-template-columns: max-content 1fr; gap: 0 6mm; margin: 1.5mm 0 1.5mm; }
.papier .cours ul { list-style: none; margin: 0; padding: 0; }
.papier .cours li { display: flex; justify-content: space-between; gap: 4mm; padding: .3mm 0; max-width: 125mm; }
.papier .case { display: inline-block; flex: none; width: 3.2mm; height: 3.2mm; border: 1px solid #000; position: relative; top: .4mm; }
.papier .case.cochee::after { content: "✕"; position: absolute; inset: -1.6mm 0 0 .3mm; color: #1d3c8f; font: 700 10pt sans-serif; }
.papier .oui-non { display: flex; justify-content: space-between; align-items: baseline; gap: 4mm; font-size: 10.5pt; padding: .8mm 0; }
.papier .oui-non strong { white-space: nowrap; }
.papier .conditions { margin: 3mm 0 2mm 4mm; }
.papier .invite { font-weight: 700; font-style: italic; margin: 2mm 0; }
.papier .signature-en-ligne { border: 1px solid #000; padding: 2mm 3mm; margin-top: 4mm; font-size: 10.5pt; }
.pied-fiche { position: absolute; left: 0; right: 0; bottom: 8mm; text-align: center; font-size: 8.5pt; line-height: 1.3; }
.renseignements { text-align: center; font-size: 12pt; font-weight: 400; margin: 20mm 0 12mm; }
table.reinscriptions { width: 100%; border-collapse: collapse; background: #fff; border: 0; font: 11pt "Calibri", "Segoe UI", sans-serif; }
table.reinscriptions th, table.reinscriptions td { border: 1px solid #000; height: 14mm; padding: 1mm 2mm; vertical-align: middle; color: #000; background: #fff; font-weight: 400; }
table.reinscriptions th { text-align: center; height: 17mm; }
table.reinscriptions th:nth-child(1), table.reinscriptions td:nth-child(1) { width: 15%; }
table.reinscriptions th:nth-child(5) { width: 30%; }
@page { size: A4; margin: 0; }
@media print {
  body.papier { background: #fff; }
  .papier .page { margin: 0; box-shadow: none; page-break-after: always; break-after: page; height: 297mm; overflow: hidden; }
  .papier .page:last-child { page-break-after: auto; break-after: auto; }
}
@media (max-width: 220mm) { .papier .page { transform-origin: top left; } }
@media print {
  body.papier table.reinscriptions th, body.papier table.reinscriptions td { background: #fff !important; border-color: #000 !important; }
}

/* Fiches papier scannées : l'image à gauche, ce qui a été lu à droite */
.envoi-fiche { max-width: 720px; margin-bottom: 1.5rem; }
.choix-public { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.scan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.scan-images { position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); overflow: auto; display: flex;
  flex-direction: column; gap: .75rem; }
.scan-images img { width: 100%; display: block; border: 1px solid var(--bordure); border-radius: 6px; background: #fff; }
.scan-images iframe { width: 100%; height: calc(100vh - 4rem); border: 1px solid var(--bordure); border-radius: 6px; }
.scan-formulaire form.saisie { display: flex; flex-direction: column; gap: .9rem; }
.scan-formulaire .champ.doute { outline: 2px solid #e08a00; outline-offset: 3px; border-radius: 4px; }
.doute-exemple { outline: 2px solid #e08a00; border-radius: 3px; padding: 0 .25rem; }
.note-doute { font-size: .8rem; color: #a35f00; }
.avant { font-size: .8rem; color: var(--discret); }
.scan-formulaire ul, .scan-formulaire [id$="_groupe"] > div, .scan-formulaire .champ > div { list-style: none; padding: 0; margin: 0; }
.scan-formulaire .champ label:has(input[type=radio]) { font-weight: normal; display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; }
.scan-formulaire .champ.large label:has(input[type=radio]) { display: flex; margin: .2rem 0; }
.choix-ligne { display: block; margin: .25rem 0; font-weight: normal; }
.sous-choix { margin-top: .6rem; padding-left: 1rem; border-left: 3px solid var(--bordure); }
.remarques { margin: .5rem 0; }
.actions-fiche { margin-top: 1rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.actions-fiche form { margin: 0; }
.lecture-attente { display: flex; flex-direction: column; gap: .3rem; }
.roue { display: inline-block; width: 1em; height: 1em; border: 2px solid var(--bordure); border-top-color: currentColor;
  border-radius: 50%; animation: tourne 1s linear infinite; vertical-align: -2px; }
@keyframes tourne { to { transform: rotate(360deg); } }
.statut.lecture-lue { background: var(--jaune); color: var(--jaune-texte); border-color: transparent; }
.statut.lecture-erreur { background: var(--orange); color: var(--orange-texte); border-color: transparent; }
@media (max-width: 900px) {
  .scan { grid-template-columns: 1fr; }
  .scan-images { position: static; max-height: none; }
}

/* Appel en ligne : une ligne par élève, de gros boutons pour le pouce */
.appel-titre { margin-bottom: .6rem; }
.appel-date { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; max-width: 520px; }
.appel-date select { flex: 1; font-size: 1rem; padding: .45rem .5rem; }
.appel-date .bouton { font-size: 1.2rem; padding: .3rem .9rem; line-height: 1.2; }
.appel-date .inactif { opacity: .35; pointer-events: none; }
.appel-liste { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 820px; }
.appel-eleve { display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap;
  padding: .6rem .2rem; border-bottom: 1px solid var(--bordure); }
.appel-nom { font-size: 1rem; }
.appel-infos { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .78rem; color: var(--discret); margin-top: .1rem; }
.etiquette-appel { border-radius: 4px; padding: 0 .35rem; background: var(--gris); color: var(--texte); }
.etiquette-appel.essai { background: var(--jaune); color: var(--jaune-texte); }
.etiquette-appel.attention { background: var(--orange); color: var(--orange-texte); }
.appel-choix { display: flex; gap: .3rem; }
.appel-choix label { position: relative; cursor: pointer; }
.appel-choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.appel-choix span { display: block; min-width: 4.2rem; text-align: center; padding: .55rem .5rem; border-radius: 8px;
  border: 1px solid var(--bordure); background: var(--surface); font-size: .9rem; user-select: none; }
.appel-choix input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.appel-choix .choix-present input:checked + span { background: var(--vert); color: var(--vert-texte); border-color: transparent; font-weight: 600; }
.appel-choix .choix-absent input:checked + span { background: var(--orange); color: var(--orange-texte); border-color: transparent; font-weight: 600; }
.appel-choix .choix-excuse input:checked + span { background: var(--gris); color: var(--texte); border-color: var(--discret); font-weight: 600; }
.appel-choix .choix-retard input:checked + span { background: var(--jaune); color: var(--jaune-texte); border-color: transparent; font-weight: 600; }
.appel-note { max-width: 820px; display: flex; flex-direction: column; gap: .2rem; }
.appel-note label { font-size: .82rem; color: var(--discret); }
.appel-barre { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 820px; padding: .7rem 0; background: var(--fond); border-top: 1px solid var(--bordure); }
.appel-barre button { font-size: 1rem; padding: .6rem 1.2rem; }
@media (max-width: 600px) {
  .appel-eleve { flex-direction: column; align-items: stretch; }
  .appel-choix label { flex: 1; }
  .appel-choix span { min-width: 0; padding: .7rem .2rem; }
}

/* Historique des présences */
.legende-presences { font-size: .85rem; color: var(--discret); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.legende-presences span { display: inline-block; min-width: 1.4rem; text-align: center; border-radius: 4px; color: var(--texte); }
table.presences { border-collapse: collapse; }
table.presences th, table.presences td { border: 1px solid var(--bordure); text-align: center; padding: .3rem .45rem; white-space: nowrap; }
table.presences .nom { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: normal; min-width: 8rem; }
table.presences th a { color: inherit; text-decoration: none; }
table.presences .sans-appel { background: var(--gris); color: var(--discret); }
table.presences .total { font-variant-numeric: tabular-nums; }
.p-present { background: var(--vert); color: var(--vert-texte); }
.p-absent { background: var(--orange); color: var(--orange-texte); font-weight: 600; }
.p-excuse { background: var(--gris); }
.p-retard { background: var(--jaune); color: var(--jaune-texte); }
