/* =========================================================================
   Système de design — Fédération de Football de Mdjoiezi
   Palette vert sombre, typographie sobre, densité adaptée à un back-office
   administratif consulté toute la journée.
   ========================================================================= */

:root {
    /* Verts, du plus sombre au plus clair */
    --v-950: #06180F;
    --v-900: #0A2318;
    --v-850: #0D2E20;
    --v-800: #103A28;
    --v-700: #14513C;
    --v-600: #196B4E;
    --v-500: #1E8560;
    --v-400: #2FA477;
    --v-300: #5BC199;
    --v-200: #9BDCC1;
    --v-100: #D8F0E4;
    --v-50:  #F2F9F5;

    /* Neutres chauds, accordés au vert */
    --n-900: #16241F;
    --n-700: #3D5049;
    --n-600: #55685F;
    --n-500: #6B8078;
    --n-400: #93A69D;
    --n-300: #BFCEC7;
    --n-200: #DCE7E1;
    --n-100: #EDF3F0;
    --n-50:  #F7FAF8;
    --blanc: #FFFFFF;

    /* Accents fonctionnels */
    --or:      #C8A233;
    --or-clair:#F6EDD2;
    --succes:  #1E8560;
    --succes-bg:#E4F4EC;
    --alerte:  #B07A12;
    --alerte-bg:#FCF2DC;
    --danger:  #B3452F;
    --danger-bg:#FBE9E5;
    --info:    #2A6F97;
    --info-bg: #E5F0F7;

    /* Couleurs réglementaires des cartons */
    --carton-j: #E0A81C;
    --carton-r: #C4362A;

    --rayon: 8px;
    --rayon-sm: 5px;
    --rayon-lg: 14px;

    --ombre-1: 0 1px 2px rgba(6, 24, 15, .06), 0 1px 3px rgba(6, 24, 15, .05);
    --ombre-2: 0 2px 6px rgba(6, 24, 15, .07), 0 8px 20px rgba(6, 24, 15, .06);
    --ombre-3: 0 12px 32px rgba(6, 24, 15, .14);

    --barre-l: 258px;
    --entete-h: 60px;

    --police: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --police-chiffres: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

    --transition: 140ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--police);
    font-size: 14px;
    line-height: 1.55;
    color: var(--n-900);
    background: var(--n-50);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: .95rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--v-600); text-decoration: none; }
a:hover { color: var(--v-500); text-decoration: underline; }

.num { font-family: var(--police-chiffres); font-variant-numeric: tabular-nums; }

/* ---------- Icônes ----------
   Taille de référence 16 px. Le width/height figure aussi en attribut sur le
   SVG : sans lui, une icône placée dans un conteneur sans règle dédiée
   s'étirerait à toute la largeur disponible. */

.ico {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-block;
    vertical-align: -0.16em;
    stroke-width: 1.6;
}

.ico-sm { width: 13px; height: 13px; flex-basis: 13px; stroke-width: 1.8; }
.ico-lg { width: 19px; height: 19px; flex-basis: 19px; stroke-width: 1.5; }
.ico-xl { width: 30px; height: 30px; flex-basis: 30px; stroke-width: 1.3; }

/* Couleurs porteuses de sens : un carton jaune est jaune, un rouge est rouge. */
.ico-jaune { color: var(--carton-j); }
.ico-rouge { color: var(--carton-r); }
.ico-vert  { color: var(--succes); }
.ico-or    { color: var(--or); }
.ico-gris  { color: var(--n-400); }
.ico-info  { color: var(--info); }

/* Événement de match : pastille icône + libellé */
.evt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.evt .ico { flex-shrink: 0; }

/* ---------- Ossature ---------- */

.app { display: flex; min-height: 100vh; }

/* Deux navigations pour un même balisage.
   Sur un écran étroit, la barre est un tiroir : masquée, elle glisse de la
   gauche vers la droite au-dessus du contenu. Sur un écran large, elle
   redevient la colonne fixe habituelle — la place ne manque pas, et un menu
   toujours visible s'y consulte plus vite qu'un menu à ouvrir.
   Les règles ci-dessous décrivent le tiroir ; la bascule vers la colonne se
   fait plus bas, à partir de 901 px. */
.barre {
    width: min(var(--barre-l), 86vw);
    background: var(--v-900);
    color: var(--v-100);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .22s ease;
}

.barre.ouverte { transform: translateX(0); box-shadow: var(--ombre-3); }

/* Le voile ferme le tiroir au clic et signale que le reste est en attente. */
.voile-nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(6, 24, 15, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.voile-nav.ouvert { opacity: 1; visibility: visible; }

/* Bouton d'ouverture, en tête de l'en-tête. */
.bouton-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border: 1px solid var(--n-300);
    border-radius: var(--rayon-sm);
    background: var(--blanc);
    color: var(--n-700);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}

.bouton-nav:hover { background: var(--n-50); color: var(--n-900); border-color: var(--n-400); }
.bouton-nav:focus-visible { outline: 2px solid var(--v-400); outline-offset: 2px; }
.bouton-nav .ico { width: 19px; height: 19px; flex-basis: 19px; }

/* Fermeture depuis l'intérieur du tiroir, à portée de pouce. */
.barre-fermer {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--rayon-sm);
    background: rgba(255, 255, 255, .08);
    color: var(--v-100);
    cursor: pointer;
}

.barre-fermer:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.barre-fermer:focus-visible { outline: 2px solid var(--v-300); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .barre, .voile-nav { transition: none; }
}

/* À partir de 901 px, la barre reprend sa place de colonne fixe : plus de
   tiroir, plus de voile, plus de bouton. C'est la disposition d'origine. */
