/* ============================================================
   JUDO MJC GERSTHEIM — Feuille de style
   Design v2 : topbar pleine largeur, sidebar blanche, indigo
   ============================================================ */

:root {
  /* ---- Surfaces ---- */
  --bg:            #F1F2F6;   /* fond de page */
  --surface:       #FFFFFF;   /* cartes */
  --surface-alt:   #FAFAFC;   /* champs, en-tête de tableau */
  --surface-sunk:  #F1F2F6;   /* fonds enfoncés (groupes de filtres) */
  --surface-hover: #F4F5F9;   /* survol de ligne et de navigation */

  /* ---- Sidebar (désormais claire, sous la topbar) ---- */
  --side-bg:       #FFFFFF;
  --side-hover:    #F4F5F9;
  --side-active:   #EBECF7;   /* fond de l'élément courant */
  --side-text:     #4A4E60;
  --side-label:    #6E7285;
  --side-muted:    #6E7285;
  --side-border:   #E3E5EC;
  --side-width:    240px;
  --topbar-h:      66px;

  /* ---- Marque ---- */
  --brand:         #1A1FA8;   /* bleu électrique : liens, titres de section */
  --brand-dark:    #0A0E5C;   /* indigo profond : aplats, boutons */
  --accent:        #C8322B;   /* rouge : erreurs, champs obligatoires */
  --accent-soft:   #FBEDEC;

  /* ---- Texte ---- */
  --text:          #14161F;
  --text-2:        #4A4E60;
  --text-3:        #6E7285;
  --placeholder:   #9A9DAD;

  /* ---- Bordures ---- */
  --border:        #E3E5EC;   /* cartes, séparateurs */
  --border-input:  #E3E5EC;   /* champs */
  --border-mid:    #E3E5EC;   /* séparateurs internes */
  --border-soft:   #EDEEF2;   /* lignes de tableau */
  --border-strong: #C7CAD6;   /* survol */

  /* ---- Statuts ---- */
  --ok-bg:    #E4EFE9;  --ok-fg:    #1F6B4A;
  --wait-bg:  #FAF0DE;  --wait-fg:  #9A6210;
  --draft-bg: #EDEEF2;  --draft-fg: #6E7285;
  --err-bg:   #FBEDEC;  --err-fg:   #C8322B;
  --info-bg:  #EBECF7;  --info-fg:  #1A1FA8;

  /* Bordures teintées (boutons d'action discrets) */
  --ok-border:  #C9E0D4;
  --err-border: #F0C4C1;

  /* ---- Disciplines ---- */
  --judo-bg:    #EBECF7;  --judo-fg:    #1A1FA8;
  --baby-bg:    #F0EAF9;  --baby-fg:    #5B3A9E;
  --self-bg:    #E4EFE9;  --self-fg:    #1F6B4A;

  /* ---- Bannière d'écran ---- */
  --hero-h:        112px;
  --hero-gradient: linear-gradient(100deg, #0A0E5C 0%, #3A1E86 52%, #0A0E5C 100%);

  /* ---- Rayons ---- */
  --r-card:  12px;
  --r-field:  8px;
  --r-nav:    8px;
  --r-icon:   7px;
  --r-pill:   5px;   /* les badges v2 sont rectangulaires, pas en pastille */

  /* ---- Ombres ---- */
  --sh-sm: 0 1px 2px rgba(0,0,0,.08);
  --sh-md: 0 4px 16px rgba(23,24,26,.10);
  --sh-lg: 0 18px 50px rgba(23,24,26,.20);

  /* ============================================================
     ALIAS DE COMPATIBILITÉ
     Ces noms sont utilisés en style inline dans les vues (56 fois).
     Les conserver évite de reprendre les 18 fichiers un par un.
     ============================================================ */
  --bleu:       var(--brand);
  --bleu-clair: var(--info-bg);
  --rouge:      var(--accent);
  --vert:       var(--ok-fg);
  --orange:     var(--wait-fg);
  --gris-bg:    var(--bg);
  --gris-bord:  var(--border);
  --blanc:      var(--surface);
  --texte:      var(--text);
  --texte-doux: var(--text-3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

input, select, textarea, button { font-family: inherit; }
::placeholder { color: var(--placeholder); }

h1, h2, h3 { letter-spacing: -.02em; font-weight: 800; }

/* Traitement récurrent du design v2 : capitales, gras, interlettrage.
   Regroupé ici pour éviter de le répéter sur chaque composant. */
.eyebrow,
.card-header,
.stat-label,
.side-group,
.badge,
.btn,
.app-body .hero-eyebrow {
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ============================================================
   COQUE — topbar pleine largeur, sidebar claire en dessous
   ============================================================ */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

/* ---- BARRE SUPÉRIEURE (pleine largeur) ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-sep {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex: 0 0 1px;
}
.topbar-spacer { flex: 1; }

/* Marque, désormais dans la topbar */
.sidebar-brand,
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: 0 0 auto;
}
.sidebar-brand:hover, .site-brand:hover { color: inherit; }

.brand-icon {
  /* Logo officiel seul, sans carré sombre : on laisse le fond transparent. */
  width: 40px; height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon img, .brand-icon svg {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text { line-height: 1.1; }
.brand-name {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.brand-sub {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Saison : encadré discret dans la topbar */
.side-season { flex: 0 0 auto; }
.side-season-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  background: var(--surface-alt);
  white-space: nowrap;
}
.side-season-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
}
.side-season-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

/* Compte, à droite de la topbar */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.side-avatar {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--brand-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- CORPS : sidebar + contenu ---- */
.app-body {
  display: flex;
  align-items: flex-start;
}

.sidebar {
  width: var(--side-width);
  flex: 0 0 var(--side-width);
  background: var(--side-bg);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--topbar-h));
  padding: 16px 14px 24px;
  position: sticky;
  top: var(--topbar-h);
}

/* Encadré de tête de sidebar */
.side-espace {
  background: var(--brand-dark);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.side-espace svg { flex: 0 0 auto; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-group {
  padding: 14px 12px 6px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
}

/* Élément de navigation : liseré gauche pour l'état courant,
   au lieu du fond plein de la version précédente. */
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-nav) var(--r-nav) 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--side-text);
  background: transparent;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--side-hover); color: var(--text); }
.nav-link.nav-active {
  background: var(--side-active);
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.nav-link-label { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-icon { flex: 0 0 17px; width: 17px; height: 17px; }
.nav-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.nav-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}

.side-sep {
  height: 1px;
  background: var(--border);
  margin: 14px 0 12px;
}

.side-foot {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-user { display: none; }   /* le compte est remonté dans la topbar */

.btn-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-nav) var(--r-nav) 0;
  background: none;
  color: var(--side-text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.btn-logout:hover { background: var(--side-hover); color: var(--text); }

/* ---- Zone de contenu ---- */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.main-content {
  flex: 1;
  padding: 20px 22px 36px;
  min-width: 0;
}


/* ---- Bannière d'écran (administration uniquement) ----
   Cloisonnée sous .app-body : le site public a sa propre section
   « .hero », en clair, qui ne doit pas hériter du dégradé. */
.app-body .hero {
  position: relative;
  height: var(--hero-h);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--hero-gradient);
  display: flex;
  align-items: center;
  padding: 0 32px;
  margin-bottom: 18px;
}
.app-body .hero-deco {
  position: absolute;
  right: 0; top: 0;
  height: 100%;
  opacity: .16;
  pointer-events: none;
}
.app-body .hero-inner { position: relative; }
.hero-eyebrow {
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  margin-bottom: 5px;
}
.app-body .hero h1 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.app-body .hero-sub {
  color: rgba(255,255,255,.78);
  font-size: 13.5px;
  margin-top: 8px;
}

/* ============================================================
   EN-TÊTES DE PAGE
   ============================================================ */
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 20px; margin-bottom: 4px; }
.page-header p { color: var(--text-3); font-size: 13px; }

.header-with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.header-with-actions h1 { font-size: 20px; margin-bottom: 4px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ============================================================
   CARTES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  /* x:auto → un tableau trop large défile dans sa carte au lieu d'être
     rogné ; y:hidden → les coins arrondis continuent de découper. */
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-mid);
  font-size: 14px;
  font-weight: 600;
}
.card-header h2, .card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px 18px; }
/* Un tableau SEUL dans le card-body occupe toute la largeur de la carte.
   Le « :only-child » est essentiel : sur les onglets de configuration où
   une table cohabite avec un formulaire (Catégories, Administrateurs,
   Saisons), on veut au contraire garder le padding — sinon tout le
   contenu se colle au bord gauche.
   Surtout pas de marge négative ici : quand la vue neutralise le
   padding du card-body, elle remonterait le tableau hors de la carte
   et masquerait sa ligne d'en-tête. */
