/* =====================================================================
   Peninim MIS — feuille de style. Refonte du 22/09/2026 : « uniforme d ecole ».

   Demande Yossef Haim : garder l idee (bleu nuit du blason, laiton, titres a
   empattements, fond papier) mais « bien plus style et pro ». Le monde est
   tire de l uniforme d une ecole britannique, que chaque utilisatrice connait :
     - le BLAZER : barre laterale bleu nuit du blason (#191060, MESURE sur
       l image), avec une trame de serge de laine a peine visible ;
     - la CRAVATE D ECOLE : rayure diagonale bleu nuit / laiton / argent, seule
       ornementation du systeme — bandeau sous le blason, trait sous chaque
       titre de page, liseret de la page de connexion ;
     - le BULLETIN : titres en EB Garamond (chiffres alignes), libelles en
       petites capitales, fiches en grille de faits.

   ⛔ Aucune classe prefixee `ad-`/`ads-`/`banner`/`sponsor`/`pop-` : les
   bloqueurs de pub les masquent par du CSS injecte, invisible au diagnostic.
   ⛔ Aucune bordure laterale coloree (tic des interfaces generees) : le repere
   actif est un point de laiton.
   Les regles FONCTIONNELLES de l ancienne feuille sont reprises telles quelles
   (`[hidden]`, grille de faits, codes d appel 44 px, impression) avec leur motif.
   ===================================================================== */

:root {
  --navy:        #191060;
  --navy-deep:   #120b45;
  --navy-ink:    #0d0833;
  --navy-soft:   #2f2489;
  --navy-wash:   #ecebf6;
  --brass:       #9a7b3f;
  --brass-soft:  #c9a961;
  --brass-ink:   #7a5f2a;
  --silver:      #dcdbe8;

  --paper:       #efeee9;
  --card:        #ffffff;
  --card-2:      #fbfaf7;
  --ink:         #17162a;
  --ink-soft:    #4f5266;
  --ink-faint:   #6b6f82;
  --rule:        #e7e5de;
  --rule-strong: #d4d1c7;

  --ok:          #1f6b4a;  --ok-wash:   #e5f1ea;
  --warn:        #86560f;  --warn-wash: #f8eedc;
  --bad:         #96261e;  --bad-wash:  #f8e8e6;

  --sans:  "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --serif: "EB Garamond", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  /* La cravate d ecole : larges bandes bleu nuit, une rayure laiton bordee
     d un fil d argent — le motif d une vraie cravate d uniforme. */
  --tie: repeating-linear-gradient(-45deg,
           var(--navy) 0 11px, var(--silver) 11px 12px, var(--brass-soft) 12px 16px,
           var(--silver) 16px 17px, var(--navy) 17px 28px);

  --lift: 0 1px 1px rgba(25, 16, 96, .035), 0 10px 26px -14px rgba(25, 16, 96, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar: 256px;
  --radius:  8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--navy);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .08 0 0 0 0 .3 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
}
::selection { background: rgba(201, 169, 97, .32); color: var(--ink); }
:focus-visible { outline: 2px solid var(--navy-soft); outline-offset: 2px; }

a { color: var(--navy-soft); text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.005em;
  font-variant-numeric: lining-nums; text-wrap: balance; color: var(--navy-ink);
}
p { text-wrap: pretty; }

