@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/manrope-latin-wght-normal.fc03edc2c673.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/manrope-latin-ext-wght-normal.91e6441f12d2.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --vert: #0E5A3A;
  --vert-fonce: #0A4029;
  --vert-clair: #E3EFE8;
  --ocre: #B4530A;
  --ocre-clair: #FBEBDD;
  --ocre-texte: #8A3A05;
  --fond: #F5F3EE;
  --encre: #17201B;
  --gris: #5A645E;
  --ligne: #E2DED5;
  --blanc: #FFFFFF;
  --rayon: 12px;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--encre);
  background: var(--fond);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; font-size: 15px; }
a { color: var(--vert); font-weight: 600; }
a:hover { color: var(--vert-fonce); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.4px; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 800; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ocre); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Mise en page générale ---------- */
.app { display: flex; min-height: 100vh; }
.menu {
  width: 248px; flex: none; background: var(--vert); color: var(--blanc);
  padding: 22px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marque { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--blanc); text-decoration: none; }
.marque svg { flex: none; }
.marque strong { display: block; font-size: 18px; font-weight: 800; }
.marque small { display: block; font-size: 12px; color: #CFE3D7; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu nav { display: flex; flex-direction: column; gap: 2px; }
.menu nav a {
  display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: 10px;
  color: #E6F1EA; text-decoration: none; font-weight: 500; font-size: 14px;
}
.menu nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--blanc); }
.menu nav a.actif { background: rgba(255, 255, 255, 0.16); color: var(--blanc); font-weight: 700; }
.menu .groupe { font-size: 12px; color: #A9CDB8; padding: 12px 12px 4px; font-weight: 600; }
.menu .pied { margin-top: auto; padding: 0 8px; font-size: 13px; color: #CFE3D7; display: flex; flex-direction: column; gap: 8px; }
.menu .pied button { background: none; border: 1px solid rgba(255,255,255,.35); color: var(--blanc); border-radius: 10px; min-height: 40px; font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; }

.barre-mobile { display: none; }
.contenu { flex: 1; min-width: 0; padding: 32px; }
.page { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
.entete .sous { color: var(--gris); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.retour { font-size: 13px; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .menu { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; height: 100%; }
  .menu-ouvert .menu { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .barre-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--vert); color: var(--blanc); padding: 10px 16px; position: sticky; top: 0; z-index: 20;
  }
  .barre-mobile button { background: none; border: 0; color: var(--blanc); min-width: 44px; min-height: 44px; font-size: 24px; cursor: pointer; }
  .barre-mobile strong { font-size: 17px; }
  .contenu { padding: 20px 16px 40px; }
  h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { .menu { transition: none; } }

/* ---------- Blocs ---------- */
.bloc { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bloc-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bloc .aide, .aide { color: var(--gris); font-size: 13px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.colonnes { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.colonnes > .large { flex: 3 1 440px; min-width: 0; }
.colonnes > .etroit { flex: 2 1 300px; min-width: 0; }

.chiffre { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.chiffre span:first-child { font-size: 13px; color: var(--gris); font-weight: 600; }
.chiffre strong { font-size: 30px; font-weight: 800; }
.chiffre small { font-size: 13px; color: var(--gris); }
.chiffre.vert strong { color: var(--vert); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid #CFCAC0; background: var(--blanc); color: var(--encre);
  font-weight: 700; font-size: 14px; line-height: 1; font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--gris); color: var(--encre); }
.btn.principal { background: var(--vert); border-color: var(--vert); color: var(--blanc); }
.btn.principal:hover { background: var(--vert-fonce); }
.btn.contour { border-color: var(--vert); color: var(--vert); }
.btn.danger { border-color: #E8B98F; color: var(--ocre-texte); }
.btn.petit { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.large { width: 100%; min-height: 52px; font-size: 16px; }
.lien-bouton { background: none; border: 0; padding: 0; color: var(--vert); font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Tableaux ---------- */
.defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--gris); font-size: 12px; font-weight: 700; padding: 8px 10px; white-space: nowrap; }
td { padding: 10px; border-top: 1px solid #EEEBE4; vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 800; background: var(--fond); }

.pastille { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pastille.vert { background: var(--vert-clair); color: var(--vert-fonce); }
.pastille.ocre { background: var(--ocre-clair); color: var(--ocre-texte); }
.pastille.noir { background: var(--encre); color: var(--blanc); }
.pastille.gris { background: #EEEBE4; color: #3F4943; }

.progression { height: 8px; border-radius: 4px; background: #EEEBE4; overflow: hidden; }
.progression span { display: block; height: 100%; background: var(--vert); }
.progression.ocre span { background: var(--ocre); }

.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #EEEBE4; align-items: center; flex-wrap: wrap; }
.liste-simple li:first-child { border-top: 0; }
.vide { text-align: center; padding: 28px 16px; color: var(--gris); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.vide strong { color: var(--encre); font-size: 16px; }

/* ---------- Formulaires ---------- */
.formulaire { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ.plein { grid-column: 1 / -1; }
.champ label { font-size: 13px; font-weight: 700; }
.champ .aide { font-size: 12px; }
.champ .erreur, .erreurlist { color: #A3320B; font-size: 13px; font-weight: 600; margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid #CFCAC0;
  background: var(--blanc); font-weight: 500; font-size: 15px; font-family: inherit; color: var(--encre);
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--vert); outline: 2px solid var(--vert-clair); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--vert); }
.case { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.pied-form { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Messages ---------- */
.messages { display: flex; flex-direction: column; gap: 8px; }
.message { padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; background: var(--vert-clair); color: var(--vert-fonce); border: 1px solid #BFD9C9; }
.message.error { background: var(--ocre-clair); color: var(--ocre-texte); border-color: #E8B98F; }
.message.info { background: #EEF2F7; color: #24364A; border-color: #CBD6E2; }

/* ---------- Appel ---------- */
.appel-ligne { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--blanc); flex-wrap: wrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--vert-clair); color: var(--vert); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.appel-ligne .qui { flex: 1; font-weight: 700; min-width: 140px; }
.choix { display: flex; border: 1px solid #CFCAC0; border-radius: 10px; overflow: hidden; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix label { min-width: 72px; min-height: 40px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0 10px; color: var(--gris); }
.choix label + input + label, .choix input + label ~ label { border-left: 1px solid #E2DED5; }
.choix input:checked + label.p { background: var(--vert-clair); color: var(--vert-fonce); }
.choix input:checked + label.a { background: var(--ocre); color: var(--blanc); }
.choix input:checked + label.r { background: var(--encre); color: var(--blanc); }
.choix input:focus-visible + label { outline: 3px solid var(--ocre); outline-offset: -3px; }
.barre-collante { position: sticky; bottom: 0; background: var(--blanc); border-top: 1px solid var(--ligne); padding: 14px; margin: 0 -20px -20px; border-radius: 0 0 14px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Notes ---------- */
.note-input { width: 84px !important; text-align: center; font-weight: 800 !important; font-size: 16px !important; }
.note-input.erreur { border-color: var(--ocre); background: var(--ocre-clair); }

/* ---------- Pages publiques ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-tete { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; gap: 12px; flex-wrap: wrap; }
.public-tete .marque { color: var(--vert); }
.public-tete .marque strong { color: var(--encre); }
.heros { flex: 1; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: center; padding: 30px 28px 60px; max-width: 1160px; margin: 0 auto; width: 100%; }
.heros-texte { flex: 1 1 420px; display: flex; flex-direction: column; gap: 20px; }
.heros-texte h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -1.2px; }
.heros-texte p { font-size: 18px; color: #3F4943; max-width: 520px; }
.origine { font-size: 14px; color: var(--gris); border-left: 3px solid var(--ocre); padding-left: 12px; }
.carte-auth { flex: 1 1 360px; max-width: 440px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.carte-auth.seule { margin: 20px auto 60px; }

/* ---------- Bulletin imprimable ---------- */
.feuille { background: var(--blanc); width: 210mm; min-height: 297mm; margin: 0 auto 24px; padding: 14mm 14mm 12mm; display: flex; flex-direction: column; gap: 14px; font-size: 12px; box-shadow: 0 2px 18px rgba(23,32,27,.12); }
.feuille .b-tete { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--vert); }
.feuille .b-ecole { display: flex; gap: 12px; align-items: center; }
.feuille .b-ecole img { width: 64px; height: 64px; object-fit: contain; }
.feuille .b-ecole strong { font-size: 16px; color: var(--vert); display: block; }
.feuille .b-etat { text-align: right; color: #3F4943; }
.feuille .b-etat strong { color: var(--encre); }
.feuille .b-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.feuille .b-titre h1 { font-size: 18px; letter-spacing: .2px; }
.feuille .b-identite { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; background: var(--fond); border-radius: 6px; padding: 10px 12px; }
.feuille table { font-size: 11.5px; }
.feuille th { background: var(--vert); color: var(--blanc); padding: 7px 6px; font-size: 11px; }
.feuille td { padding: 6px; border-top: 0; border-bottom: 1px solid var(--ligne); }
.feuille .b-bas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feuille .b-cadre { border: 1px solid var(--ligne); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.feuille .b-ligne { display: flex; justify-content: space-between; gap: 8px; }
.feuille .b-signature { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.feuille .cachet { width: 150px; height: 70px; border: 1px dashed #8C948F; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gris); font-size: 10.5px; }
.barre-impression { display: flex; justify-content: center; gap: 12px; padding: 16px; flex-wrap: wrap; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: var(--blanc); }
  .barre-impression { display: none; }
  .feuille { box-shadow: none; margin: 0; page-break-after: always; break-after: page; }
  .feuille:last-child { page-break-after: auto; break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media screen and (max-width: 860px) {
  .feuille { width: 100%; min-height: 0; padding: 16px; }
  .feuille .b-identite, .feuille .b-bas { grid-template-columns: 1fr; }
}

/* ---------- Cases à cocher multiples ---------- */
.champ div[id] { display: flex; flex-wrap: wrap; gap: 8px; }
.champ div[id] > div label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #CFCAC0; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--blanc); }
.champ div[id] > div label:has(input:checked) { border-color: var(--vert); background: var(--vert-clair); color: var(--vert-fonce); }

/* ---------- Onglets de filtre ---------- */
.onglets { display: flex; flex-wrap: wrap; gap: 6px; }
.onglets a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ligne); background: var(--blanc); color: var(--encre); text-decoration: none; font-size: 13px; font-weight: 600; }
.onglets a.actif { background: var(--vert); border-color: var(--vert); color: var(--blanc); }
.onglets a span { color: inherit; opacity: .7; font-weight: 700; }

/* ---------- Scolarité ---------- */
.montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.barre td { text-decoration: line-through; color: var(--gris); }
.photo-eleve { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.pieces { display: flex; flex-direction: column; gap: 10px; }
.piece { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--ligne); border-radius: 12px; flex-wrap: wrap; background: var(--blanc); }
.piece .apercu { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid var(--ligne); background: var(--fond); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--gris); text-decoration: none; }
.piece .info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.qr svg { display: block; width: 100%; height: auto; }

/* ---------- Cartes scolaires (format CR80 : 85,6 × 54 mm) ---------- */
.planche { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 6mm; justify-content: center; padding: 10mm 0; }
.carte { width: 85.6mm; height: 54mm; border-radius: 3mm; overflow: hidden; background: var(--blanc); border: 0.3mm solid #CFCAC0; display: flex; flex-direction: column; font-size: 7.5pt; color: var(--encre); break-inside: avoid; }
.carte-tete { background: var(--vert); color: var(--blanc); display: flex; align-items: center; gap: 2mm; padding: 1.8mm 3mm; }
.carte-tete img { width: 7mm; height: 7mm; object-fit: contain; background: var(--blanc); border-radius: 1.2mm; }
.carte-tete strong { font-size: 8pt; line-height: 1.1; display: block; }
.carte-tete small { font-size: 6pt; opacity: .85; }
.carte-corps { flex: 1; display: flex; gap: 3mm; padding: 2.5mm 3mm; }
.carte-photo { width: 21mm; height: 26mm; border-radius: 1.5mm; object-fit: cover; background: var(--vert-clair); color: var(--vert); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14pt; flex: none; }
.carte-infos { flex: 1; display: flex; flex-direction: column; gap: .9mm; min-width: 0; }
.carte-infos .nom { font-size: 9.5pt; font-weight: 800; line-height: 1.1; }
.carte-infos span { color: #3F4943; }
.carte-qr { width: 17mm; flex: none; align-self: flex-end; }
.carte-pied { background: var(--ocre); height: 2mm; }
@media print {
  .planche { padding: 8mm 0; }
  .carte { border-color: #BBB; }
}