@media (min-width: 901px) {
    .barre {
        position: sticky;
        top: 0;
        height: 100vh;
        width: var(--barre-l);
        flex: 0 0 var(--barre-l);
        transform: none;
        transition: none;
        z-index: auto;
    }

    .barre.ouverte { box-shadow: none; }
    .bouton-nav, .voile-nav, .barre-fermer { display: none; }
}

.barre-marque {
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 11px;
}

.marque-ecu {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    background: linear-gradient(150deg, var(--v-500), var(--v-700));
    display: grid;
    place-items: center;
    font-weight: 750;
    font-size: 13px;
    color: var(--blanc);
    letter-spacing: .02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.marque-nom { font-size: 13.5px; font-weight: 650; color: var(--blanc); line-height: 1.2; }
.marque-sous { font-size: 10.5px; color: var(--v-300); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }

.barre-saison { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }

.barre-nav { flex: 1; padding: 14px 12px 20px; }

.nav-groupe { margin-bottom: 18px; }

.nav-titre {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--v-300);
    opacity: .72;
    padding: 0 10px 7px;
    font-weight: 600;
}

.nav-lien {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--rayon-sm);
    color: var(--v-100);
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    position: relative;
}

.nav-lien:hover { background: rgba(255, 255, 255, .07); color: var(--blanc); text-decoration: none; }

.nav-lien.actif {
    background: var(--v-700);
    color: var(--blanc);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--v-300);
}

.nav-lien .ico { opacity: .82; }
.nav-lien.actif .ico { opacity: 1; }

.nav-compteur {
    margin-left: auto;
    background: var(--v-500);
    color: var(--blanc);
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.nav-compteur.attention { background: var(--or); color: var(--v-950); }

.barre-pied {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 33px; height: 33px;
    flex: 0 0 33px;
    border-radius: 50%;
    background: var(--v-600);
    color: var(--blanc);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 650;
}

.pied-nom { font-size: 12.5px; font-weight: 600; color: var(--blanc); line-height: 1.25; }
.pied-role { font-size: 10.5px; color: var(--v-300); }

/* ---------- Zone principale ---------- */

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.entete {
    height: var(--entete-h);
    background: var(--blanc);
    border-bottom: 1px solid var(--n-200);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.fil { font-size: 12.5px; color: var(--n-500); display: flex; align-items: center; gap: 7px; }
.fil a { color: var(--n-500); }
.fil a:hover { color: var(--v-600); }
.fil .sep { color: var(--n-300); }
.fil .actuel { color: var(--n-900); font-weight: 600; }

.entete-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.contenu { flex: 1; padding: 24px 26px 44px; max-width: 1560px; width: 100%; }

.page-tete {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-tete .titres { flex: 1; min-width: 240px; }
.page-tete .accroche { color: var(--n-500); font-size: 13.5px; margin: 4px 0 0; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Cartes ---------- */

.carte {
    background: var(--blanc);
    border: 1px solid var(--n-200);
    border-radius: var(--rayon);
    box-shadow: var(--ombre-1);
}

.carte-tete {
    padding: 14px 18px;
    border-bottom: 1px solid var(--n-200);
    display: flex;
    align-items: center;
    gap: 12px;
}

.carte-tete h2, .carte-tete h3 { flex: 1; }
.carte-tete > .ico { color: var(--v-600); }
.carte-corps { padding: 18px; }
.carte-corps.serre { padding: 0; }
.carte-pied { padding: 12px 18px; border-top: 1px solid var(--n-200); background: var(--n-50); border-radius: 0 0 var(--rayon) var(--rayon); }

.grille { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

/* ---------- Indicateurs ---------- */

.kpi {
    background: var(--blanc);
    border: 1px solid var(--n-200);
    border-radius: var(--rayon);
    padding: 16px 18px;
    box-shadow: var(--ombre-1);
    position: relative;
    overflow: hidden;
}

.kpi::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--v-500);
}

.kpi.or::before     { background: var(--or); }
.kpi.danger::before { background: var(--danger); }
.kpi.info::before   { background: var(--info); }
.kpi.neutre::before { background: var(--n-300); }

.kpi-lib { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--n-500); font-weight: 600; }
.kpi-val { font-size: 27px; font-weight: 700; color: var(--v-900); line-height: 1.15; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; color: var(--n-500); margin-top: 3px; }

/* ---------- Tableaux ---------- */

.tableau-enveloppe { overflow-x: auto; }

table.tableau { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.tableau th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--n-600);
    font-weight: 650;
    padding: 10px 14px;
    background: var(--n-100);
    border-bottom: 1px solid var(--n-200);
    white-space: nowrap;
}

table.tableau td { padding: 11px 14px; border-bottom: 1px solid var(--n-100); vertical-align: middle; }
table.tableau tbody tr:hover { background: var(--v-50); }
table.tableau tbody tr:last-child td { border-bottom: 0; }
table.tableau .c { text-align: center; }
table.tableau .d { text-align: right; }
table.tableau .fort { font-weight: 650; color: var(--v-900); }
table.tableau .discret { color: var(--n-500); font-size: 12.5px; }

.tableau.dense td, .tableau.dense th { padding: 7px 11px; }

/* En-tête cliquable pour le tri */
th.th-triable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px !important;
}
th.th-triable:hover { background: var(--n-200); color: var(--v-700); }
th.th-triable::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -5px;
    width: 7px;
    height: 10px;
    opacity: .3;
    background: currentColor;
    clip-path: polygon(50% 0, 100% 38%, 0 38%, 50% 0, 50% 100%, 100% 62%, 0 62%);
}
th.th-triable[data-sens]::after { opacity: .95; }
th.th-triable[data-sens="asc"]::after { clip-path: polygon(50% 4%, 100% 62%, 0 62%); }
th.th-triable[data-sens="desc"]::after { clip-path: polygon(50% 96%, 100% 38%, 0 38%); }