/* Petites capitales de libelle : un seul endroit les definit. */
.eyebrow, .tile .label, table.data th, label.field > span, .facts dt, .pane-count {
  font-size: .7rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* =====================================================================
   Barre laterale : le blazer
   ===================================================================== */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  color: #cfcde4;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M-1 1l2-2M0 6l6-6M5 7l2-2' stroke='%23ffffff' stroke-opacity='.035' stroke-width='1'/%3E%3C/svg%3E"),
    radial-gradient(120% 30% at 50% 0%, rgba(201, 169, 97, .12), transparent 70%),
    linear-gradient(180deg, #1b1266 0%, var(--navy-deep) 50%, var(--navy-ink) 100%);
  box-shadow: inset -1px 0 0 rgba(201, 169, 97, .16);
}

.sidebar .crest-block {
  position: relative;
  padding: 1.9rem 1.25rem 1.6rem;
  text-align: center;
}
/* Le bandeau de cravate sous le blason, comme le ruban d un chapeau d uniforme. */
.sidebar .crest-block::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background: var(--tie);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.sidebar .crest-block img {
  height: 88px; width: auto; display: block; margin: 0 auto .95rem;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .4));
}
.sidebar .school {
  font-family: var(--serif); font-weight: 600; font-size: 1.12rem; line-height: 1.22;
  color: #fff; display: block; letter-spacing: .005em; text-wrap: balance;
}
.sidebar .crest-block .rule { width: 26px; height: 1px; background: var(--brass-soft); margin: .7rem auto .6rem; }
.sidebar .school-sub {
  display: block; font-size: .6rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--brass-soft);
}

.sidebar nav { padding: 1.2rem .75rem; flex: 1 1 auto; overflow-y: auto; }
.sidebar nav a {
  position: relative; display: flex; align-items: center; gap: .75rem;
  padding: .58rem .85rem; margin-bottom: .1rem;
  border-radius: 6px; text-decoration: none;
  color: #bcb9d8; font-size: .94rem; font-weight: 500;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.sidebar nav .nav-ico { flex: none; color: rgba(201, 169, 97, .62); transition: color 140ms var(--ease); }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a:hover .nav-ico { color: var(--brass-soft); }
.sidebar nav a.active {
  background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(201, 169, 97, .22);
}
.sidebar nav a.active .nav-ico { color: var(--brass-soft); }
.sidebar nav a:focus-visible, .sidebar .who a:focus-visible { outline: 2px solid var(--brass-soft); outline-offset: 1px; }

/* Le blason en grand filigrane au bas du blazer, comme une broderie de poche :
   habille le vide sous la navigation sans rien ajouter a lire. */
.sidebar::before {
  content: ""; position: absolute; left: 50%; bottom: 92px; width: 150px; height: 210px;
  transform: translateX(-50%);
  background: url(/assets/crest-light.png) no-repeat center bottom / contain;
  opacity: .06; pointer-events: none;
}
.sidebar > * { position: relative; }
.sidebar .who {
  padding: 1rem 1.25rem; border-top: 1px solid rgba(201, 169, 97, .16);
  background: rgba(0, 0, 0, .18); font-size: .85rem;
}
.sidebar .who strong { display: block; color: #fff; font-weight: 600; }
.sidebar .who a { color: var(--brass-soft); text-decoration: none; font-size: .82rem; }
.sidebar .who a:hover { text-decoration: underline; }

/* =====================================================================
   Zone de contenu
   ===================================================================== */
.content { flex: 1 1 auto; min-width: 0; }
/* Le contenu part de la barre laterale (il flottait au centre d une colonne de
   1140 px : grand vide a gauche sur les ecrans larges, remarque du 22/09). */
main { max-width: 1400px; margin: 0; padding: 2.4rem 3rem 5rem; }

.page-head {
  position: relative;
  display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap;
  padding-bottom: 1.05rem; margin-bottom: 1.7rem;
  border-bottom: 1px solid var(--rule-strong);
}
/* Le trait de cravate sous le titre : la signature du systeme. */
.page-head::after {
  content: ""; position: absolute; left: 0; bottom: -3.5px;
  width: 84px; height: 6px; border-radius: 1px; background: var(--tie);
}
.page-head h1 { margin: 0; font-size: 2.55rem; line-height: 1.08; }
.page-head .count { color: var(--ink-soft); font-size: .95rem; }
.page-head .spacer { margin-left: auto; }
/* Le premier bouton d un en-tete part a droite meme sans `.spacer` (Comptes,
   Roles le posaient colle au titre). */
.page-head > .btn:not(.spacer ~ *):not(.btn ~ .btn) { margin-left: auto; }

.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--lift);
}
.card + .card { margin-top: 1.4rem; }
.card-head {
  padding: 1rem 1.45rem; border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 1.4rem; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 1.45rem; }

