/* Styles du module « Présences et sondages » — pages de l'encadrement (préfixe « pr- »).
   Couleurs : uniquement les jetons de app.css (clair et sombre). Rien ne passe à la ligne dans l'interface. */
/* Tons lisibles sur fond sombre : les jetons --ok / --alerte / --danger du socle sont pensés pour un fond clair.
   Pour le TEXTE et les pictogrammes, le module les éclaircit en thème sombre (les aplats gardent le jeton). */
:root { --pr-ok: var(--ok); --pr-alerte: var(--alerte); --pr-danger: var(--danger); }
@media (prefers-color-scheme: dark) {
  :root { --pr-ok: color-mix(in srgb, var(--ok) 48%, #fff); --pr-alerte: color-mix(in srgb, var(--alerte) 42%, #fff); --pr-danger: color-mix(in srgb, var(--danger) 48%, #fff); }
}
.pr-liste .pastille.ok, .pr-etat-ligne .pastille.ok, .pr-panneau .tout-bon, .pr-tableau .tout-bon { color: var(--pr-ok); }
.pr-liste .pastille.alerte, .pr-tete-ev .pastille.alerte { color: var(--pr-alerte); }
.pr-barre { margin-bottom: -4px; }
.pr-filtre { width: auto; max-width: 280px; }
.pr-rien { padding: 6px 20px 18px; margin: 0; }
.pr-liste > li { flex-wrap: nowrap; }
.pr-tableau { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

/* bloc date « mar. / 9 » */
.pr-date { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--teinte); line-height: 1.05; }
.pr-date small { font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.pr-date strong { font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; }

/* actions sur un rendez-vous (agenda) : icône seule dans les lignes au téléphone */
.ag-liste .pr-action { padding: 5px 10px; }
@media (max-width: 860px) { .ag-liste .pr-action span { display: none; } .ag-liste .pr-action { width: 34px; padding: 0; justify-content: center; } }

/* ---------- pointage ---------- */
.pr-bandeau { position: sticky; top: 68px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-petit); box-shadow: var(--ombre); }
.pr-comptes-saisie { display: flex; gap: 6px; min-width: 0; }
.pr-compte { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: .82rem; color: var(--doux); white-space: nowrap; }
.pr-compte strong { color: var(--encre); font-size: .95rem; font-variant-numeric: tabular-nums; }
.pr-compte .icone { flex: none; }
.pr-c-present .icone, .pr-c-retard .icone { color: var(--pr-ok); }
.pr-c-excuse .icone { color: var(--pr-alerte); }
.pr-c-absent .icone { color: var(--pr-danger); }
.pr-compte.pr-c-sans { background: var(--alerte-fond); color: var(--pr-alerte); }
.pr-compte.pr-c-sans strong { color: var(--pr-alerte); }
.pr-enregistrement { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: .82rem; font-weight: 600; color: var(--doux); white-space: nowrap; }
.pr-e-ok { color: var(--pr-ok); }
.pr-e-echec { color: var(--pr-danger); }
.pr-roue { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--trait-fort); border-top-color: var(--club); animation: pr-tourne .8s linear infinite; }
@keyframes pr-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pr-roue { animation: none; } }
.pr-aide { margin: -6px 0 0; max-width: none; }
.pr-pointage > li { flex-wrap: nowrap; gap: 14px; padding: 10px 12px 10px 16px; transition: background .15s; }
.pr-pointage > li.pr-est-present, .pr-pointage > li.pr-est-retard { background: color-mix(in srgb, var(--ok-fond) 40%, var(--surface)); }
.pr-pointage > li.pr-est-absent { background: color-mix(in srgb, var(--danger-fond) 40%, var(--surface)); }
.pr-pointage > li.pr-est-excuse { background: color-mix(in srgb, var(--alerte-fond) 40%, var(--surface)); }
.pr-qui { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.pr-choix { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: none; width: min(100%, 440px); }
.pr-bouton { min-height: 46px; padding: 6px 8px; gap: 6px; justify-content: center; background: var(--surface); color: var(--doux); border: 1px solid var(--trait-fort); border-radius: 12px; font-size: .85rem; overflow: hidden; }
.pr-bouton span { overflow: hidden; text-overflow: ellipsis; }
.pr-bouton .icone { flex: none; }
.pr-bouton:hover { filter: none; background: var(--surface-2); color: var(--encre); }
.pr-bouton[aria-pressed=true] { color: #fff; }
.pr-b-present[aria-pressed=true] { background: var(--ok); border-color: var(--ok); }
.pr-b-retard[aria-pressed=true] { background: color-mix(in srgb, var(--ok) 72%, var(--alerte)); border-color: transparent; }
.pr-b-excuse[aria-pressed=true] { background: var(--alerte); border-color: var(--alerte); }
.pr-b-absent[aria-pressed=true] { background: var(--danger); border-color: var(--danger); }
.pr-plus { flex: none; }
.pastille.pr-p-present, .pastille.pr-p-retard { background: var(--ok-fond); color: var(--pr-ok); border-color: transparent; }
.pastille.pr-p-excuse { background: var(--alerte-fond); color: var(--pr-alerte); border-color: transparent; }
.pastille.pr-p-absent { background: var(--danger-fond); color: var(--pr-danger); border-color: transparent; }
.pr-sante { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: var(--rayon-petit); background: var(--alerte-fond); color: var(--pr-alerte); font-size: .85rem; font-weight: 600; max-width: none; }
.pr-sante .icone { flex: none; }
.pr-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pr-pied p { margin: 0; }
@media (max-width: 860px) {
  .pr-compte .pr-long { display: none; }
  .pr-compte { padding: 4px 8px; }
  .pr-comptes-saisie { gap: 4px; }
  .pr-bandeau { flex-wrap: wrap; row-gap: 4px; }
  .pr-enregistrement { margin-left: auto; }
  /* au téléphone : le nom sur une ligne, quatre grandes touches dessous */
  .pr-pointage > li { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; padding: 10px 10px 12px 12px; }
  .pr-choix { width: 100%; }
  .pr-bouton { min-height: 48px; }
}
@media (max-width: 420px) {
  .pr-bandeau { padding: 8px; gap: 6px; }
  .pr-bouton { flex-direction: column; gap: 2px; font-size: .74rem; padding: 5px 2px; min-height: 54px; }
  .pr-qui .avatar { width: 32px; height: 32px; font-size: .74rem; }
}

/* ---------- sondage : fenêtre ---------- */
.pr-form-sondage { display: flex; flex-direction: column; gap: 14px; }
.pr-form-sondage > p { margin: 0; max-width: none; }
.pr-champ { display: flex; flex-direction: column; gap: 6px; }
.pr-libelle { font-size: .88rem; font-weight: 600; }
.pr-choix-ev { display: flex; flex-direction: column; gap: 6px; max-height: min(230px, 32vh); overflow-y: auto; padding: 2px; }
.pr-ev-case { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--trait); border-radius: var(--rayon-petit); background: var(--surface); }
.pr-ev-case input { width: auto; min-height: 0; margin-top: 3px; flex: none; }
.pr-ev-case:has(input:checked) { border-color: var(--club); background: var(--teinte); }
.pr-ev-case:has(input:disabled) { opacity: .6; }
.pr-ev-case .ligne-texte { gap: 2px; }
.pr-incomplet { border-color: color-mix(in srgb, var(--alerte) 40%, var(--trait)); }
.pr-manque { display: flex; align-items: center; gap: 6px; color: var(--pr-alerte); font-weight: 600; margin: 0; max-width: none; }
.pr-manque .icone { flex: none; }
.pr-manque span { min-width: 0; }
small.pr-manque span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-incomplets { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.message > p { margin: 0; max-width: none; }

/* ---------- sondage : résultats ---------- */
.pr-entete-sondage { display: flex; flex-direction: column; gap: 10px; }
.pr-etat-ligne { display: flex; align-items: center; gap: 10px; margin: 0; max-width: none; font-size: .9rem; }
.pr-etat-ligne .doux { min-width: 0; }
.pastille.pr-etat-brouillon { background: var(--alerte-fond); color: var(--pr-alerte); border-color: transparent; }
.pr-message-sondage { margin: 0; padding: 12px 14px; border-left: 3px solid var(--club); background: var(--surface); border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0; white-space: pre-line; max-width: 720px; }
.pr-resultats { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.pr-carte-ev { display: flex; flex-direction: column; gap: 12px; padding: 18px; min-width: 0; }
.pr-carte-ev.pr-annule { opacity: .7; }
.pr-tete-ev { display: flex; align-items: center; gap: 12px; }
.pr-tete-ev h2 { margin: 0; font-size: 1.05rem; }
.pr-comptes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pr-comptes > span { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 10px; border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--doux); font-size: .8rem; white-space: nowrap; overflow: hidden; }
.pr-comptes strong { font-size: 1.4rem; line-height: 1.1; color: var(--encre); font-variant-numeric: tabular-nums; }
.pr-n-oui strong { color: var(--pr-ok); }
.pr-n-non strong { color: var(--pr-danger); }
.pr-n-peutetre strong { color: var(--pr-alerte); }
.pr-comptes > .pr-attention { background: var(--alerte-fond); color: var(--pr-alerte); font-weight: 650; }
.pr-attention strong { color: var(--pr-alerte); }
.pr-barre-rep { display: flex; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--trait); }
.pr-seg { width: var(--part, 0%); }
.pr-seg-oui { background: var(--ok); }
.pr-seg-peutetre { background: var(--alerte); }
.pr-seg-non { background: var(--danger); }
.pr-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--doux); padding: 4px 0; }
.pr-details summary:hover { color: var(--encre); }
.pr-groupe h3 { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.pr-nb { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: .75rem; font-weight: 700; color: var(--encre); letter-spacing: 0; }
.pr-g-oui .pr-nb { background: var(--ok-fond); color: var(--pr-ok); }
.pr-g-non .pr-nb { background: var(--danger-fond); color: var(--pr-danger); }
.pr-g-peutetre .pr-nb, .pr-g-sans .pr-nb { background: var(--alerte-fond); color: var(--pr-alerte); }
.lignes.nues.pr-reponses > li { padding: 4px 0; gap: 10px; flex-wrap: nowrap; min-height: 40px; border-top: 0; }
.pr-rep-boutons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
button.pr-rep { min-height: 46px; background: var(--surface); color: var(--encre); border-color: var(--trait-fort); }
button.pr-rep:hover { filter: none; background: var(--surface-2); }
button.pr-rep-oui[aria-pressed=true] { background: var(--ok); border-color: var(--ok); color: #fff; }
button.pr-rep-non[aria-pressed=true] { background: var(--danger); border-color: var(--danger); color: #fff; }
button.pr-rep-peutetre[aria-pressed=true] { background: var(--alerte); border-color: var(--alerte); color: #fff; }
button.icone-seule.pr-suppr { color: var(--pr-danger); }
.pr-vers-presences { justify-content: flex-end; }
@media (max-width: 860px) { .pr-resultats { grid-template-columns: 1fr; } .pr-carte-ev { padding: 14px; } }
@media (max-width: 560px) {
  /* les actions du sondage tiennent sur une ligne */
  .pr-entete-sondage .entete-page .actions { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .pr-entete-sondage .entete-page .actions > button:not(.icone-seule) { padding: 8px 10px; font-size: .88rem; gap: 6px; min-width: 0; }
  .pr-entete-sondage .entete-page .actions > .pr-suppr { margin-left: auto; }
}
@media (max-width: 560px) {
  /* au téléphone : quatre comptes sur deux lignes, chiffre et libellé côte à côte */
  .pr-comptes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-comptes > span { flex-direction: row; align-items: baseline; gap: 8px; }
}

/* ---------- tableau de saison ---------- */
.pr-filtres { align-items: center; }
.pr-filtre-l { display: inline-flex; }
.pr-filtres select, .pr-filtres input[type=date] { width: auto; max-width: 230px; min-height: 40px; padding: 7px 10px; }
.pr-dates { display: inline-flex; gap: 10px; }
.pr-dates[hidden] { display: none; }
.pr-export { display: inline-flex; gap: 6px; margin-left: auto; }
.pr-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0; max-width: none; }
.pr-leg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pr-saison { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pr-saison > p { margin: 0; max-width: none; }
.pr-cadre { overflow-x: auto; max-width: 100%; }
.pr-cadre:focus-visible { outline: 2px solid var(--club); outline-offset: 2px; }
.pr-table { width: auto !important; min-width: 100%; white-space: nowrap; }
.tableau-donnees .pr-table th, .tableau-donnees .pr-table td { padding: 8px 6px; text-align: center; min-width: 0; max-width: none; }
.tableau-donnees .pr-table .pr-col-nom { position: sticky; left: 0; z-index: 2; text-align: left; padding-left: 16px; padding-right: 12px; min-width: 170px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; background: var(--surface); box-shadow: inset -1px 0 0 var(--trait); }
.tableau-donnees .pr-table thead .pr-col-nom, .tableau-donnees .pr-table tfoot .pr-col-nom { background: var(--surface-2); }
.tableau-donnees .pr-table tbody th.pr-col-nom { font-size: .92rem; font-weight: 600; color: var(--encre); text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--trait); }
.tableau-donnees .pr-table tbody tr:hover th.pr-col-nom { background: var(--surface-2); }
.tableau-donnees .pr-table tfoot td, .tableau-donnees .pr-table tfoot th { background: var(--surface-2); border-top: 1px solid var(--trait); border-bottom: 0; font-size: .82rem; }
.tableau-donnees .pr-table tfoot th { text-transform: none; letter-spacing: 0; font-weight: 650; }
.pr-col-ev { min-width: 44px; }
.pr-col-ev a { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--doux); line-height: 1.15; letter-spacing: 0; text-transform: none; }
.pr-col-ev a:hover { color: var(--encre); }
.pr-col-ev small { font-size: .62rem; text-transform: uppercase; }
.pr-col-ev span { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pr-col-ev.pr-t-match, .pr-col-ev.pr-t-tournoi { box-shadow: inset 0 -3px 0 var(--club); }
.tableau-donnees .pr-table .pr-col-tot { min-width: 58px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--trait); }
.pr-col-tot small, .pr-c-total small { margin-left: 1px; }
.pr-c-total { font-variant-numeric: tabular-nums; }
.pr-bas { color: var(--pr-danger); font-weight: 700; }
/* Une forme par statut (pas seulement une couleur) : disque plein, anneau, carré, croix. */
.pr-m { display: inline-block; width: 14px; height: 14px; vertical-align: middle; box-sizing: border-box; }
.pr-m-present { border-radius: 50%; background: var(--pr-ok); }
.pr-m-retard { border-radius: 50%; border: 3px solid var(--pr-ok); }
.pr-m-excuse { border-radius: 3px; background: var(--pr-alerte); }
.pr-m-absent { background: linear-gradient(45deg, transparent 42%, var(--pr-danger) 42%, var(--pr-danger) 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--pr-danger) 42%, var(--pr-danger) 58%, transparent 58%); }
.pr-c-vide { color: var(--trait-fort); }
@media (max-width: 860px) {
  .pr-export { margin-left: 0; }
  .pr-filtre-l { flex: 1 1 140px; }
  .pr-filtres select, .pr-filtres input[type=date] { max-width: none; width: 100%; }
  .pr-dates { flex: 1 1 100%; }
  .tableau-donnees .pr-table .pr-col-nom { min-width: 120px; max-width: 140px; padding-left: 12px; }
}