/* Requête de recherche en cours : la liste s'estompe légèrement. */
table.en-recherche tbody { opacity: .45; transition: opacity 120ms; }

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-top: 1px solid var(--n-200);
    background: var(--n-50);
    border-radius: 0 0 var(--rayon) var(--rayon);
}

.pg-compte { font-size: 12.5px; color: var(--n-600); }
.pg-compte strong { color: var(--n-900); }

.pg-liens { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.pg-lien {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 30px;
    justify-content: center;
    padding: 5px 9px;
    border-radius: var(--rayon-sm);
    border: 1px solid var(--n-300);
    background: var(--blanc);
    color: var(--n-700);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.pg-lien:hover { background: var(--n-100); color: var(--v-700); text-decoration: none; border-color: var(--n-400); }
.pg-lien.actif { background: var(--v-700); border-color: var(--v-700); color: var(--blanc); cursor: default; }
.pg-ellipse { color: var(--n-400); padding: 0 2px; }

/* Message affiché quand un filtre ne laisse aucune ligne */
.aucun-resultat {
    padding: 26px 22px;
    text-align: center;
    color: var(--n-500);
    font-size: 13.5px;
}

.ligne-cliquable { cursor: pointer; }

/* Classement */
.rang { font-weight: 700; font-variant-numeric: tabular-nums; width: 34px; }
tr.montee    td:first-child { box-shadow: inset 3px 0 0 var(--v-500); }
tr.descente  td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.forme { display: inline-flex; gap: 3px; }
.forme span {
    width: 17px; height: 17px;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    color: var(--blanc);
}
.forme .V { background: var(--succes); }
.forme .N { background: var(--n-400); }
.forme .D { background: var(--danger); }

/* ---------- Étiquettes de statut ---------- */

.etiq {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.5;
}

.etiq::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.etiq.sans-point::before { display: none; }

.etiq-neutre  { background: var(--n-100);   color: var(--n-600); }
.etiq-succes  { background: var(--succes-bg); color: var(--succes); }
.etiq-alerte  { background: var(--alerte-bg); color: var(--alerte); }
.etiq-danger  { background: var(--danger-bg); color: var(--danger); }
.etiq-info    { background: var(--info-bg);   color: var(--info); }
.etiq-or      { background: var(--or-clair);  color: #8A6D14; }

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: var(--rayon-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--v-400); outline-offset: 2px; }
.btn:disabled, .btn.desactive { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-principal { background: var(--v-700); color: var(--blanc); box-shadow: var(--ombre-1); }
.btn-principal:hover { background: var(--v-600); color: var(--blanc); }

.btn-second { background: var(--blanc); color: var(--n-900); border-color: var(--n-300); }
.btn-second:hover { background: var(--n-50); border-color: var(--n-400); color: var(--n-900); }

.btn-fantome { background: transparent; color: var(--n-600); }
.btn-fantome:hover { background: var(--n-100); color: var(--n-900); }

.btn-danger { background: var(--danger); color: var(--blanc); }
.btn-danger:hover { background: #9B3A26; color: var(--blanc); }

.btn-or { background: var(--or); color: var(--v-950); }
.btn-or:hover { background: #B8942C; color: var(--v-950); }

.btn-sm { font-size: 12.5px; padding: 5px 11px; }
.btn-lg { font-size: 15px; padding: 11px 22px; }
.btn-bloc { width: 100%; }
.btn-icone { padding: 7px; }
.btn .ico { width: 15px; height: 15px; flex-basis: 15px; }

.groupe-btn { display: inline-flex; }
.groupe-btn .btn { border-radius: 0; margin-left: -1px; }
.groupe-btn .btn:first-child { border-radius: var(--rayon-sm) 0 0 var(--rayon-sm); margin-left: 0; }
.groupe-btn .btn:last-child { border-radius: 0 var(--rayon-sm) var(--rayon-sm) 0; }

/* ---------- Formulaires ---------- */

.champ { margin-bottom: 15px; }
.champ:last-child { margin-bottom: 0; }

.champ label, .etiquette {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--n-700);
    margin-bottom: 5px;
}

.champ .requis { color: var(--danger); margin-left: 2px; }

.saisie, .champ input[type="text"], .champ input[type="email"], .champ input[type="password"],
.champ input[type="date"], .champ input[type="datetime-local"], .champ input[type="number"],
.champ input[type="tel"], .champ input[type="search"], .champ input[type="color"],
.champ select, .champ textarea {
    width: 100%;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--n-900);
    background: var(--blanc);
    border: 1px solid var(--n-300);
    border-radius: var(--rayon-sm);
    padding: 8px 11px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.saisie:focus, .champ input:focus, .champ select:focus, .champ textarea:focus {
    outline: none;
    border-color: var(--v-500);
    box-shadow: 0 0 0 3px rgba(30, 133, 96, .13);
}

.champ input[type="color"] { padding: 3px; height: 36px; }
.champ textarea { min-height: 84px; resize: vertical; }
.champ .aide { font-size: 12px; color: var(--n-500); margin-top: 4px; }

/* Verdict d'éligibilité affiché sous le sélecteur de catégorie. */
.verdict {
    font-size: 12.5px;
    margin-top: 6px;
    padding: 7px 10px;
    border-radius: 7px;
    line-height: 1.45;
}
.verdict-accord { background: var(--succes-bg); color: var(--succes); }
.verdict-refus  { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.verdict-neutre { display: none; }
.champ .erreur { font-size: 12px; color: var(--danger); margin-top: 4px; font-weight: 500; }
.champ.en-erreur input, .champ.en-erreur select, .champ.en-erreur textarea { border-color: var(--danger); }

.case { display: flex; align-items: flex-start; gap: 9px; }
.case input[type="checkbox"], .case input[type="radio"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--v-600); flex: 0 0 16px; }
.case label { margin: 0; font-weight: 500; color: var(--n-900); }

.champs-ligne { display: grid; gap: 15px; }
.cl-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cl-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cl-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

fieldset.bloc { border: 0; padding: 0; margin: 0 0 22px; }
fieldset.bloc legend {
    padding: 0 0 9px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--v-700);
    border-bottom: 1px solid var(--n-200);
    width: 100%;
    margin-bottom: 15px;
}

/* Barre de filtres */
.filtres {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--n-50);
    border-bottom: 1px solid var(--n-200);
}
.filtres .champ { margin: 0; min-width: 150px; }
.filtres .champ.large { flex: 1; min-width: 220px; }

/* ---------- Messages ---------- */

.alerte-bloc {
    display: flex;
    gap: 11px;
    padding: 12px 15px;
    border-radius: var(--rayon-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
    border: 1px solid;
    align-items: flex-start;
}

.alerte-bloc > .ico { margin-top: 2px; }
.alerte-bloc strong { display: block; margin-bottom: 2px; }
.alerte-bloc ul { margin: 6px 0 0; padding-left: 18px; }
.alerte-bloc li { margin-bottom: 3px; }

.a-succes { background: var(--succes-bg); border-color: #B5E0CB; color: #15543D; }
.a-alerte { background: var(--alerte-bg); border-color: #EBD199; color: #7A5409; }
.a-danger { background: var(--danger-bg); border-color: #EFC2B7; color: #7F2F1F; }
.a-info   { background: var(--info-bg);   border-color: #BCD8E9; color: #1E4E6B; }

/* ---------- Vide et divers ---------- */

.vide { text-align: center; padding: 46px 22px; color: var(--n-500); }
.vide > .ico { width: 30px; height: 30px; flex-basis: 30px; color: var(--n-300); margin-bottom: 11px; stroke-width: 1.3; }
.vide h3 { color: var(--n-700); margin-bottom: 5px; }
.vide p { font-size: 13.5px; max-width: 430px; margin: 0 auto 14px; }

.separateur { height: 1px; background: var(--n-200); margin: 20px 0; border: 0; }

.pastille-club {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--blanc);
    background: var(--v-700);
    flex: 0 0 26px;
    letter-spacing: .02em;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.pastille-ronde { border-radius: 50%; }

/* Écusson : le logo téléversé remplace la pastille de sigle. Il est cadré
   « contain » pour ne jamais rogner un blason, quelle que soit sa forme. */
.ecusson {
    object-fit: contain;
    border-radius: 6px;
    background: var(--n-50);
    display: inline-block;
    vertical-align: middle;
}

.ecusson-rond { border-radius: 50%; object-fit: cover; }

.avec-pastille { display: flex; align-items: center; gap: 9px; min-width: 0; }

/* Une cellule de nom ne doit jamais faire exploser la largeur du tableau. */
.cellule-nom {
    max-width: 22ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-vignette {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--n-100);
    flex: 0 0 34px;
}

.jauge { height: 6px; background: var(--n-200); border-radius: 20px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--v-500); border-radius: 20px; }

/* Chronologie d'instruction */
.chrono { list-style: none; margin: 0; padding: 0; position: relative; }
.chrono::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--n-200); }
.chrono li { position: relative; padding: 0 0 16px 26px; }
.chrono li:last-child { padding-bottom: 0; }
.chrono .point {
    position: absolute; left: 0; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--blanc); border: 3px solid var(--n-300);
}
.chrono li.fait .point { border-color: var(--v-500); background: var(--v-500); }
.chrono li.actif .point { border-color: var(--or); }
.chrono .quand { font-size: 11.5px; color: var(--n-500); }
.chrono .quoi { font-size: 13.5px; font-weight: 600; }

/* Sélecteur de saison dans la barre */
.select-saison {
    width: 100%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    color: var(--blanc);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: var(--rayon-sm);
    cursor: pointer;
}
.select-saison option { color: var(--n-900); }

/* Sélection par lot */
.barre-lot {
    position: sticky;
    bottom: 0;
    background: var(--v-900);
    color: var(--blanc);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--rayon) var(--rayon) 0 0;
    box-shadow: var(--ombre-3);
    z-index: 15;
}
.barre-lot .compte { font-weight: 650; }
.barre-lot .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Connexion ---------- */

.page-connexion {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--n-50);
}

.connexion-visuel {
    background:
        radial-gradient(circle at 20% 15%, rgba(47, 164, 119, .28), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(20, 81, 60, .5), transparent 60%),
        var(--v-950);
    color: var(--blanc);
    padding: 54px 58px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.connexion-visuel h1 { font-size: 2rem; max-width: 15em; line-height: 1.25; }
.connexion-visuel .intro { color: var(--v-200); font-size: 15px; max-width: 30em; margin-top: 14px; }

.visuel-points { display: grid; gap: 13px; margin-top: 34px; }
.visuel-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--v-100); }
.visuel-point .ico { color: var(--v-300); margin-top: 2px; }