.grid { display: grid; gap: 1.3rem; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
/* Quatre champs COURTS sur une ligne (heures, ordre, site). */
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }

/* ---------- bandeau de chiffres : la ligne de notes du bulletin ----------
   Une seule boite divisee par des filets, pas trois cartes flottantes. */
.figures {
  position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--lift); overflow: hidden;
}
.figures > div { padding: 1.5rem 1.6rem 1.35rem; border-right: 1px solid var(--rule); }
/* La premiere case porte le blazer : bleu nuit, blason en filigrane. */
.figures > div:first-child {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, #1b1266, var(--navy-deep));
}
.figures > div:first-child::after {
  content: ""; position: absolute; right: -18px; top: -14px; bottom: -14px; width: 150px;
  background: url(/assets/crest-light.png) no-repeat center / contain;
  opacity: .13; pointer-events: none;
}
.figures > div:first-child > * { position: relative; z-index: 1; }
.figures > div:first-child .label { color: var(--brass-soft); }
.figures > div:first-child .value { color: #fff; }
.figures > div:first-child .hint { color: rgba(255, 255, 255, .72); }
.figures > div:last-child { border-right: 0; }
@media (max-width: 780px) {
  .figures { grid-template-columns: 1fr; }
  .figures > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .figures > div:last-child { border-bottom: 0; }
}

.tile { padding: 1.2rem 1.35rem; }
.tile .value {
  font-family: var(--serif); font-size: 3.3rem; line-height: 1;
  font-weight: 600; letter-spacing: -.02em; margin-top: .55rem; color: var(--navy);
  font-variant-numeric: lining-nums tabular-nums;
}
.tile .hint { font-size: .86rem; color: var(--ink-soft); margin-top: .45rem; }
/* Jauge des appels : un rail fin, rempli en bleu nuit, pointe laiton. */
.meter { height: 6px; margin-top: .8rem; border-radius: 3px; background: var(--navy-wash); overflow: hidden; max-width: 16rem; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--navy) calc(100% - 6px), var(--brass-soft) 0); min-width: 6px; }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th {
  text-align: left;
  padding: .7rem 1.45rem .65rem; border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap; background: var(--card-2);
}
table.data td {
  padding: .78rem 1.45rem; border-bottom: 1px solid var(--rule); vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background-color 120ms var(--ease); }
