/*
 * Feuille unique de la console (présentation D : neutre, menu latéral).
 * Chaque club ne change que --accent (injecté par le layout) et son logo.
 */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/plex-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(fonts/plex-500.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/plex-600.woff2) format('woff2'); }

:root {
  --accent: #1F4FA3;
  --accent-fond: color-mix(in srgb, var(--accent) 9%, #fff);
  --fond: #F5F6F8;
  --surface: #FFFFFF;
  --bordure: #E1E4EA;
  --trait: #EDEFF3;
  --champ: #D3D8E0;
  --texte: #1B2230;
  --texte-2: #3A4353;
  --discret: #5B6473;
  --danger: #B42318;   --danger-fond: #FDECEA;
  --succes: #1E6B3C;   --succes-fond: #E7F4EC;
  --attention: #8A5300; --attention-fond: #FEF4E2;
  --rayon: 8px;
  --menu: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* hidden l'emporte toujours sur un display de classe (boutons, lignes filtrées) */
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 'IBM Plex Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
a:hover { color: color-mix(in srgb, var(--accent) 75%, #000); }
h1 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.3; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }
.discret { color: var(--discret); font-size: 14px; }
.note { margin: 0; padding: 12px 16px; color: var(--discret); font-size: 15px; border-top: 1px solid var(--trait); }

/* --- Structure : menu latéral + contenu --- */
body.app { display: grid; grid-template-columns: var(--menu) 1fr; min-height: 100vh; }
.menu {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px; padding: 16px 12px;
  background: var(--surface); border-right: 1px solid var(--bordure);
}
/* En-tête du menu : le logo du club seul (proportions gardées), sinon son nom ; sélecteur dessous s'il y a plusieurs clubs. */
.club { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 52px; padding: 8px; border: 1px solid var(--bordure); border-radius: var(--rayon); }
/* align-self : sans lui, la colonne flex étire le logo sur toute la largeur (proportions perdues). */
.club-logo { display: block; align-self: flex-start; max-width: 100%; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.club select { font: inherit; font-weight: 600; border: 0; background: none; padding: 0; max-width: 100%; }
.menu-groupe { display: flex; flex-direction: column; gap: 2px; }
.menu-titre { padding: 0 10px 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6B7482; }
.menu a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border-radius: 6px; color: var(--texte-2); text-decoration: none;
}
.menu a:hover { background: var(--fond); color: var(--texte); }
.menu a[aria-current] { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.etiquette { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; text-align: center; }
.menu-pied { display: flex; align-items: center; gap: 10px; padding: 4px 10px 0; }
.menu-pied form { margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bordure); color: var(--texte-2); font-size: 14px; font-weight: 600; }
.qui { display: flex; flex-direction: column; line-height: 1.3; }
.qui small { color: var(--discret); font-size: 14px; }
.contenu { min-width: 0; padding: 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.barre-mobile { display: none; }

/* --- Blocs --- */
.entete { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.entete > div { display: flex; flex-direction: column; gap: 2px; }
.entete .actions { margin-left: auto; display: flex; gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Titre d'une page du menu : déjà signalé par le menu latéral, gardé pour les lecteurs d'écran et sur mobile (menu replié). */
@media (min-width: 901px) { .titre-module { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.colonnes { display: flex; gap: 16px; align-items: flex-start; }
.colonnes > * { flex: 1; min-width: 0; }
.colonnes > .carte-etroite { flex: 0 0 380px; }
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); }
.carte > h2 { padding: 14px 16px; border-bottom: 1px solid var(--trait); }
.carte > p { margin: 0; padding: 14px 16px; }
.liste { list-style: none; margin: 0; padding: 0 16px; }
.liste li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.liste li:last-child { border-bottom: 0; }

/* --- Formulaires et boutons --- */
.pile { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--discret); }
input:not([type=checkbox], [type=radio], [type=hidden]), select, textarea {
  min-height: 40px; padding: 0 10px; border: 1px solid var(--champ); border-radius: 6px;
  font: inherit; font-size: 16px; color: var(--texte); background: var(--surface);
}
textarea { padding: 8px 10px; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--champ); border-radius: 6px; background: var(--surface);
  font: inherit; color: var(--texte); text-decoration: none; cursor: pointer;
}
.bouton-principal { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.bouton-principal:hover { background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff; }
.bouton-icone { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--discret); cursor: pointer; }
.bouton-icone:hover { background: var(--fond); color: var(--texte); }
.bouton-lien { min-height: 40px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--discret); text-decoration: underline; cursor: pointer; } /* action discrète (annuler un cours) */
.bouton-lien:hover { color: var(--danger); }

/* Sections repliables (<details>) : chevron à gauche qui pivote vers le bas à l'ouverture, libellé en accent (se lit comme cliquable). */
summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--accent); font-weight: 500; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; flex: none; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
details[open] > summary::before { transform: rotate(45deg); }
summary:hover { color: color-mix(in srgb, var(--accent) 80%, #000); }
summary .discret, summary .statut { font-weight: 400; }

/* Partage du formulaire d'inscription : aperçu du QR, lien à copier, téléchargements. */
.partage { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 24px; }
.partage p { margin: 4px 0 0; }
.partage-qr { width: 128px; height: 128px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: #fff; }
.partage-texte { flex: 1 1 320px; min-width: 0; display: grid; gap: 16px; }
.partage-telecharger { flex-wrap: wrap; align-items: center; }
.partage-telecharger .bouton { white-space: nowrap; }
.lien-copie { display: flex; align-items: center; gap: 8px; padding: 2px 2px 2px 14px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--fond); }
.lien-copie span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.lien-copie .icone-copie, .lien-copie .copie .icone-copier { display: none; }
.lien-copie .copie .icone-copie { display: block; color: var(--succes); }

/* --- Statuts (toujours avec un libellé texte) --- */
.statut { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 14px; background: var(--fond); color: var(--texte-2); }
.statut-succes { background: var(--succes-fond); color: var(--succes); }
.statut-danger { background: var(--danger-fond); color: var(--danger); }
.statut-attention { background: var(--attention-fond); color: var(--attention); }
.alerte { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--danger-fond); color: var(--danger); }

/* --- Pages sans menu (connexion, erreurs) --- */
body.simple { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.carte-centree { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.carte-centree > p { padding: 0; }

/* --- Mobile : le menu devient un panneau --- */
@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; align-content: start; }
  .barre-mobile {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 2;
    padding: 4px 8px; background: var(--surface); border-bottom: 1px solid var(--bordure); font-weight: 600;
  }
  .menu { display: none; position: fixed; inset: 49px 0 0; z-index: 3; width: min(var(--menu), 85vw); height: auto; }
  .menu-ouvert .menu { display: flex; box-shadow: 0 8px 24px rgb(27 34 48 / .18); }
  .contenu { padding: 16px; }
  .colonnes { flex-direction: column; align-items: stretch; }
  .colonnes > .carte-etroite { flex-basis: auto; }
}

/* --- Phase 2 : réglages, tableaux, messages --- */
.menu-bas { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--bordure); }
.menu .moi { flex: 1; min-width: 0; padding: 4px; margin: -4px; }
.flash { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--succes-fond); color: var(--succes); }
.bandeau { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--attention-fond); color: var(--attention); }
.bandeau a { color: inherit; font-weight: 600; }
.centre { text-align: center; }
.corps { padding: 16px; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--trait); }
.carte-titre a { font-size: 15px; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bordure); overflow-x: auto; }
.onglets a { min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--texte-2); text-decoration: none; white-space: nowrap; }
.onglets a[aria-current] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { padding: 10px 16px; text-align: left; font-size: 14px; font-weight: 500; color: var(--discret); border-bottom: 1px solid var(--trait); }
.tableau td { padding: 10px 16px; vertical-align: top; border-bottom: 1px solid var(--trait); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr.selection td { background: var(--accent-fond); }
.tableau select { width: 100%; max-width: 100%; } /* choix dans un tableau (relevé bancaire) : ne déborde pas sur mobile */
.actions-ligne { display: flex; justify-content: flex-end; margin: -8px 0; } /* boutons de 40 px centrés sur la ligne : toutes les lignes gardent la même hauteur */
.actions-ligne.a-gauche { justify-content: flex-start; }
.nowrap { white-space: nowrap; }
.tableau td.retrait { padding-left: 32px; } /* sous-rubrique */
.tableau input.fort { font-weight: 600; }
.tableau input[name^=nom_] { width: 100%; min-width: 180px; }
.tableau tr.total th, .tableau tr.total td { border-top: 1px solid var(--trait); color: var(--texte); }
.tableau td input.nombre { max-width: 120px; margin-left: auto; }
.tableau-comptes td, .tableau-comptes th { padding: 6px 10px; }
.tableau-comptes tr.mere td { font-weight: 600; }
.tableau-comptes .favorable { color: var(--succes); }
.tableau-comptes .defavorable { color: var(--danger); }
.tableau-bilan { max-width: 560px; }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.intertitre { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.pagination { display: flex; justify-content: space-between; }
.actions { display: flex; gap: 8px; }
.details { margin: 0; padding: 16px; display: grid; gap: 12px; }
.details dt { font-size: 14px; color: var(--discret); }
.details dd { margin: 0; }
.bouton-danger { color: var(--danger); }
@media (max-width: 900px) {
  .tableau thead { display: none; }
  .tableau tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--trait); }
  .tableau td { display: block; padding: 2px 16px; border: 0; }
}