.connexion-form { display: grid; place-items: center; padding: 40px 26px; }
.connexion-boite { width: 100%; max-width: 388px; }

@media (max-width: 900px) {
    .page-connexion { grid-template-columns: 1fr; }
    .connexion-visuel { display: none; }
}

/* ---------- Portail public ---------- */

.portail-entete {
    background: var(--v-900);
    color: var(--blanc);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 30;
}

.portail-barre {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.portail-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.portail-nav a {
    color: var(--v-100);
    font-size: 13.5px;
    font-weight: 550;
    padding: 8px 13px;
    border-radius: var(--rayon-sm);
    white-space: nowrap;
}
.portail-nav a:hover { background: rgba(255, 255, 255, .09); color: var(--blanc); text-decoration: none; }
.portail-nav a.actif { background: var(--v-700); color: var(--blanc); }

/* Bascule du menu, sans JavaScript : une case à cocher masquée pilote
   l'ouverture. Le menu reste donc utilisable si le script ne se charge pas. */
.bascule-menu { display: none; }

.bouton-menu {
    display: none;
    margin-left: auto;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    color: var(--blanc);
    border-radius: var(--rayon-sm);
    padding: 7px 10px;
    cursor: pointer;
    align-items: center;
    gap: 7px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}

.bouton-menu .ico-fermer { display: none; }
.bascule-menu:checked ~ .portail-barre .bouton-menu .ico-ouvrir { display: none; }
.bascule-menu:checked ~ .portail-barre .bouton-menu .ico-fermer { display: inline-block; }

.portail-heros {
    background: linear-gradient(160deg, var(--v-900), var(--v-800) 55%, var(--v-700));
    color: var(--blanc);
    padding: 46px 24px 52px;
}
.portail-heros .dedans { max-width: 1240px; margin: 0 auto; }
.portail-heros h1 { font-size: 2.1rem; max-width: 17em; }
.portail-heros p { color: var(--v-200); font-size: 15.5px; max-width: 40em; margin-top: 10px; }

.portail-contenu { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }

.portail-pied {
    background: var(--v-950);
    color: var(--v-200);
    padding: 30px 24px;
    font-size: 13px;
}
.portail-pied .dedans { max-width: 1240px; margin: 0 auto; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.portail-pied a { color: var(--v-300); }

/* Affiche de rencontre sur le portail */
.affiche {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--n-100);
}
.affiche:last-child { border-bottom: 0; }
.affiche:hover { background: var(--v-50); }
.affiche .eq {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 14px;
    min-width: 0;
}
.affiche .eq > span:not(.pastille-club) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.affiche .eq.dom { justify-content: flex-end; text-align: right; }
.affiche .score {
    font-family: var(--police-chiffres);
    font-size: 15px;
    font-weight: 700;
    background: var(--v-900);
    color: var(--blanc);
    padding: 4px 12px;
    border-radius: var(--rayon-sm);
    min-width: 64px;
    text-align: center;
    letter-spacing: .02em;
}
.affiche .score.avenir {
    background: var(--n-100);
    color: var(--n-700);
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.25;
    padding: 5px 12px;
}
.affiche .score.avenir .jour { display: block; }
.affiche .score.avenir .heure { display: block; font-size: 10.5px; color: var(--n-500); font-weight: 600; }

/* ---------- Écran de calage de la carte de licence ---------- */

.scene-carte {
    display: grid;
    place-items: center;
    padding: 14px 0;
}

/* La carte est rendue aux dimensions réelles : ce que l'on cale à l'écran
   correspond au millimètre près à ce qui sortira de l'imprimante. */
.apercu-carte {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 10px rgba(6, 24, 15, .18);
    border-radius: 2mm;
    overflow: hidden;
    touch-action: none;
}

.apercu-carte .fond {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

.apercu-carte .ap-champ {
    position: absolute;
    cursor: grab;
    line-height: 1.15;
    white-space: nowrap;
    outline: 1px dashed rgba(30, 133, 96, .55);
    outline-offset: 1px;
}
.apercu-carte .ap-champ:active { cursor: grabbing; }
.apercu-carte .ap-champ:hover { outline-color: var(--v-500); outline-style: solid; }

.apercu-carte .ap-image {
    display: grid;
    place-items: center;
    background: rgba(20, 81, 60, .14);
    font-size: 8px;
    letter-spacing: .08em;
    color: var(--v-700);
    font-weight: 700;
}

.apercu-carte.avec-reperes { outline: .2mm solid #d00; }

/* Bloc dépliable d'un emplacement */
.bloc-champ {
    border: 1px solid var(--n-200);
    border-radius: var(--rayon-sm);
    background: var(--blanc);
}
.bloc-champ[open] { border-color: var(--v-300); box-shadow: var(--ombre-1); }

.bloc-champ > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
    font-size: 13.5px;
}
.bloc-champ > summary::-webkit-details-marker { display: none; }
.bloc-champ > summary:hover { background: var(--n-50); }

.bc-etat {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--n-300);
    flex: 0 0 8px;
}
.bc-etat.on { background: var(--v-500); box-shadow: 0 0 0 3px rgba(30, 133, 96, .16); }

.bc-nom { font-weight: 600; flex: 1; }
.bc-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--n-500);
    background: var(--n-100);
    padding: 2px 7px;
    border-radius: 20px;
}
.bc-pos { font-size: 11.5px; color: var(--n-500); }

