/* Gestion hockey AHMVD — tableau de bord dense et lisible (compétence ui-ux-pro-max : data-dense dashboard) */
:root {
  --fond: #f4f6fa; --surface: #ffffff; --surface-2: #eef2f8; --texte: #14213d; --texte-2: #4a5872; --bordure: #d6dde9;
  --primaire: #1f3864; --primaire-txt: #ffffff; --accent: #c62828; --focus: #2f6fe4;
  --ok: #1b7a3d; --ok-fond: #e3f4e8; --avert: #8a5300; --avert-fond: #fff1d6; --erreur: #b3261e; --erreur-fond: #fde7e6;
  --g1: #e8eefb; --g1-bord: #6d8fd8; --g2: #fff4c7; --g2-bord: #d7a600; --mal: #dcecf9; --mal-bord: #3c8fd0; --ext: #ececec; --ext-bord: #9a9a9a;
  --rayon: 10px; --ombre: 0 1px 2px rgb(20 33 61 / .06), 0 2px 8px rgb(20 33 61 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0e1422; --surface: #161e30; --surface-2: #1d2740; --texte: #e8edf7; --texte-2: #a9b5cc; --bordure: #2c3856;
    --primaire: #7ea2ec; --primaire-txt: #0e1422; --accent: #ff6b6b; --focus: #8fb0ff;
    --ok: #6fd18f; --ok-fond: #15301f; --avert: #ffc35c; --avert-fond: #36290f; --erreur: #ff8a80; --erreur-fond: #3a1716;
    --g1: #1c2a4a; --g1-bord: #6d8fd8; --g2: #3a3214; --g2-bord: #d7a600; --mal: #15304a; --mal-bord: #4fa3e3; --ext: #262b33; --ext-bord: #7c8594;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--primaire); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sauter { position: absolute; left: -999px; top: 0; background: var(--primaire); color: var(--primaire-txt); padding: 8px 12px; z-index: 100; }
.sauter:focus { left: 8px; top: 8px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* entête */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); position: sticky; top: 0; z-index: 10; }
.entete-int { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 8px 16px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--texte); text-decoration: none; min-height: 44px; }
.marque svg { color: var(--accent); width: 26px; height: 26px; stroke-width: 2.5; }
.marque small { font-weight: 500; color: var(--texte-2); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { display: flex; align-items: center; gap: 6px; padding: 10px 12px; min-height: 44px; border-radius: 8px; color: var(--texte-2); text-decoration: none; font-weight: 500; }
nav a:hover { background: var(--surface-2); color: var(--texte); }
nav a.actif { background: var(--primaire); color: var(--primaire-txt); }
.deco { margin-left: 0; }
.moi { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 6px 10px; min-height: 44px; border-radius: 8px; color: var(--texte); text-decoration: none; }
.moi:hover, .moi.actif { background: var(--surface-2); }
.moi span { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: .9rem; }
.moi small { font-weight: 400; color: var(--texte-2); font-size: .75rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset.nu { border: 0; padding: 0; margin: 0; min-width: 0; }
.mdp-unique { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; letter-spacing: .02em; background: var(--surface); border: 1px dashed var(--bordure);
  padding: 8px 12px; border-radius: 8px; display: inline-block; user-select: all; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 12px; }
.choix-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choix-mode label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 12px; cursor: pointer; background: var(--surface); }
.choix-mode label:has(input:checked) { border-color: var(--primaire); box-shadow: 0 0 0 2px var(--primaire) inset; }
.choix-mode input { width: 20px; height: 20px; min-height: 20px; margin-top: 2px; }
.choix-mode small { display: block; color: var(--texte-2); font-weight: 400; margin-top: 2px; }
table.donnees td.quand { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* page */
.page { max-width: 1440px; margin: 0 auto; padding: 16px; }
.titre-page h1 { margin: 8px 0 2px; font-size: 1.6rem; line-height: 1.2; }
.sous { margin: 0 0 16px; color: var(--texte-2); }
h2 { font-size: 1.1rem; margin: 20px 0 10px; }
.fil { font-size: .9rem; color: var(--texte-2); margin-top: 8px; }
.note, .aide { color: var(--texte-2); font-size: .93rem; }
.vide { color: var(--texte-2); font-style: italic; }
.mono, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88rem; }
pre { white-space: pre-wrap; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; }
.num, .heure, .nb { font-variant-numeric: tabular-nums; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease; }
.btn:hover { background: var(--surface-2); }
.btn-principal { background: var(--primaire); border-color: var(--primaire); color: var(--primaire-txt); }
.btn-principal:hover { filter: brightness(1.08); background: var(--primaire); }
.btn-danger { background: var(--erreur); border-color: var(--erreur); color: #fff; }
.btn-fantome { border-color: transparent; background: transparent; color: var(--texte-2); }
.actions-ligne { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* alertes et badges (couleur + icône + texte, jamais la couleur seule) */
.alerte { padding: 12px 14px; border-radius: var(--rayon); background: var(--surface-2); border-left: 4px solid var(--primaire); margin: 12px 0; }
.alerte.erreur { background: var(--erreur-fond); border-color: var(--erreur); }
.alerte.succes { background: var(--ok-fond); border-color: var(--ok); }
.alerte ul { margin: 6px 0 0; padding-left: 20px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 1.5; margin-top: 4px; }
.badge svg { width: 14px; height: 14px; stroke-width: 2.5; }
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.avert { background: var(--avert-fond); color: var(--avert); }
.badge.erreur { background: var(--erreur-fond); color: var(--erreur); }
.badge.annule { background: var(--ext); color: var(--texte-2); text-decoration: line-through; }
.regle { display: flex; gap: 6px; align-items: flex-start; font-size: .85rem; color: var(--avert); margin: 4px 0 0; }
.regle svg { width: 16px; height: 16px; margin-top: 2px; }
.txt-erreur { color: var(--erreur); font-size: .9rem; }

/* indicateurs */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.indic { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 14px 16px;
  box-shadow: var(--ombre); color: var(--texte); text-decoration: none; border-top: 4px solid var(--bordure); }
.indic .nb { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.indic .lib { color: var(--texte-2); font-size: .9rem; }
.indic.bon { border-top-color: var(--ok); } .indic.moyen { border-top-color: var(--avert); } .indic.mauvais { border-top-color: var(--erreur); }

/* glaces */
.glace { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.glace.g1 { background: var(--g1); border-color: var(--g1-bord); } .glace.g2 { background: var(--g2); border-color: var(--g2-bord); }
.glace.mal { background: var(--mal); border-color: var(--mal-bord); } .glace.exterieur, .glace.autre { background: var(--ext); border-color: var(--ext-bord); }
.legende { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--texte-2); font-size: .9rem; }

/* cartes */
.carte { display: block; background: var(--surface); border: 1px solid var(--bordure); border-left: 5px solid var(--ext-bord); border-radius: var(--rayon);
  padding: 8px 10px; margin-bottom: 8px; color: var(--texte); text-decoration: none; box-shadow: var(--ombre); transition: border-color .15s ease, transform .15s ease; }
a.carte:hover { border-color: var(--primaire); }
.carte.g1 { border-left-color: var(--g1-bord); } .carte.g2 { border-left-color: var(--g2-bord); } .carte.mal { border-left-color: var(--mal-bord); }
.carte.partie { border-left-style: double; border-left-width: 6px; }
.carte.annulee { opacity: .6; }
.carte-haut { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.heure { font-weight: 700; }
.carte-type { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-2); margin-top: 2px; }
.carte-eq { font-weight: 500; }
.carte-meta { font-size: .85rem; color: var(--texte-2); }
.vs { color: var(--texte-2); font-size: .85rem; }
.jour-court { margin: 0 0 4px; font-size: .85rem; font-weight: 600; color: var(--texte-2); text-transform: capitalize; }
.liste-cartes { display: grid; gap: 4px; }
.liste-simple { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.liste-simple li { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 10px 12px; }
.liste-simple a { text-decoration: none; color: var(--texte); display: block; }

/* semaine */
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; margin-top: 12px; }
.jour h2 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; font-size: .95rem; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; }
.ajout { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--primaire); }
.ajout:hover { background: var(--surface); }
.navsemaine { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

/* filtres et formulaires */
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 12px; }
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.champ.large { min-width: 240px; flex: 1; } .champ.plein { grid-column: 1 / -1; }
label { font-weight: 600; font-size: .9rem; }
input, select { font: inherit; min-height: 44px; padding: 8px 10px; border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface); color: var(--texte); width: 100%; }
fieldset { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 12px 14px; margin: 0 0 14px; background: var(--surface); }
legend { font-weight: 700; padding: 0 6px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.zone-danger { border: 1px solid var(--erreur); border-radius: var(--rayon); padding: 12px 14px; margin-top: 24px; background: var(--surface); }
.zone-danger h2 { margin-top: 0; color: var(--erreur); }
.zone-confirmer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0; padding: 12px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); }
.case { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.case input { width: 22px; min-height: 22px; height: 22px; }

/* tableau */
.tableau-defile { overflow-x: auto; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
table.donnees { width: 100%; border-collapse: collapse; font-size: .95rem; }
.donnees th, .donnees td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.donnees thead th { background: var(--surface-2); font-size: .85rem; color: var(--texte-2); }
.donnees tbody tr:hover { background: var(--surface-2); }
.donnees small { color: var(--texte-2); }

/* connexion */
.connexion { min-height: 80dvh; display: grid; place-items: center; }
.connexion-carte { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--bordure); border-radius: 14px; padding: 28px; box-shadow: var(--ombre); }
.connexion-carte .logo { width: 44px; height: 44px; color: var(--accent); stroke-width: 2.5; }
.connexion-carte h1 { margin: 8px 0 0; } .connexion-carte form { display: grid; gap: 8px; } .connexion-carte .btn { margin-top: 8px; }

.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 1200px) { .semaine { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .semaine { grid-template-columns: repeat(2, minmax(0, 1fr)); } .deux-col { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .semaine { grid-template-columns: 1fr; }
  .entete-int { flex-wrap: nowrap; gap: 4px; padding: 4px 8px; }
  .marque span { display: none; }
  nav { flex-wrap: nowrap; justify-content: center; }
  nav a span, .deco span, .moi span { display: none; } nav a { padding: 10px; }
  nav { overflow-x: auto; scrollbar-width: none; } .moi { margin-left: 0; padding: 10px; }
  .deco .btn { padding: 8px 10px; }
  .titre-page h1 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
table.donnees input, table.donnees select { min-height: 40px; width: 100%; min-width: 70px; }
table.donnees input[readonly] { background: var(--surface-2); color: var(--texte-2); }