/* --- Phase 4 : fiches, adresses, logo --- */
.ligne-champs { display: flex; flex-wrap: wrap; gap: 12px; }
.ligne-champs > label { flex: 1 1 140px; }
.ligne-champs > .large { flex: 3 1 220px; }
.ligne-champs > .etroit { flex: 0 1 120px; }
label.etroit { max-width: 200px; }
.filtres .large { flex: 1 1 260px; }
.filtres input[name=annee] { width: 110px; }
.logo-apercu { max-width: 220px; max-height: 90px; object-fit: contain; align-self: flex-start; border: 1px solid var(--trait); border-radius: 6px; padding: 6px; background: #fff; }
input[type=color] { padding: 2px; width: 64px; }
input[type=file] { min-height: 40px; padding-top: 6px; }
.adresse { display: flex; flex-direction: column; gap: 14px; }

/* --- Facturation --- */
.nombre { text-align: right; }
th.nombre { text-align: right; }
input.nombre { text-align: right; }
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.indicateur { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); }
.indicateur span { color: var(--discret); font-size: 14px; }
.indicateur strong { font-size: 20px; font-weight: 600; }
.indicateur-danger strong { color: var(--danger); }
.statut-brouillon { background: var(--accent-fond); color: var(--accent); }
.onglets-filtres { flex-wrap: wrap; }
.lignes-facture td { padding: 6px 8px; }
.lignes-facture th { padding: 8px; }
.lignes-facture input { width: 100%; }
.lignes-facture td:nth-child(2), .lignes-facture td:nth-child(3) { width: 130px; }
.lignes-facture td:nth-child(4) { width: 120px; vertical-align: middle; }
.lignes-facture tfoot td { border-bottom: 0; }
.ligne-produit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ligne-produit input[name=designation] { flex: 1 1 220px; }
.lignes-facture select { width: 100%; margin-top: 4px; min-height: 32px; font-size: 14px; color: var(--texte-2); } /* catalogue sous la désignation */
.ligne-produit input[name=categorie] { flex: 0 1 200px; min-width: 120px; }
.ligne-produit input[name=prix] { width: 110px; }
.ligne-produit select[name=rubrique] { flex: 0 1 220px; min-width: 140px; }
.filtres input[name=prix] { width: 110px; }
label.case { flex-direction: row; align-items: center; gap: 6px; color: var(--texte); }
.details-grille { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-bottom: 1px solid var(--trait); }
.titre-fiche { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.carte > form.filtres { border-top: 1px solid var(--trait); }
@media (max-width: 900px) {
  .lignes-facture td:nth-child(n) { width: auto; }
}
.entete > .actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
.carte.corps > h2 { padding: 0 0 14px; }
/* Envoi groupé : création en lot repliable (ouverte tant qu'aucun brouillon n'attend) ; articles | membres, réglages et total en pied. */
.lot > summary { padding: 0 16px; min-height: 52px; }
.lot > summary .discret { margin-left: auto; text-align: right; }
.lot[open] > summary { border-bottom: 1px solid var(--trait); }
.lot > .bandeau { margin: 16px 16px 0; }
.lot-corps { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.zone-lot { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 14px 16px; border: 0; }
.zone-lot + .zone-lot { border-left: 1px solid var(--trait); }
.zone-lot > p { margin: 0; }
.zone-titre { float: left; display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 0; font-weight: 600; } /* float : légende dans le flux */
.zone-titre .discret { font-weight: 400; }
.articles-groupe { margin: 8px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--discret); }
.article-lot { display: grid; grid-template-columns: minmax(0, 1fr) 52px 84px; align-items: center; gap: 8px; min-height: 42px; margin: 0 -6px; padding: 0 6px; border-radius: 6px; }
.article-lot:has(:checked) { background: var(--accent-fond); }
.article-lot input.nombre { width: 52px; min-height: 34px; padding: 0 6px; }
.article-lot > span.nombre { text-align: right; }
.article-lot:not(:has(:checked)) input.nombre { opacity: .45; }
.article-lot:has(:checked) span:not(.discret) { font-weight: 500; }
.article-lot:has(:checked) > span.nombre { color: var(--texte); }
.outils-lot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.outils-lot input[type=search] { flex: 1 1 160px; min-width: 0; }
.membres-lot { columns: 2 200px; column-gap: 16px; max-height: 340px; overflow-y: auto; padding: 4px 10px; border: 1px solid var(--bordure); border-radius: 6px; }
.membres-lot label.case { min-height: 36px; break-inside: avoid; }
.pied-lot { border-top: 1px solid var(--trait); }
.recap-lot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; padding: 12px 16px; background: var(--fond); border-top: 1px solid var(--trait); border-radius: 0 0 var(--rayon) var(--rayon); }
.recap-lot p { margin: 0; }
@media (max-width: 900px) {
  .lot-corps { grid-template-columns: 1fr; }
  .zone-lot + .zone-lot { border-left: 0; border-top: 1px solid var(--trait); }
  .lot > summary .discret { display: none; }
}
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