.bc-corps { padding: 4px 12px 14px; border-top: 1px solid var(--n-100); }

.groupe-btn .btn.actif { background: var(--v-700); color: var(--blanc); border-color: var(--v-700); }

/* Annuaire des clubs : cartes compactes, en grille souple */
.grille-clubs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 12px;
}

.fiche-club {
    position: relative;
    background: var(--blanc);
    border: 1px solid var(--n-200);
    border-radius: var(--rayon);
    padding: 14px 15px 12px 18px;
    box-shadow: var(--ombre-1);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}
.fiche-club:hover { box-shadow: var(--ombre-2); transform: translateY(-1px); }

.fc-bande { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.fc-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; min-width: 0; }
.fc-ecu { width: 34px; height: 34px; flex: 0 0 34px; font-size: 11px; border-radius: 7px; }
.fc-nom {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    color: var(--v-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fc-num { font-size: 11px; color: var(--n-500); margin-top: 1px; }

.fc-infos { margin: 0; display: grid; gap: 5px; }
.fc-infos > div { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.fc-infos dt {
    flex: 0 0 78px;
    color: var(--n-500);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 650;
}
.fc-infos dd { margin: 0; color: var(--n-900); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ligne « compétition » de l'accueil public */
.ligne-division {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 11px 13px;
    border: 1px solid var(--n-200);
    border-radius: var(--rayon-sm);
    background: var(--n-50);
}
.ligne-division .d-cat {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--n-500);
    font-weight: 650;
}
.ligne-division .d-nom { font-weight: 650; font-size: 14px; color: var(--v-900); }
.ligne-division .d-liens { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }

/* ---------- Impression écran ---------- */

@media print {
    .barre, .entete, .page-actions, .filtres, .barre-lot,
    .bouton-nav, .voile-nav, .barre-action { display: none !important; }
    .contenu { padding: 0; }
    .carte { border: 0; box-shadow: none; }
    body { background: #fff; }
}

/* ---------- Adaptatif ---------- */

@media (max-width: 1200px) {
    .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Portail public sur petit écran : la navigation se replie derrière un menu. */
@media (max-width: 760px) {
    .portail-barre { height: 56px; padding: 0 16px; gap: 12px; }
    .bouton-menu { display: inline-flex; }

    .portail-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 56px;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: var(--v-850);
        border-top: 1px solid rgba(255, 255, 255, .10);
        padding: 10px 12px 14px;
        box-shadow: var(--ombre-3);
        display: none;
    }

    .bascule-menu:checked ~ .portail-barre .portail-nav { display: flex; }

    .portail-nav a { padding: 11px 13px; font-size: 15px; }
    .portail-nav .btn { margin: 6px 0 0; justify-content: center; }

    .portail-heros { padding: 30px 16px 34px; }
    .portail-heros h1 { font-size: 1.45rem; }
    .portail-heros p { font-size: 14px; }
    .portail-contenu { padding: 20px 16px 44px; }
    .portail-pied { padding: 24px 16px; }

    /* Une affiche de rencontre passe en pile : les noms de club restent lisibles. */
    .affiche { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 14px; }
    .affiche .eq { font-size: 13.5px; }
    .affiche .eq.dom { grid-column: 1; justify-content: flex-start; text-align: left; }
    .affiche .score { grid-row: 1 / span 2; grid-column: 2; }
}

@media (max-width: 900px) {
    .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
    .cl-2, .cl-3, .cl-4 { grid-template-columns: minmax(0, 1fr); }
    .contenu { padding: 18px 15px 36px; }
    .entete { padding: 0 15px; }
}

/* --- Sélecteur filtrable (mutations) --- */
.selecteur-liste {
    font-family: inherit;
    padding: 0;
}
.selecteur-liste option {
    padding: 7px 10px;
    border-bottom: 1px solid var(--n-100);
}
.selecteur-liste option:checked {
    background: var(--v-600);
    color: #fff;
}
.selecteur-compte {
    font-variant-numeric: tabular-nums;
}

/* --- Volets d'édition (calendrier) --- */
.volet {
    background: var(--n-50);
    border-top: 1px solid var(--n-200);
    border-bottom: 1px solid var(--n-200);
}
.titre-volet {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--n-600);
    margin-bottom: 11px;
}
.titre-volet svg { color: var(--v-600); }

/* ============================================================
   Périodes réglementaires : décomptes d'ouverture et de clôture
   ============================================================ */
.periode {
    position: relative;
    border: 1px solid var(--n-200);
    border-radius: var(--rayon);
    background: var(--blanc);
    padding: 15px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow: hidden;
}
/* Filet de couleur porteur de l'état, lisible sans dépendre du texte. */
.periode::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--n-300);
}
.periode.p-ouverte::before { background: var(--succes); }
.periode.p-a-venir::before { background: var(--info); }
.periode.p-close::before   { background: var(--n-400); }
.periode.p-urgente::before { background: var(--alerte); }

.periode-tete {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.periode-tete svg { color: var(--v-600); flex: none; }
.periode-titre {
    font-weight: 650;
    font-size: 13.5px;
    color: var(--n-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.periode-etat {
    margin-left: auto;
    flex: none;
    font-size: 10.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--n-100);
    color: var(--n-600);
}
.p-ouverte .periode-etat { background: var(--succes-bg); color: var(--succes); }
.p-a-venir .periode-etat { background: var(--info-bg); color: var(--info); }
.p-close   .periode-etat { background: var(--n-100); color: var(--n-500); }
.p-urgente .periode-etat { background: var(--alerte-bg); color: var(--alerte); }

.periode-chiffre {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}
.periode-jours {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--n-700);
}
.p-urgente .periode-jours { color: var(--alerte); }
.periode-tiret { color: var(--n-300); }
.periode-unite { font-size: 12.5px; color: var(--n-500); }

.periode-jauge {
    height: 5px;
    border-radius: 999px;
    background: var(--n-100);
    overflow: hidden;
}
.periode-jauge span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--v-600);
}
.p-urgente .periode-jauge span { background: var(--alerte); }