.card-body:has(> .table:only-child) { padding: 0; }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
  padding: 12px 15px;
  border-radius: var(--r-field);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert-success { background: var(--ok-bg);   color: var(--ok-fg);   border-color: #CFE6DA; }
.alert-error   { background: var(--err-bg);  color: var(--err-fg);  border-color: #F3D3D1; }
.alert-info    { background: var(--info-bg); color: var(--info-fg); border-color: #D8E2EC; }
.alert strong { font-weight: 600; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-field);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { color: var(--text); }

.btn-primary {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
  border-color: var(--brand-dark);
}
.btn-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.btn-outline {
  background: var(--surface);
  border-color: var(--border-input);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--border-strong); color: var(--text); }

.btn-success { background: var(--ok-fg);   border-color: var(--ok-fg);   color: #fff; font-weight: 600; }
.btn-success:hover { background: #26694B; border-color: #26694B; color: #fff; }

.btn-danger  { background: var(--accent);  border-color: var(--accent);  color: #fff; font-weight: 600; }
.btn-danger:hover { background: #A82922; border-color: #A82922; color: #fff; }

.btn-warning { background: var(--wait-fg); border-color: var(--wait-fg); color: #fff; font-weight: 600; }
.btn-warning:hover { background: #96601580; color: #fff; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* Boutons icône des tableaux.
   Surtout PAS display:flex sur le <td> : une cellule en flex sort du
   calcul des largeurs de colonnes et vient chevaucher ses voisines.
   On reste en table-cell et on aligne les boutons en inline-flex. */
.actions-cell {
  white-space: nowrap;
  text-align: right;
}
.actions-cell > *,
.actions-cell form {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}
.actions-cell > *:first-child { margin-left: 0; }
.actions-cell .btn {
  height: 28px;
  width: 28px;
  padding: 0;
  border-color: var(--border);
  color: #6E7178;
  font-size: 13px;
}
.actions-cell .btn:hover { border-color: var(--border-strong); color: var(--text); }

/* Dans une ligne de tableau, les boutons restent neutres au repos et ne
   se colorent qu'au survol — comme dans la maquette, où seule
   l'interaction révèle la nature de l'action. Un aplat vert ou rouge
   permanent attirait l'œil plus que la donnée elle-même. */
.actions-cell .btn-success {
  background: var(--surface);
  border-color: var(--border);
  color: #6E7178;
}
.actions-cell .btn-success:hover {
  background: var(--ok-bg);
  border-color: transparent;
  color: var(--ok-fg);
}

.actions-cell .btn-danger,
.btn-delete-licencie {
  background: transparent;
  border-color: transparent;
  color: var(--placeholder);
}
.actions-cell .btn-danger:hover,
.btn-delete-licencie:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}
.form-group--sm   { flex: 0 0 130px; min-width: 130px; }
.form-group--auto { flex: 0 0 auto;  min-width: 0; }

.form-group label,
.form-group > span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.form-group label .req,
.required { color: var(--accent); }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select,
.form-group textarea,
input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="date"], input[type="password"],
select, textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--r-field);
  background: var(--surface-alt);
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27,58,92,.10);
  background: var(--surface);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-sunk);
  color: var(--text-3);
  cursor: not-allowed;
}

.field-hint { font-size: 11.5px; color: var(--text-3); }
.field-optionnel { font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.info-text  { font-size: 12.5px; color: var(--text-3); }
.text-muted { color: var(--text-3); }

/* Cases à cocher en carte */
.checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border-input);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .12s, background .12s;
}
.checkbox-label:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  width: 15px; height: 15px;
  flex: 0 0 15px;
  margin-top: 2px;
  accent-color: var(--brand-dark);
  height: 15px;
  padding: 0;
}
.checkbox-label strong { display: block; font-size: 13px; font-weight: 600; }
.checkbox-label small  { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Champ montant : les vues fournissent déjà leur propre <span>€</span>,
   on se contente donc de les aligner (pas de pseudo-élément, qui ferait doublon). */
.input-euro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.input-euro input {
  width: 96px;
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.input-euro > span {
  color: var(--text-3);
  font-size: 13px;
  flex: 0 0 auto;
}

/* ============================================================
   TABLEAUX
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  padding: 9px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-mid);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  /* Pas de nowrap : un intitulé long doit revenir à la ligne plutôt que
     d'élargir le tableau au-delà de la carte (qui le rognerait). */
  line-height: 1.35;
}
.table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-alt); }
.table strong { font-weight: 600; letter-spacing: -.01em; }
.table .num,
.table .right { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }

/* ---- Cellules composées (tableau des dossiers) ---- */
.cell-famille {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cell-famille-txt { min-width: 0; line-height: 1.3; }
.cell-famille-txt strong { display: block; }

/* Ligne secondaire : ville sous le nom, téléphone sous l'email */
.cell-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.35;
}
.cell-mail {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-passsport {
  display: inline-flex;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

/* La colonne d'actions se réduit à son contenu, pour laisser la
   place aux colonnes de texte. */
td.actions-cell { width: 1%; }

.table-responsive { overflow-x: auto; }

/* Dans un tableau, un champ ne doit pas s'étirer sur toute la cellule */
.table input[type="number"],
.table input[type="text"] { width: auto; min-width: 90px; }
.table .input-euro input { width: 96px; min-width: 0; }
.table td > label { margin: 0; }

.count-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  color: var(--text-3);
  font-size: 12.5px;
}

.empty {
  padding: 40px 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

/* Couleurs de ligne par statut */
.row-confirme   { background: rgba(46,125,91,.035); }
.row-en_attente { background: rgba(180,116,28,.035); }
.row-annule     { opacity: .55; }
.row-annule td  { text-decoration: line-through; }

/* ============================================================
   BADGES ET PASTILLES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--draft-bg);
  color: var(--draft-fg);
}
.badge-ok      { background: var(--ok-bg);    color: var(--ok-fg); }
.badge-warning { background: var(--wait-bg);  color: var(--wait-fg); }

.badge-statut-confirme   { background: var(--ok-bg);    color: var(--ok-fg); }
.badge-statut-en_attente { background: var(--wait-bg);  color: var(--wait-fg); }
.badge-statut-brouillon  { background: var(--draft-bg); color: var(--draft-fg); }
.badge-statut-annule     { background: var(--err-bg);   color: var(--err-fg); }

/* Point coloré devant le libellé — remplace visuellement les ✅ / ⏳
   qui préfixaient les statuts avant le passage au nouveau design. */
.badge[class*="badge-statut-"]::before,
.badge-ok::before,
.badge-warning::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 5px;
}
/* Les pastilles de discipline n'ont pas de point */
.badge-judo::before,
.badge-baby-judo::before,
.badge-self-defense::before,
.badge-saison::before { content: none; }

/* Disciplines : pastille carrée, pas ronde */
.badge-judo,
.badge-baby-judo,
.badge-self-defense {
  border-radius: 6px;
  padding: 3px 9px;
}
.badge-judo         { background: var(--judo-bg); color: var(--judo-fg); }
.badge-baby-judo    { background: var(--baby-bg); color: var(--baby-fg); }
.badge-self-defense { background: var(--self-bg); color: var(--self-fg); }

.badge-saison {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
}

/* Icônes SVG en ligne (helper Icone) — alignées sur la ligne de texte */
.ico {
  flex: 0 0 auto;
  vertical-align: -.18em;
}
.btn .ico, .nav-link .ico, .tab .ico { vertical-align: 0; }

/* Marqueurs oui / attente / non des tableaux (remplacent ✅ ⏳ ❌) */
.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.mark-yes  { background: var(--ok-bg);   color: var(--ok-fg); }
.mark-wait { background: var(--wait-bg); color: var(--wait-fg); }
.mark-no   { background: none; color: var(--placeholder); font-size: 13px; }

/* Initiales de famille dans les tableaux */
.initials {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: var(--r-nav);
  background: var(--info-bg);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   STATISTIQUES (tableau de bord)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px 18px;
  /* Les vues écrivent le nombre puis le libellé ; le design veut
     le libellé au-dessus. On inverse à l'affichage plutôt que de
     reprendre le balisage de chaque vue. */
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
}
.stat-label {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.stat-number {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  margin-top: 9px;
  line-height: 1.1;
}
/* Sous-titre grisé sous le grand chiffre (répartition par discipline) */
.stat-sub {
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 4px;
}
/* Le conteneur nombre + sous-titre reste dans le sens normal (le
   column-reverse de la carte ne concerne que libellé vs bloc chiffre) */
.stat-main { display: flex; flex-direction: column; }
.stat-ok      .stat-number { color: var(--ok-fg); }
.stat-pending .stat-number { color: var(--wait-fg); }
.stat-draft   .stat-number { color: var(--draft-fg); }

/* ============================================================
   FILTRES ET ONGLETS
   ============================================================ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Groupe de filtres façon segments */
.tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-sunk);
  padding: 3px;
  border-radius: var(--r-field);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 0;
  border-radius: var(--r-icon);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--draft-fg);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.tab:hover { color: var(--text); }