/* --- Inscription publique --- */
.carte-large { width: min(720px, 100%); }
/* Formulaire : sections en cartes sur le fond gris, comme les pages de la console. */
.carte-large:has(.formulaire-public) { padding: 0; background: none; border: 0; }
.carte-large .carte > h2 { font-size: 17px; }
.entete-public { display: flex; flex-direction: column; gap: 4px; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
.logo-public { display: block; max-width: 220px; max-height: 72px; margin: 0 auto; object-fit: contain; }
/* Smartphone d'abord : cibles de 44 px, cases alignées sur la première ligne du texte, bouton pleine largeur. */
.formulaire-public input:not([type=checkbox], [type=radio], [type=hidden]), .formulaire-public select { min-height: 44px; }
.formulaire-public label.case { align-items: center; gap: 10px; min-height: 44px; font-size: 16px; }
.formulaire-public label.case:has(a) { align-items: flex-start; padding-top: 10px; }
.formulaire-public label.case input { flex: none; width: 22px; height: 22px; margin: 0; }
.formulaire-public [role=radiogroup].pile { gap: 2px; }
.formulaire-public .actions { gap: 28px; }
.formulaire-public .bouton-principal { align-self: flex-start; min-height: 48px; font-size: 17px; }
@media (max-width: 600px) {
  body.simple:has(.carte-large) { padding: 0; place-items: start stretch; }
  .carte-large { padding: 20px 16px 28px; border: 0; border-radius: 0; box-shadow: none; }
  .carte-large:has(.formulaire-public) { padding: 16px 12px 28px; }
  .formulaire-public .bouton-principal { align-self: stretch; }
  /* Rue et N°, NPA et localité restent sur une ligne : les champs ne gardent pas leur largeur naturelle. */
  .formulaire-public .ligne-champs > label { min-width: 0; }
  .formulaire-public .ligne-champs input { width: 100%; }
  .formulaire-public .ligne-champs > .etroit { flex-basis: 80px; }
}

/* --- Présences (saisie au dojo, sur téléphone) --- */
.appel-liste { list-style: none; margin: 0; padding: 0; }
.appel-liste li { border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 16px; }
.appel-nom { font-size: 17px; color: var(--texte); }
/* Présent / Retard / Excusé / Absent : boutons radio de 44 px, couleur du statut une fois choisi (libellé toujours visible). */
.appel-statuts { display: flex; gap: 4px; }
.appel-statuts label { position: relative; }
.appel-statuts input { position: absolute; opacity: 0; }
.appel-statuts span { display: flex; align-items: center; justify-content: center; min-width: 68px; min-height: 44px; padding: 0 8px; border: 1px solid var(--bordure); border-radius: 6px; font-size: 14px; color: var(--texte-2); cursor: pointer; }
.appel-statuts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.appel-statuts input:checked + span { color: #FFFFFF; font-weight: 600; border-color: transparent; }
.statut-P input:checked + span { background: var(--succes); }
.statut-R input:checked + span { background: var(--attention); }
.statut-E input:checked + span { background: var(--texte-2); }
.statut-A input:checked + span { background: var(--danger-fond); color: var(--danger); border-color: var(--danger); }   /* état par défaut : discret */
@media (max-width: 420px) { .appel-statuts { width: 100%; } .appel-statuts label { flex: 1; } .appel-statuts span { min-width: 0; } }
.appel-pied { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--bordure); border-radius: 0 0 var(--rayon) var(--rayon); }
.appel input[type=search] { width: 100%; }
.appel-etat { flex: 1; font-size: 14px; color: var(--discret); }
.appel-etat.erreur { color: var(--danger); font-weight: 600; }

/* --- Inventaire --- */
.tableau tr.groupe th { padding-top: 16px; color: var(--texte); font-weight: 600; font-size: 15px; background: var(--fond); }
/* Rubriques et budget : budget et effectif de la saison précédente à côté de la saisie ; tableau empilé (≤ 900 px),
   une ligne sous le champ à la place des colonnes, qui n'auraient plus d'en-tête. */
.tableau-budget .ref { color: var(--discret); }
.ref-mobile { display: none; }
@media (max-width: 900px) {
  .tableau tr.groupe th { display: block; }
  .tableau-budget .ref { display: none; }
  .ref-mobile { display: block; margin-top: 4px; font-size: 13px; color: var(--discret); white-space: nowrap; }
}
/* Catégories : une puce chacune (avec son nombre d'articles), sur plusieurs lignes : toutes visibles sur ordinateur,
   l'ouverte pleine en accent, sur n'importe quelle ligne. Téléphone : une rangée à faire glisser (voir plus bas). */
.puces { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.puces a { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--bordure); border-radius: 20px; background: var(--surface); color: var(--texte-2); text-decoration: none; white-space: nowrap; }
.puces a:hover { border-color: var(--accent); color: var(--accent); }
.puces a[aria-current] { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.puces .compte { font-size: 12px; font-weight: 500; color: var(--texte-2); background: var(--trait); border-radius: 10px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.puces a[aria-current] .compte { background: rgb(255 255 255 / .25); color: #fff; }
.actions a[aria-current] { border-color: var(--accent); color: var(--accent); }
.recherche-inventaire { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recherche-inventaire input { flex: 1 1 260px; min-height: 44px; }
.titre-groupe { font-size: 17px; margin: 8px 0 0; }
.resume-stock { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; color: var(--texte-2); }
.resume-stock b { font-size: 17px; color: var(--texte); font-variant-numeric: tabular-nums; }
.carte > h2 small { font-size: 13px; font-weight: 400; color: var(--discret); margin-left: 8px; }
/* « À commander » : liste de courses en tête de la grille. */
.commande { border-color: var(--attention); }
.commande ul { list-style: none; margin: 0; padding: 6px 16px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 24px; }
.commande li { display: flex; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid var(--trait); }
.commande .manque { margin-left: auto; font-weight: 600; color: var(--attention); font-variant-numeric: tabular-nums; }
/* Compteur − n + : boutons ronds de 44 px ; stock 0 en rouge sur fond rouge pâle (sans « épuisé » à côté). */
.compteur { display: inline-flex; align-items: center; gap: 4px; }
.compteur button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bordure); background: var(--surface); color: var(--accent); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.compteur button:active { background: var(--accent-fond); }
.compteur button:disabled { color: var(--trait); cursor: default; }
.compteur .n, .n-ex { min-width: 40px; min-height: 36px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 18px; font-weight: 600; color: var(--texte); text-decoration: none; font-variant-numeric: tabular-nums; }
.compteur.zero .n, .n-ex.zero { color: var(--danger); background: var(--danger-fond); }
.compteur.change .n { box-shadow: inset 0 0 0 2px var(--accent); }
.n-ex { min-width: 26px; min-height: 22px; font-size: 13px; }
.prevoir { font-size: 12px; color: var(--discret); white-space: nowrap; }
.prevoir.manque { color: var(--attention); background: var(--attention-fond); font-weight: 600; border-radius: 10px; padding: 0 8px; }
/* Grille des ceintures (ordinateur) : lignes de 64 px, − et + au survol de la case (toujours visibles sans souris). */
.grille-stock { border-collapse: separate; border-spacing: 0; width: 100%; }
.grille-stock th, .grille-stock td { padding: 8px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--trait); }
.grille-stock thead th { font-size: 13px; color: var(--discret); font-weight: 600; white-space: nowrap; }
.grille-stock th:first-child { text-align: left; padding-left: 16px; }
.grille-stock tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 500; white-space: nowrap; }
.grille-stock tbody tr:last-child > * { border-bottom: 0; }
.grille-stock td { height: 64px; min-width: 132px; }
.grille-stock .total { text-align: right; padding-right: 16px; color: var(--texte-2); font-weight: 600; min-width: 64px; font-variant-numeric: tabular-nums; }
.grille-stock .case + .case { margin-top: 4px; }
.grille-stock .nom-case { display: block; font-size: 12px; color: var(--discret); }   /* nom de l'insigne (Terre-Eau…) */
.grille-stock .prevoir { display: table; margin: 2px auto 0; }   /* sous le stock ou le « + », centré */
.grille-stock .ajout { display: grid; width: 44px; margin: 0 auto; place-items: center; min-height: 36px; border-radius: 6px; color: var(--discret); text-decoration: none; font-size: 18px; opacity: .35; }
.grade { display: inline-flex; align-items: center; gap: 8px; }
@media (hover: hover) {
  .grille-stock .compteur button { opacity: 0; }
  .grille-stock td:hover .compteur button, .grille-stock .compteur:focus-within button { opacity: 1; }
}
.grille-stock tr:hover .ajout, .grille-stock .ajout:focus-visible { opacity: 1; background: var(--trait); }
.legende-stock { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--discret); border-top: 1px solid var(--trait); }
.legende-stock > span { display: inline-flex; align-items: center; gap: 6px; }
/* Listes (livres, autres catégories, téléphone) : une ligne par article, compteur à droite. */
.liste-stock { list-style: none; margin: 0; padding: 0; }
.ligne-stock { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 16px; border-top: 1px solid var(--trait); }
.liste-stock:first-child > .ligne-stock:first-child { border-top: 0; }
.ligne-stock .nom { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ligne-stock .nom > a { font-weight: 500; }
.ligne-stock small { color: var(--discret); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.groupe-stock h3 { position: sticky; top: 0; z-index: 1; margin: 0; display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 15px; background: var(--fond); border-top: 1px solid var(--trait); }
.groupe-stock h3 .discret { margin-left: auto; font-weight: 400; font-size: 14px; }
.groupe-stock:first-child h3 { border-top: 0; border-radius: var(--rayon) var(--rayon) 0 0; }
.ajout-taille { display: block; padding: 10px 16px; min-height: 44px; border-top: 1px solid var(--trait); text-decoration: none; font-weight: 500; }
.mobile-seul { display: none; }
@media (max-width: 700px) {
  .bureau-seul { display: none; }
  .mobile-seul { display: block; }
  .groupe-stock h3 { top: 49px; }   /* sous la barre mobile collée en haut */
  .puces { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }   /* plusieurs lignes pousseraient l'inventaire trop bas */
}
/* État de l'enregistrement et « Annuler » (5 s) en bas de l'écran. */
.etat-stock { position: sticky; top: 0; z-index: 2; margin: 0; padding: 8px 12px; border-radius: 6px; background: var(--danger-fond); color: var(--danger); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 4; width: min(420px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 10px; background: var(--texte); color: var(--surface); box-shadow: 0 8px 24px rgb(27 34 48 / .25); }
.toast button { margin-left: auto; min-height: 40px; padding: 0 12px; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.photo-article { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 6px; border: 1px solid var(--trait); }
.contact { display: flex; flex-direction: column; gap: 6px; }

/* Détails : une longue valeur (e-mail, adresse) passe à la ligne au lieu de chevaucher la voisine. */
.details > div { min-width: 0; }
.details dd { overflow-wrap: anywhere; }
a[href^="mailto:"] { overflow-wrap: anywhere; }

/* --- Grades : pastille de couleur de la ceinture, toujours suivie du libellé --- */
.pastille { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 50%; vertical-align: -2px; border: 1px solid rgb(0 0 0 / 25%); }
.grade-blanche { background: #FFFFFF; border-color: #9AA0A6; }
.grade-jaune { background: #F5C400; }
.grade-orange { background: #F08A00; }
.grade-verte { background: #2E8B3E; }
.grade-bleue { background: #1F5FBF; }
.grade-marron { background: #7B4A21; }
.grade-cn1, .grade-cn2, .grade-cn3, .grade-cn4, .grade-cn5 { background: #111111; }
.grade-cn6 { background: #6B2FA3; }

/* Débiteur hors club (formulaire de facture) : repliable, ouvert s'il est rempli. */
.hors-club[open] > .pile { margin-top: 12px; }

/* Fiche membre : actions rares (pause, sortie, fusion, hors club) repliées sous le suivi. */
.replie { border-top: 1px solid var(--trait); }
.replie summary { padding: 0 16px; }
.replie > form { padding: 0 16px 16px; }
.carte-etroite .filtres .large { flex-basis: 160px; min-width: 0; }
.carte-etroite .filtres select { width: 100%; }

/* --- Relevé des présences : grille dates × membres, codes colorés (avec la lettre), défilement horizontal --- */
.defile { overflow-x: auto; }
.releve { border-collapse: collapse; }
.releve th, .releve td { padding: 6px 8px; white-space: nowrap; text-align: left; border-bottom: 1px solid var(--trait); }
.releve thead th { font-size: 13px; }
.releve .code { text-align: center; font-variant-numeric: tabular-nums; }
.releve .code-P { background: var(--succes-fond); color: var(--succes); }
.releve .code-R { background: var(--attention-fond); color: var(--attention); }
.releve .code-E { background: var(--fond); color: var(--texte-2); }
.releve .code-A { background: var(--danger-fond); color: var(--danger); font-weight: 600; }
.releve .fermeture { text-align: center; font-size: 13px; letter-spacing: .04em; color: var(--discret); background: var(--fond); }
.releve tfoot th, .releve tfoot td { border-top: 1px solid var(--bordure); font-size: 14px; }
.releve tfoot th { text-align: left; font-weight: 500; color: var(--discret); }

/* Membres d'un cours : cases à cocher en colonnes, « tout cocher » sur toute la largeur. */
.liste-cases { margin: 0; padding: 0 16px 12px; border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.liste-cases label.case { min-height: 44px; align-items: center; }
.liste-cases .tout { grid-column: 1 / -1; border-bottom: 1px solid var(--trait); font-weight: 600; }

/* Compte bancaire : tiers et communication sur une ligne chacun, coupés (toucher ou tabulation : texte entier). */
.tableau-compte td.mouvement { max-width: 320px; }
.coupe { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coupe:focus { white-space: normal; overflow: visible; outline: none; }
.attribution { display: flex; flex-direction: column; gap: 4px; }
.attribution .bouton { min-height: 32px; padding: 0 10px; margin-left: 6px; }
@media (max-width: 900px) { .tableau-compte td.mouvement { max-width: none; } }