.periode-resume { font-size: 12.5px; color: var(--n-600); }

.periode-lien {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--v-600);
    text-decoration: none;
    margin-top: 1px;
}
.periode-lien:hover { text-decoration: underline; }
.periode-lien svg { width: 13px; height: 13px; }

/* Variante compacte */
.periode-bandeau {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--n-200);
    border-left-width: 3px;
    border-radius: var(--rayon);
    background: var(--blanc);
    font-size: 13px;
}
.periode-bandeau.p-ouverte { border-left-color: var(--succes); }
.periode-bandeau.p-a-venir { border-left-color: var(--info); }
.periode-bandeau.p-close   { border-left-color: var(--n-400); }
.periode-bandeau.p-urgente { border-left-color: var(--alerte); }
.periode-bandeau svg { color: var(--v-600); flex: none; }
.periode-bandeau > div:first-of-type { flex: 1; min-width: 0; }

.periode-pastille {
    flex: none;
    text-align: center;
    padding: 5px 11px;
    border-radius: var(--rayon-sm);
    background: var(--n-100);
    line-height: 1.15;
}
.periode-pastille strong {
    display: block;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}
.periode-pastille span { font-size: 10.5px; color: var(--n-500); }
.p-urgente .periode-pastille { background: var(--alerte-bg); color: var(--alerte); }