table.data tbody tr:hover { background: #f8f7f2; }
table.data a { text-decoration: none; color: var(--navy-soft); font-weight: 600; }
table.data a:hover { text-decoration: underline; }
table.data a.btn { color: var(--navy); text-decoration: none; }
/* Boutons de ligne : un libelle ne se casse jamais en deux (« Change / access »). */
table.data .btn.small { white-space: nowrap; margin: .12rem 0; }
/* Action principale d une ligne : fleche qui avance au survol. */
.btn.go svg { transition: transform 140ms var(--ease); }
.btn.go:hover svg { transform: translateX(2px); }
/* Code de site (EY, MAIN) : etiquette, pas un mot perdu dans la ligne. */
.site-tag {
  display: inline-block; padding: .12rem .5rem; border-radius: 4px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--navy); background: var(--navy-wash);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rtl { direction: rtl; unicode-bidi: isolate; }

/* ---------- grille de faits (le corps d une fiche) ----------
   Le libelle est JUSTE au-dessus de sa valeur ; une seule grille qui coule,
   donc deux colonnes voisines ne peuvent pas se desaligner.
   ⚠️ Le minimum de colonne se regle sur la place REELLE : a 1180 px, la barre
   laterale et le volet liste ne laissent que ~457 px a la fiche. `auto-fit`
   + `minmax` mesure le conteneur — ⛔ ne jamais recopier la largeur du voisin. */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.15rem 1.7rem; margin: 0;
}
.facts > div { min-width: 0; }
.facts dt { margin: 0 0 .2rem; }
.facts dd { margin: 0; font-size: .97rem; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.facts dd .muted { color: var(--ink-faint); }
.facts .wide { grid-column: 1 / -1; }

/* ---------- pastilles ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .18rem .6rem .18rem .52rem; border-radius: 4px;
  font-size: .78rem; font-weight: 600; letter-spacing: 0; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok   { background: var(--ok-wash);   color: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad  { background: var(--bad-wash);  color: var(--bad); }
.pill.mute { background: var(--navy-wash); color: var(--navy); }

/* ---------- formulaires ---------- */
label.field { display: block; margin-bottom: 1.05rem; }
label.field > span { display: block; margin-bottom: .36rem; }
label.field .note { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=search], input[type=number], input[type=time], input[type=tel], select, textarea {
  width: 100%; padding: .62rem .78rem; font: inherit; font-size: .96rem; color: inherit;
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: 6px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #bdb9ad; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy-soft);
  box-shadow: 0 0 0 3px rgba(47, 36, 137, .14);
}
input[type=checkbox], input[type=radio] { accent-color: var(--navy); }
select[multiple] { min-height: 9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.25rem; font: inherit; font-size: .94rem; font-weight: 600;
  cursor: pointer; border-radius: 6px; border: 1px solid var(--navy-deep);
  text-decoration: none; background: var(--navy); color: #fff; letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 2px rgba(18, 11, 69, .2);
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease),
              color 140ms var(--ease), transform 90ms var(--ease);
}
.btn:hover { background: var(--navy-soft); }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn.ghost {
  background: var(--card); color: var(--navy); border-color: var(--rule-strong);
  box-shadow: 0 1px 0 rgba(25, 16, 96, .04);
}
.btn.ghost:hover { background: var(--card-2); border-color: var(--brass-soft); }
.btn.small { padding: .34rem .75rem; font-size: .86rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- messages ---------- */
.alert {
  padding: .65rem 1rem; border-radius: 6px; font-size: .92rem;
  margin-bottom: 1.2rem; border: 1px solid transparent;
}
.alert.bad  { background: var(--bad-wash);  color: var(--bad);  border-color: #e8c9c5; }
.alert.ok   { background: var(--ok-wash);   color: var(--ok);   border-color: #c8ddd2; }
.alert.warn { background: var(--warn-wash); color: var(--warn); border-color: #e8d3ae; }
.alert strong { font-weight: 650; }

.empty { padding: 3.2rem 1.4rem; text-align: center; color: var(--ink-soft); }
.empty h3 { margin: 0 0 .45rem; font-size: 1.3rem; }
.empty p { margin: 0 auto; max-width: 34rem; }
.empty .btn { margin-top: 1.1rem; }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: .86rem; }
.mono  { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
/* `.note` seul = utilitaire generique (hors `label.field`, il n avait aucun
   style et s affichait en texte plein). */
.note { color: var(--ink-faint); font-size: .88rem; }

/* =====================================================================
   Connexion — page en deux volets : le blazer a gauche, la feuille a droite
   ===================================================================== */
.auth { display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-brand {
  position: relative; overflow: hidden;
  flex: 0 0 44%; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 2.5rem; text-align: center;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M-1 1l2-2M0 6l6-6M5 7l2-2' stroke='%23ffffff' stroke-opacity='.035' stroke-width='1'/%3E%3C/svg%3E"),
    radial-gradient(90% 60% at 50% 30%, rgba(201, 169, 97, .14), transparent 70%),
    linear-gradient(170deg, #1b1266 0%, var(--navy-deep) 55%, var(--navy-ink) 100%);
}
/* La cravate descend le long du bord : un liseret raye, pas un aplat. */
.auth-brand::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 12px;
  background: var(--tie);
}
.auth-brand img { height: 180px; width: auto; margin-bottom: 1.8rem; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }
.auth-brand h1 { font-size: 2rem; margin: 0; color: #fff; line-height: 1.2; max-width: 16ch; }
.auth-brand .rule { width: 42px; height: 1px; background: var(--brass-soft); margin: 1.2rem auto; }
.auth-brand p {
  margin: 0; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--brass-soft);
}

.auth-panel { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }
.auth-form {
  width: 100%; max-width: 24rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 1px 1px rgba(25, 16, 96, .04), 0 18px 30px -20px rgba(25, 16, 96, .35);
  padding: 2.3rem 2.3rem 1.9rem;
}
.auth-form h2 { margin: 0 0 .35rem; font-size: 1.85rem; }
.auth-form .sub { margin: 0 0 1.8rem; color: var(--ink-soft); font-size: .94rem; }
.auth-form .btn { width: 100%; padding: .75rem; }
.auth-foot { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--ink-faint); }
.auth-foot a { color: var(--ink-soft); }

@media (max-width: 800px) {
  .auth { flex-direction: column; }
  .auth-brand { flex: 0 0 auto; padding: 2rem 1.5rem 2.2rem; }
  .auth-brand::after { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 8px; }
  .auth-brand img { height: 100px; margin-bottom: 1rem; }
  .auth-brand h1 { font-size: 1.4rem; }
  .auth-brand .rule { margin: .8rem auto; }
  .auth-panel { padding: 1.5rem 1rem 2.5rem; align-items: flex-start; }
  .auth-form { padding: 1.7rem 1.4rem 1.4rem; }
}

/* =====================================================================
   Appel
   ===================================================================== */
.roll { display: grid; gap: .4rem; }
.roll-row {
  display: flex; align-items: center; gap: 1rem; padding: .55rem .95rem;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--card);
  transition: border-color 120ms var(--ease);
}
.roll-row:hover { border-color: var(--rule-strong); }
.roll-row .name { font-weight: 600; flex: 1 1 auto; min-width: 9rem; }
.codes { display: flex; gap: .3rem; flex-wrap: wrap; }
.codes label {
  cursor: pointer; border: 1px solid var(--rule-strong); border-radius: 6px;
  padding: 0 .55rem; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  /* 44 px : l appel se fait debout, sur une tablette posee sur un bureau. */
  min-width: 46px; min-height: 44px;
  color: var(--ink-soft); background: var(--card);
  transition: border-color 120ms var(--ease), background-color 120ms var(--ease), color 120ms var(--ease);
}
.codes label:hover { border-color: var(--navy-soft); color: var(--navy); background: var(--navy-wash); }
.codes input { position: absolute; opacity: 0; pointer-events: none; }
.codes label:has(input:checked) {
  background: var(--navy); border-color: var(--navy); color: #fff;
  box-shadow: inset 0 -3px 0 var(--brass-soft);
}
.codes label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(47, 36, 137, .22); }

.sticky-actions {
  position: sticky; bottom: 0; background: var(--card);
  border-top: 1px solid var(--rule-strong);
  padding: .9rem 1.45rem; display: flex; gap: .9rem; align-items: center; flex-wrap: wrap;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -10px 24px -18px rgba(25, 16, 96, .3);
}
.legend { font-size: .82rem; color: var(--ink-faint); }

/* Registre numerote comme un cahier d appel (compteur CSS, aucun balisage). */
.roll { counter-reset: roll; }
.roll-row { counter-increment: roll; }
.roll-row::before {
  content: counter(roll, decimal-leading-zero);
  flex: none; width: 1.7rem; font-family: var(--serif); font-size: 1.02rem;
  color: var(--ink-faint); font-variant-numeric: lining-nums tabular-nums;
}
/* Le code coche prend la couleur de son SENS (categorie de la table
   attendance_codes), pour qu une absence saute aux yeux avant l envoi. */
.codes label[data-cat="LATE"]:has(input:checked)                 { background: var(--warn); border-color: var(--warn); }
.codes label[data-cat="UNKNOWN"]:has(input:checked)              { background: var(--bad);  border-color: var(--bad); }
.codes label[data-cat="UNAUTHORISED_ABSENCE"]:has(input:checked) { background: var(--bad);  border-color: var(--bad); }
.codes label[data-cat="AUTHORISED_ABSENCE"]:has(input:checked)   { background: var(--ok);   border-color: var(--ok); }
.roll-row:has(label[data-cat="UNKNOWN"] input:checked),
.roll-row:has(label[data-cat="UNAUTHORISED_ABSENCE"] input:checked) { background: #fdf6f5; border-color: #ecd0cc; }
.roll-row:has(label[data-cat="LATE"] input:checked) { background: #fdf9f1; border-color: #eddcbc; }

/* Legende des codes : une rangee de pastilles au lieu d une ligne de texte. */
.code-legend { display: flex; flex-wrap: wrap; gap: .35rem .5rem; font-size: .8rem; color: var(--ink-soft); }
.code-key { display: inline-flex; align-items: center; gap: .35rem; }
.code-key b {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem;
  border-radius: 4px; font-family: var(--serif); font-size: .95rem; color: #fff; background: var(--navy);
}
.code-key[data-cat="LATE"] b { background: var(--warn); }
.code-key[data-cat="UNKNOWN"] b, .code-key[data-cat="UNAUTHORISED_ABSENCE"] b { background: var(--bad); }
.code-key[data-cat="AUTHORISED_ABSENCE"] b { background: var(--ok); }

/* Emploi du temps : une case libre se lit comme une case a remplir. */
table.data a.slot-add, a.slot-add {
  display: inline-flex; align-items: center; justify-content: center; min-width: 4.5rem; padding: .3rem .6rem;
  border: 1px dashed var(--rule-strong); border-radius: 5px; color: var(--ink-faint); font-weight: 500;
  transition: border-color 120ms var(--ease), color 120ms var(--ease), background-color 120ms var(--ease);
}
table.data a.slot-add:hover, a.slot-add:hover { border-color: var(--navy-soft); color: var(--navy); background: var(--navy-wash); text-decoration: none; }

/* Etats vides : le blason, discret, au-dessus du message. */
.empty::before {
  content: ""; display: block; width: 54px; height: 74px; margin: 0 auto 1.1rem;
  background: url(/assets/crest.png) no-repeat center / contain; opacity: .2;
}
.legend strong { color: var(--ink-soft); font-weight: 600; font-family: var(--serif); font-size: 1rem; }

/* =====================================================================
   Vue scindee — liste a gauche, fiche a droite (forme demandee par l ecole
   le 03/09 : on ne quitte jamais la liste pour lire une fiche)
   ===================================================================== */
main:has(.split) { max-width: 1600px; }

.split {
  display: grid;
  grid-template-columns: clamp(15rem, 26%, 20.5rem) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.pane-list {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--lift);
  position: sticky; top: 1.2rem;
  max-height: calc(100vh - 2.4rem);
  display: flex; flex-direction: column; overflow: hidden;
}
.pane-list .pane-filter {
  padding: .85rem .9rem; border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: .5rem; background: var(--card-2);
}
.pane-list .pane-filter input,
.pane-list .pane-filter select { font-size: .9rem; padding: .45rem .62rem; }
.pane-list .pane-count { padding: .5rem 1rem; border-bottom: 1px solid var(--rule); background: var(--card-2); }
.pane-list .pane-count a { font-weight: 600; }
.pane-list .rows { overflow-y: auto; flex: 1 1 auto; }

.pane-list .rows a {
  position: relative;
  display: block; padding: .52rem 1rem .52rem 1.35rem; text-decoration: none; color: var(--ink);
  box-shadow: inset 0 -1px 0 #f1efea;
  font-size: .93rem; line-height: 1.3;
  transition: background-color 120ms var(--ease);
}
.pane-list .rows a:hover { background: #f8f7f2; }
.pane-list .rows a.on { background: var(--navy-wash); color: var(--navy); font-weight: 600; box-shadow: none; }
.pane-list .rows a.on::before {
  content: ""; position: absolute; left: .55rem; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: var(--brass);
}
.pane-list .rows a .sub {
  display: block; font-size: .8rem; color: var(--ink-faint); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pane-list .rows a.on .sub { color: var(--navy-soft); }
.pane-list .rows .none { padding: 1.6rem 1rem; text-align: center; color: var(--ink-faint); font-size: .88rem; }

.pane-detail { min-width: 0; }
.pane-detail > .card + .card { margin-top: 1.4rem; }

/* Bandeau de titre de la fiche : le nom porte, en Garamond. (Pas de liseret
   colore sur le bord de la carte : la cravate reste un objet, pas une bordure.) */
.record-head {
  position: relative;
  display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap;
  padding: 1.25rem 1.45rem 1.05rem; border-bottom: 1px solid var(--rule);
  border-radius: var(--radius) var(--radius) 0 0;
}
.record-head h2 { margin: 0; font-size: 1.55rem; }
.record-head .spacer { margin-left: auto; }

/* Numero de telephone cliquable : chiffres tabulaires de la fonte d interface
   (⛔ plus de chasse fixe : un numero n est pas du code). */
a.tel {
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  white-space: nowrap; text-decoration: none; color: var(--navy-soft);
  border-bottom: 1px solid var(--navy-wash);
}
a.tel:hover { color: var(--navy); border-bottom-color: var(--navy-soft); }

@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; }
  .pane-list { position: static; max-height: 26rem; }
}

/* =====================================================================
   Ecrans etroits : la barre laterale passe en bandeau
   ===================================================================== */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto; flex: 0 0 auto; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 1rem; padding: .6rem .9rem .8rem;
    flex-wrap: wrap;
  }
  .sidebar .crest-block {
    padding: 0; display: flex; align-items: center; gap: .6rem; text-align: left;
  }
  .sidebar .crest-block a { display: flex; align-items: center; gap: .6rem; }
  .sidebar .crest-block::after { display: none; }
  .sidebar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--tie); }
  .sidebar { position: relative; }
  .sidebar .crest-block img { height: 40px; margin: 0; }
  .sidebar .school { font-size: .95rem; }
  .sidebar .crest-block .rule, .sidebar .school-sub { display: none; }
  .sidebar nav { display: flex; gap: .2rem; padding: 0; flex: 1 1 100%; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar::before { display: none; }
  .sidebar .who { padding: 0; border-top: 0; background: none; margin-left: auto; }
  .sidebar .who strong { display: inline; margin-right: .5rem; }
  main { padding: 1.6rem 1.15rem 4rem; }
  .page-head h1 { font-size: 1.8rem; }
}

/* =====================================================================
   Impression — les listes de classe et l appel sont imprimes
   ===================================================================== */
@media print {
  .sidebar, .sticky-actions, .btn, .page-head .spacer, .pane-list { display: none !important; }
  body { background: #fff; }
  .card { border-color: #bbb; box-shadow: none; }
  .split { display: block; }
  main { padding: 0; max-width: none; }
  .page-head::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ⛔⛔ `[hidden]` D ABORD, et avec `!important`. `.pane-list .rows a` porte
   `display: block`, plus specifique que le `display: none` de l attribut
   `hidden` : sans cette ligne, `app.js` cache des lignes qui restent visibles
   et le filtre parait casse alors que le JavaScript fait son travail. */
.pane-list .rows a[hidden] { display: none !important; }

/* Retour de la verification du code postal : une aide a la saisie, pas une
   erreur — un code non reconnu n empeche jamais d enregistrer une fiche. */
label.field .pc-hint { display: block; margin-top: .25rem; font-size: .8rem; }

/* Cases a cocher alignees sur la ligne de base de leur libelle. */
.check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 400;
         text-transform: none; letter-spacing: 0; font-size: .92rem; }
.check input { margin: 0; }

/* Action en fin de ligne de tableau : confirmation et bouton restent ensemble. */
.inline-act { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; }

/* Pied de formulaire court : case a cocher et bouton sur UNE ligne, bouton
   pousse a droite par le meme `.spacer` que `.card-head`. */
.check-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--rule);
}
.check-row .spacer { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; }
}