.tab-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-sm);
}

.search-bar { display: flex; align-items: center; gap: 8px; }
.search-input {
  height: 34px;
  min-width: 240px;
  padding: 0 12px;
  border-radius: var(--r-field);
  border: 1px solid var(--border-input);
  background: var(--surface-alt);
  font-size: 13px;
}
.select-saison,
.sport-select,
.passeport-select {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-nav);
  border: 1px solid var(--border-input);
  background: var(--surface-alt);
  font-size: 12.5px;
  width: auto;
}

/* ============================================================
   BLOCS LICENCIÉ (formulaire d'inscription)
   ============================================================ */
.licencie-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.licencie-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-mid);
}
.licencie-num {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: var(--brand-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.licencie-categorie-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--judo-bg);
  padding: 3px 9px;
  border-radius: 6px;
}
/* Largeur fixe, pas un flex-basis : dans un .form-group en colonne,
   la base flex devient une hauteur et le champ gonfle en carré. */
.annee-naissance { flex: 0 0 auto; width: 110px; min-width: 110px; }
.passeport-judo-field { flex: 0 0 190px; min-width: 190px; }

/* ---- Étapes d'inscription ---- */
.inscription-steps {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.step { display: flex; align-items: center; gap: 9px; }
.step-number {
  width: 22px; height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-name { font-size: 13px; font-weight: 500; color: var(--text-3); }
.step-active .step-number { background: var(--brand-dark); color: #fff; }
.step-active .step-name   { color: var(--text); font-weight: 600; }
.step-done   .step-number { background: var(--ok-fg); color: #fff; }
.step-done   .step-name   { color: var(--text-2); }

/* ============================================================
   COTISATIONS ET TOTAUX
   ============================================================ */
.cotisation-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  font-size: 13px;
}
.cotisation-montant {
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* Décomposition du montant : le détail à gauche, le total à droite.
   La famille doit pouvoir refaire le calcul de tête. */
.cotisation-detail {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--text-2);
}
.cotisation-total { flex: 0 0 auto; white-space: nowrap; }

/* Fiches admin en colonne contenue : même gabarit que le formulaire
   public (880px), une fiche étalée sur tout l'écran se lit mal. */
.page-etroite { max-width: 880px; margin: 0 auto; }

/* Journal du dossier : une ligne datée par action majeure */
.journal-dossier { list-style: none; margin: 0; padding: 0; }
.journal-dossier li {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.journal-dossier li:last-child { border-bottom: 0; }
.journal-date {
  flex: 0 0 auto;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Champ sans objet pour la discipline choisie : grisé, étoile masquée.
   Le select est aussi disabled — le style ne fait que le dire. */
.champ-off { opacity: .45; }
.champ-off .required { visibility: hidden; }
.champ-off select { cursor: not-allowed; }

/* Code Pass'Sport et son montant : deux champs courts côte à côte —
   le code ne fait que quelques caractères. */
.champ-passsport-code { flex: 0 0 220px; }
@media (max-width: 640px) { .champ-passsport-code { flex: 1 1 45%; } }

/* Ajout d'un licencié : sous le dernier bloc, en pleine largeur —
   après avoir rempli une personne, le geste suivant est juste là. */
.btn-ajouter-personne {
  display: block;
  width: 100%;
  margin: 14px 0 10px;
  padding: 13px;
  border: 2px dashed var(--brand);
  border-radius: var(--radius);
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease;
}
.btn-ajouter-personne:hover { background: #E4E6F8; }

/* Récapitulatif par licencié : le nom porte la ligne, le détail du
   calcul et le Pass'Sport nominatif en dessous, en plus discret. */
.recap-lic { align-items: flex-start; }
.recap-lic > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* La règle « span:last-child en gras » du total-line ne doit pas
   toucher ces sous-lignes (le détail est parfois dernier enfant). */
.total-line .recap-detail { font-size: 12px; font-weight: 400; color: var(--text-2); }
.total-line .recap-pass   { font-size: 12px; font-weight: 600; color: var(--brand-dark); }

/* Suggestion de correction d'email : discrète mais cliquable */
.email-suggestion {
  display: block;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

/* Avertissement : les justificatifs Pass'Sport seront contrôlés */
.note-verification {
  margin: 10px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--err-fg);
}

.total-recap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
}
.total-line:last-child { border-bottom: 0; }
/* Enfant direct seulement : la colonne du montant, pas les sous-lignes
   de détail imbriquées dans la colonne du nom. */
.total-line > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.total-deduction { color: var(--ok-fg); }
.total-final {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  margin-top: 6px;
  padding-top: 14px;
  font-size: 16px;
  font-weight: 600;
}
.total-final span:last-child { font-size: 20px; letter-spacing: -.02em; }

.recap-table { width: 100%; font-size: 13px; }
.recap-table td { padding: 7px 0; }
.recap-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   PASS'SPORT CAF
   ============================================================ */
.passsport-section {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
}
.passsport-registered {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.passsport-detail { color: var(--text-3); font-size: 12.5px; }
.passsport-deduction-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12.5px;
}
.file-uploaded { color: var(--ok-fg); font-weight: 600; font-size: 12.5px; }
.btn-toggle-passsport {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.btn-toggle-passsport:hover { color: var(--accent); }

/* ============================================================
   CARTE DE STATUT (tableau de bord famille)
   ============================================================ */
.status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.status-icon { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.status-brouillon  { border-left: 3px solid var(--draft-fg); }
.status-en_attente { border-left: 3px solid var(--wait-fg); }
.status-confirme   { border-left: 3px solid var(--ok-fg); }

.info-box,
.info-box-aide,
.tip-box {
  background: var(--info-bg);
  border: 1px solid #D8E2EC;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 13px;
  color: var(--info-fg);
  margin-bottom: 14px;
}

/* Variante rouge : pour ce qui engage la famille (acceptation du règlement).
   Le blanc sur --accent donne un contraste de 5,3:1, au-dessus du minimum
   AA de 4,5:1 pour du texte courant. Le lien reste souligné : sur un aplat
   coloré, la couleur seule ne suffit plus à le signaler. */
.info-box--rouge {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
.info-box--rouge strong { color: #FFFFFF; }
.info-box--rouge a,
.info-box--rouge a strong {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.info-box--rouge a:hover { text-decoration-thickness: 2px; }

/* ============================================================
   ÉTAPES DU WORKFLOW (page d'aide)
   ============================================================ */
.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.step-icon { font-size: 20px; flex: 0 0 auto; }

/* Points de statut de la page Aide (remplacent les anciens émojis) */
.step-dot {
  width: 9px; height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  margin-top: 5px;
}
.step-dot-brouillon  { background: var(--draft-fg); }
.step-dot-en_attente { background: var(--wait-fg); }
.step-dot-confirme   { background: var(--ok-fg); }
.step-desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.workflow-arrow { text-align: center; color: var(--text-3); font-size: 18px; margin: 2px 0; }

/* ============================================================
   MODALES
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(23,24,26,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-content {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sh-lg);
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ============================================================
   PAGE DE CONNEXION
   ============================================================ */
.login-page {
  background: var(--bg);
  min-height: 100vh;
  font-family: 'Archivo', system-ui, sans-serif;
}
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--sh-md);
}
/* Marque : carré sombre à coins arrondis, comme dans la sidebar */
.login-logo {
  /* Logo officiel seul, sans carré sombre. */
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo img, .login-logo svg { width: 100%; height: 100%; object-fit: contain; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 2px;
}
.login-card .form-group { margin-bottom: 14px; }
.login-subtitle {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  margin-bottom: 24px;
}
.login-info, .login-help {
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
  margin-top: 18px;
  line-height: 1.6;
}

/* ============================================================
   INFOBULLES
   ============================================================ */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  margin-left: 5px;
}
.tooltip-icon:hover { background: var(--brand); color: #fff; }
.tooltip-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  width: max-content;
  max-width: 260px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity .14s;
  z-index: 100;
  box-shadow: var(--sh-md);
  pointer-events: none;
}
.tooltip-icon:hover::after { opacity: 1; visibility: visible; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--sh-md);
  z-index: 300;
  animation: toast-in .22s ease-out;
}
.toast-success { background: var(--ok-fg); }
.toast-error   { background: var(--accent); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PIED DE PAGE
   ============================================================ */
.footer {
  padding: 20px 28px;
  color: var(--text-3);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ============================================================
   UTILITAIRES
   ============================================================ */
.center { text-align: center; }
.right  { text-align: right; }
.hidden { display: none !important; }
.mb-0   { margin-bottom: 0 !important; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.nowrap { white-space: nowrap; }
.num    { font-variant-numeric: tabular-nums; }

/* ============================================================
   RESPONSIVE — la sidebar passe en barre horizontale
   ============================================================ */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: column;
  }
  /* En-tête compact : la marque et la saison partagent une rangée.
     Repliée sur plusieurs lignes, la navigation occupait ~770 px —
     sur un téléphone on ne voyait que le menu, jamais le contenu. */
  .sidebar-brand { padding: 12px 16px; flex: 1; }
  .brand-icon { width: 30px; height: 30px; flex-basis: 30px; }

  .side-season {
    padding: 0 16px;
    display: flex;
    align-items: center;
  }
  .side-season-box { padding: 6px 10px; }
  .side-season-label { display: none; }

  /* Une seule rangée, qui défile latéralement au doigt */
  .side-nav,
  .side-foot {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding: 6px 12px;
    margin: 0;
  }
  .side-nav::-webkit-scrollbar,
  .side-foot::-webkit-scrollbar { display: none; }

  .side-nav { border-top: 1px solid var(--side-border); }
  .side-foot { border-top: 1px solid var(--side-border); }

  .side-group { display: none; }
  .nav-link {
    justify-content: flex-start;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .btn-logout { flex: 0 0 auto; white-space: nowrap; }
  .side-user { flex: 0 0 auto; }
  .side-user .user-name { max-width: 140px; }

  /* La marque et la saison sur la même ligne */
  .sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand season"
      "nav   nav"
      "foot  foot";
    align-items: center;
  }
  .sidebar-brand { grid-area: brand; }
  .side-season   { grid-area: season; }
  .side-nav      { grid-area: nav; }
  .side-foot     { grid-area: foot; }

  .topbar {
    height: auto;
    flex: none;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
    position: static;
  }
  .topbar-spacer { display: none; }
  .main-content { padding: 18px 16px 32px; }
  .search-input { min-width: 0; width: 100%; }

  /* Cartes de statistiques : deux par ligne plutôt qu'une */
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-card { padding: 12px 14px; }
  .stat-number { font-size: 24px; margin-top: 4px; }
  .stat-label { font-size: 10px; }
}

@media (max-width: 620px) {
  .form-group, .form-group--sm, .form-group--auto {
    flex: 1 1 100%;
    min-width: 0;
  }
  .table { font-size: 12.5px; }
  .table thead th, .table tbody td { padding: 10px 12px; }
  .card-body { padding: 16px 14px; }
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
  .sidebar, .topbar, .footer, .actions-bar, .filters-bar, .tabs { display: none !important; }
  .app-shell { display: block; }
  .main-content { padding: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* ============================================================
   SITE PUBLIC — vitrine et préinscription
   ============================================================ */
.site-public { background: var(--bg); }

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  margin-right: auto;
}
.site-brand:hover { color: inherit; }
.site-brand .brand-name { color: var(--text); }
.site-brand .brand-sub  { color: var(--text-3); }

.site-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

/* ---- Accroche ---- */
.hero { margin-bottom: 40px; }
.hero h1 {
  font-size: 30px;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}
.hero-lead {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 64ch;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero-note { font-size: 13px; color: var(--text-3); }

/* ---- Blocs de contenu ---- */
.bloc { margin-bottom: 40px; }
.bloc h2 {
  font-size: 19px;
  margin-bottom: 16px;
  letter-spacing: -.02em;
}
.bloc p { color: var(--text-2); line-height: 1.6; }

.etapes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.etape {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px 20px;
}
.etape-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.etape h3 { font-size: 14.5px; margin-bottom: 6px; }
.etape p  { font-size: 13.5px; color: var(--text-3); line-height: 1.55; }

/* ---- Confirmation de préinscription ---- */
.confirmation { text-align: center; margin-bottom: 32px; }
.confirmation .hero-lead { margin: 0 auto 20px; }
.confirmation-marque {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok-fg);
  margin-bottom: 18px;
}
.confirmation-marque svg { width: 28px; height: 28px; }
.confirmation h1 { font-size: 26px; margin-bottom: 10px; letter-spacing: -.02em; }
.confirmation .alert { text-align: left; }

/* ---- Pied de page public ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 28px;
}
.site-footer-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-3);
}
.site-footer-sep { color: var(--border-strong); }
.site-footer-spacer { flex: 1; }
/* Accès administration : présent mais discret */
.site-footer-admin { color: var(--text-3); }
.site-footer-admin:hover { color: var(--brand); }

/* ---- Séparateur « ou » de la page de connexion ---- */
.login-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--text-3);
  font-size: 12.5px;
}
.login-sep::before, .login-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

@media (max-width: 620px) {
  .site-header { padding: 12px 16px; }
  .site-main   { padding: 24px 16px 40px; }
  .hero h1     { font-size: 24px; }
}

@media print {
  .site-header, .site-footer, .actions-bar { display: none !important; }
  .site-main { padding: 0; max-width: none; }
}

/* ============================================================
   AJUSTEMENTS DESIGN v2
   Surcharges appliquées après les règles de base : capitales
   marquées, badges rectangulaires, lignes de tableau en blocs.
   ============================================================ */

/* ---- En-têtes de carte : titre de section en bleu électrique ---- */
.card-header {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
  border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}

/* ---- Badges : rectangulaires, capitales ---- */
.badge {
  border-radius: var(--r-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}
/* Le point coloré de la v1 disparaît : la couleur du fond suffit */
.badge[class*="badge-statut-"]::before { content: none; }

.badge-judo, .badge-baby-judo, .badge-self-defense {
  border-radius: var(--r-pill);
  letter-spacing: .04em;
}

/* ---- Boutons ---- */
.btn {
  border-radius: var(--r-field);
  font-weight: 600;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline:hover { border-color: var(--brand-dark); color: var(--brand-dark); }
.actions-cell .btn:hover { border-color: var(--brand-dark); color: var(--brand-dark); }

/* ---- Statistiques ---- */
.stat-label { font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-dark);
  margin-top: 10px;
}
.stat-ok .stat-number      { color: var(--ok-fg); }
.stat-pending .stat-number { color: var(--wait-fg); }
.stat-draft .stat-number   { color: var(--draft-fg); }

/* ---- Tableaux : lignes aérées, en-tête sans aplat ---- */
.table thead th {
  background: transparent;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  border-bottom: 1px solid var(--border);
}
.table tbody td { border-bottom: 1px solid var(--border-soft); }
.table tbody tr:hover { background: var(--surface-hover); }
.table strong { font-weight: 700; }

/* Initiales : rondes, aplat indigo */
.initials {
  width: 34px; height: 34px;
  flex-basis: 34px;
  border-radius: 50%;
  background: var(--brand-dark);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

/* ---- Filtres segmentés ---- */
.tabs { border-radius: var(--r-field); }
.tab {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
.tab-active { background: var(--surface); color: var(--brand); box-shadow: var(--sh-sm); }
.tab-count { font-weight: 500; opacity: .65; }

/* ---- Étapes d'inscription ---- */
.step-active .step-number { background: var(--brand); }
.step-done   .step-number { background: var(--ok-fg); }
.licencie-num { background: var(--brand-dark); }

/* ---- Site public : la topbar sert d'en-tête ---- */
.site-header { height: var(--topbar-h); padding: 0 26px; gap: 22px; }
.site-main   { max-width: 940px; }
.hero-public h1 { font-size: 32px; text-transform: uppercase; letter-spacing: -.02em; }
.etape-num { background: var(--brand-dark); font-weight: 700; }
.confirmation-marque { background: var(--ok-bg); color: var(--ok-fg); }

/* ---- Responsive : la sidebar repasse au-dessus du contenu ---- */
@media (max-width: 900px) {
  /* En colonne, « align-items: flex-start » ferait prendre aux enfants la
     largeur de leur CONTENU : la navigation défilante (près de 1000 px)
     imposait alors sa largeur à toute la page. On force l'étirement, et
     min-width:0 autorise les enfants à se réduire sous leur contenu. */
  .app-body {
    flex-direction: column;
    align-items: stretch;
  }
  .app-main, .sidebar { min-width: 0; max-width: 100%; }
  .sidebar {
    width: 100%;
    flex: none;
    min-height: 0;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }
  .side-espace { display: none; }
  .side-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: var(--r-nav);
  }
  .nav-link.nav-active { border-left: 0; border-bottom-color: var(--brand); }
  .side-foot { flex-direction: row; margin-top: 4px; }
  .side-group { display: none; }

  .topbar { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; position: static; }
  .topbar-sep, .topbar-spacer { display: none; }
  .user-name { max-width: 120px; }

  .hero { height: auto; padding: 24px 22px; }
  .hero h1 { font-size: 26px; }
  .main-content { padding: 18px 16px 32px; }
}

/* Annotation Pass'Sport dans la colonne des montants : discrète et
   bornée, pour ne pas élargir la colonne au point de repousser les
   actions hors de la carte. */
.cell-passsport {
  font-size: 10px;
  letter-spacing: .03em;
  padding: 2px 7px;
  max-width: 110px;
  white-space: normal;
  text-align: center;
}

/* Tableaux denses : l'interlettrage des en-têtes en capitales élargit
   les colonnes étroites (« LICENCIÉS », « ENCAISSÉ ») bien au-delà de
   leur contenu. On le réduit et on resserre les cellules. */
.table thead th { letter-spacing: .05em; padding: 9px 11px; }
.table tbody td { padding: 12px 11px; }
.table .cell-mail { max-width: 180px; }

/* ---- En-têtes de colonne triables ---- */
.table th.tri { padding: 0; }
.table th.tri > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  transition: color .12s;
}
.table th.tri > a:hover { color: var(--brand); }
.table th.tri.center > a { justify-content: center; }
.table th.tri.right  > a { justify-content: flex-end; }
.table th.tri-actif > a { color: var(--brand); }
.tri-fleche { font-size: 8px; line-height: 1; }

/* ---- Colonne d'actions toujours accessible ----
   Sur les tableaux larges (les licenciés en ont 14 colonnes), la
   colonne d'actions sortait du cadre et les boutons devenaient
   invisibles sans défiler. On l'épingle à droite : elle reste sous
   la main quelle que soit la position horizontale. */
.table th.actions-col,
.table td.actions-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  /* Liseré discret pour signaler que du contenu passe dessous */
  box-shadow: -8px 0 8px -8px rgba(20,22,31,.18);
}
.table thead th.actions-col { z-index: 2; }
/* Le fond doit suivre l'état de la ligne, sinon la colonne épinglée
   resterait blanche au-dessus d'une ligne colorée ou survolée. */
.table tbody tr:hover td.actions-cell     { background: var(--surface-hover); }
.table tbody tr.row-confirme td.actions-cell   { background: #FAFCFB; }
.table tbody tr.row-en_attente td.actions-cell { background: #FEFCF8; }
.table tbody tr.row-annule td.actions-cell     { background: var(--surface); }

/* ---- Densité des tableaux ----
   Les tableaux de gestion comptent jusqu'à 14 colonnes : on gagne de
   la place sur le rembourrage et la taille de police plutôt que de
   sacrifier des colonnes. */
.table { font-size: 12.5px; }
.table thead th { padding: 8px 9px; font-size: 10px; }
.table th.tri > a { padding: 8px 9px; }
.table tbody td { padding: 9px 9px; }
.table .badge { padding: 3px 7px; font-size: 10.5px; }
.table .initials { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.table .cell-mail { font-size: 12px; max-width: 165px; }
.table .cell-sub  { font-size: 11px; }
.actions-cell .btn { height: 26px; width: 26px; }

/* ============================================================
   BARRE LATÉRALE REPLIABLE
   L'état est porté par <html> (et non par le body) : il est ainsi
   applicable avant le premier rendu, sans repli visible à l'écran.
   ============================================================ */
.btn-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.btn-sidebar:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-alt); }
.btn-sidebar svg { width: 18px; height: 18px; }

.sidebar {
  /* La largeur est animée : overflow caché pour que le contenu ne
     déborde pas pendant la transition. */
  overflow: hidden;
  transition: width .22s ease, flex-basis .22s ease, padding .22s ease, opacity .18s ease;
}

html.sidebar-fermee .sidebar {
  width: 0;
  flex-basis: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

/* Le contenu récupère la place libérée */
html.sidebar-fermee .app-main { width: 100%; }

/* Repère visuel sur le bouton quand la barre est repliée */
html.sidebar-fermee .btn-sidebar { border-color: var(--brand); color: var(--brand); }

/* Sur mobile la barre est déjà une rangée défilante : le repli n'a
   pas de sens, et la masquer priverait de toute navigation. */
@media (max-width: 900px) {
  .btn-sidebar { display: none; }
  html.sidebar-fermee .sidebar {
    width: 100%;
    flex-basis: auto;
    padding: 10px 12px;
    opacity: 1;
    pointer-events: auto;
    border-right-color: transparent;
  }
}

/* Respecte le réglage système « animations réduites » */
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ============================================================
   INFOBULLES RAPIDES
   Le title natif du navigateur met ~1 s à apparaître et n'est pas
   réglable. On le remplace par une infobulle maison, affichée en
   80 ms. Elle est attachée au <body> et positionnée en `fixed` :
   dans la carte, dont l'overflow permet le défilement du tableau,
   une infobulle en CSS pur serait rognée.
   ============================================================ */
.infobulle {
  position: fixed;
  z-index: 300;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .08s ease, transform .08s ease;
  box-shadow: var(--sh-md);
}
.infobulle.visible { opacity: 1; transform: translateY(0); }
/* Petite pointe vers l'élément survolé */
.infobulle::after {
  content: '';
  position: absolute;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
}
.infobulle[data-sens="haut"]::after { top: 100%; border-top-color: var(--text); }
.infobulle[data-sens="bas"]::after  { bottom: 100%; border-bottom-color: var(--text); }

/* Pot de miel anti-robots : hors écran plutôt que display:none, que
   certains robots reconnaissent et ignorent. Invisible à l'œil, retiré
   du parcours clavier et des lecteurs d'écran via aria-hidden. */
.piege {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Bouton « préinscriptions fermées » ----
   Volontairement rouge et non cliquable : la fermeture doit se
   comprendre d'un coup d'œil, sans lire le paragraphe. */
.btn-ferme {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: not-allowed;
  opacity: .9;
}
.btn-ferme:hover { color: #fff; }

/* ---- Soirée d'inscription ---- */
.soiree {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
}
.soiree-quand {
  display: flex;
  flex-direction: column;
  padding-right: 24px;
  border-right: 1px solid var(--border);
}
.soiree-jour {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--brand);
  text-transform: uppercase;
}
.soiree-heure { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.soiree-ou { font-size: 14px; line-height: 1.6; color: var(--text-2); }

@media (max-width: 620px) {
  .soiree { gap: 14px; }
  .soiree-quand {
    padding-right: 0;
    padding-bottom: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .soiree-jour { font-size: 17px; }
}

/* ============================================================
   LISIBILITÉ — texte courant agrandi (2026)
   On ne touche NI aux boutons (.btn) NI aux titres (h1/h2/h3,
   .card-header, .page-header h1) : seul le texte de lecture
   (tableaux, formulaires, libellés, aides) est agrandi.
   ============================================================ */
.table                    { font-size: 14px; }
.table td                 { font-size: 14px; }
.table thead th           { font-size: 11.5px; }
.table .badge             { font-size: 11.5px; }
input, select, textarea   { font-size: 14.5px; }
label                     { font-size: 13.5px; }
.info-text                { font-size: 13.5px; }
.field-hint               { font-size: 12.5px; }
.page-header p            { font-size: 14px; }
.cell-sub, .cell-mail     { font-size: 13px; }

/* ============================================================
   PRÉINSCRIPTION — choix obligatoire (droit à l'image) et
   consultation du règlement sans quitter le formulaire
   ============================================================ */
.choix-box { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
             justify-content: space-between; margin-top: 18px; }
.choix-titre strong { display: block; color: var(--text); font-size: 13.5px; }
.choix-titre small  { display: block; color: var(--text-3); font-size: 12.5px;
                      line-height: 1.5; margin-top: 3px; max-width: 62ch; }
.choix-options { display: flex; gap: 10px; flex-wrap: wrap; }
/* Cibles larges : sur mobile, un rond de 16 px se rate une fois sur deux. */
.choix-radio { display: flex; align-items: center; gap: 8px; cursor: pointer;
               background: var(--surface); border: 1px solid var(--border-input);
               border-radius: 8px; padding: 9px 14px; font-size: 13.5px;
               font-weight: 600; color: var(--text-2); white-space: nowrap; }
.choix-radio:hover { border-color: var(--border-strong); }
.choix-radio input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.choix-radio:has(input:checked) { border-color: var(--brand); background: var(--info-bg);
                                  color: var(--brand); }

.reglement-lire { margin-bottom: 12px; }
.reglement-lire > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  list-style: none; padding: 11px 14px; border-radius: 8px;
  background: var(--brand); color: #FFFFFF; font-weight: 600; font-size: 13.5px;
}
.reglement-lire > summary::-webkit-details-marker { display: none; }
.reglement-lire > summary:hover { background: var(--brand-dark); }
.reglement-lire-icone { font-size: 16px; }
.reglement-lire-flag { margin-left: auto; font-weight: 400; font-size: 12px; opacity: .85; }
.reglement-lire[open] > summary .reglement-lire-flag::after { content: ' (replier)'; }
.reglement-lire-corps { border: 1px solid var(--border); border-top: none;
                        border-radius: 0 0 8px 8px; padding: 12px; background: var(--surface); }
.reglement-lire-corps iframe { width: 100%; height: 420px; border: 1px solid var(--border);
                               border-radius: 6px; background: var(--surface-alt); }
.reglement-lire-dl { margin-top: 10px; display: inline-block; }
@media (max-width: 640px) {
  .choix-box { flex-direction: column; align-items: flex-start; }
  .choix-options { width: 100%; }
  .choix-radio { flex: 1; justify-content: center; }
  /* Beaucoup de mobiles n'affichent pas un PDF dans un cadre : on réduit la
     hauteur et le bouton de téléchargement prend le relais. */
  .reglement-lire-corps iframe { height: 260px; }
}