@media (max-width: 560px) {
    .periode-jours { font-size: 25px; }
}

/* --- Compte à rebours vivant --- */
.chrono {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    font-variant-numeric: tabular-nums;
}
.chrono-bloc {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
}
.chrono-val {
    font-size: 27px;
    font-weight: 700;
    line-height: 1.05;
    color: var(--n-700);
    /* Largeur figée : les chiffres qui défilent ne doivent pas décaler la ligne. */
    font-feature-settings: 'tnum' 1;
}
.chrono-lib {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--n-500);
    margin-top: 3px;
}
.chrono-sep {
    font-size: 21px;
    font-weight: 600;
    line-height: 1;
    color: var(--n-300);
    padding-bottom: 15px;
}
.p-urgente .chrono-val { color: var(--alerte); }
.p-urgente .chrono-sep { color: var(--alerte-bg); }

/* La seconde bat discrètement : repère visuel que le compte est vivant. */
.chrono-val[data-segment="secondes"] { color: var(--v-600); }
.p-urgente .chrono-val[data-segment="secondes"] { color: var(--alerte); }

.chrono-echu .chrono-val { color: var(--n-400); }

.periode-legende {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--n-400);
    margin-top: -3px;
}

/* Variante compacte, dans les bandeaux */
.chrono-compact {
    flex: none;
    gap: 2px;
}
.chrono-compact .chrono-bloc {
    min-width: 33px;
    padding: 4px 3px;
    border-radius: var(--rayon-sm);
    background: var(--n-100);
}
.chrono-compact .chrono-val { font-size: 16px; }
.chrono-compact .chrono-lib { font-size: 8.5px; margin-top: 1px; }
.chrono-compact .chrono-sep { display: none; }
.p-urgente .chrono-compact .chrono-bloc { background: var(--alerte-bg); }

@media (max-width: 560px) {
    .chrono-val { font-size: 22px; }
    .chrono-bloc { min-width: 36px; }
    .chrono-sep { font-size: 17px; padding-bottom: 13px; }
}

/* --- Proposition d'installation en application --- */
.voile-installation {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 35, 24, .55);
    opacity: 0;
    transition: opacity .22s ease;
}
.voile-installation.visible { opacity: 1; }

.installation {
    width: min(420px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px 24px 22px;
    text-align: center;
    background: var(--blanc);
    border-radius: var(--rayon-lg);
    box-shadow: 0 24px 60px rgba(10, 35, 24, .34);
    transform: translateY(14px) scale(.97);
    transition: transform .22s ease;
}
.visible .installation { transform: none; }

.installation-icone {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    margin-bottom: 15px;
    background: var(--v-700, #0F3D2E);
    box-shadow: 0 6px 18px rgba(10, 35, 24, .22);
}
.installation h2 {
    font-size: 18px;
    line-height: 1.25;
    color: var(--n-700);
    margin: 0 0 8px;
}
.installation-texte {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--n-600);
    margin: 0;
}

.installation-etapes {
    margin: 15px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: etape;
    text-align: left;
}
.installation-etapes li {
    counter-increment: etape;
    position: relative;
    padding: 8px 0 8px 34px;
    font-size: 13px;
    color: var(--n-700);
    border-top: 1px solid var(--n-100);
}
.installation-etapes li::before {
    content: counter(etape);
    position: absolute;
    left: 0;
    top: 7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--v-600);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.installation-actions {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

/* Le fond ne défile pas tant que la fenêtre est ouverte. */
body.fige { overflow: hidden; }

@media (max-width: 420px) {
    .installation { padding: 22px 18px 18px; }
    .installation-icone { width: 64px; height: 64px; }
    .installation h2 { font-size: 16.5px; }
}

/* En mode application, la proposition n'a plus lieu d'être. */
@media (display-mode: standalone) {
    .voile-installation { display: none; }
}

/* =========================================================================
   Feuille de match
   Le club coche ses joueurs, le commissaire tient le match. Deux écrans
   très différents, un même vocabulaire visuel : le maillot porte le numéro,
   la flèche porte le sens du changement.
   ========================================================================= */

/* --- Sélection de l'effectif, côté club ------------------------------- */

.effectif-choix { display: grid; gap: 7px; }

.choix-ligne {
    display: grid;
    grid-template-columns: 62px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid var(--n-200);
    border-radius: var(--rayon-sm);
    background: var(--blanc);
    transition: border-color .12s, background .12s;
}

/* `display: grid` l'emporte sur la règle [hidden] du navigateur : sans ce
   rappel, une ligne filtrée resterait affichée et la recherche paraîtrait
   sans effet. */
.choix-ligne[hidden] { display: none; }

.choix-ligne.retenu-titulaire { border-color: var(--v-400); background: var(--v-50); }
.choix-ligne.retenu-remplacant { border-color: var(--or); background: var(--or-clair); }
.choix-ligne.indisponible { opacity: .55; background: var(--n-50); }

.choix-nom { min-width: 0; }
.choix-nom .fort { display: block; }
.choix-nom .discret { font-size: 11.5px; }

/* Le numéro de maillot se saisit dans un maillot : la case ressemble
   à ce qu'elle représente. */
.champ-maillot {
    width: 54px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 6px 4px;
    border: 1px solid var(--n-300);
    border-radius: var(--rayon-sm);
    background: var(--blanc);
}

.champ-maillot:disabled { background: var(--n-100); color: var(--n-400); }

/* Trois états exclusifs — titulaire, remplaçant, non retenu — en un seul
   groupe de boutons : le président voit son onze d'un coup d'œil. */
/* `position: relative` ancre les boutons radio masqués à l'intérieur du
   groupe. Sans lui ils se placent par rapport à la page : cliquer un libellé
   donnait le focus à un élément situé ailleurs, et le navigateur y sautait —
   la page dévalait à chaque case cochée. */
.bascule-role { display: inline-flex; position: relative; border: 1px solid var(--n-300); border-radius: var(--rayon-sm); overflow: hidden; }
.bascule-role input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bascule-role label {
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--n-600);
    background: var(--blanc);
    cursor: pointer;
    border-right: 1px solid var(--n-200);
    user-select: none;
}
.bascule-role label:last-of-type { border-right: 0; }
.bascule-role input:checked + label { color: var(--blanc); background: var(--v-600); }
.bascule-role input[value="remplacant"]:checked + label { background: var(--or); color: var(--v-950); }
.bascule-role input[value=""]:checked + label { background: var(--n-200); color: var(--n-700); }
.bascule-role input:focus-visible + label { outline: 2px solid var(--v-400); outline-offset: -2px; }

.compteur-compo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--n-100);
    color: var(--n-700);
}
.compteur-compo.complet { background: var(--succes-bg); color: var(--succes); }
.compteur-compo.trop { background: var(--danger-bg); color: var(--danger); }

/* --- Feuille tenue par le commissaire --------------------------------- */

.feuille-terrain { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.compo-liste { display: grid; gap: 5px; }

.compo-joueur {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid var(--n-200);
    border-radius: var(--rayon-sm);
    background: var(--blanc);
    font-size: 13px;
}

.compo-joueur.sorti { background: var(--n-50); color: var(--n-500); }
.compo-joueur.sorti .compo-nom { text-decoration: line-through; }
.compo-joueur.entre { border-color: var(--v-400); background: var(--v-50); }
.compo-joueur.exclu { border-color: var(--carton-r); background: var(--danger-bg); }

.compo-numero {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: var(--rayon-sm);
    background: var(--v-800);
    color: var(--blanc);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.compo-joueur.sorti .compo-numero { background: var(--n-400); }

.compo-nom { min-width: 0; }
.compo-marques { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.compo-marques .ico { width: 14px; height: 14px; flex-basis: 14px; }

.compo-role {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--n-500);
}

/* Chronologie du match : la minute à gauche, le fait à droite. */
.chrono-match { display: grid; gap: 3px; }

.chrono-fait {
    display: grid;
    grid-template-columns: 46px 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--rayon-sm);
    font-size: 13px;
}
.chrono-fait:nth-child(odd) { background: var(--n-50); }
.chrono-minute { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--v-700); }
.chrono-fait .discret { font-size: 11.5px; }

/* Le remplacement se lit en deux lignes accolées : celui qui sort, celui
   qui entre. Le liseré les tient ensemble. */
.bloc-remplacement {
    border-left: 3px solid var(--v-400);
    padding-left: 9px;
    margin: 3px 0;
}

@media (max-width: 900px) {
    .feuille-terrain { grid-template-columns: 1fr; }
    .choix-ligne { grid-template-columns: 54px 1fr; grid-template-areas: "num nom" "role role"; row-gap: 9px; }
    .choix-ligne .bascule-role { grid-area: role; }
}

/* --- Recherche et défilement de l'effectif ---------------------------- */

.barre-filtre {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-bottom: 1px solid var(--n-200);
    background: var(--n-50);
}

.champ-recherche {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    padding: 7px 12px;
    border: 1px solid var(--n-300);
    border-radius: var(--rayon-sm);
    background: var(--blanc);
}

.champ-recherche > .ico { color: var(--n-500); flex-shrink: 0; }

.champ-recherche input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    font-size: 13.5px;
    color: inherit;
}

.champ-recherche input:focus { outline: none; }
.champ-recherche:focus-within { border-color: var(--v-400); box-shadow: 0 0 0 3px var(--v-100); }

.filtre-onglets { display: inline-flex; border: 1px solid var(--n-300); border-radius: var(--rayon-sm); overflow: hidden; }

.filtre-onglets button {
    padding: 7px 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--n-600);
    background: var(--blanc);
    border: 0;
    border-right: 1px solid var(--n-200);
    cursor: pointer;
}

.filtre-onglets button:last-child { border-right: 0; }
.filtre-onglets button.actif { background: var(--v-700); color: var(--blanc); }
.filtre-onglets button span { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* La liste défile dans son propre cadre : la page reste courte, et les
   boutons d'action ne s'éloignent jamais du pouce. */
.liste-defilante {
    max-height: min(56vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.filtre-vide { text-align: center; padding: 22px 0 6px; }

/* Barre d'action collée au bas de la fenêtre. */
.barre-action {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin: 0 -4px;
    border: 1px solid var(--n-200);
    border-radius: var(--rayon);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    box-shadow: var(--ombre-2);
}

.guichet-compo { align-items: center; }
.guichet-compo .chrono { flex-shrink: 0; }

@media (max-width: 700px) {
    .barre-filtre { padding: 10px 12px; }
    .filtre-onglets { width: 100%; }
    .filtre-onglets button { flex: 1; }
    .liste-defilante { max-height: 60vh; }
    /* Le pied de page mobile ne doit pas recouvrir les boutons. */
    .barre-action { bottom: 8px; margin: 0; }
    .barre-action .btn { flex: 1; justify-content: center; }
}
