/* ============================================================================
   ABC Support Planning — feuille de style unique.

   ORGANISATION
   1. Variables (la seule source de vérité : couleurs, tailles, rayons, ombres)
   2. Base + utilitaires
   3. Coque (topbar, sidebar)
   4. En-tête de vue, chips, navigation de période
   5. Stats, légende
   6. Frise horaire (vue Site)
   7. Panneaux trous / légal
   8. Vue Équipe
   9. Écrans de gestion (listes)
   10. Boutons (base commune + variantes)
   11. Flash messages
   12. Formulaires
   13. Vue Agent
   14. Réattribution
   15. Vue Jour · tous sites
   16. Vue Remplacement urgent (mode crise)
   17. Relevé d'anomalies (écran Extractions)

   RÈGLES DU FICHIER
   - Aucune couleur en dur dans les sections : tout passe par les variables.
     Exceptions : nuances dérivées très locales (fonds pâles d'un composant).
   - Les classes utilisées par app.js et par les tests (bloc-prim, poignee,
     day-add, day-col, chip actif, day-head…) ne se renomment JAMAIS.
   - Palette des couleurs d'agents : presentation.py (_PALETTE), synchronisée
     à l'œil avec cette charte. Le code couleur agent est une donnée métier
     (distinguer les personnes), pas une couleur d'interface.
   ============================================================================ */

:root {
  /* -- Structure -- */
  --frise-h: 720px;
  --grid-cols: 56px repeat(7, 1fr);

  /* -- Neutres -- */
  --bg: #f1f5f9;          /* fond général */
  --card: #ffffff;        /* fond des cartes */
  --ink: #0f172a;         /* texte principal + navy structurel (topbar, chips actifs) */
  --ink-2: #1e293b;       /* navy hover / texte fort secondaire */
  --muted: #64748b;       /* texte secondaire */
  --muted-2: #94a3b8;     /* texte/bords éteints, hover discret */
  --line: #e2e8f0;        /* bordures */
  --hover: #f1f5f9;       /* fond survol neutre */
  --thead: #f8fafc;       /* fond des en-têtes de tableau + boutons fantômes */

  /* -- Marque ABC Support (accents, avec parcimonie) -- */
  --abc-violet: #ab0f9b;
  --abc-orange: #fe9a09;
  --abc-vert: #077e4c;

  /* -- Action (violet ABC : boutons primaires, focus, liens d'action) -- */
  --accent: var(--abc-violet);
  --accent-fonce: #8d0c80;      /* hover + texte sur fond pâle */
  --accent-pale: #faeef8;       /* fond des états actifs discrets */
  --accent-bord: #ecc7e7;       /* bordure des états actifs discrets */
  --accent-ring: rgba(171, 15, 155, .14);  /* halo de focus */

  /* -- Sémantique statut (fond plein / fond pâle / texte sur pâle) -- */
  --ok: #16a34a;       --ok-pale: #dcfce7;    --ok-ink: #166534;   --ok-bord: #86efac;
  --warn: #d97706;     --warn-pale: #fef3c7;  --warn-ink: #92400e; --warn-bord: #fde68a;
  --bad: #dc2626;      --bad-pale: #fee2e2;   --bad-ink: #991b1b;  --bad-bord: #fca5a5;
  --pp: #f59e0b;       /* marqueur prime panier (ambre, réservé) */

  /* -- Pastilles neutres (chips de données : créneaux, qualifs) -- */
  --pill-pale: #eef2ff;
  --pill-bord: #e0e7ff;

  /* -- Échelle typographique -- */
  --fs-h1: 22px;
  --fs-h2: 15px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-2xs: 11px;

  /* -- Rayons (concentriques : conteneur = contenu + écart) -- */
  --r-s: 6px;
  --r-m: 8px;
  --r-l: 10px;
  --r-xl: 12px;
  --r-pill: 999px;

  /* -- Ombres (superposées, discrètes : la profondeur sans les traits durs) -- */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
  --shadow-pop: 0 4px 12px rgba(15, 23, 42, .10), 0 1px 3px rgba(15, 23, 42, .08);
}

/* ====================== 2. Base + utilitaires ====================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3 { text-wrap: balance; }

/* Montserrat sur les titres (charte ABC Support, décision d'Omar du 19/10/2026) :
   les titres seulement. Le corps reste en police système, plus lisible 8 h par jour
   dans des tableaux denses. Le fichier est celui que le rapport PDF embarque déjà
   (static/polices, licence OFL) : auto-hébergé, aucun appel à un service extérieur.
   Une seule graisse livrée (Bold) : les titres sont en 700. */
@font-face {
  font-family: "Montserrat";
  src: url("polices/montserrat/Montserrat-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
h1, h2 { font-family: "Montserrat", "Segoe UI", system-ui, sans-serif; font-weight: 700; letter-spacing: -.01em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Feuille d'icônes SVG inline (les <symbol> de base.html) : jamais affichée
   elle-même — l'attribut hidden ne vaut rien sur un élément SVG. */
.sprite { display: none; }

/* Utilitaires d'appoint (à n'utiliser que pour de la mise en page ponctuelle,
   jamais pour redéfinir un composant). */
.m0 { margin: 0; }
.ml-auto { margin-left: auto; }
.mt-s { margin-top: 6px; }
.mt-m { margin-top: 16px; }
.mt-l { margin-top: 24px; }
.mb-m { margin-bottom: 14px; }
.align-end { align-items: flex-end; }
.grow-0 { flex: 0 0 auto; }
.form-inline { display: inline; margin: 0; }

/* ====================== 3. Coque : sidebar sombre + contenu ======================
   Une seule colonne de navigation (façon app SaaS) : marque en tête, sections
   Planning / Gestion / Configuration, pied avec Replier + Compte + organisation.
   app.js s'accroche à #burger et #shell : ne pas renommer ces ids. */

.shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--ink);
  color: #cbd5e1;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: width .15s ease;
  overflow: hidden auto;              /* x cache, y défile si nav trop haute */
  position: sticky;
  top: 0;
  height: 100vh;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.shell.collapsed .sidebar { width: 64px; padding: 16px 8px 12px; }
.shell.collapsed .sidebar .lbl,
.shell.collapsed .sidebar .side-title { display: none; }

.side-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; }
.shell.collapsed .side-head { justify-content: center; padding: 2px 0 16px; }
.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: #fff;
  border-radius: var(--r-l);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.logo-tile img { width: 30px; height: 30px; object-fit: contain; display: block; }
.brand-txt {
  color: #f8fafc;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: .2px;
  line-height: 1.25;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-title {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 14px 10px 5px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-m);
  color: #cbd5e1;
  text-decoration: none;
  font-size: var(--fs-body);
  white-space: nowrap;
  transition: background-color .12s, color .12s;
}
.shell.collapsed .side-item { justify-content: center; padding: 9px 0; }
.side-item:hover { background: var(--ink-2); color: #fff; }
.side-item.actif { background: var(--accent); color: #fff; font-weight: 600; }
.side-item .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 3px; padding-top: 10px; }
/* Un <button> n'herite pas du style d'un lien : sans cette remise a zero il arrive
   avec le fond gris et la police du systeme, et detonne dans la barre sombre (vu a
   l'ecran sur « Déconnexion », qui s'affichait en clair sur clair). Portee par
   l'element plutot que par une classe qu'on peut oublier : tout bouton ajoute
   demain dans la barre laterale sera juste d'emblee. */
button.side-item {
  border: none;
  background: transparent;
  font-family: inherit;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.side-collapse { color: var(--muted-2); }
.shell.collapsed .side-collapse .ico { transform: scaleX(-1); }
.side-org { padding: 8px 10px 2px; font-size: 11.5px; color: var(--muted); }

main { padding: 24px 28px; flex: 1; min-width: 0; }

/* ====================== 4. En-tête de vue + chips + période ====================== */

/* EN-TÊTE FIGÉ des vues planning (Vai, 23/08/2026 : « le nom de l'agent, la recherche,
   les téléchargements et les boutons de période doivent rester visibles et accessibles
   tout au long de la navigation »). Un planning au mois fait plusieurs écrans de haut :
   sans cela, changer de période oblige à remonter jusqu'en haut, puis à redescendre.

   Les marges négatives compensent le padding de `main` : sans elles, le contenu qui
   défile passerait dans les 28 px de marge latérale, à côté du fond opaque — on verrait
   des blocs glisser le long des bords. `top: 0` colle au haut de la fenêtre : la page
   n'a pas d'autre conteneur défilant (vérifié : aucun `overflow` sur `main`). */
.entete-collante {
  position: sticky;
  top: 0;
  z-index: 30;                /* au-dessus des blocs de frise (1, 2, 5), sous les infobulles (40) */
  margin: -24px -28px 16px;
  padding: 16px 28px 10px;
  background: var(--bg);
  /* Une ombre plutôt qu'une bordure : elle ne se dessine QUE lorsque du contenu passe
     dessous, et ne laisse pas un trait flottant en haut de page au repos. */
  box-shadow: 0 6px 12px -10px rgba(15, 23, 42, .5),
              0 1px 0 rgba(15, 23, 42, .06);
}
/* La barre de recherche et les onglets sont dans la zone figée : leurs marges basses
   d'origine y ajouteraient de la hauteur, or chaque pixel figé est un pixel de planning
   en moins. */
.entete-collante .entete { margin-bottom: 10px; }
.entete-collante .entete:last-child { margin-bottom: 0; }
.entete-collante .barre-filtre:last-child { margin-bottom: 0; }

/* Le titre cède la place, les commandes jamais (lot UI 1, 19/10/2026). Avant, à
   1280 px, tout rétrécissait ensemble : « Une seule couleur » sur trois lignes, les
   onglets de période en pastilles verticales. Désormais le titre se resserre jusqu'à
   220 px (sa ligne de période passe à la ligne), puis les commandes passent DESSOUS,
   alignées à droite, d'un bloc. */
.entete {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.entete > :first-child { flex: 1 1 220px; min-width: 0; }
.entete h1,
.page-head h1,
.page-actions h1 { margin: 0; font-size: var(--fs-h1); }
.periode { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-body); }
.entete-droite {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Vue Site : un nom de site long s'abrège au lieu de pousser l'en-tête figé sur
   trois lignes. Le nom entier reste au survol (title sur .titre-aide) et dans les
   onglets de sites juste au-dessus. Le seuil monte à 240 px : la période, elle, ne
   s'abrège pas en dessous de « Semaine 23 · du 01/06 au 07/06/2026 ». */
.vue-site .entete > :first-child { flex-basis: 240px; }
.vue-site .entete .titre-aide { min-width: 0; }
.vue-site .entete h1,
.vue-site .entete .periode { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Onglets de site au-dessus de la frise */
.site-onglets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
/* Cachée tant qu'on ne cherche rien (29/10/2026), comme la barre d'agents. */
.site-onglets.filtre-au-repos { margin: 0; }

.btn-mono {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-m);
  font-size: var(--fs-sm);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s, scale .12s;
}
.btn-mono:active { scale: .96; }
.btn-mono::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent) 50%, var(--ok) 50%);
}
.btn-mono.actif { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-mono.actif::before { background: var(--muted-2); }

/* Les quatre périodes forment UN contrôle segmenté (lot UI 1) : une seule
   silhouette au lieu de quatre pastilles flottantes, et ~30 px de gagnés. 32 px de
   haut, comme les flèches ‹ › et les boutons voisins. */
.periode-chips {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
}
.chip {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;        /* « 2 sem. » ne se coupe plus en deux lignes */
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s, scale .12s;
}
.chip:active { scale: .96; }
.chip.actif { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.off { color: var(--muted); }
.chip.off:hover { border-color: var(--muted-2); color: var(--ink); }
.periode-chips .chip { padding: 4px 8px; border-color: transparent; background: transparent; }
.periode-chips .chip.actif { background: var(--ink); color: #fff; }
.periode-chips .chip.off:hover { border-color: transparent; background: var(--hover); }

/* Écrans de moins de 1480 px (portable 1280 ou 1366, ou 1920 zoomé à 150 %) : le
   bouton monochrome se réduit à sa pastille et l'étiquette « Télécharger » s'efface
   (les boutons ↓ gardent leur encadré violet, c'est lui qui fait repère). Sans ce
   resserrement, l'en-tête de la vue Site ne tient pas sur une ligne à 1280 px. Le
   libellé du bouton est masqué À L'ŒIL seulement : il en reste le nom pour les
   lecteurs d'écran, et le title l'affiche au survol. */
@media (max-width: 1479px) {
  .btn-mono { justify-content: center; gap: 0; width: 32px; height: 32px; padding: 0; }
  .btn-mono-lbl {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.periode-nav { display: flex; gap: 4px; }
.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  line-height: 1;
  transition: background-color .12s, border-color .12s, scale .12s;
}
.nav-arrow:hover { border-color: var(--muted-2); background: var(--hover); }
.nav-arrow:active { scale: .96; }

/* BOUTONS-ICÔNES d'en-tête (Omar, 29/10/2026 : « il y a énormément de texte, il faut
   aérer ») : la silhouette des flèches de période (32 px, rayon 8), le nom au
   survol (title) et pour les lecteurs d'écran (aria-label). */
.btn-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s, scale .12s;
}
.btn-icone::-webkit-details-marker { display: none; }
.btn-icone:hover { border-color: var(--muted-2); background: var(--hover); }
.btn-icone:active { scale: .96; }
.btn-icone:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-icone .ico {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Le téléchargement, aux couleurs ABC : le violet de la marque, comme l'ancien
   « ↓ PDF » qu'il remplace — on repère d'un coup d'œil où récupérer les documents. */
.btn-icone-doc {
  border-color: var(--accent-bord);
  background: var(--accent-pale);
  color: var(--accent-fonce);
}
.btn-icone-doc:hover,
.menu-dl[open] > .btn-icone-doc {
  border-color: var(--accent);
  background: #f6e2f3;
  box-shadow: 0 1px 3px rgba(171, 15, 155, .16);
}

/* Le petit menu des documents de la page. Ancré à droite de l'icône : elle est en
   bout d'en-tête, un menu centré sortirait de l'écran. */
.menu-dl { position: relative; }
.menu-dl-liste {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 45;                 /* au-dessus de l'en-tête figé (30) et des infobulles (40) */
  min-width: 210px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-pop);
  transform-origin: top right;
  animation: menu-dl-entree .14s cubic-bezier(.2, 0, 0, 1);
}
@keyframes menu-dl-entree {
  from { opacity: 0; transform: translateY(-4px) scale(.97); }
}
.menu-dl-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--r-s);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.menu-dl-item .ico {
  width: 16px; height: 16px; flex-shrink: 0;
  fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.menu-dl-item:hover { background: var(--accent-pale); color: var(--accent-fonce); }
.menu-dl-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-dl-fmt {
  margin-left: auto;
  padding-left: 12px;
  color: var(--muted-2);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .04em;
}
@media (prefers-reduced-motion: reduce) {
  .btn-icone { transition: none; }
  .btn-icone:active { scale: 1; }
  .menu-dl-liste { animation: none; }
}

.frise-scroll { overflow-x: auto; padding-bottom: 2px; }

/* Barre de défilement jumelle, AU-DESSUS du planning (Vai, 24/08/2026). La barre
   native de .frise-scroll est au bas d'un conteneur de 720 px : sur un écran de
   1080 px elle tombe ~200 px sous le bord, et on ne peut l'attraper qu'en quittant
   le planning des yeux. Celle-ci est là où l'on regarde déjà.
   Sa piste ne porte aucun contenu : app.js lui donne la largeur du contenu de la
   frise. Tant qu'elle vaut 0, aucune barre ne s'affiche — donc rien ne bouge en vue
   Semaine, où la frise ne déborde pas, ni si le JS ne tourne pas. */
.frise-rail {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 6px;
}
/* 1 px : la piste n'est là que pour donner sa course à la barre. En vue Semaine, où
   rien ne déborde, le rail fait donc 1 px de haut et ne se remarque pas. */
.frise-rail-piste { height: 1px; }

/* ====================== 5. Stats + légende ====================== */

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--r-l);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.stat.ok { border-left-color: var(--ok); }
.stat.warn { border-left-color: var(--warn); }
.stat.bad { border-left-color: var(--bad); }
.stat-val {
  display: block;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.stat-lbl { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }

/* Vue Site : RÉCAP DE LA PLANIFICATION (Omar, 29/10/2026). Deux colonnes au même
   niveau : les heures des agents à gauche (le tableau prend la place), les chiffres
   de la période à droite, en une carte étroite, une ligne par chiffre. Les chiffres
   sont les premiers dans le code (l'urgence se lit d'abord) : la grille les pose à
   droite. Sous 1100 px, une seule colonne, chiffres en tête. */
.recap-planif {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 12px 16px;
  align-items: start;
  margin-bottom: 12px;
}
.recap-planif > .stats { grid-column: 2; grid-row: 1; }
.recap-planif > .recap-agents { grid-column: 1; grid-row: 1; min-width: 0; margin: 0; overflow-x: auto; }
@media (max-width: 1099px) {
  .recap-planif { grid-template-columns: minmax(0, 1fr); }
  .recap-planif > .stats,
  .recap-planif > .recap-agents { grid-column: 1; grid-row: auto; }
}
.vue-site .stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
}
.vue-site .stats-titre {
  margin: 2px 8px 4px;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.vue-site .stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-m);
  background: none;
  box-shadow: none;
}
.vue-site .stat-lbl { display: inline; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.vue-site .stat-val { display: inline; font-size: 16px; text-align: right; white-space: nowrap; }
.vue-site .stat-detail { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.vue-site .stat.bad { background: var(--bad-pale); }
.vue-site .stat.bad .stat-val,
.vue-site .stat.bad .stat-lbl,
.vue-site .stat.bad .stat-detail { color: var(--bad-ink); }
.vue-site .stat.ok .stat-val { color: var(--ok-ink); }
.vue-site .stat.warn .stat-val { color: var(--warn-ink); }
/* La prime : une information, pas une urgence. Sous un filet, en retrait. */
.vue-site .stat-info { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-m) var(--r-m); padding-top: 9px; }
.vue-site .stat-info .stat-val { font-size: var(--fs-body); font-weight: 600; color: var(--muted); }

.legende {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: var(--fs-sm);
}
.leg-titre { color: var(--muted); }
.leg-item { display: inline-flex; align-items: center; gap: 6px; }
.leg-item i {
  width: 14px; height: 14px; border-radius: 4px; display: inline-block;
}
.leg-trou {
  background: repeating-linear-gradient(45deg, var(--bad-pale), var(--bad-pale) 4px, #fff 4px, #fff 8px);
  border: 1px dashed var(--bad);
}
.leg-pp { background: var(--pp); }
body.mono .legende .leg-item.agent i { background: var(--muted-2) !important; }

/* ====================== 6. Frise horaire (vue Site) ======================
   Les classes de cette section sont câblées à app.js (drag, poignées, ghost)
   et aux tests : ne rien renommer. */

.frise-head, .frise-foot, .frise-semaines {
  display: grid;
  grid-template-columns: var(--grid-cols);
}
.frise-head { margin-top: 4px; }

/* Bandeau des SEMAINES au-dessus de la frise (vues 2 sem., Cycle, Mois — retour de
   Vai du 23/08/2026). Chaque bandeau s'étend sur ses propres colonnes grâce à un
   span posé par le gabarit : la grille est la même que celle des jours, donc les
   deux restent alignés quelle que soit la largeur. */
.frise-semaines { margin-top: 8px; }
.sem-bandeau {
  margin: 0 3px;
  padding: 3px 0;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  background: var(--hover);
  border-radius: var(--r-s) var(--r-s) 0 0;
  font-variant-numeric: tabular-nums;
}
/* Semaine coupée par le bord de la période : hachures légères, pour qu'on ne lise
   pas trois jours comme une semaine entière. */
.sem-bandeau.sem-partielle {
  background: repeating-linear-gradient(
    135deg, var(--hover), var(--hover) 5px, transparent 5px, transparent 10px);
}
/* Le trait de fin de semaine : posé sur le LUNDI (première colonne du groupe), donc
   il tombe exactement entre dimanche et lundi. Jamais sur la première colonne
   affichée — le gabarit ne pose pas le marqueur là.

   Posé via un ATTRIBUT et non une classe : plusieurs tests comptent les colonnes en
   cherchant `class="day-head"` à l'identique, et une classe de plus les casserait
   pour une raison purement décorative. */
.day-head[data-debut-semaine],
.day-col[data-debut-semaine] { box-shadow: inset 2px 0 0 -1px var(--muted-2); }
.day-head {
  position: relative;
  text-align: center;
  padding: 8px 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-m) var(--r-m) 0 0;
  margin-left: 3px;
}
/* Le « + » se tient dans le COIN et ne se montre qu'au survol de la journée
   (Omar, 02/09/2026 : en vue Mois il masquait la date, qui est l'information).
   Il n'est pas la seule porte d'entrée — cliquer la colonne crée déjà un créneau —
   donc le cacher au repos ne retire aucun geste. Au clavier, le focus le révèle. */
.day-add {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  font-size: var(--fs-xs);
  border-radius: var(--r-s);
  border: 1px solid var(--accent-bord);
  color: var(--accent-fonce);
  background: var(--card);
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: scale(.85);
  transition: opacity .12s cubic-bezier(.2, 0, 0, 1),
              transform .12s cubic-bezier(.2, 0, 0, 1),
              background-color .12s, border-color .12s, color .12s;
}
.day-head:hover .day-add,
.day-add:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
/* Élargit la cible de clic sans grossir le visuel : 18 px + 11 px de marge de
   chaque côté = 40 px, le minimum confortable à la souris. */
.day-add::after { content: ""; position: absolute; inset: -11px; }
.day-add:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
/* La date reste lisible sous le bouton : elle se décale d'un cheveu au survol au
   lieu d'être recouverte. En vue Mois, la colonne est étroite et c'est ce
   chevauchement qui faisait disparaître le numéro du jour. */
.day-head span { display: inline-block; transition: transform .12s cubic-bezier(.2, 0, 0, 1); }
.day-head:hover span { transform: translateX(-9px); }
@media (prefers-reduced-motion: reduce) {
  .day-add, .day-head span { transition: none; }
  .day-head:hover span { transform: none; }
}

.frise-aide { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-sm); text-wrap: pretty; }
.frise-aide b { color: var(--ink); }

/* La journée entière est une cible de création (clic = nouveau créneau à cette heure). */
.day-col { cursor: copy; }
.day-col .bloc { cursor: grab; }
.day-col:hover { box-shadow: inset 0 0 0 1px var(--accent-bord); }
.day-head b { color: var(--ink); font-size: 15px; }
.axis-corner { }

.frise-body {
  position: relative;
  display: grid;
  grid-template-columns: var(--grid-cols);
  height: var(--frise-h);
}
.axis-col { position: relative; }
.axis-h {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: var(--fs-2xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.day-col {
  position: relative;
  margin-left: 3px;
  /* Lignes horaires : fines à chaque heure, plus marquées toutes les 2 h (= axe). */
  background: var(--card)
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--frise-h) / 24 - 1px),
      rgba(148, 163, 184, .25) calc(var(--frise-h) / 24 - 1px),
      rgba(148, 163, 184, .25) calc(var(--frise-h) / 24)
    ),
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--frise-h) / 12 - 1px),
      var(--line) calc(var(--frise-h) / 12 - 1px),
      var(--line) calc(var(--frise-h) / 12)
    );
  border: 1px solid var(--line);
}

/* Blocs de vacation */
/* DEUX AGENTS SUR LE MEME CRENEAU (retour de Vai du 23/08/2026, site RONDIER SUD :
   ils sont deux a chaque fois, et un seul se voyait). Les blocs qui se recouvrent
   sont repartis en VOIES par le serveur (affichage.repartir_en_voies) ; ici on ne
   fait que traduire voie/voies en position.

   `--voies` n'est posé QUE sur les blocs qui partagent leur colonne : un bloc seul
   garde `left/right: 4px` et donc exactement l'aspect d'avant. Les deux règles ne se
   marchent pas dessus — celle-ci gagne par sa spécificité d'attribut. */
.bloc {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--r-s);
  color: #fff;
  padding: 4px 6px;
  overflow: hidden;
  font-size: var(--fs-xs);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.bloc-h {
  font-size: var(--fs-2xs);
  opacity: .92;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
/* Le nom de l'agent tient sur UNE ligne, et ce qui depasse se termine par des
   points de suspension. Sans ca, .bloc { overflow: hidden } coupait le texte en
   pleine lettre, sans rien signaler : « À POURVOIR » etait deja tronque en vue
   Mois, et on lisait « À POURV » comme si c'etait le libelle complet. */
.bloc-a {
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* La colonne du jour fait 4 px de marge de chaque côté ; l'espace utile est donc
   `100% - 8px`, découpé en autant de parts que de voies. Chaque part perd 2 px pour
   la gouttière — sans elle, deux couleurs voisines se toucheraient et se liraient
   comme un seul bloc bicolore. */
.bloc[style*="--voies"] {
  --gouttiere: 2px;
  width: calc((100% - 8px - (var(--voies) - 1) * var(--gouttiere)) / var(--voies));
  left: calc(4px + var(--voie) * ((100% - 8px - (var(--voies) - 1) * var(--gouttiere))
             / var(--voies) + var(--gouttiere)));
  right: auto;
}
/* Un bloc étroit n'a plus la place d'un padding confortable : le texte serait
   coupé avant la première lettre du nom. */
.bloc[style*="--voies"] { padding-inline: 4px; }

/* Le pire cas : vue large ET colonne partagée, soit ~35 px de large. L'horaire y
   s'empile sur trois lignes et ne laisse rien pour le nom — or à cette échelle on
   cherche QUI tient le poste, pas à quelle minute il commence (la position verticale
   du bloc le dit déjà, et l'infobulle donne l'horaire exact). On rend donc les trois
   lettres lisibles plutôt qu'un horaire complet et un nom coupé à « G… ». */
.bloc-serre { padding-inline: 2px; }
.bloc-serre .bloc-h { display: none; }
.bloc-serre .bloc-a { font-size: var(--fs-2xs); letter-spacing: -0.01em; }
.bloc.suite { opacity: .75; }
.bloc:not(.trou) { background: var(--c, #64748b); }
body.mono .bloc:not(.trou) { background: #64748b; }
.bloc.trou {
  background: repeating-linear-gradient(45deg, var(--bad-pale), var(--bad-pale) 6px, #fff 6px, #fff 12px);
  color: var(--bad);
  border: 1.5px dashed var(--bad);
  box-shadow: none;
}

/* Créneau ABANDONNÉ : un agent y est bien affecté, mais il est absent ce jour-là —
   personne ne tiendra le poste. On garde sa couleur (Vai doit reconnaître QUI
   manque) et on la barre d'un liseré d'alerte, pour que ça ne se confonde ni avec
   un créneau tenu ni avec un trou vide. */
.bloc.abandonne {
  border: 1.5px dashed var(--bad);
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .38);
}
/* À DROITE, comme la pastille prime panier : à gauche il recouvrait l'horaire du
   bloc (« ABSENT 4:00 » au lieu de « 06:00 → 14:00 »). Quand les deux coexistent,
   la prime se décale pour laisser passer l'absence, plus urgente à lire. */
.abs-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  background: var(--bad);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 0 4px;
  border-radius: 4px;
}
.bloc.abandonne .pp-badge { right: 58px; }
/* Lot A : absence A HORAIRE qui recouvre le créneau. Ambre, pas rouge : le poste
   EST tenu, il faut trancher -- ce n'est pas le trou masqué de « ABSENT ». */
.abs-badge.indispo {
  position: static;                      /* dans le flux, sous le nom */
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 1px 5px;
  background: var(--warn-pale);
  color: var(--warn-ink);
  border: 1px solid var(--warn-bord);
  letter-spacing: .2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Retour n°11 (Vai, 21/10/2026) : le même agent est aussi sur un autre créneau à
   cette heure-là. Rouge pâle (il ne peut pas tenir les deux), dans le flux sous le
   nom comme l'indispo ; le sigle dit où, l'infobulle du bloc donne l'horaire. */
.abs-badge.chevauche {
  position: static;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 1px 5px;
  background: var(--bad-pale);
  color: var(--bad-ink);
  border: 1px solid var(--bad-bord);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-etiq .abs-badge.chevauche { display: inline-block; margin-top: 0; }
.bloc.bloc-serre .abs-badge.chevauche { font-size: 0; padding: 0 3px; line-height: 14px; }
.bloc.bloc-serre .abs-badge.chevauche::before { content: "⇆"; font-size: 10px; }
/* Bloc partagé et serré (vue large) : plus de place pour la tranche, on garde le signe. */
.bloc.bloc-serre .abs-badge.indispo { font-size: 0; padding: 0 3px; line-height: 14px; }
.bloc.bloc-serre .abs-badge.indispo::before { content: "⚠"; font-size: 10px; }

/* Édition de la frise façon agenda : clic = éditer, glisser le corps = déplacer,
   poignées haut/bas = régler début/fin. */
.bloc { cursor: pointer; transition: filter .12s; }
.bloc-prim { cursor: grab; touch-action: none; user-select: none; }
.bloc-prim:hover { filter: brightness(1.05); }
.bloc.dragging { opacity: .4; }

/* Poignées de redimensionnement (haut = début, bas = fin) */
.poignee {
  position: absolute;
  left: 0;
  right: 0;
  height: 9px;
  cursor: ns-resize;
  z-index: 2;
}
.poignee-haut { top: -2px; }
.poignee-bas { bottom: -2px; }
.poignee::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .85);
  opacity: 0;
  transition: opacity .12s;
}
.poignee-haut::after { top: 2px; }
.poignee-bas::after { bottom: 2px; }
.bloc-prim:hover .poignee::after { opacity: .9; }
.bloc.trou .poignee::after { background: var(--bad); }

/* Aperçu fantôme pendant le geste + étiquette d'heure aimantée */
#frise-ghost {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  border: 2px solid var(--accent);
  background: var(--accent-ring);
  border-radius: var(--r-s);
  box-shadow: 0 2px 10px rgba(171, 15, 155, .25);
}
#frise-ghost.ghost-trou { border-color: var(--bad); background: rgba(220, 38, 38, .12); }
#frise-ghost-label {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* Marqueur prime panier (vacation >= 10h) */
.bloc.pp { box-shadow: 0 0 0 2px var(--pp), 0 1px 3px rgba(0, 0, 0, .25); }
.pp-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  background: var(--pp);
  color: #1f2937;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 0 4px;
  border-radius: 4px;
}
/* Variante EN LIGNE (colonne Heures de la grille de trame) : la version par defaut
   est absolute pour se poser en coin d'un bloc de frise, inutilisable dans une
   cellule de tableau. */
.pp-badge.inline {
  position: static;
  margin-left: 6px;
  vertical-align: 1px;
}

/* Pied : total par jour (ventilation minuit) */
.frise-foot { margin-bottom: 22px; }
.foot-cell {
  text-align: center;
  padding: 7px 0;
  margin-left: 3px;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--r-m) var(--r-m);
}
.axis-corner.small {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  padding: 7px 8px 0 0;
  line-height: 1.1;
}

/* ====================== 7. Panneaux trous / légal ====================== */

.panneaux {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.panneau {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.panneau h2 {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-h2);
}
.vide { color: var(--muted); font-size: var(--fs-body); margin: 4px 0; }

/* Panneaux repliables (Vai, 21/10/2026) : fermés, une ligne de récap chacun ; le
   détail s'ouvre au clic. Les deux colonnes ne s'étirent pas l'une sur l'autre. */
.panneaux:has(.panneau-pli) { align-items: start; }
.panneau-pli { padding: 0; }
.panneau-recap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; list-style: none;
  border-radius: var(--r-l);
}
.panneau-recap::-webkit-details-marker { display: none; }
.panneau-recap:hover { background: var(--bg); }
.panneau-recap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panneau-pli[open] > .panneau-recap { border-bottom: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; }
.panneau-pli[open] .remp-chevron { transform: translateY(-1px) rotate(90deg); }
.panneau-titre { font-size: var(--fs-h2); font-weight: 700; white-space: nowrap; }
.panneau-recap { flex-wrap: wrap; }
.recap-nb {
  font-size: var(--fs-sm); font-weight: 700; padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.recap-mauvais { background: var(--bad-pale); color: var(--bad-ink); }
.recap-bon { background: var(--ok-pale); color: var(--ok-ink); }
.recap-plus { color: var(--muted); font-size: var(--fs-xs); }
.panneau-pli .remp-chevron { margin-left: auto; }
.panneau-corps { padding: 6px 18px 16px; }

/* « Attribuer tous les vacants à… » : en tête du détail, avant la liste. */
.attr-vacants {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 0 12px; border-bottom: 1px solid var(--line);
}
.attr-vacants-lbl { font-weight: 600; font-size: var(--fs-body); }
.attr-vacants .form-select { width: auto; min-width: 220px; flex: 1 1 220px; }
.attr-absent { display: block; margin-top: 2px; }

.liste-trous { list-style: none; margin: 0; padding: 0; }
.liste-trous li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.liste-trous li:last-child { border-bottom: none; }
.t-jour { font-weight: 600; min-width: 64px; }
.t-h { font-variant-numeric: tabular-nums; }
.t-poste { color: var(--muted); flex: 1; }
.t-action { color: var(--accent-fonce); font-size: var(--fs-sm); font-weight: 600; }
button.t-action {
  background: none; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: var(--r-m);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-family: inherit;
}
button.t-action:hover { background: var(--accent-pale); }
button.t-action:focus-visible { outline: 2px solid var(--accent); }

.liste-alertes, .liste-infos { list-style: none; margin: 0; padding: 0; }
.liste-alertes .al {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.liste-alertes .al:last-child { border-bottom: none; }
.badge {
  color: #fff;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.badge.mini { padding: 1px 5px; font-size: 10px; }
.al-regle { color: var(--bad); font-weight: 700; }
.al-msg { flex: 1; }
.al-art { color: var(--muted); font-size: var(--fs-xs); }
.infos { margin-top: 10px; }
.infos summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
.liste-infos li { padding: 5px 0; font-size: var(--fs-sm); color: #475569; }

/* ====================== 8. Vue Équipe ====================== */

/* Zone remplaçant en 5 s */
.remplacant-zone { margin-bottom: 18px; }
.trou-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--bad);
  border-radius: var(--r-l);
  padding: 12px 16px;
}
.trou-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trou-badge {
  background: var(--bad);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 5px;
}
/* Créneau à pourvoir parce que l'agent prévu est ABSENT (≠ créneau jamais pourvu) :
   même urgence, cause différente — on le distingue en orange, et la phrase qui suit
   nomme l'absent. */
.trou-badge.abs { background: var(--warn); color: #1f2937; }
.trou-absent {
  flex-basis: 100%;
  color: var(--warn-ink);
  font-size: var(--fs-body);
  font-weight: 600;
}
.trou-quand { font-weight: 700; font-size: 15px; }
.trou-detail { color: var(--muted); font-size: var(--fs-body); }

.remp-panel {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 4px;
}
.remp-panel.open { display: grid; }
.remp-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.remp-col.oui { border-top: 3px solid var(--ok); }
.remp-col.non { border-top: 3px solid var(--muted); }
.remp-col h3 { margin: 0 0 8px; font-size: var(--fs-body); }
.remp-col.oui h3 { color: var(--ok); }
.remp-col.non h3 { color: var(--muted); }
.remp-col ul { list-style: none; margin: 0; padding: 0; }
.remp-col li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.remp-col li:last-child { border-bottom: none; }
.remp-col .h { color: var(--muted); font-size: var(--fs-sm); }
/* Les deux charges (période et cycle de paie) forment UN bloc poussé à droite :
   c'est le conteneur qui porte `margin-left: auto`, sinon la première valeur
   décollerait et la seconde resterait accrochée au nom. */
.remp-charge {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;   /* les totaux s'alignent d'une ligne à l'autre */
  white-space: nowrap;
}
/* La charge du cycle se lit APRÈS celle de la période : un ton plus bas, séparé par
   un point médian, pour qu'on voie d'un coup laquelle répond à quelle question. */
.h-cycle { color: var(--muted-2); }
.h-cycle::before { content: "· "; }
/* Quota déjà atteint : le chiffre le dit. C'est ce qui « aide et priorise » — sans
   cela, deux agents à 32 h cette semaine se ressemblent, alors que l'un est à 90 h
   sur son cycle et l'autre à 170 h. */
.h-cycle.au-quota { color: var(--bad); font-weight: 700; }
.remp-col .motif { color: var(--muted); font-size: var(--fs-sm); margin-left: auto; text-align: right; }
.badge.gris { background: var(--muted-2); }

/* Actions « combler un trou en 1 clic » (vue Équipe) */
.form-affecter, .form-forcer { margin: 0 0 0 10px; display: inline-flex; }

/* Grille équipe (agents x jours) */
/* La grille défile DANS SA BOÎTE, dans les deux sens (Omar, 02/09/2026 : « quand on
   utilise la barre de défilement, il faut que la colonne des agents reste figée ;
   idem pour la ligne de dates »). Un conteneur à hauteur bornée est la condition
   pour que `position: sticky` tienne : sans elle, l'en-tête se collait au haut d'une
   boîte plus grande que l'écran, donc ne se voyait jamais.
   La hauteur laisse la place à l'en-tête de page et aux cartes de remplacement ;
   `min-height` évite qu'un petit effectif se retrouve dans une fenêtre écrasée. */
.equipe-grille {
  overflow: auto;
  /* Presque toute la hauteur d'ecran : la boite depasse donc le bas de la fenetre
     tant qu'on n'a pas fait defiler la page, et une fois descendu elle l'occupe
     entierement. Une hauteur calculee sur la position de la grille se mordrait la
     queue -- plus la boite raccourcit, moins la page a de quoi defiler, donc moins
     elle remonte (mesure au CDP le 02/09 : elle se figeait a 288 px). */
  max-height: calc(100vh - 120px);
  border-radius: var(--r-m);
}
/* Largeur mini des colonnes-jour : au-delà d'une semaine, la grille défile
   horizontalement au lieu de s'écraser. 52 px depuis que le SIGLE du site a
   remplacé son nom entier dans les pastilles — la période tient sur bien moins
   de largeur, donc on en voit davantage d'un coup d'œil. */
.grille td.cell { min-width: 52px; }
.grille { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--card); }
.grille th, .grille td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px 6px;
  text-align: center;
  vertical-align: top;
  font-size: var(--fs-sm);
}
.grille th:first-child, .grille td:first-child { border-left: 1px solid var(--line); }
/* `separate` et non `collapse` : avec des bordures fusionnees, celles d'une cellule
   figee restent en arriere et laissent passer le contenu qui defile dessous. */
.grille thead th {
  border-top: 1px solid var(--line);
  background: var(--thead);
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}
.grille thead th b { color: var(--ink); }
.grille .col-agent { text-align: left; min-width: 150px; }
.grille .col-h { min-width: 66px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Colonne des agents figée à gauche. Fond OPAQUE obligatoire : les pastilles
   défilent dessous. L'ombre portée remplace la bordure au moment où la colonne
   surplombe le contenu — une bordure seule ne dirait pas qu'il y a de la matière
   dessous. */
.grille th.col-agent,
.grille td.col-agent {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: 1px 0 0 var(--line), 6px 0 10px -8px rgba(15, 23, 42, .25);
}
/* Le coin haut-gauche croise les deux : il doit passer au-dessus des deux. */
.grille thead th.col-agent { z-index: 3; background: var(--thead); }
/* Une ligne survolée garde son fond jusque sous la colonne figée. */
.grille tbody tr:hover td.col-agent { background: var(--hover); }
.grille tbody tr.libre-row td.col-agent { background: var(--thead); }

/* Le flex est porte par un DIV a l'interieur de la cellule : sur le `td` lui-meme,
   il sortait la cellule du modele tabulaire et son `position: sticky` ne tenait plus
   au defilement vertical (mesure au CDP le 02/09/2026 : la colonne figee decrochait
   de 383 px). */
.agent-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Pastille agent : aujourd'hui initiales sur fond couleur (la couleur vient de
   presentation.py, en donnée). Accueille une photo (lot 4, fait) :
   la même boîte affiche l'<img> rond à la place des initiales. */
.agent-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-2xs);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
/* Liste des agents : la pastille et le nom restent sur UNE ligne (lot UI 2,
   19/10/2026). Le tableau en largeur automatique cassait « DURAND » sous sa
   pastille dès qu'une autre colonne réclamait de la place. */
.agent-identite { white-space: nowrap; }
.agent-identite .agent-pill { margin-right: 8px; vertical-align: middle; }
/* Lot 4 : la photo remplit la pastille ronde ; repli initiales si absente. */
.agent-pill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.agent-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.agent-nom { font-weight: 600; }
.agent-qual { color: var(--muted); font-size: var(--fs-2xs); }
.al-dot { color: var(--bad); }

.vac-chip {
  display: inline-block;
  background: var(--pill-pale);
  border: 1px solid var(--pill-bord);
  color: var(--muted);
  border-radius: 5px;
  padding: 1px 5px;
  margin: 1px;
  font-size: var(--fs-xs);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: help;
}
/* Le SIGLE porte l'information qu'on cherche en balayant la ligne ; l'horaire vient
   ensuite. D'où le contraste sur l'un et pas sur l'autre, à taille égale. */
.vac-chip b { color: var(--ink-2); font-weight: 700; }
.form-retirer { display: inline; margin: 0; }

.repos { color: #cbd5e1; }
.libre-row { background: #fafafa; }
.libre-row .col-h .dispo { color: var(--ok); font-weight: 600; }
.dispo { color: var(--ok); }

body.mono .agent-pill { background: var(--muted-2) !important; }

/* ====================== 9. Écrans de gestion ====================== */

.page-head { margin-bottom: 16px; }
.page-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-body);
  text-wrap: pretty;
}
.soon {
  display: inline-block;
  margin-left: 8px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--warn-ink);
  background: var(--warn-pale);
  border: 1px solid var(--warn-bord);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  vertical-align: middle;
}
/* border-collapse: separate (et non collapse + overflow: hidden, qui taillait les
   coins mais ROGNAIT toute infobulle posee dans une cellule). Les coins arrondis
   sont portes par les cellules d'angle, rayon interieur = exterieur - bordure. */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
}
.tbl thead tr:first-child th:first-child { border-top-left-radius: calc(var(--r-l) - 1px); }
.tbl thead tr:first-child th:last-child { border-top-right-radius: calc(var(--r-l) - 1px); }
.tbl tbody tr:last-child td:first-child { border-bottom-left-radius: calc(var(--r-l) - 1px); }
.tbl tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--r-l) - 1px); }
/* Le lien d'en-tête triable remplit toute la cellule (padding porté par le a) : dans
   une cellule d'angle, son fond de survol suivrait le rectangle et creverait le coin
   arrondi. inherit reprend le rayon du th (nul hors des angles). */
.th-tri a { border-radius: inherit; }
.tbl th, .tbl td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.tbl th { background: var(--thead); color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Cellule d'état vide (« Aucun agent… ») */
.cell-vide { padding: 16px 14px; color: var(--muted); }

/* En-têtes triables (liste des agents, ?tri=&sens=). Le lien remplit TOUTE la
   cellule (padding porté par le a, pas le th) : la zone cliquable fait la hauteur
   de l'en-tête, pas la largeur du mot. */
.tbl th.th-tri { padding: 0; }
.th-tri a {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  color: inherit;
  text-decoration: none;
  transition: color .15s ease-out, background-color .15s ease-out;
}
.tbl .th-tri.num a { justify-content: flex-end; }
.th-tri a:hover { color: var(--ink); background: var(--hover); }
.th-tri a:focus-visible { outline-offset: -2px; }   /* l'anneau reste DANS la cellule */
.th-tri a.tri-actif { color: var(--ink); }
/* La flèche de sens vit dans la 1re ligne du libellé (alignée au titre, pas au
   milieu d'un en-tête à deux lignes). Fantôme (↕) sur les colonnes inactives :
   annonce qu'on peut trier, et l'en-tête ne bouge pas d'un pixel au changement. */
.tri-fleche { font-size: 9px; opacity: .4; margin-left: 5px; }
.tri-actif .tri-fleche { opacity: 1; }

/* Ligne « fenêtre regardée » au-dessus d'un tableau (label + sélecteur). */
.barre-periode {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.barre-periode .periode { margin: 0; }

/* Sous-texte « dont X h assimilées » d'une cellule d'heures comptées. */
.dont-assimile { color: var(--muted); font-size: 11.5px; font-weight: 400; }
/* « — » d'écart non calculable : le pourquoi vit dans une info-bulle accessible
   (hôte .a-bulle : focusable, aria-describedby — voir section 12bis). */
.sans-ecart { color: var(--muted); }

.pill-q {
  display: inline-block;
  background: var(--pill-pale);
  border: 1px solid var(--pill-bord);
  color: var(--ink-2);
  border-radius: var(--r-s);
  padding: 2px 8px;
  font-size: var(--fs-xs);
}

/* Types de contrat (valeurs produites par routes_agents : cdi, cdd, extra). */
.type-cdi { color: #0f766e; font-weight: 600; }
.type-cdd { color: #b45309; font-weight: 600; }
.type-extra { color: #9333ea; font-weight: 600; }
.type-contrat { color: #0f766e; font-weight: 600; } /* compat ancienne valeur */

.card-conf {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.card-conf h2 { margin: 0 0 12px; font-size: var(--fs-h2); }
.kv { display: grid; grid-template-columns: 210px 1fr; gap: 7px 16px; font-size: var(--fs-body); }
.kv .k { color: var(--muted); }
/* Un reglage modifiable pose SOUS la grille cle/valeur de la meme carte : le filet
   marque la frontiere entre ce qui se lit et ce qui se change, sans ouvrir une carte
   de plus pour un seul champ. */
.reglage-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.reglage-form .form-group { margin-bottom: 0; }

/* ====================== 10. Boutons ======================
   Base commune partagée : tout bouton est un inline-flex centré, arrondi,
   avec transition ciblée et retour tactile (scale .96 au clic). Les variantes
   ne règlent que taille / couleurs. */

.btn, .btn-remp, .btn-affecter, .btn-forcer, .btn-imprimer,
.btn-ghost-sm, .btn-danger-sm, .btn-ghost, .btn-copier, .btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  border: none;
  transition: background-color .12s, border-color .12s, color .12s, filter .12s, scale .12s;
}
.btn:active, .btn-remp:active, .btn-affecter:active, .btn-forcer:active,
.btn-imprimer:active, .btn-ghost-sm:active, .btn-danger-sm:active,
.btn-copier:active, .btn-wa:active { scale: .96; }

.btn {
  padding: 9px 18px;
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-fonce); }
.btn-primary:disabled { background: var(--muted-2); cursor: not-allowed; }

/* Action de meme rang que la primaire, mais neutre : les deux reponses a une
   absence (reattribuer / laisser a pourvoir) doivent se valoir a l'oeil, c'est la
   planificatrice qui tranche. Ni un bouton principal, ni un lien discret. */
.btn-neutre {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--muted-2);
}
.btn-neutre:hover { border-color: var(--ink); background: var(--hover); }

.btn-ghost-sm {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  font-size: var(--fs-xs);
  color: var(--muted);
  background: var(--thead);
}
.btn-ghost-sm:hover { color: var(--ink); border-color: var(--muted-2); }

.btn-danger-sm {
  padding: 4px 10px;
  border: 1px solid var(--bad-bord);
  border-radius: var(--r-s);
  font-size: var(--fs-xs);
  color: var(--bad);
  background: #fff5f5;
}
.btn-danger-sm:hover { background: var(--bad-pale); }

.btn-remp {
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--r-m);
  white-space: nowrap;
}
/* Vue Équipe (Vai, 21/10/2026) : tous les boutons de la colonne ont la MÊME largeur
   et le compte est calé à droite en chiffres de largeur fixe — sinon « 0 » et « 15 »
   décalent chaque bouton d'un cran et la colonne ondule. */
.remplacant-zone .btn-remp {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 300px; justify-content: space-between;
  font-variant-numeric: tabular-nums;
}
.btn-remp-sep { font-size: .75em; opacity: .7; }
.btn-remp-nb { margin-left: auto; text-align: right; }
.btn-remp:hover { background: var(--ink-2); }
.btn-remp.actif { background: var(--accent); }

.btn-affecter {
  background: var(--ok);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 5px 13px;
  border-radius: var(--r-s);
}
.btn-affecter:hover { filter: brightness(1.08); }

.btn-forcer {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: var(--fs-xs);
  padding: 4px 11px;
  border-radius: var(--r-s);
}
.btn-forcer:hover { border-color: var(--pp); color: #b45309; }

.btn-retirer {
  border: none;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font-size: var(--fs-body);
  line-height: 1;
  padding: 4px 6px;
  margin-left: 2px;
  vertical-align: middle;
  border-radius: 4px;
  transition: color .12s, background-color .12s;
}
.btn-retirer:hover { color: var(--bad); background: var(--bad-pale); }

.btn-imprimer {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.btn-imprimer:hover { border-color: var(--muted-2); background: var(--hover); }

.btn-ghost {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--thead);
  color: var(--muted);
  cursor: not-allowed;
}

/* ÉCHELLE DES BOUTONS (lot UI 2, 19/10/2026) : trois hauteurs, pas une de plus.
     36 px  les actions d'un formulaire ou d'une carte (Créer, Enregistrer, Annuler,
            Remplaçant en 5 s) ;
     32 px  les outils d'en-tête (↓ PDF, Réattribuer, ＋ Absence, monochrome, flèches,
            périodes : cf. section 4) ;
     28 px  les actions dans une ligne de tableau ou une carte (Modifier, ✕, Affecter,
            Forcer, Copier, WhatsApp).
   Rayon : 8 px (--r-m) à partir de 32 px, 6 px (--r-s) en dessous. Avant, « Annuler »
   faisait 24 px à côté d'un « Créer » de 36 : deux familles qui ne se répondaient pas.
   Des hauteurs MINIMALES, posées ici à part : chaque variante garde ses couleurs et
   son corps, seule la silhouette s'aligne. */
.btn, .btn-remp { min-height: 36px; }
.btn-imprimer { min-height: 32px; }
.btn-ghost-sm, .btn-danger-sm, .btn-affecter, .btn-forcer, .btn-copier, .btn-wa { min-height: 28px; }
/* Dans la barre d'actions d'un formulaire, le bouton secondaire (Annuler, Supprimer)
   prend la taille du principal : une seule rangée, une seule hauteur. */
.form-actions .btn-ghost-sm,
.form-actions .btn-danger-sm {
  min-height: 36px;
  padding: 0 16px;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--r-m);
}

.page-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ====================== 10bis. Boîte de confirmation (dialog natif) ====================== */

.modal {
  border: none;
  padding: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  max-width: 430px;
  width: calc(100% - 32px);
  color: var(--ink);
}
.modal::backdrop {
  background: rgba(15, 23, 42, .45);
}
/* Entrée douce (le dialog et son fond apparaissent ensemble). */
.modal[open] { animation: modal-in .18s cubic-bezier(0.2, 0, 0, 1); }
.modal[open]::backdrop { animation: modal-fade .18s ease; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 16px;
  padding: 22px 24px;
}
.modal-icon {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-icon.danger { background: var(--bad-pale); color: var(--bad); }
.modal-icon.primary { background: var(--accent-pale); color: var(--accent); }
.modal-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.modal-titre { margin: 3px 0 0; font-size: 16px; }
.modal-msg { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-body); line-height: 1.5; text-wrap: pretty; }
.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-ghost-modal, .btn-danger-modal {
  padding: 9px 18px;
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s, scale .12s;
}
.btn-ghost-modal:active, .btn-danger-modal:active { scale: .96; }
.btn-ghost-modal { background: var(--thead); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost-modal:hover { border-color: var(--muted-2); }
.btn-danger-modal { background: var(--bad); color: #fff; border: none; }
.btn-danger-modal:hover { background: var(--bad-ink); }
.btn-danger-modal.primary { background: var(--accent); }
.btn-danger-modal.primary:hover { background: var(--accent-fonce); }

/* ====================== 11. Flash messages ====================== */

.flashes { list-style: none; padding: 0; margin: 0 0 16px; }
.flash-msg {
  padding: 11px 16px;
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  margin-bottom: 8px;
}
.flash-success { background: var(--ok-pale); border: 1px solid var(--ok-bord); color: var(--ok-ink); }
.flash-error   { background: var(--bad-pale); border: 1px solid var(--bad-bord); color: var(--bad-ink); }
.flash-warning { background: var(--warn-pale); border: 1px solid #fcd34d; color: var(--warn-ink); }
.flash-warn    { background: var(--warn-pale); border: 1px solid var(--warn-bord); color: var(--warn-ink); }

/* Retour à la même hauteur après une modif (Vai, 21/10/2026) : le message ne reste
   pas en haut de page, hors de vue — il flotte en haut de l'écran jusqu'au clic sur ×
   (un succès s'efface seul après 5 s). */
.flashes-flottants {
  position: fixed; top: 14px; left: 50%; translate: -50% 0; z-index: 900;
  width: min(720px, calc(100vw - 32px)); margin: 0; padding-right: 0;
  filter: drop-shadow(0 8px 20px rgb(15 23 42 / .18));
  animation: flash-entree .2s cubic-bezier(.2, 0, 0, 1);
  transition: opacity .3s ease, translate .3s ease;
}
.flashes-flottants .flash-msg { padding-right: 44px; }
.flashes-flottants .flash-msg:last-of-type { margin-bottom: 0; }
.flashes-fermer {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px;
  border: 0; border-radius: var(--r-m); background: transparent;
  color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .65;
}
.flashes-fermer:hover { opacity: 1; background: rgb(15 23 42 / .06); }
.flashes-fermer:focus-visible { outline: 2px solid var(--accent); opacity: 1; }
.flashes-partis { opacity: 0; translate: -50% -8px; pointer-events: none; }
@keyframes flash-entree { from { opacity: 0; translate: -50% -8px; } }
@media (prefers-reduced-motion: reduce) {
  .flashes-flottants { animation: none; transition: none; }
}

/* ====================== 12. Formulaires ====================== */

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  max-width: 680px;
  box-shadow: var(--shadow-card);
}
.form-card + .form-card { margin-top: 24px; }
.form-card h2 { margin: 0 0 16px; font-size: 16px; }
.form-group { margin-bottom: 18px; }
.form-group.etroit { max-width: 220px; }
/* Un sigle fait 8 caracteres au plus : un champ large mentirait sur ce qu'on
   attend. La largeur EST l'indication de format. */
.form-group.sigle { max-width: 110px; flex: 0 0 auto; }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
/* Sous-étiquette discrète (ex. Début / Fin d'une plage horaire) */
.form-label.discret { font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-input, .form-select {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-input.court { width: 90px; }
/* Un champ DATE porte « 10/08/2026 » plus l'icone de calendrier du navigateur :
   a 90 px l'annee etait coupee (constate a l'ecran sur l'ancrage du cycle de
   paie). La regle vise le type, pas une classe : partout ailleurs un `court`
   n'accueille que 2 a 4 chiffres. */
.form-input.court[type="date"] { width: 150px; }
/* Un champ MOIS porte « septembre 2026 » en toutes lettres, plus long qu'une date. */
.form-input.court[type="month"] { width: 180px; }
/* Largeur intermediaire : un champ borne a quelques dizaines de caracteres (le nom
   d'une indemnite) etire sur toute la colonne donne une cible immense pour une
   saisie courte -- l'oeil ne sait plus ou commence la valeur. */
.form-input.moyen { max-width: 340px; }
.form-hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; text-wrap: pretty; }
/* Aide qui porte sur toute une LIGNE de champs (et non sur un champ) : bornee en
   largeur de lecture, sinon la phrase court sur 120 caracteres et se relit mal. */
.form-hint-large { max-width: 72ch; line-height: 1.5; }
/* Apercu du modele de message (ecran Reglages) : rendu reel avec valeurs d'exemple. */
.apercu-bloc {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  white-space: pre-wrap;
}
.apercu-alerte { margin-top: 6px; font-size: var(--fs-xs); color: #b45309; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
/* Une aide qui suit une RANGEE de champs explique ces champs-la : elle doit leur
   coller, et l'espace de section passe APRES elle. Sans ca elle flotte a mi-chemin
   entre deux blocs et semble annoncer le suivant (fiche agent, zone « volume
   contractuel » lue comme un chapeau de « Qualifications »). */
.form-row:has(+ .form-hint) .form-group { margin-bottom: 4px; }
.form-row + .form-hint { margin-bottom: 18px; }
/* Rangee ou le CHAMP prime sur les boutons (trame : « copier ici la trame de… »,
   « remplacer dans la trame… par… »). Sans elle, « .form-row .form-group { flex:1 } »
   l'emporte sur .grow-0 -- plus specifique -- et chaque bouton ou infobulle reclame un
   tiers de la rangee : le menu tombait a 200 px et affichait « ZONE ARTISANALE — 4… »,
   or c'est justement la que se lisent le site, son nombre de lignes et son cycle. Regle
   LOCALE : le comportement des autres ecrans n'est pas touche. */
.form-row.champ-large .form-group.grow-0 { flex: 0 0 auto; }
.form-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  cursor: pointer;
  background: var(--thead);
  user-select: none;
  white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.form-check:has(input:checked) {
  background: var(--accent-pale);
  border-color: var(--accent-bord);
  color: var(--accent-fonce);
}
.form-check input { margin: 0; cursor: pointer; accent-color: var(--accent); }

/* Choix EXPLIQUE : une option qui ne se comprend pas a son seul libelle (le mode de
   decompte des heures supplementaires engage une lecture legale). La puce compacte
   .form-check ne peut pas porter trois lignes d'aide ; ici chaque option est une
   carte cliquable entiere -- surface de clic largement au-dela des 40 px, et l'aide
   fait partie de la cible, pas d'une note a cote. */
.form-choix {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  /* Rayon concentrique : la carte parente est en --r-l avec 16-18 px de padding,
     l'option interieure descend donc d'un cran. */
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--thead);
  padding: 12px 14px;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.form-choix + .form-choix { margin-top: 8px; }
.form-choix:hover { border-color: var(--accent-bord); }
.form-choix:has(input:checked) {
  background: var(--accent-pale);
  border-color: var(--accent-bord);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
}
/* Le clavier doit voir ce que la souris voit : sans ca, tabuler entre deux options
   ne montre qu'un minuscule anneau sur le rond du radio. */
.form-choix:has(input:focus-visible) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-choix input { margin: 3px 0 0; cursor: pointer; accent-color: var(--accent); }
.form-choix > span { display: block; }
.form-choix strong { display: block; font-size: var(--fs-body); }
.form-choix .form-hint { margin-top: 3px; }
/* Aide d'une carte COCHEE : sur --accent-pale, le --muted tombe a 4,2:1, sous le
   seuil de lecture d'un texte de 12 px (4,5:1). Un cran plus fonce (6,7:1). */
.form-choix:has(input:checked) .form-hint { color: #475569; }
/* Option impossible (prorata d'un agent sans contrat) : fond blanc, titre grise, sans
   survol. Pas d'opacity : elle palirait aussi la phrase qui dit POURQUOI c'est
   impossible, et celle-la doit rester lisible (4,5:1). */
.form-choix:has(input:disabled) { cursor: not-allowed; background: var(--card); }
.form-choix:has(input:disabled) strong { color: var(--muted); }
.form-choix:has(input:disabled):hover { border-color: var(--line); }
.form-choix input:disabled { cursor: not-allowed; }
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Bandeau d'action dangereuse en bas de carte (ex. vider la trame) */
.zone-danger {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
/* Ce que le geste va emporter, ecrit A COTE du bouton et non dans la seule
   confirmation : on doit pouvoir le lire sans risquer le clic. */
.zone-danger-detail {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.zone-danger-detail b { color: var(--ink); font-weight: 600; }
/* Supprimer une fiche (agent, site) : sous les cartes, aligné sur leur largeur
   (lot UI 2). Le geste a quitté chaque ligne des listes. */
.zone-danger.fiche-suppression { max-width: 680px; margin-top: 24px; padding-top: 16px; }
/* Un bouton mort doit se voir mort : sans cela, « rien a effacer » se decouvre
   au clic. */
.btn-danger-sm:disabled {
  opacity: .5;
  border-color: var(--line);
  color: var(--muted);
  background: var(--thead);
  cursor: not-allowed;
}
.btn-danger-sm:disabled:hover { background: var(--thead); }

/* Carte porteuse d'un accent de marque (ex. rotation) */
.card-accent { border-left: 3px solid var(--abc-orange); }

/* Indisponibilités dans fiche agent */
.indispo-list { list-style: none; padding: 0; margin: 0 0 16px; }
.indispo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.indispo-item:last-child { border-bottom: none; }
.indispo-item.est-edite {
  background: var(--accent-pale);
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 10px;
  margin-left: -10px;
  border-radius: var(--r-s);
}
/* Le libelle du type porte la couleur ; la largeur minimale aligne les dates en
   colonne. 168px = le plus long des neuf libelles (« Absence autorisée non
   rémunérée ») sans le forcer sur deux lignes aux tailles courantes. */
.indispo-type { font-weight: 600; min-width: 168px; }
/* Absences qui COMPTENT des heures : le vert-bleu du positif. */
.type-conge,
.type-conge_exceptionnel,
.type-repos_compensateur,
.type-heure_delegation { color: #0f766e; }
/* Subie mais comptee. */
.type-maladie { color: var(--bad); }
/* Absences qui ne comptent AUCUNE heure : l'ambre de l'attention, le rouge quand
   c'est une sanction. La couleur dit le decompte, pas la gravite morale. */
.type-indispo,
.type-absence_non_remuneree { color: var(--warn); }
.type-absence_injustifiee,
.type-retard,
.type-map_conservatoire,
.type-map_disciplinaire { color: var(--bad); }

/* La plage reste d'un bloc ; la pastille d'horaire passe DESSOUS quand la place
   manque (« 21:00-05:00 (+1 j) » d'une nuit), au lieu de pousser les boutons hors de
   la carte. */
.indispo-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  color: var(--ink);
}
.indispo-plage { white-space: nowrap; }
/* Horaire d'une absence PARTIELLE. Une pastille discrete, pas une alerte : c'est une
   precision sur la ligne, mais elle change tout (l'agent garde ses autres creneaux),
   donc elle doit se voir sans relire la ligne entiere. */
.indispo-horaire {
  display: inline-block;
  white-space: nowrap;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--thead);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  cursor: help;
}
/* Chiffres qui changent d'une ligne a l'autre : chasse fixe pour qu'ils s'alignent
   verticalement au lieu de danser. */
.indispo-decompte {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.indispo-decompte strong { color: var(--ink); }
.indispo-zero { color: var(--muted-2); font-style: italic; }
/* « proposé » = l'outil a choisi pour vous, vous n'avez rien tranché. Le dire
   evite de faire passer une suggestion pour une decision. */
.indispo-propose {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--thead);
  border: 1px solid var(--line);
  color: var(--muted-2);
  font-size: var(--fs-2xs);
  font-style: normal;
}
.indispo-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.sous-titre {
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-h2);
}

/* --- Grille des jours decomptes d'une absence --- */
.jours-grille {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.jour-case {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* 40px de haut : la cible minimale confortable, y compris au doigt. */
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  /* Rayon concentrique : la case interieure (6px) + 10px de marge laterale se
     lisent bien sous le rayon du bloc parent. */
  border-radius: var(--r-m);
  background: var(--card);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.jour-case:hover { border-color: var(--muted-2); }
.jour-case:has(input:checked) {
  background: var(--accent-pale);
  border-color: var(--accent-bord);
  color: var(--accent-fonce);
  font-weight: 600;
}
.jour-case:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.jour-case input { margin: 0; cursor: pointer; accent-color: var(--accent); }
.jours-total {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* « Calcul des heures » d'une absence (Omar, 01/10/2026) : deux cartes .form-choix lues
   par leur legende comme un champ ordinaire -- sans le cadre ni la marge interieure
   qu'un navigateur donne a un fieldset. */
.heures-mode { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.heures-mode > legend { padding: 0; }
/* Note « A choisir » d'une ancienne saisie ambigue : collee a la legende, elle respire
   avant les cartes. */
.heures-mode > .form-hint { margin: 0 0 8px; max-width: 72ch; }
/* Saisie libre : debut, fin et duree calculee sur une ligne, sous les cartes. */
.heures-libre {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 16px;
  margin-top: 12px;
}
.heures-libre[hidden] { display: none; }
.heures-libre .form-group { width: 140px; margin-bottom: 0; }
.heures-libre-duree {
  /* Au niveau du texte des champs : la duree se lit comme le resultat de la ligne. */
  margin: 0 0 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.heures-libre-duree.est-erreur { color: var(--bad-ink); }
.heures-libre > .form-hint { flex-basis: 100%; margin-top: 0; }
/* Horaire DIFFERENT selon les jours (Vai, 16/10/2026) : replie sous l'horaire general,
   une ligne par jour. Un jour qui a son propre horaire se detache (fond accent) ; les
   autres restent discrets, ils ne font que suivre. */
.horaires-jour { flex-basis: 100%; margin-top: 2px; }
.horaires-jour[hidden] { display: none; }
.horaires-jour > summary {
  width: fit-content;
  padding: 6px 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-fonce);
  cursor: pointer;
}
.horaires-jour > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-s);
}
.horaires-jour > .form-hint { margin: 2px 0 8px; max-width: 72ch; }
.horaires-jour-liste { display: grid; gap: 4px; }
.horaire-jour {
  display: grid;
  grid-template-columns: 64px 120px 14px 120px 1fr;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--r-m);
  transition: background-color .12s;
}
.horaire-jour.est-propre { background: var(--accent-pale); }
.horaire-jour-nom {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.horaire-jour.est-propre .horaire-jour-nom { color: var(--accent-fonce); font-weight: 600; }
.horaire-jour-fleche { color: var(--muted); text-align: center; }
.horaire-jour-duree {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
@media (max-width: 560px) {
  .horaire-jour { grid-template-columns: 52px 1fr 12px 1fr; }
  .horaire-jour-duree { grid-column: 2 / -1; }
}

/* ====================== 13. Vue Agent ====================== */

.vue-agent h1 { display: flex; align-items: center; gap: 10px; }

.agent-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
/* Liste cachée tant qu'on ne cherche rien (Vai, 21/10/2026) : pas de marge fantôme. */
.agent-switch.filtre-au-repos { margin: 0 0 6px; }
.switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s, scale .12s;
}
.switch-pill:hover { border-color: var(--muted-2); }
.switch-pill:active { scale: .96; }
.switch-pill.actif { background: var(--ink); color: #fff; border-color: var(--ink); }
.switch-pill .badge {
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  border-radius: 5px;
  padding: 3px 5px;
}

.bloc-alertes {
  background: #fef2f2;
  border: 1px solid var(--bad-bord);
  border-radius: var(--r-l);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.bloc-alertes h3 { margin: 0 0 6px; font-size: var(--fs-body); color: var(--bad-ink); }
.bloc-alertes ul { margin: 0; padding-left: 18px; font-size: var(--fs-sm); color: #7f1d1d; }
.bloc-alertes .art { color: #b91c1c; font-size: var(--fs-2xs); }
/* Aucune alerte : il ne reste que le depliant des infos, et le cadre redevient neutre.
   Un panneau rouge sans rien dedans fait crier un planning conforme -- exactement ce
   que le lot 43 (R3 sur les blocs contigus) vient de faire cesser dans le texte. */
.bloc-alertes.sans-alerte { background: var(--card); border-color: var(--line); }
.bloc-alertes.sans-alerte .infos { margin-top: 0; }

/* AGENDA DE L'AGENT EN COLONNES DE SEMAINES (Omar, 21/09/2026 : « le mois visible
   sur l'écran entier, sans défiler ni de haut en bas ni de droite à gauche ; des
   blocs semaines côte à côte »).

   UNE seule grille CSS : la gouttière des jours (Lun … Dim) + une colonne par
   semaine, et 9 lignes (tête, 7 jours, pied). Les colonnes du gabarit sont en
   `display: contents` : leurs cases se placent directement dans la grille, en
   `grid-auto-flow: column`, donc les 5 lundis sont sur la même ligne et partagent la
   même hauteur — sans JavaScript, sans hauteur fixée. Les lignes prennent la hauteur
   de leur contenu : un mois ordinaire (une vacation par jour) tient dans ~500 px.
   Sous 1 000 px de large, les colonnes gardent leur largeur minimale et la grille
   défile de côté — mieux qu'un texte illisible. */
.agent-agenda {
  --nb-sem: 5;
  display: grid;
  grid-template-columns: 40px repeat(var(--nb-sem), minmax(190px, 1fr));
  grid-template-rows: auto repeat(7, auto) auto;
  grid-auto-flow: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: auto;
  box-shadow: var(--shadow-card);
  font-variant-numeric: tabular-nums;
}
.sem-col { display: contents; }

/* Gouttière : les noms de jours, une fois pour toutes les semaines. Même fond que
   les têtes de colonne pour que les deux se lisent comme le cadre de la grille. */
.gout-tete, .gout-jour, .gout-pied {
  background: var(--thead);
  border-right: 1px solid var(--line);
}
.gout-jour {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.gout-tete { border-bottom: 1px solid var(--line); }
.gout-pied { border-top: 1px solid var(--line); }

/* Tête de colonne : numéro de semaine et bornes, sans total (le total est au PIED,
   là où l'œil le cherche). */
.sem-tete {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 7px 10px;
  background: var(--thead);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.sem-col:first-of-type .sem-tete,
.sem-col:first-of-type .jour-ligne,
.sem-col:first-of-type .sem-pied { border-left: none; }
.sem-num { font-weight: 700; color: var(--ink); }
.sem-dates { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
/* Semaine tronquée par le bord de la période : l'étiquette « 3 j. » le dit, et le
   fond de sa tête reste neutre — un motif rayé criait plus que l'information. */
.sem-tronquee {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--hover);
  color: var(--muted-2);
  font-style: italic;
}

/* Une case = un jour. La date en haut à gauche (avec son mois : une semaine peut
   chevaucher deux mois), puis l'absence et/ou les créneaux empilés. */
.jour-ligne {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transition-property: background-color;
  transition-duration: .12s;
}
.jour-ligne:hover { background: var(--hover); }
.jour-ligne .jd {
  color: var(--muted);
  font-size: var(--fs-2xs);
  line-height: 1.3;
}
.jour-ligne .repos {
  font-size: var(--fs-xs);
  font-style: italic;
  line-height: 1.2;
}
/* Hors période (les jours qui complètent une semaine tronquée) : la case existe
   pour l'alignement, elle ne porte que sa date, éteinte. */
.jour-ligne.hors-periode { background: var(--bg); }
.jour-ligne.hors-periode .jd { color: var(--muted-2); }
.jour-ligne.hors-periode:hover { background: var(--bg); }

/* Le créneau prend la largeur de la case (plafonnée : sur une seule semaine, la
   colonne fait tout l'écran et une pastille de 1 200 px éloignerait les heures de
   l'horaire) : horaire et site à gauche, heures et bouton à droite, alignés d'une
   case à l'autre. Sur un écran étroit (1 366 px : colonnes de ~220 px), la pastille
   passe sur deux lignes — heures et bouton dessous — plutôt que de couper
   « 19:00 → 05:30 » en deux, ce qui se lirait comme deux horaires. */
.jour-ligne .creneau {
  width: 100%;
  max-width: 380px;
  min-width: 0;
  flex-wrap: wrap;
  padding: 3px 8px;
  gap: 4px 6px;
}
.jour-ligne .creneau .cr-horaire,
.jour-ligne .creneau .cr-h { white-space: nowrap; }
.jour-ligne .creneau .cr-site {
  padding: 0 5px;
  border-radius: var(--r-s);
  background: var(--card);
  border: 1px solid var(--pill-bord);
  font-size: var(--fs-xs);
  letter-spacing: .2px;
  cursor: help;
}
.jour-ligne .creneau .cr-h { margin-left: auto; }
/* Lot A : créneau tenu pendant une absence à horaire -- un signe, le détail au survol. */
.jour-ligne .creneau .cr-indispo {
  color: var(--warn); font-size: var(--fs-xs); line-height: 1; cursor: help;
}
.jour-ligne .jour-abs { padding: 3px 8px; font-size: var(--fs-xs); }

/* Pied de colonne : travaillées + assimilées = total, chaque nombre dans sa couleur.
   L'encre pour le travail, l'ambre des étiquettes d'absence pour l'assimilé — l'œil
   relie le « + 13 h » aux cases CP juste au-dessus. Les notes (non compté, report
   de minuit) suivent en gris : on les voit, elles ne s'additionnent pas. */
.sem-pied {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 7px 10px 8px;
  background: var(--thead);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.pied-calcul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
}
.h-travail { color: var(--ink); font-weight: 600; }
.h-assimile { color: var(--warn-ink); font-weight: 600; cursor: help; }
.h-egal { color: var(--muted-2); }
.h-total { color: var(--ink); font-size: var(--fs-body); font-weight: 700; }
/* Semaine à cheval (29/10/2026) : la part de la période, sous le total réel. */
.pied-dont { color: var(--accent-fonce); font-size: var(--fs-xs); font-weight: 600; cursor: help; }
.pied-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.h-non-compte { color: var(--muted); }
.h-report { color: var(--muted); }
/* Le bilan de période, en haut, parle la même langue que les pieds de colonne. */
.agent-bilan .h-assimile { cursor: help; }
.agent-bilan .h-non-compte { color: var(--muted); font-size: var(--fs-sm); }
/* Effectif de l'écran Agents : le total dans le titre, la répartition juste
   dessous. Le total est en chiffres tabulaires — il change au fil des ajouts et
   ne doit pas faire sauter le titre. */
.compte-titre {
  margin-left: 6px;
  padding: 2px 8px;
  background: var(--hover);
  border-radius: var(--r-s);
  color: var(--muted);
  font-size: var(--fs-h2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.effectif-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.effectif-detail b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Séparateur dessiné plutôt qu'écrit : un « · » dans le HTML se copierait avec
   le texte et se lirait à voix haute par un lecteur d'écran. */
.effectif-detail span + span::before { content: ""; margin-right: 10px; border-left: 1px solid var(--line); }

.jour-ligne.repos-jour { background: #fafafa; }
/* Jour d'ABSENCE : un troisième état, entre « travaillé » et « repos ». Le fond
   ambre très pâle donne la lecture d'un coup d'œil sur toute la ligne — c'est ce
   qu'on regarde en planifiant — et l'étiquette dit lequel des neuf types.
   Ambre et non rouge : un congé n'est pas une anomalie, l'anomalie serait de
   planifier dessus. Le fond de repos ne s'applique plus (un jour absent n'est pas
   un repos), les deux classes ne coexistent donc jamais. */
.jour-ligne.jour-absent { background: #fffbeb; }
/* Même hauteur et même rayon que .creneau : quand les deux cohabitent sur la
   ligne, ils s'alignent au lieu de se décaler d'un pixel. */
.jour-abs {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--warn-pale);
  border: 1px solid var(--warn-bord);
  border-radius: var(--r-m);
  color: var(--warn-ink);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .2px;
}
.creneau {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--pill-pale);
  border: 1px solid var(--pill-bord);
  border-radius: var(--r-m);
  font-size: var(--fs-sm);
}
.creneau .cr-horaire { font-weight: 700; font-variant-numeric: tabular-nums; }
.creneau .cr-site { font-weight: 600; }
.creneau .cr-poste, .creneau .cr-qualif { color: var(--muted); font-size: var(--fs-xs); }
.creneau .cr-h { color: var(--ink-2); font-weight: 600; }

/* Bouton « réattribuer » d'un créneau (lot 35). Il est TOUJOURS là, jamais révélé
   au seul survol : une action qu'on ne découvre qu'en passant la souris dessus
   n'existe pas pour qui ne sait pas qu'elle existe. Mais il est estompé au repos —
   sur un mois, l'écran en porte une trentaine, et trente icônes à pleine encre
   feraient concurrence aux horaires, qui sont l'information de la ligne.
   Rond plutôt que concentrique : le rayon d'un carré de 24 px logé à 5 px du bord
   d'une pastille de 8 px tomberait à 3 px — ni carré ni arrondi, juste flou. */
.creneau .cr-chg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  /* Marges négatives : le bouton reprend le padding de la pastille au lieu de
     l'agrandir. Sans elles, chaque ligne de jour gagnerait 3 px de haut. */
  margin: -3px -5px -3px -2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  opacity: .5;
  cursor: pointer;
  position: relative;
  /* Jamais `all` : seules ces propriétés-là changent d'état. */
  transition-property: opacity, color, background-color, scale;
  transition-duration: .14s;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}
.creneau .cr-chg .ico {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;      /* +.15 sur le trait de la nav : à 15 px, 1.75 blanchit */
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Zone cliquable élargie à 34 px sans déplacer un pixel à l'écran. Elle déborde de
   5 px, soit moins que le `gap: 8px` entre deux créneaux : deux zones ne se
   recouvrent donc jamais. On reste sous les 40 px recommandés au tactile —
   assumé : l'écran est un poste de travail, et 40 px imposeraient d'aérer toute la
   ligne. À revoir le jour où le planning se consulte sur tablette. */
.creneau .cr-chg::after {
  content: "";
  position: absolute;
  inset: -5px;
}
/* Survol de la LIGNE, pas seulement du bouton : la cible se révèle avant qu'on
   l'ait atteinte, donc on sait où viser. */
.creneau:hover .cr-chg { opacity: 1; }
.creneau .cr-chg:hover {
  opacity: 1;
  color: var(--accent);
  background: var(--card);
}
.creneau .cr-chg:focus-visible {
  opacity: 1;
  color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.creneau .cr-chg:active { scale: .96; }
@media (prefers-reduced-motion: reduce) {
  .creneau .cr-chg { transition-property: opacity, color, background-color; }
  .creneau .cr-chg:active { scale: 1; }
}

/* Mention de report : explique pourquoi la somme des lignes ne fait pas le total
   quand une vacation franchit minuit. Discrète — c'est une note de lecture, pas
   une alerte — mais jamais masquée : sans elle le total paraît faux. */
.bilan-report {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.bilan-report b { color: var(--ink-2); font-weight: 700; }

/* Les totaux se lisent AVANT le planning (Vai, 23/08/2026 : « faire remonter cette
   ligne juste au-dessus du planning »). Au mois, ce pied de page tombait à deux écrans
   de défilement : le chiffre le plus consulté était le moins accessible. Remonté, il
   gagne un fond — sans lui, une ligne de chiffres posée juste au-dessus d'un tableau
   se lit comme sa première ligne. */
.agent-bilan {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 22px;
  margin: 0 0 10px;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  font-size: var(--fs-body);
  font-variant-numeric: tabular-nums;
}
.agent-bilan .bilan-quota { color: var(--muted); }
/* L'écart au quota du cycle (22/09/2026) : le signe porte la couleur, pas la phrase. */
.agent-bilan .bilan-cycle { color: var(--muted); font-variant-numeric: tabular-nums; cursor: help; }
.agent-bilan .bilan-cycle b { color: var(--ink); }
.agent-bilan .bilan-cycle .ecart {
  display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-sm); line-height: 20px;
}
.agent-bilan .ecart-plus .ecart { background: var(--ok-pale); color: var(--ok-ink); border: 1px solid var(--ok-bord); }
.agent-bilan .ecart-moins .ecart { background: var(--warn-pale); color: var(--warn-ink); border: 1px solid var(--warn-bord); }
.agent-bilan .ecart-nul .ecart { background: var(--thead); color: var(--muted); border: 1px solid var(--line); }

/* ====================== 14. Réattribution en lot ====================== */

/* Retour à la frise d'origine (29/09/2026) : un bouton d'en-tête comme les autres
   (même composant que « ⇄ Réattribuer » de la vue Agent), sous la période. */
.page-head .reatt-retour-frise { margin-top: 10px; }

/* Enchaînement d'une absence (retour 28) : libérer, PUIS pourvoir. Les deux temps
   sont affichés en clair — sans eux, on ne sait pas si le geste est terminé.
   Deux étapes réelles et successives, pas une décoration de section. */
.etapes-abs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  max-width: 680px;
}
.etapes-abs li {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 220px;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.etapes-abs-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  background: var(--hover);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.etapes-abs li.active {
  background: var(--accent-pale);
  border-color: var(--accent-bord);
  color: var(--accent-fonce);
  font-weight: 600;
}
.etapes-abs li.active .etapes-abs-num { background: var(--accent); color: #fff; }
.etapes-abs li.faite {
  background: var(--ok-pale);
  border-color: var(--ok-bord);
  color: var(--ok-ink);
}
.etapes-abs li.faite .etapes-abs-num { background: var(--ok); color: #fff; }

/* Transférer toute l'absence à UN seul agent reste possible, mais ce n'est pas le
   chemin normal (un seul agent couvre rarement une absence entière : repos,
   plafond hebdo, qualifications). D'où le repli, et non la suppression. */
.reatt-transfert { max-width: 680px; margin-top: 28px; }
/* Le repli est un BOUTON (Omar, 21/09/2026) : même vocabulaire que « Pourvoir »
   (btn-neutre), un chevron qui pivote à l'ouverture. Natif, sans script. */
.reatt-transfert > summary { list-style: none; }
.reatt-transfert > summary::-webkit-details-marker { display: none; }
.reatt-transfert-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.reatt-transfert-chevron {
  display: inline-block;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);           /* alignement optique du glyphe */
  transition: transform .2s cubic-bezier(.2, 0, 0, 1);
}
.reatt-transfert[open] .reatt-transfert-chevron { transform: translateY(-1px) rotate(90deg); }
.reatt-transfert-hint { margin: 10px 0 12px; max-width: 64ch; }
@media (prefers-reduced-motion: reduce) {
  .reatt-transfert-chevron { transition: none; }
}

/* Écran Absence (lot D, 21/09/2026) : tableau des créneaux à GAUCHE, cartes des
   remplaçants à DROITE. Tant qu'il n'y a pas de cartes, le tableau garde sa
   largeur de formulaire (680 px). Avec des cartes, deux colonnes ; la gauche
   reste collée en haut de la fenêtre pendant qu'on parcourt les cartes, pour
   donner la date du 3 à l'un et celle du 5 à l'autre sans jamais la chercher. */
.reatt-absence { display: block; }
.reatt-absence.deux-colonnes {
  display: grid;
  grid-template-columns: minmax(380px, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: start;
}
.reatt-absence.deux-colonnes .form-card { max-width: none; }
.reatt-absence.deux-colonnes .reatt-gauche {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;                        /* une longue absence défile DANS sa carte */
}
.reatt-absence.deux-colonnes .form-actions { flex-wrap: wrap; }
/* En 1366 px la colonne gauche est étroite : une date ou un horaire coupé en deux
   ne se lit plus. Seul le nom du site a le droit de se replier. */
.reatt-absence.deux-colonnes .reatt-table td:nth-child(2),
.reatt-absence.deux-colonnes .reatt-table td:nth-child(3) { white-space: nowrap; }
.reatt-absence.deux-colonnes .reatt-table td:nth-child(5) { white-space: nowrap; }
/* Le sigle du site, même pastille que sur la vue Agent (nom complet au survol). */
.reatt-table .cr-site {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-s);
  background: var(--card);
  border: 1px solid var(--pill-bord);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  cursor: help;
}
.reatt-droite-tete { margin-bottom: 16px; }

/* « Qui l'a tenu ? » (Vai, 15/10/2026) : une ligne = agent + de + à. La grille est
   partagée par l'en-tête et les lignes, pour que les colonnes s'alignent quel que
   soit le nombre d'agents ajoutés. */
.tenir-carte { margin-bottom: 16px; }
.tenir-titre {
  margin: 0 0 12px;
  font-size: var(--fs-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}
details.tenir-carte > summary.tenir-titre {
  margin: 0;
  cursor: pointer;
  color: var(--accent-fonce);
}
details.tenir-carte[open] > summary.tenir-titre { margin-bottom: 12px; }
.tenir-entete, .tenir-ligne {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 112px 32px;
  gap: 8px;
  align-items: center;
}
.tenir-entete {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: 4px;
}
.tenir-ligne + .tenir-ligne { margin-top: 8px; }
.tenir-ligne .form-input, .tenir-ligne .form-select {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.tenir-retirer {
  position: relative;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-s);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.tenir-retirer::after { content: ""; position: absolute; inset: -4px; }  /* 40 px de prise */
.tenir-retirer:hover { background: var(--hover); color: var(--ink); }
.tenir-retirer:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tenir-actions { justify-content: space-between; margin-top: 14px; }
@media (max-width: 560px) {
  .tenir-entete { display: none; }
  .tenir-ligne { grid-template-columns: 1fr 1fr 32px; }
  .tenir-ligne select { grid-column: 1 / -1; }
}
.reatt-droite .form-card + .vue-remplacement { margin-top: 0; }
@media (max-width: 1100px) {
  .reatt-absence.deux-colonnes { grid-template-columns: 1fr; }
  .reatt-absence.deux-colonnes .reatt-gauche { position: static; max-height: none; }
}

/* Une ligne en traitement (cochée puis « Pourvoir ») : fond accent pâle, flèche
   vers la colonne de droite. Le tableau dit où sont ses remplaçants. */
.reatt-row { transition: background-color .15s ease; }
.reatt-row:hover { background: var(--hover); }
.reatt-row.reatt-traitee { background: var(--accent-pale); }
.reatt-row.reatt-traitee:hover { background: #f5e2f1; }
.reatt-row.reatt-traitee td:nth-child(2) { font-weight: 600; color: var(--accent-fonce); }
.reatt-fleche { color: var(--accent); font-weight: 700; margin-left: 4px; }


.reatt-recap { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.reatt-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.reatt-table th, .reatt-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.reatt-table th { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.reatt-table td:first-child, .reatt-table th:first-child { width: 28px; text-align: center; }
.reatt-row.reatt-alerte { background: #fffbeb; }
.reatt-row.reatt-conflit { background: #fef2f2; }

/* Verdicts (pastilles de statut) */
.vd {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.vd-ok { background: var(--ok-pale); color: var(--ok-ink); }
.vd-alerte { background: var(--warn-pale); color: var(--warn-ink); }
.vd-conflit { background: var(--bad-pale); color: var(--bad-ink); }

/* ====================== 15. Vue Jour · tous sites ====================== */

.jour-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.jchip {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--card);
  font-variant-numeric: tabular-nums;
  transition: background-color .12s, border-color .12s, color .12s, scale .12s;
}
.jchip:active { scale: .96; }
.jchip.actif { background: var(--ink); color: #fff; border-color: var(--ink); }
.jchip.off:hover { border-color: var(--muted-2); }

/* Compteurs d'en-tete, PARTAGES (vue Jour, releve d'anomalies) : un chiffre
   fort, son libelle dessous, et une bordure qui dit s'il est bon ou mauvais. */
.kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.kpi {
  flex: 1;
  min-width: 150px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-card);
}
.kpi .kpi-val { font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .kpi-lbl { font-size: var(--fs-xs); color: var(--muted); }
.kpi.good { border-color: var(--ok-bord); } .kpi.good .kpi-val { color: var(--ok-ink); }
.kpi.bad  { border-color: var(--bad-bord); } .kpi.bad .kpi-val { color: var(--bad-ink); }
.kpi.ok   { border-color: var(--ok-bord); } .kpi.ok .kpi-val { color: var(--ok-ink); }
.kpi.warn { border-color: var(--warn-bord); } .kpi.warn .kpi-val { color: var(--warn-ink); }

.jour-frise {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 8px 16px 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.jour-axis { display: flex; align-items: flex-end; height: 22px; margin-bottom: 4px; }
.jr-corner { width: 110px; flex: 0 0 110px; }
.jr-scale { position: relative; flex: 1; height: 100%; }
.jr-scale span {
  position: absolute;
  transform: translateX(-50%);
  font-size: var(--fs-2xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.jr-row { display: flex; align-items: center; border-top: 1px solid var(--hover); }
.jr-label {
  width: 110px;
  flex: 0 0 110px;
  font-weight: 700;
  font-size: var(--fs-body);
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jr-track { position: relative; flex: 1; height: 44px; }
.jr-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hover); }
.jblk {
  position: absolute;
  top: 6px;
  bottom: 6px;
  min-width: 14px;
  border-radius: var(--r-s);
  background: var(--c, #64748b);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 7px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  transition: filter .12s;
}
.jblk:hover { filter: brightness(1.07); }
.jblk-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jblk.suite { opacity: .82; }
.jblk.trou {
  background: repeating-linear-gradient(45deg, #fef2f2, #fef2f2 6px, var(--bad-pale) 6px, var(--bad-pale) 12px);
  color: var(--bad-ink);
  box-shadow: inset 0 0 0 1px var(--bad-bord);
}

/* ====================== 16. Vue Remplacement urgent ====================== */

/* Bandeau repli (démo) : aucun trou à venir, on montre les trous passés. */
.note-repli {
  background: #fff7ed;              /* nuance ambrée locale, comme .trou-card */
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: var(--r-m);
  padding: 8px 12px;
  font-size: var(--fs-sm);
  margin: 0 0 14px;
}

/* État vide = bonne nouvelle : carte calme, pas une page cassée. */
.remp-vide {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--r-l);
  padding: 34px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.remp-vide h2 { margin: 0 0 6px; font-size: 17px; }
.remp-vide p { margin: 0 auto; max-width: 52ch; color: var(--muted); font-size: var(--fs-body); }

/* Une carte par trou : l'en-tête orange (réutilisé de la vue Équipe) + le
   classement des éligibles + les écartés repliés. */
.remp-carte {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.remp-carte .trou-card { margin-bottom: 12px; }
/* Écran Remplacement (22/09/2026) : une carte repliée = une ligne de la liste des
   créneaux non pourvus ; l'en-tête orange est le bouton qui l'ouvre. */
.remp-pli { padding: 0; overflow: hidden; }
.remp-pli > summary.trou-card { list-style: none; cursor: pointer; margin: 0; border-radius: var(--r-l); }
.remp-pli > summary::-webkit-details-marker { display: none; }
.remp-pli > summary:hover { filter: brightness(.98); }
.remp-pli > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.remp-pli[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.remp-pli .remp-corps { padding: 12px 16px 14px; }
.remp-chevron {
  flex: none; margin-left: 8px; color: var(--muted); font-size: 22px; line-height: 1;
  transform: translateY(-1px); transition: transform .2s cubic-bezier(.2, 0, 0, 1);
}
.remp-pli[open] .remp-chevron { transform: translateY(-1px) rotate(90deg); }
.remp-outils { display: flex; justify-content: flex-end; margin: 0 0 10px; }
/* Premier niveau de l'écran Remplacement : un groupe par mois (Vai, 21/10/2026). */
.remp-mois {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow-card); margin-bottom: 12px;
}
.remp-mois-tete {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  list-style: none; cursor: pointer; border-radius: var(--r-l);
}
.remp-mois-tete::-webkit-details-marker { display: none; }
.remp-mois-tete:hover { background: var(--bg); }
.remp-mois-tete:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.remp-mois[open] > .remp-mois-tete { border-bottom: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; }
.remp-mois-titre { font-size: var(--fs-h2); font-weight: 700; }
.remp-mois-tete .remp-chevron { margin-left: auto; }
.remp-mois[open] > .remp-mois-tete .remp-chevron { transform: translateY(-1px) rotate(90deg); }
.remp-mois-corps { padding: 12px 12px 2px; }
/* Colonnes alignées d'une ligne à l'autre (Vai, 21/10/2026, retour n°10) : badge,
   vacation, prime, site. La colonne prime existe même vide — sans ça le site
   sautait vers la gauche dès qu'un créneau ne déclenche pas d'indemnité. Seulement
   sur l'écran Remplacement, et en écran large : en dessous, la ligne se replie. */
@media (min-width: 1100px) {
  .vue-remplacement .trou-info {
    display: grid; flex: 1; min-width: 0; align-items: center; column-gap: 14px;
    grid-template-columns: auto 22.5rem 15.5rem minmax(0, 1fr);
  }
  .vue-remplacement .trou-badge  { grid-column: 1; justify-self: start; }
  .vue-remplacement .trou-quand  { grid-column: 2; font-variant-numeric: tabular-nums; }
  .vue-remplacement .trou-prime  { grid-column: 3; }
  .vue-remplacement .trou-detail { grid-column: 4; }
  .vue-remplacement .trou-absent { grid-column: 2 / -1; }
}
@media (prefers-reduced-motion: reduce) { .remp-chevron { transition: none; } }
.remp-carte .remp-col { box-shadow: none; }  /* déjà dans une carte : pas de double ombre */
/* Écran Remplacement (Vai, 21/10/2026) : le compte forme une COLONNE calée à droite,
   à la même place sur chaque ligne quelle que soit la longueur du créneau à gauche. */
.remp-compteur {
  color: var(--muted); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  margin-left: auto; min-width: 15ch; text-align: right; font-variant-numeric: tabular-nums;
}

/* Classement : le rang est un vrai élément (pas un ::marker), le 1er est teinté. */
.remp-classement { list-style: none; margin: 0; padding: 0; }
.remp-classement li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.remp-classement li:last-child { border-bottom: none; }
.remp-rang {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--thead);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  flex: none;
}
.remp-classement li:first-child .remp-rang {
  background: var(--ok-pale); border-color: var(--ok-bord); color: var(--ok-ink);
}
.remp-tel { color: var(--muted); font-size: var(--fs-sm); }
.remp-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.remp-msg {
  flex-basis: 100%;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-style: italic;
  padding-left: 31px;               /* aligné sous le nom (rang 22px + gap 9px) */
}

/* « + X h au-delà du contrat » (plan du 20/10/2026) : la pastille de verdict ambrée
   (.vd .vd-alerte), juste après la charge qu'elle prolonge. Elle ne se coupe jamais :
   quand la ligne est trop étroite (panneau de la frise : 720 à 770 px demandés pour
   637 disponibles, mesuré le 20/10/2026 ; mode crise sous ~1280 px), c'est la
   pastille ENTIÈRE qui passe à la ligne. */
.remp-au-dela {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* ... et elle y commence SOUS L'AGENT, comme le message, pas sous le numéro de rang :
   le retrait est porté par la ligne, le rang revient au bord par une marge négative.
   Limité aux lignes qui portent la pastille : les autres ne bougent pas d'un pixel
   (un retrait sur toutes décalait de 15 px une charge passée à la ligne). */
.remp-classement li:has(.remp-au-dela) { padding-left: 31px; }
.remp-classement li:has(.remp-au-dela) .remp-rang { margin-left: -31px; }
.remp-classement li:has(.remp-au-dela) .remp-msg { padding-left: 0; }

/* « Ce créneau déclenche la prime » : UNE mention par carte, à côté de l'horaire
   (la prime se juge sur la durée du créneau, jamais sur l'agent). Le marqueur est
   celui des blocs de la frise, pour qu'on le reconnaisse d'un écran à l'autre. */
.trou-prime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--warn-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.trou-prime .pp-badge { position: static; flex: none; }

/* Écartés : repliés par défaut (le mode crise regarde d'abord les solutions). */
.remp-exclus { margin-top: 10px; }
.remp-exclus summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 4px 0;
}
.remp-exclus ul { list-style: none; margin: 6px 0 0; padding: 0; }
.remp-exclus li {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.remp-exclus li:last-child { border-bottom: none; }
.remp-exclus .motif { color: var(--muted); font-size: var(--fs-sm); margin-left: auto; text-align: right; }

/* Boutons propres à l'écran (raccordés à la base commune, section 10). */
.btn-copier {
  border: 1px solid var(--line);
  background: var(--thead);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-s);
}
.btn-copier:hover { border-color: var(--accent); color: var(--accent-fonce); }
.btn-copier.copie { background: var(--ok-pale); border-color: var(--ok-bord); color: var(--ok-ink); }
.btn-wa {
  background: #25d366;              /* vert de marque WhatsApp (couleur externe) */
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-s);
}
.btn-wa:hover { filter: brightness(1.06); }

/* ====================== 12bis. Info-bulle + trame : reglage compact ======================
   Info-bulle : pastille « i » qui revele une aide au survol et au focus (souris, clavier,
   tactile). Range les textes explicatifs pour epurer les ecrans. Composant transverse. */
.info-bulle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 5px;
  border-radius: var(--r-pill);
  background: var(--thead);
  border: 1px solid var(--line);
  color: var(--muted);
  font: italic 700 11px/1 Georgia, "Times New Roman", serif;
  cursor: help;
  vertical-align: middle;
  flex: 0 0 auto;
  user-select: none;
  transition: color .15s ease, border-color .15s ease;
}
.info-bulle::before { content: "i"; }
.info-bulle:hover, .info-bulle:focus-visible {
  color: var(--accent);
  border-color: var(--accent-bord);
  outline: none;
}
.info-bulle-txt {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 40;
  width: max-content;
  max-width: 300px;
  padding: 10px 13px;
  background: var(--ink);
  color: #fff;
  font: 400 var(--fs-xs)/1.5 "Segoe UI", system-ui, sans-serif;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  border-radius: var(--r-m);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.info-bulle:hover .info-bulle-txt,
.info-bulle:focus .info-bulle-txt {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.info-bulle-txt b { color: #fff; font-weight: 700; }
.info-bulle-txt::before {        /* fleche vers la pastille */
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--ink);
}

/* Hote texte : la meme bulle portee par un element qui existe deja a l'ecran
   (ex. le « — » d'ecart de la liste des agents), sans pastille « i ». Focusable
   (tabindex) pour que l'aide soit atteignable au clavier, pas seulement au survol. */
.a-bulle { position: relative; cursor: help; }
.a-bulle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.a-bulle:hover > .info-bulle-txt,
.a-bulle:focus > .info-bulle-txt {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Variantes de position : pres d'un bord, la bulle centree deborderait de l'ecran ;
   elle s'etend alors du cote qui a la place. A poser sur l'hote (.info-bulle ou
   .a-bulle). Declarees APRES les regles de base : a specificite egale, elles gagnent. */
.pos-gauche > .info-bulle-txt { left: auto; right: -6px; transform: translateY(-4px); }
.pos-gauche > .info-bulle-txt::before { left: auto; right: 10px; transform: none; }
.pos-droite > .info-bulle-txt { left: -6px; transform: translateY(-4px); }
.pos-droite > .info-bulle-txt::before { left: 10px; transform: none; }
.pos-gauche:hover > .info-bulle-txt, .pos-gauche:focus > .info-bulle-txt,
.pos-droite:hover > .info-bulle-txt, .pos-droite:focus > .info-bulle-txt { transform: translateY(0); }

/* Titre + info-bulle sur la meme ligne */
.titre-aide { display: flex; align-items: center; }

/* Reglage du cycle, version compacte (en haut, a droite du titre : zero hauteur en plus) */
.cycle-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
}
.cycle-compact-lbl {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.cycle-compact .form-input { margin: 0; }
.cycle-compact-date { width: auto; }
.cycle-compact .btn { padding: 8px 14px; }
.cycle-compact .info-bulle { margin-left: 0; }

/* Barre au-dessus de la grille : selecteur de semaine + aide de saisie */
.trame-barre { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.trame-barre .trame-semaines { margin: 0; }

/* Champ desactive (ex. l'ancrage quand le cycle vaut 1 semaine) */
.form-input:disabled {
  background: var(--thead);
  color: var(--muted-2);
  cursor: not-allowed;
}

/* Les styles de l'éditeur tableur de la trame sont dans static/trame_grille.css,
   chargé APRÈS tabulator.min.css pour gagner la cascade (voir templates/trame.html). */

/* ====================== 30. Extractions (Paie / heures) ======================
   Écran /exports : formulaire de période + aperçu matriciel (un agent par ligne,
   une colonne par semaine). Le panneau d'aperçu déborde la largeur d'un form-card
   (jusqu'à ~12 colonnes) : carte pleine largeur + tableau scrollable horizontal
   avec la colonne Agent figée. */

/* Icône en tête de bouton primaire (trait, teinté par currentColor comme la nav). */
.btn-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exports-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px 24px 24px;
  box-shadow: var(--shadow-card);
  margin-top: 24px;
}
.exports-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.exports-titre { display: flex; flex-direction: column; gap: 2px; }
.exports-panel-head h2 { margin: 0; font-size: var(--fs-h2); }
.exports-meta { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.exports-legende { margin: 4px 0 16px; font-size: var(--fs-xs); color: var(--muted); text-wrap: pretty; }

/* Conteneur scrollable : rayon concentrique (r-l = r-xl du panneau − ~2px de padding). */
.exports-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
}
.exports-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
}
.exports-table th,
.exports-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.exports-table thead th {
  background: var(--thead);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  font-weight: 600;
}
.exports-table tbody tr:last-child td { border-bottom: none; }
.exports-table tbody tr:nth-child(even) td { background: #fbfcfe; }

.exports-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.exports-table th.num { text-align: right; }
.exports-table .agent {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  /* La colonne des noms reste visible pendant le defilement horizontal. Le tableau
     depasse la largeur de l'ecran des que la periode fait plusieurs semaines, et
     plus encore depuis les trois colonnes du decompte legal : sans ca, on lit une
     ligne de chiffres sans savoir de QUI elle parle.
     Fond opaque obligatoire (les cellules defilent dessous) et zebrure reprise
     ci-dessous, sinon la ligne paire se voit par transparence. */
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
}
.exports-table thead th.agent { z-index: 2; background: var(--thead); }
.exports-table tbody tr:nth-child(even) td.agent { background: #fbfcfe; }
/* La bordure droite remplace celle que `border-collapse` perd sous une cellule
   collante, et marque la frontiere entre le nom et les chiffres qui glissent. */
.exports-table .agent { box-shadow: 1px 0 0 var(--line); }
/* Sépare visuellement le bloc "semaines" du bloc "totaux". */
.exports-table .sep { border-left: 2px solid var(--line); }
/* Rien à afficher (0 h, pas de quota) : point discret plutôt qu'un 0 trompeur. */
.exports-zero { color: var(--muted-2); }

/* Colonne Agent figée pendant le scroll horizontal (les noms restent lisibles). */
.exports-table th.agent,
.exports-table td.agent {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: 1px 0 0 var(--line);
}
.exports-table thead th.agent { z-index: 2; background: var(--thead); }
.exports-table tbody tr:nth-child(even) td.agent { background: #fbfcfe; }

/* ==========================================================================
   Mise en service — le tout premier ecran, sur une base encore vide.
   Page autonome (sans la barre laterale) : il n'y a rien a naviguer tant que
   la societe n'existe pas. Un seul objet a l'ecran, une seule action.
   ========================================================================== */
.mes-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.mes-shell { width: 100%; max-width: 468px; }

.mes-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 32px 28px 28px;
}

.mes-head { margin-bottom: 24px; }
.mes-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: var(--r-l);          /* 10px pour 44px de cote : concentrique avec l'image */
  background: var(--ink);
}
.mes-logo img { width: 26px; height: 26px; display: block; }

.mes-titre {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;             /* plancher a -.04em : on reste bien au-dessus */
  color: var(--ink);
  text-wrap: balance;
}
.mes-sous {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.mes-flashes { margin: 0 0 20px; }

/* Champ nombre + son unite : « 4 semaines » se lit d'un bloc, au lieu d'un
   nombre nu dont on doit deviner l'unite. */
.mes-champ-unite { display: flex; align-items: center; gap: 10px; }
.mes-input-nb {
  width: 88px;
  font-variant-numeric: tabular-nums;  /* la largeur ne saute pas entre 4 et 11 */
}
.mes-unite { font-size: var(--fs-body); color: var(--muted); }

.mes-actions { margin-top: 24px; }
.mes-btn {
  width: 100%;
  min-height: 44px;                    /* zone de clic confortable (>= 40px) */
  transition: background-color .12s ease, transform .12s cubic-bezier(.2, 0, 0, 1);
}
.mes-btn:active { transform: scale(.96); }
.mes-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.mes-pied {
  margin: 18px 0 0;
  text-align: center;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* Entree en trois temps (en-tete, formulaire, mention de bas de page). L'etat
   VISIBLE est l'etat par defaut : l'opacite 0 ne vit que dans l'image-cle, donc
   si l'animation ne joue pas (mouvement reduit, moteur de rendu sans animation),
   la page s'affiche complete au lieu de rester blanche. */
@keyframes mes-entree {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.mes-head, .mes-form, .mes-pied {
  animation: mes-entree .45s cubic-bezier(.16, 1, .3, 1) both;
}
.mes-form { animation-delay: .07s; }
.mes-pied { animation-delay: .14s; }

@media (prefers-reduced-motion: reduce) {
  .mes-head, .mes-form, .mes-pied { animation: none; }
  .mes-btn { transition: none; }
  .mes-btn:active { transform: none; }
}

/* --------------------------------------------------------------------------
   Espace agent (lot C1) : la page publique /espace/<jeton>, ouverte sur le
   telephone de l'agent, reprend la carte .mes-* ci-dessus. Seuls s'ajoutent
   ici son texte, et la page ou la planificatrice recopie le lien (une fois).
   -------------------------------------------------------------------------- */
/* Un prenom compose sans espace ne doit jamais elargir la page a 375 px. */
.esp-titre { overflow-wrap: anywhere; }
.esp-texte {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
  /* Meme entree echelonnee que le formulaire de ses jumeaux. */
  animation: mes-entree .45s cubic-bezier(.16, 1, .3, 1) .07s both;
}
@media (prefers-reduced-motion: reduce) {
  .esp-texte { animation: none; }
}

/* Fiche agent : l'etat du lien (dates a chiffres fixes, elles ne dansent pas). */
.esp-etat {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Page « lien personnel » : le lien tient sur plusieurs lignes sans deborder, et un
   clic le selectionne en entier (le recopier a la main est l'erreur classique). */
.esp-avertissement { margin: 0 0 20px; }
.esp-lien {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--thead);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}
.esp-message {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent-bord);
  border-radius: 0 var(--r-m) var(--r-m) 0;
  background: var(--thead);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.esp-gestes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }

/* --- Espace agent, lot C2 : « Mes demandes » et « Nouvelle demande » ---------
   Sur telephone, souvent dehors et d'une main : cibles de 44 px au moins, textes
   a 4,5:1 au moins sur blanc (jamais --muted-2 pour du texte), champs a 16 px
   (en dessous, iOS zoome la page au premier appui dans un champ). */
@media (max-width: 400px) {
  .esp-page .mes-card { padding: 24px 18px 22px; }
}
.esp-section {
  /* L'entree existante de la carte, reprise telle quelle (pas de nouvelle anim.). */
  animation: mes-entree .45s cubic-bezier(.16, 1, .3, 1) .07s both;
}
.esp-section + .esp-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.esp-h2 {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}
.esp-vide {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* Une demande = une ligne de liste, separees par un filet (pas de carte dans la
   carte). Le motif et le statut d'abord : c'est ce que l'agent cherche des yeux. */
.esp-demandes { list-style: none; margin: 0; padding: 0; }
.esp-demande { padding: 12px 0; }
.esp-demande:first-child { padding-top: 0; }
.esp-demande + .esp-demande { border-top: 1px solid var(--line); }
.esp-demande-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.esp-demande-motif {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.esp-demande .dem-statut { flex: none; font-size: var(--fs-xs); white-space: nowrap; }
.esp-demande-quoi {
  margin: 3px 0 0;
  font-size: var(--fs-body);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.esp-demande-mot {
  margin: 6px 0 0;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink-2);
  font-style: italic;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.esp-demande-note {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Le formulaire : des champs plus hauts que sur l'ordinateur de la planificatrice. */
.esp-form .form-input { min-height: 44px; font-size: 16px; }
.esp-form textarea.form-input { resize: vertical; }
.esp-form .dem-fac { color: var(--muted); }
.esp-motifs { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.esp-motifs legend { padding: 0; }

/* Les quatre motifs en tuiles 2 x 2 : toute la tuile se touche, le rond dit « un
   seul choix », et le choix fait se voit sans avoir a lire. */
.esp-tuiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
/* Le rond AU-DESSUS du libelle, pas a cote : a 375 px une tuile fait ~150 px, et
   « indisponibilite » ou « Changement » ne tiendraient plus sur leur ligne -- un mot
   coupe en deux se lit mal, surtout au soleil. */
.esp-tuile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 56px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--card);
  cursor: pointer;
  transition: border-color .12s, background-color .12s, box-shadow .12s, scale .12s;
}
.esp-tuile:active { scale: .98; }
/* Le vrai bouton radio reste la, invisible mais focusable et lu par les lecteurs
   d'ecran : il recouvre toute la tuile. */
.esp-tuile input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.esp-tuile-rond {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--card);
  transition: border-color .12s, background-color .12s, box-shadow .12s;
}
.esp-tuile-txt {
  max-width: 100%;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
  /* Sur un ecran plus etroit encore, une vraie cesure francaise (« indisponi-
     bilite ») plutot qu'une lettre orpheline ; break-word en tout dernier recours. */
  hyphens: auto;
  overflow-wrap: break-word;
}
/* Choisi : le rond se remplit (selecteur de voisin, compris partout), et la tuile
   se teinte la ou :has() est compris. */
.esp-tuile input:checked + .esp-tuile-rond {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--card);
}
.esp-tuile input:checked ~ .esp-tuile-txt { color: var(--accent-fonce); }
.esp-tuile:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-pale);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.esp-tuile input:focus-visible + .esp-tuile-rond { box-shadow: 0 0 0 3px var(--accent-ring); }
.esp-tuile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .esp-tuile:hover { border-color: var(--muted-2); }
}

/* Du / Au cote a cote, sans jamais pousser la page au-dela de 375 px. */
.esp-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
/* Rembourrage reduit : « jj/mm/aaaa » et l'icone du calendrier tiennent dans une
   demi-largeur de telephone. */
.esp-dates .form-input { min-width: 0; padding-left: 6px; padding-right: 4px; }
/* L'icone du calendrier de Chrome garde une marge et un rembourrage : une date SAISIE
   (« 22/07/2026 ») passait dessous. Resserree ici seulement. */
.esp-dates .form-input::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  .esp-section { animation: none; }
  .esp-tuile, .esp-tuile-rond { transition: none; }
  .esp-tuile:active { scale: 1; }
}

/* --------------------------------------------------------------------------
   Premier lancement : l'ecran planning quand AUCUN site n'existe encore.
   Cet ecran n'etait jamais atteint avant la mise en service (on arrivait
   toujours par le seed, donc avec des sites) ; c'est desormais la premiere
   chose que voit un nouveau client.
   -------------------------------------------------------------------------- */
.debut {
  max-width: 480px;
  margin: 48px auto;
  padding: 36px 32px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.debut-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border-radius: var(--r-pill);
  background: var(--accent-pale);
  border: 1px solid var(--accent-bord);
  color: var(--accent);
}
.debut-ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.debut-titre {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
}
.debut-txt {
  margin: 0 auto 24px;
  max-width: 42ch;                    /* longueur de ligne confortable */
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;                 /* court et centre : mieux equilibre que pretty */
}
.debut-btn {
  display: inline-block;
  min-height: 44px;                   /* zone de clic confortable */
  padding: 11px 22px;
  transition: background-color .12s ease, transform .12s cubic-bezier(.2, 0, 0, 1);
}
.debut-btn:active { transform: scale(.96); }
.debut-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* Les trois temps de la mise en route : on annonce le chemin, pour que la
   creation d'un site ne ressemble pas a une demande isolee sans suite. */
.debut-etapes {
  margin: 26px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  display: grid;
  gap: 10px;
  text-align: left;
}
.debut-etapes li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.debut-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--thead);
  border: 1px solid var(--line);
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Connexion. L'ecran REUTILISE .mes-* (meme carte centree que la mise en
   service) ; il n'ajoute ici que ce qui lui est propre : le champ mot de passe
   avec son oeil, et le message du serveur sans compte.
   -------------------------------------------------------------------------- */
.cnx-champ-mdp { position: relative; }
/* Place pour l'oeil : sans cette reserve, un mot de passe long passerait DESSOUS
   le bouton -- on ne verrait plus ce qu'on tape au moment ou on veut le voir. */
.cnx-champ-mdp .form-input { padding-right: 44px; }

.cnx-oeil {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  /* 40x40 : la cible reste confortable au doigt et a la souris, alors que l'icone
     n'en occupe que 18. Le bouton deborde volontairement d'un pixel a droite du
     champ pour que l'icone, elle, tombe a 12 px du bord -- alignee optiquement
     sur le padding du champ, pas collee au trait de bordure. */
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  transition: color .12s, scale .12s;
}
.cnx-oeil:hover { color: var(--ink); }
.cnx-oeil:active { scale: .96; }
.cnx-oeil:focus-visible { outline-offset: -6px; }   /* l'anneau epouse l'icone, pas la cible */

/* Les deux icones cohabitent, superposees : on croise opacite + echelle + flou
   plutot que d'echanger un display, qui ferait clignoter le bouton. */
.cnx-ico {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity .2s cubic-bezier(.2, 0, 0, 1),
              scale .2s cubic-bezier(.2, 0, 0, 1),
              filter .2s cubic-bezier(.2, 0, 0, 1);
}
.cnx-ico-off, .cnx-oeil.montre .cnx-ico-on {
  opacity: 0;
  scale: .25;
  filter: blur(4px);
}
.cnx-oeil.montre .cnx-ico-off {
  opacity: 1;
  scale: 1;
  filter: blur(0);
}

/* Serveur verrouille (EXIGER_CONNEXION) mais aucun compte en base : on explique
   au lieu de laisser quelqu'un s'acharner sur un formulaire imprenable. */
.cnx-vide {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--thead);
}
.cnx-vide-titre { margin: 0 0 6px; font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.cnx-vide-txt { margin: 0; font-size: var(--fs-sm); color: var(--muted); text-wrap: pretty; }
.cnx-vide code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
}
/* Meme entree echelonnee que le formulaire qu'il remplace. */
.cnx-vide { animation: mes-entree .45s cubic-bezier(.16, 1, .3, 1) .07s both; }

@media (prefers-reduced-motion: reduce) {
  .cnx-vide { animation: none; }
  .cnx-ico { transition: opacity .12s; scale: 1; filter: none; }
  .cnx-oeil:active { scale: 1; }
}
/* Le formulaire de deconnexion ne doit rien changer a la mise en page du pied de
   barre : il n'existe que pour porter le POST. */
.side-deco { display: contents; }

/* ---------------------------------------------------------------------------
   Lot 18 — l'OBSERVATION d'un créneau (le mot laissé au contrôleur terrain).
   Marqueur volontairement muet : un coin plié en BAS à droite. Le haut à droite
   est déjà occupé (badges ABSENT et indemnité), et le bas reste libre même sur
   un bloc de 30 minutes, là où un badge de texte ne tiendrait pas.
   `currentColor` : blanc sur un bloc d'agent, rouge sur un bloc VACANT — le
   marqueur suit la couleur du texte du bloc sans qu'on la redéclare.
   --------------------------------------------------------------------------- */
.bloc.a-note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  /* 16 px, soit bien plus que l'arrondi du bloc (--r-s = 6 px). À 10 px la
     diagonale disparaissait dans le coin rond : on ne voyait qu'une écharde. */
  border-left: 16px solid transparent;
  border-bottom: 16px solid currentColor;
  /* Un liseré sombre décolle le triangle blanc d'un aplat clair (vert, ocre)
     sans lui donner de couleur propre. */
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .3));
  /* Le geste passe au travers : la poignée de redimensionnement occupe le même
     bord bas, elle doit rester saisissable. */
  pointer-events: none;
}
/* Un bloc BORDÉ (vacant en pointillés, absent en pointillés rouges, indemnité en
   liseré ocre) : posé dans l'angle, le triangle chevauchait la bordure et
   l'ensemble se lisait comme une bordure abîmée. On le rentre de 2 px — la
   bordure reste continue, le marqueur reste franc. */
.bloc.trou.a-note::after,
.bloc.pp.a-note::after,
.bloc.abandonne.a-note::after {
  right: 2px;
  bottom: 2px;
  border-left-width: 14px;
  border-bottom-width: 14px;
  filter: none;
}

/* Repère de la légende : le même triangle, posé dans le flux du texte. */
.note-puce {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-bottom: 9px solid var(--muted);
  vertical-align: -1px;
  margin-right: 5px;
}
/* Vue Jour : les blocs sont deux fois moins hauts qu'en vue Site — le coin
   plié y descend d'un cran pour ne pas manger le libellé. */
.jblk.a-note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-bottom: 12px solid currentColor;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .3));
  pointer-events: none;
}
.jblk.trou.a-note::after { filter: none; }

/* La ligne juste au-dessus de la frise (lot UI 1, 19/10/2026) : à gauche la
   légende de ce que la frise montre (vacant, prime, observation), à droite le mode
   d'emploi rangé dans une bulle. Les sorties PDF, qui vivaient ici au lot 20, sont
   remontées dans l'en-tête figé le 23/08. */
.frise-barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.frise-barre .legende { margin: 0; }
.frise-barre .frise-aide { display: inline-flex; align-items: center; margin: 0; flex: 0 0 auto; }

/* ====================== 21. Écran Demandes (lot 21) ======================
   La boîte unique où atterrissent les demandes des agents (congé, absence,
   changement de quart, acompte). Une carte par demande en attente, un tableau
   replié pour l'historique. Rien n'y est jamais supprimé. */

/* La pastille du menu. Posée hors du <span class="lbl">, elle survit au repli du
   menu — c'est précisément quand la barre est réduite qu'un compteur doit rester
   lisible. `tabular-nums` : le chiffre change sans faire bouger l'item. */
.side-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.side-item.actif .side-badge { background: #fff; color: var(--accent); }
/* Bulle REMPLACEMENT (Vai, 23/09/2026) : des postes à venir que personne ne
   tiendra. Rouge d'alerte, pas le violet d'action : ce n'est pas une boîte à
   trier, c'est un site qui risque de rester sans agent. */
.side-badge-urgent { background: var(--bad); }
.side-item.actif .side-badge-urgent { background: #fff; color: var(--bad-ink); }
.shell.collapsed .side-item { position: relative; }
/* Menu replié : l'item ne fait plus que l'icône, la pastille se pose dessus. */
.shell.collapsed .side-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  margin: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  box-shadow: 0 0 0 2px var(--ink);
}

/* --- Noter une demande reçue (repli) --- */
.dem-ajout { margin-bottom: 22px; }
.dem-ajout > summary { list-style: none; }
.dem-ajout > summary::-webkit-details-marker { display: none; }
.dem-ajout-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, background-color .12s, scale .12s;
}
.dem-ajout-btn:hover { border-color: var(--muted-2); background: var(--hover); }
.dem-ajout-btn:active { scale: .96; }
.dem-ajout[open] .dem-ajout-btn { border-color: var(--accent); color: var(--accent-fonce); }
.dem-form { margin-top: 14px; }
.dem-form-intro { margin: 0 0 18px; }

/* --- Titre de section + compteur --- */
.dem-titre {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 16px;
  text-wrap: balance;
}
.dem-compte {
  min-width: 22px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-pale);
  border: 1px solid var(--accent-bord);
  color: var(--accent-fonce);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.dem-compte.gris {
  background: var(--thead);
  border-color: var(--line);
  color: var(--muted);
}

/* --- Les cartes en attente --- */
.dem-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dem-carte {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
/* Entrée échelonnée : la liste se pose de haut en bas plutôt que d'apparaître
   d'un bloc. Bornée aux 6 premières cartes (au-delà l'attente serait perceptible)
   et coupée net pour qui a demandé moins d'animations. */
@media (prefers-reduced-motion: no-preference) {
  .dem-carte {
    animation: dem-entree .28s cubic-bezier(.2, 0, 0, 1) both;
  }
  .dem-carte:nth-child(2) { animation-delay: .04s; }
  .dem-carte:nth-child(3) { animation-delay: .08s; }
  .dem-carte:nth-child(4) { animation-delay: .12s; }
  .dem-carte:nth-child(5) { animation-delay: .16s; }
  .dem-carte:nth-child(n + 6) { animation-delay: .2s; }
}
@keyframes dem-entree {
  from { opacity: 0; translate: 0 4px; }
  to   { opacity: 1; translate: 0 0; }
}

.dem-tete {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.dem-agent { font-size: 15px; }
.dem-periode { font-size: var(--fs-sm); color: var(--ink); font-variant-numeric: tabular-nums; }
.dem-montant {
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--abc-vert);
}
.dem-age { margin-left: auto; font-size: var(--fs-xs); color: var(--muted-2); }

/* Le motif, en pastille colorée : quatre motifs, quatre teintes, reconnaissables
   d'un coup d'œil dans une liste (c'est le premier tri que fait l'œil). */
.dem-type {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.dem-type-conge { background: var(--accent-pale); color: var(--accent-fonce); }
.dem-type-absence { background: var(--warn-pale); color: var(--warn-ink); }
.dem-type-changement_quart { background: var(--pill-pale); color: #3730a3; }
.dem-type-acompte { background: var(--ok-pale); color: var(--ok-ink); }

.dem-message {
  margin: 9px 0 0;
  font-size: var(--fs-body);
  color: var(--muted);
  font-style: italic;
  text-wrap: pretty;
}
.dem-collegue { margin: 9px 0 0; font-size: var(--fs-body); }
.dem-impact {
  display: inline-block;   /* la largeur de la phrase, pas celle de la carte */
  margin: 10px 0 0;
  padding: 8px 11px;
  border-radius: var(--r-m);
  background: var(--warn-pale);
  color: var(--warn-ink);
  font-size: var(--fs-sm);
  text-wrap: pretty;
}

/* --- La ligne de réponse --- */
.dem-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.dem-champ { display: flex; flex-direction: column; gap: 5px; min-width: 190px; }
.dem-champ-large { flex: 1 1 240px; }
.dem-champ-lbl { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
/* « (facultatif) » vit aussi dans un .form-label, qui met tout en capitales :
   sans cette remise a zero il crie « (FACULTATIF) » plus fort que son champ. */
.dem-fac { font-weight: 400; color: var(--muted-2); text-transform: none; letter-spacing: 0; }
.dem-boutons { display: flex; gap: 8px; margin-left: auto; }
/* Les deux réponses ne se valent pas : accepter est le geste courant, refuser
   reste possible sans être mis en avant. Ni l'un ni l'autre n'est destructeur —
   la trace est gardée dans les deux cas — d'où un refus neutre, pas rouge vif. */
.btn-accepter { background: var(--ok); color: #fff; min-height: 40px; }
.btn-accepter:hover { filter: brightness(1.08); }
.btn-refus {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  min-height: 40px;
}
.btn-refus:hover { border-color: var(--bad-bord); color: var(--bad); background: #fff5f5; }

.dem-vide {
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  color: var(--muted);
  font-size: var(--fs-body);
  text-wrap: pretty;
}

/* --- Historique --- */
.dem-histo { margin-top: 26px; }
.dem-histo > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.dem-histo > summary:hover { color: var(--accent-fonce); }
.dem-histo .tbl { margin-top: 10px; }
.dem-statut {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.dem-statut.acceptee { background: var(--ok-pale); color: var(--ok-ink); }
.dem-statut.refusee { background: var(--bad-pale); color: var(--bad-ink); }
/* L'agent voit aussi ses demandes en attente (espace agent, lot C2). */
.dem-statut.en_attente { background: var(--warn-pale); color: var(--warn-ink); }
/* Deposee par l'agent lui-meme depuis son espace (lot C2) : une etiquette discrete,
   neutre -- c'est une provenance, pas une alerte. */
.dem-origine {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.dem-reponse { margin-left: 8px; font-size: var(--fs-xs); color: var(--muted); font-style: italic; }
/* Un fait date (l'absence posee a ete effacee ensuite), pas un mot de la
   planificatrice : sur sa propre ligne, sans italique ni guillemets. */
.dem-retiree { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); }
.dem-quand { font-size: var(--fs-xs); color: var(--muted-2); white-space: nowrap; }
/* `hidden` doit gagner contre un display: flex pose par une classe (sans quoi un
   bloc masque par le script reste affiche -- cas des champs du formulaire de
   demande, qui sont des .form-row). Regle globale, volontairement en fin de
   feuille : c'est le comportement qu'on attend de l'attribut partout. */
[hidden] { display: none !important; }

/* ===========================================================================
   Changer l'agent depuis un bloc de la frise (lot 24, retour 25)
   Le nom affiché dans le bloc devient un bouton, et ouvre un panneau qui
   REPREND les cartes de remplaçants du mode crise — d'où si peu de style ici :
   l'essentiel est déjà écrit (.remp-carte, .trou-card, .remp-classement…).
   =========================================================================== */

/* Le nom de l'agent est un <button> : on lui retire tout ce qu'un navigateur
   ajoute (fond, bordure, police), pour qu'il reste le texte du bloc — et on lui
   rend ce qui dit « ceci se clique » : curseur, soulignement au survol. */
button.bloc-a {
  display: block;
  /* Pas de width:100% : avec box-sizing: border-box, la boîte ferait la largeur du
     bloc PUIS serait décalée par la marge négative — elle dépasserait à gauche et
     rognerait le nom de 8 px à droite. En display:block sans largeur, la marge
     négative élargit des deux côtés, ce qui est bien l'intention. */
  /* La cible fait la hauteur d'une ligne (~14 px) et touche une zone qui, elle,
     QUITTE l'écran (le reste du bloc ouvre le formulaire). On l'agrandit de 3 px
     en haut et en bas — padding compensé par une marge négative, donc le texte ne
     bouge pas d'un pixel et la mise en page du bloc est inchangée. */
  margin: -3px -4px;
  padding: 3px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color .12s ease-out;
}
button.bloc-a:hover { background: rgba(0, 0, 0, .18); text-decoration: underline; }
.bloc.trou button.bloc-a:hover { background: rgba(220, 38, 38, .10); }
/* Anneau de focus visible au clavier (jamais au clic, qui a déjà le survol). */
button.bloc-a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -1px;
}
.bloc.trou button.bloc-a:focus-visible { outline-color: var(--bad); }

/* La boîte du panneau est bien plus large qu'une confirmation : elle porte une
   liste d'agents. Elle défile en INTERNE pour ne jamais dépasser la fenêtre. */
.modal-large { max-width: 760px; }
.modal-large .modal-card {
  display: block;
  padding: 20px 22px;
  max-height: min(78vh, 760px);
  overflow-y: auto;
}
.chg-titre {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.chg-actuel {
  margin: 0 0 14px;
  font-size: var(--fs-body);
  color: var(--ink);
}
.chg-absent {
  display: block;
  margin-top: 4px;
  color: var(--bad);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.chg-alertes {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border-radius: var(--r-m, 8px);
  background: var(--bad-pale);
  color: var(--bad-ink, #7f1d1d);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.chg-alertes b { display: block; margin-bottom: 3px; color: var(--bad); }
.chg-alerte { display: block; }
.chg-alerte i { color: #b91c1c; font-size: var(--fs-2xs); font-style: normal; }
.chg-chargement, .chg-erreur { margin: 0; color: var(--muted); font-size: var(--fs-body); }
.chg-erreur { color: var(--bad); }
/* Le pied reste atteignable quelle que soit la longueur de la liste : sans cela,
   « Rendre vacant » et « Fermer » se trouvaient sous 23 agents, hors de l'écran. */
.chg-pied {
  position: sticky;
  bottom: -20px;
  background: var(--card, #fff);
  /* Une ombre courte vers le haut : elle dit que la liste continue dessous, sans
     tracer un trait qui, lui, resterait visible meme en bas de liste. */
  box-shadow: 0 -6px 10px -8px rgba(15, 23, 42, .35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.chg-pied .btn-ghost-modal { margin-left: auto; }
/* Le créneau EST tenu : le badge ne doit pas crier « VACANT » alors qu'un nom
   figure au planning. Teinte neutre — ce n'est ni une alerte ni un manque. */
/* Un créneau TENU n'est pas une alerte : la carte du mode crise porte un liseré
   rouge et un fond ambré, justes pour un poste que personne ne tiendra, faux quand
   on vient simplement corriger un nom. On la ramène au neutre dans ce cas. */
.chg-agent .trou-card:has(.trou-badge.tenu) {
  background: var(--hover);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
}
.trou-badge.tenu {
  background: var(--hover);
  color: var(--muted);
  border: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  button.bloc-a { transition: none; }
}

/* ---------------------------------------------------------------------------
   L'OBSERVATION SE LIT DANS LE BLOC (retour de Vai du 21/08/2026)
   Le coin plié seul ne suffisait pas : elle a rouvert trois fois le formulaire
   pour relire ce qu'elle venait d'écrire, puis n'a pas retrouvé le jour concerné
   au moment de sortir la feuille de route. Le texte s'affiche donc en clair dès
   que le bloc a la hauteur pour le porter (décidé côté serveur, cf. _bloc).
   Un filet plutôt qu'un fond : sur un aplat de couleur, un voile clair mangerait
   le blanc du texte.
   --------------------------------------------------------------------------- */
.bloc-note {
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, .4);
  font-size: 10px;
  line-height: 1.3;
  /* Trois lignes puis « … » : au-delà, le bloc devient un pavé de texte et on ne
     lit plus le planning. Le reste se lit au survol et sur la feuille de route. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.bloc.trou .bloc-note { border-top-color: var(--bad-bord); }

/* ---------------------------------------------------------------------------
   LES SORTIES DE DOCUMENTS, REPÉRABLES D'UN COUP D'ŒIL (même retour)
   « les boutons devraient être un peu plus visuels, avec un encadré léger plus
   coloré [...] pour repérer direct l'emplacement où récupérer les docs. »
   Un bouton neutre de plus dans une barre qui en compte cinq ne se voit pas.
   --------------------------------------------------------------------------- */
.btn-doc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--accent-bord);
  border-radius: var(--r-m);
  background: var(--accent-pale);
  /* --accent-fonce est la couleur prévue par la charte pour du texte sur fond
     pâle : le violet ABC pur y manquerait de contraste. */
  color: var(--accent-fonce);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn-doc:hover {
  background: #f6e2f3;
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(171, 15, 155, .16);
}
.btn-doc:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.btn-doc:active { scale: .96; }

@media (prefers-reduced-motion: reduce) {
  .btn-doc { transition: none; }
  .btn-doc:active { scale: 1; }
}

/* ---------------------------------------------------------------------------
   ÉCRAN DOCUMENTS — les extractions en lot (retour de Vai du 21/08/2026)
   « en tant que planificatrice, je suis amenée à extraire le planning de tous
   les sites d'un coup, sur une période que je définis. » Un bouton posé sur un
   écran qui ne montre qu'un site et une semaine ne pouvait pas y répondre.
   Une carte par document : le titre dit CE QUE C'EST, le texte dit qui a le
   droit de le lire — c'est la question qui compte ici.
   --------------------------------------------------------------------------- */
.docs-liste {
  display: grid;
  gap: 12px;
  padding: 4px 2px 2px;
}
.doc-carte {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-l, 12px);
  background: #fff;
}
.doc-carte h3 {
  margin: 0 0 3px;
  font-size: var(--fs-body);
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-carte p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: var(--fs-sm);
  text-wrap: pretty;
}
/* Le document du contrôleur est le seul qui porte les observations : il se
   distingue à l'œil pour qu'on ne le remette pas à un agent par mégarde. */
.doc-carte-reserve {
  border-color: var(--warn-bord);
  background: #fffdf7;
}
.doc-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn-pale);
  color: var(--warn-ink);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
/* Précision accolée à une étiquette de champ (« rien de coché = tous ») : elle
   fait partie de la consigne, pas d'une note qu'on lit après coup. */
.form-label-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   ÉCRAN DOCUMENTS — deux colonnes (retour de Vai du 21/08/2026)
   « tu peux remonter le pavé "à télécharger" à côté du pavé où l'on définit les
   sites, agents et dates ? pour gagner de la place et éviter le défilement. »
   Avec vingt-cinq agents, la liste poussait les boutons hors de l'écran : on
   choisissait en haut, on téléchargeait tout en bas, sans jamais voir les deux.
   Une seule colonne sous 1100 px, sinon les cases deviennent illisibles.
   --------------------------------------------------------------------------- */
.docs-agencement {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.docs-agencement > .form-card { margin-bottom: 0; }
.docs-panneau { margin-top: 0; }
@media (max-width: 1100px) {
  .docs-agencement { grid-template-columns: 1fr; }
}
/* En une colonne, une carte de document reprend la ligne : le bouton sous le
   texte plutôt qu'écrasé à côté. */
@media (max-width: 640px) {
  .doc-carte { flex-direction: column; align-items: stretch; }
}

/* Champ de recherche au-dessus d'une longue liste de cases à cocher. Il ne porte
   pas de `name` : il filtre l'affichage, il n'entre jamais dans le formulaire. */
.recherche-liste {
  max-width: 320px;
  margin-bottom: 8px;
}

/* Le meme champ, mais au-dessus d'une BARRE D'ONGLETS (vues Site et Agent, retour de
   Vai du 23/08/2026). Le compte se met a cote du champ et non dessous : la barre de
   pastilles qui suit doit rester collee a son filtre pour qu'on lise les deux comme
   un seul bloc. Le champ perd sa marge basse, c'est la barre qui la porte deja. */
.barre-filtre {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.barre-filtre .recherche-liste { margin-bottom: 0; flex: 0 1 260px; }
/* « 3 sur 24 » change a chaque frappe : sans chasse fixe, le texte se decale d'un
   demi-caractere a chaque chiffre et la ligne tremble sous les doigts. */
.compte-filtre { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Listes Contrat / Diplôme de la barre d'agents (Vai, 23/09/2026). Largeur au
   contenu ; un filtre ENGAGÉ se voit (teinte d'action) : le choix est gardé d'un
   agent à l'autre, une barre raccourcie sans raison apparente ferait croire à des
   agents disparus. */
.barre-filtre .filtre-choix { width: auto; flex: 0 0 auto; padding-right: 28px; }
.barre-filtre .filtre-choix:not(:has(option[value=""]:checked)) {
  border-color: var(--accent-bord);
  background-color: var(--accent-pale);
  color: var(--accent-fonce);
  font-weight: 600;
}

/* Colonne de SELECTION d'un tableau (ecran Sites : cocher les trames a derouler,
   retour de Vai du 23/08/2026). Le label remplit la cellule et deborde sur son
   padding (marges negatives) : la case fait 13 px, mais la zone qui la coche fait
   toute la hauteur de la ligne -- viser une case de 13 px a la souris, ligne apres
   ligne, est le genre de detail qui rend un ecran penible. */
.tbl .col-cocher { width: 40px; text-align: center; }
.tbl .col-cocher .case-ligne {
  display: block;
  padding: 14px 10px;
  margin: -14px -10px;
  cursor: pointer;
}
.tbl .col-cocher input { margin: 0; cursor: pointer; accent-color: var(--accent); }

/* Etat du deroule, colonne « Planifié » de l'ecran Sites (Vai, 23/08/2026 : « un
   affichage qui me dit : sites planifiés en septembre 6/9 »). Trois etats, trois
   tons : fait, a faire, sans objet. Le rouge est reserve a ce qui MANQUE -- un site
   sans trame n'est pas un oubli, il reste gris. */
.etat-ok { color: var(--ok-ink); font-weight: 600; }
.etat-manque { color: var(--bad-ink); font-weight: 600; white-space: nowrap; }
.etat-neutre { color: var(--muted); white-space: nowrap; }

/* Compteur « trames déroulées : 6 / 7 » pose a cote de la periode. Il ne crie que
   s'il MANQUE quelque chose : tout vert en permanence ne se lit plus au bout de
   trois jours. */
.periode-compteur { font-weight: 600; color: var(--muted); }
.periode-compteur.incomplet { color: var(--bad-ink); }

/* ---- « Dupliquer ce créneau vers d'autres jours » (Vai, USINE) ---------------
   « Les horaires varient, je n'ai pas fait de trame ; plutôt que de créer la vac à
   chaque fois, si je pouvais juste dupliquer la première… » La carte vit SOUS le
   formulaire du créneau, dans son propre <form> : dupliquer ne doit jamais emporter
   une modification d'horaire non enregistrée.
   Chaque jour arrive déjà jugé par le serveur ; un jour impossible reste VISIBLE,
   éteint, avec son motif — le masquer laisserait chercher pourquoi il manque. */
.dup-titre { margin: 0 0 6px; font-size: 16px; }
.dup-rappel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.dup-rappel b { color: var(--ink); }
.dup-h { font-variant-numeric: tabular-nums; }
.dup-agent { padding: 2px 9px; border-radius: 999px; background: var(--pill-pale);
  border: 1px solid var(--pill-bord); color: var(--ink); font-weight: 600; }
.dup-vacant { background: var(--bad-pale); border-color: var(--bad-bord);
  color: var(--bad-ink); }
.dup-entete { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; }
.dup-periode { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }

/* Mini-calendrier (lot C, 22/09/2026) : 8 semaines, une ligne par semaine, Lun -> Dim.
   Une seule grille : colonne 1 = en-tête de semaine (bouton « toute la semaine »),
   colonnes 2-8 = les jours ; la première ligne porte les en-têtes de colonnes
   (boutons « tous les lundis »). Chaque case fait 40 px de haut au moins : c'est le
   geste que Vai répète, la cible doit être franche. */
.dup-cal { display: grid; grid-template-columns: minmax(118px, auto) repeat(7, minmax(40px, 1fr));
  gap: 4px; align-items: stretch; }
.dup-cal-coin { min-height: 28px; }
.dup-cal-col, .dup-cal-sem {
  appearance: none; border: 1px solid transparent; border-radius: var(--r-m);
  background: transparent; color: var(--muted); font: inherit; cursor: pointer;
  transition-property: background-color, border-color, color; transition-duration: .12s; }
.dup-cal-col { min-height: 28px; padding: 2px 0; font-size: var(--fs-2xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; text-align: center; }
.dup-cal-sem { display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start; gap: 1px; min-height: 40px; padding: 4px 10px; text-align: left; }
.dup-cal-sem b { color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.dup-cal-dates { font-size: var(--fs-2xs); color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.dup-cal-col:hover, .dup-cal-sem:hover { background: var(--accent-pale); color: var(--accent-fonce);
  border-color: var(--accent-bord); }
.dup-cal-sem:hover b { color: var(--accent-fonce); }
.dup-cal-col:focus-visible, .dup-cal-sem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dup-cal-sem:disabled { cursor: default; opacity: .5; }
.dup-cal-sem:disabled:hover { background: transparent; border-color: transparent; }
/* Chaque case remplit sa cellule : toutes les tuiles d'une ligne ont la même hauteur. */
.dup-jour { display: flex; }
.dup-case { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; min-height: 40px; padding: 6px 4px; border: 1px solid var(--line);
  border-radius: var(--r-m); background: var(--card);
  transition-property: border-color, background-color, box-shadow;
  transition-duration: .12s; }
.dup-case:hover { border-color: var(--muted-2); background: var(--thead); }
.dup-case input { margin: 0; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.dup-case:has(input:checked) { border-color: var(--accent-bord); background: var(--accent-pale);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.dup-case:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dup-lbl { font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; }
/* Jour qui ne peut PAS recevoir de copie : éteint, non cochable ; le motif est en
   infobulle sur la case ET écrit dans la liste « non proposés » sous le calendrier. */
.dup-jour.impossible .dup-case { cursor: not-allowed; background: var(--thead); border-style: dashed; }
.dup-jour.impossible .dup-case:hover { border-color: var(--line); }
.dup-jour.impossible .dup-lbl { color: var(--muted-2); font-weight: 500; }
/* Le créneau d'origine : c'est lui qu'on duplique, on le repère d'un cadre accent. */
.dup-jour.origine .dup-case { border: 2px solid var(--accent); padding: 5px 3px; }
.dup-jour.origine .dup-lbl { color: var(--accent-fonce); font-weight: 700; }
.dup-refus { margin-top: 10px; font-size: var(--fs-xs); color: var(--muted); }
.dup-refus > summary { cursor: pointer; padding: 6px 0; min-height: 28px; }
.dup-refus > summary:hover { color: var(--ink); }
.dup-refus ul { margin: 4px 0 0; padding: 0 0 0 18px; columns: 2; column-gap: 24px; }
.dup-refus li { break-inside: avoid; padding: 2px 0; }
.dup-refus li b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.dup-motif { color: var(--muted); line-height: 1.35; text-wrap: pretty; }
@media (max-width: 700px) {
  .dup-cal { grid-template-columns: minmax(64px, auto) repeat(7, minmax(32px, 1fr)); }
  .dup-cal-dates { display: none; }
  .dup-refus ul { columns: 1; }
}
.dup-rien { margin: 0; font-size: var(--fs-sm); color: var(--muted);
  text-wrap: pretty; }

/* --- Jours feries chomes (lot 44, ecran Reglages) -------------------------- */
/* Douze cases a cocher : une grille qui se replie plutot qu'une liste de douze
   lignes, parce qu'on les lit toutes d'un coup pour compter les sept retenus. */
.feries-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.ferie-case {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 9px;
  /* Meme rayon concentrique que .form-choix : la carte parente est en --r-l. */
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--thead);
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.ferie-case:hover { border-color: var(--accent-bord); }
.ferie-case:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ferie-case:has(input:checked) {
  background: var(--accent-pale);
  border-color: var(--accent-bord);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
}
.ferie-case input { grid-row: 1 / span 2; }
.ferie-nom { font-weight: 600; }
/* Chiffres alignes d'une ligne a l'autre : ce sont des dates qu'on compare. */
.ferie-date { grid-column: 2; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ferie-note {
  grid-column: 2;
  justify-self: start;
  margin-top: 3px;
  font-size: var(--fs-2xs);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 1px 6px;
  cursor: help;
}


/* ====================== 17. Relevé d'anomalies ======================
   Écran Extractions ▸ Anomalies. Il réutilise tout le système .exports-* (même
   panneau, même tableau, même légende) : ce n'est pas un nouvel écran, c'est le
   même geste — choisir une période, voir, télécharger. Seules trois choses lui
   sont propres : la pastille de règle, la ligne tolérée, et l'état « rien à
   signaler », qui doit être une bonne nouvelle et pas un tableau vide. */

.anom-regle {
  display: inline-block;
  min-width: 46px;
  padding: 2px 8px;
  text-align: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--bad-bord);
  background: var(--bad-pale);
  color: var(--bad-ink);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .02em;
}
/* Un dépassement TOLÉRÉ par la société reste un constat : il change de ton
   (ambre, pas rouge), il ne disparaît pas. Un planning fait preuve au moment
   des paies — effacer la trace du choix, c'est perdre le choix, pas le
   dépassement. */
.anom-regle.toleree {
  border-color: var(--warn-bord);
  background: var(--warn-pale);
  color: var(--warn-ink);
}
.anom-table tr.toleree td { color: var(--muted); }

/* La seule colonne qui a le droit de revenir à la ligne : une phrase de constat
   sur une seule ligne pousserait le tableau à trois écrans de large. */
.anom-table .constat {
  white-space: normal;
  min-width: 300px;
  max-width: 52ch;
  text-wrap: pretty;
}
.anom-table .jour { font-variant-numeric: tabular-nums; color: var(--muted); }
.anom-table .article { font-size: var(--fs-2xs); color: var(--muted); }

/* « Rien à signaler » : un tableau vide laisse croire à une panne. On l'écrit. */
.anom-rien {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--ok-bord);
  border-radius: var(--r-l);
  background: var(--ok-pale);
  color: var(--ok-ink);
  font-size: var(--fs-sm);
  text-wrap: pretty;
}
.anom-rien .ico-ok { width: 18px; height: 18px; flex: none; }

/* Le palmarès sous le titre : par où commencer quand il y a trois pages. */
.anom-palmares {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.anom-palmares li {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--thead);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.anom-palmares li b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* L'étiquette d'un axe du palmarès : sans elle, « R3 ×26 » et « FANENE ×6 »
   se lisent comme une seule liste mélangée. */
.anom-palmares li.titre {
  border: none;
  background: none;
  padding-left: 0;
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted-2);
}

.anom-signalements { margin-top: 18px; }
.anom-signalements > summary {
  cursor: pointer;
  padding: 9px 14px;
  border: 1px solid var(--warn-bord);
  border-radius: var(--r-l);
  background: var(--warn-pale);
  color: var(--warn-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  list-style-position: inside;
  transition: background-color .12s, border-color .12s;
}
.anom-signalements > summary:hover { border-color: var(--warn); }
.anom-signalements > summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
/* Le tableau s'ouvre DANS le repli : rayon concentrique (r-l dans r-l + 12px
   d'écart, donc le conteneur intérieur reste sous le rayon extérieur). */
.anom-signalements[open] > summary { border-radius: var(--r-l) var(--r-l) 0 0; }
.anom-signalements .exports-scroll { border-top: none; border-radius: 0 0 var(--r-l) var(--r-l); }

/* Motifs : ce que la planificatrice écrit pour EXPLIQUER une anomalie. Deux niveaux,
   un bloc et une colonne — le motif COMMUN d'une règle, repris les mois suivants (le
   bloc, au-dessus du tableau), puis le motif de CHAQUE anomalie (la dernière colonne).
   Mêmes champs .form-input que le reste de l'app, resserrés pour tenir dans une
   ligne de tableau ; leur focus (bord + halo d'accent) vient de .form-input:focus. */
.anom-communs {
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--thead);
}
.anom-communs-titre { margin: 0; font-size: var(--fs-body); font-weight: 600; }
.anom-communs-aide { margin: 2px 0 12px; font-size: var(--fs-xs); color: var(--muted); text-wrap: pretty; }
/* Deux colonnes : le libellé de la règle (sa largeur propre, plafonnée) et le champ,
   qui prend tout le reste. Les champs s'alignent d'une règle à l'autre. */
.anom-communs-grille {
  display: grid;
  grid-template-columns: fit-content(24rem) minmax(0, 1fr);
  gap: 8px 16px;
  align-items: center;
}
.anom-commun-lbl { font-size: var(--fs-sm); color: var(--ink); text-wrap: pretty; }
.anom-commun-nb { margin-left: 4px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.anom-communs .form-input,
.anom-table .motif .form-input { padding: 6px 10px; font-size: var(--fs-sm); }

/* La colonne Motif : un champ qui prend toute la cellule, jamais écrasé. Un motif
   commun long, rappelé en indice, finit par « … » au lieu d'être coupé net. */
.anom-table .motif { min-width: 220px; }
.anom-table .motif .form-input { width: 100%; text-overflow: ellipsis; }
/* Une alerte de la même clé que la ligne du dessus (agent, jour, règle) n'a pas son
   propre champ : elle partage le motif de la première, qui le porte. Discret, pour
   se lire comme une mention et non comme un champ vide qui attendrait une saisie. */
.anom-table .motif-partage { font-size: var(--fs-xs); color: var(--muted); }

.anom-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
/* Sous 640 px, le libellé passe AU-DESSUS de son champ plutôt que de l'écraser. */
@media (max-width: 640px) {
  .anom-communs-grille { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .anom-communs-grille .form-input { margin-bottom: 8px; }
}

/* Duplication : « Recopier aussi l'agent » (lot B, 22/09/2026). Une ligne franche
   au-dessus du calendrier, 40 px de haut : c'est un choix, pas une option cachée. */
.dup-avec-agent { display: flex; align-items: center; gap: 10px; min-height: 40px;
  margin: 0 0 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--thead); font-size: var(--fs-sm); color: var(--ink); cursor: pointer;
  transition-property: border-color, background-color; transition-duration: .12s; }
.dup-avec-agent:hover { border-color: var(--muted-2); }
.dup-avec-agent input { margin: 0; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.dup-avec-agent:has(input:checked) { border-color: var(--accent-bord); background: var(--accent-pale); }
.dup-avec-agent:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dup-avec-agent-note { color: var(--muted); }
.dup-avec-agent:has(input:not(:checked)) .dup-avec-agent-note b { color: var(--bad-ink); }

/* Alertes hors de la période affichée (22/09/2026) : comptées, jamais effacées. */
.al-hors { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--muted); text-wrap: pretty; }

/* Récap heures par agent sur la vue Site (22/09/2026) : dense, chiffres tabulaires,
   la période en gras. Repliable (details) mais ouvert : c'est pour piloter en direct. */
.recap-agents { margin: 0 0 12px; }
.recap-agents > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 2px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink); cursor: pointer; list-style: none;
}
.recap-agents > summary::-webkit-details-marker { display: none; }
.recap-agents > summary::before { content: "›"; display: inline-block; color: var(--muted); font-size: 18px; line-height: 1;
  transform: translateY(-1px); transition: transform .2s cubic-bezier(.2, 0, 0, 1); }
.recap-agents[open] > summary::before { transform: translateY(-1px) rotate(90deg); }
.recap-agents > summary:hover { color: var(--accent-fonce); }
.recap-agents > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-s); }
.recap-note { color: var(--muted); font-weight: 400; }
.recap-table { border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; margin-top: 4px; }
.recap-table th, .recap-table td { padding: 5px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.recap-table th { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--thead); }
.recap-table th:first-child, .recap-table td:first-child { text-align: left; }
.recap-table tbody tr:last-child td { border-bottom: none; }
.recap-table tbody tr:hover td { background: var(--hover); }
.recap-agent { font-weight: 600; }
.recap-agent i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.recap-h.zero { color: var(--muted-2); }
.recap-periode { border-left: 1px solid var(--line); }
.recap-ici { color: var(--muted); font-size: var(--fs-xs); cursor: help; }
.recap-partiel { color: var(--warn); margin-left: 2px; font-weight: 800; }
/* Écart au cycle (Vai, 23/09/2026) : la même pastille que GESTION ▸ Agents. Deux
   cycles touchés par la période = deux pastilles côte à côte. */
.recap-ecart { border-left: 1px solid var(--line); }
.recap-ecart .vd + .vd { margin-left: 4px; }
.recap-sans-ecart { color: var(--muted-2); cursor: help; }
.recap-table .dont-assimile { font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .recap-agents > summary::before { transition: none; } }

/* Vue Agent : « + Absence » (22/09/2026), même famille que « Réattribuer ». */
/* font-family seulement : le raccourci `font: inherit` écrasait aussi la taille et
   la graisse de .btn-imprimer, et « ＋ Absence » sortait plus gros que ses voisins. */
.btn-absence { cursor: pointer; font-family: inherit; }
#absence-modal .modal-card { max-width: 760px; }
#absence-modal .form-actions { margin-top: 8px; }

/* ====================== Diplômes : validité et rappels (Vai, 23/09/2026) ======================
   Fiche agent : la date de fin de validité se saisit À CÔTÉ de chaque diplôme.
   GESTION ▸ Agents : une icône de diplôme 6 mois puis 3 mois avant l'échéance, avec
   sa case « vu » (seul moyen de l'effacer) ; rouge plein une fois expiré, sans case.
   Couleurs du système : ambre = à surveiller, rouge = urgent / hors règle. */
.qualifs-validite { flex-direction: column; gap: 6px; }
.qualif-ligne { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qualif-ligne .form-check { min-width: 170px; }
.qualif-fin { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); }
.qualif-fin .form-input { width: 160px; padding: 6px 10px; }
/* Diplôme décoché : sa date ne sera pas enregistrée, le champ s'efface en visuel. */
.qualif-ligne:has(input[type="checkbox"]:not(:checked)) .qualif-fin { opacity: .45; }
.qualif-fin { transition: opacity .15s ease; }

.col-qualifs { white-space: normal; }
.diplome { display: inline-flex; align-items: center; gap: 5px; }
.diplome-sep { margin-right: 2px; }
.diplome-rappel { display: inline-flex; align-items: center; gap: 1px; margin: 0; vertical-align: middle; }
.diplome-rappel .a-bulle,
.diplome-rappel.a-bulle { display: inline-flex; padding: 3px; border-radius: var(--r-s); }
.ico-diplome {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.diplome-rappel.palier-6 .a-bulle { color: var(--warn-ink); background: var(--warn-pale); }
.diplome-rappel.palier-3 .a-bulle { color: var(--bad-ink); background: var(--bad-pale); }
.diplome-rappel.palier-0 { color: #fff; background: var(--bad); }
/* La case « vu » : petite à l'œil, mais une cible de clic confortable (le label
   déborde autour de la case sans pousser la ligne). */
.diplome-vu { display: inline-flex; align-items: center; padding: 6px; margin: -6px -4px -6px 0; cursor: pointer; }
.diplome-vu input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.diplome-fin { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .qualif-fin { transition: none; } }

/* ====================== Calendrier de paie (Réglages) ======================
   Un tableau de 15 mois de salaire : période, durée, état, et la fin (saisie libre).
   Même grammaire que .exports-table (en-têtes en petites capitales, filets fins).
   Les dates et les durées sont en chiffres tabulaires : les colonnes s'alignent
   d'un mois à l'autre. Sous ~640 px le tableau défile DANS son cadre plutôt que
   de faire déborder toute la page. */
.cal-paie-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
}
.cal-paie {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: var(--fs-sm);
}
/* Le titre du tableau sert aux lecteurs d'écran ; à l'œil, le h2 de la carte suffit. */
.cal-paie caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.cal-paie th,
.cal-paie td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.cal-paie thead th {
  background: var(--thead);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.cal-paie tbody tr:last-child th,
.cal-paie tbody tr:last-child td { border-bottom: none; }
.cal-paie-mois { font-weight: 600; color: var(--ink); white-space: nowrap; }
.cal-paie-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-paie-vide { color: var(--muted); }
/* Le mois en cours : fond pâle d'accent sur toute la ligne, et la mention écrite
   à côté du mois (la couleur seule ne suffit pas). */
.cal-paie tr.est-courant th,
.cal-paie tr.est-courant td { background: var(--accent-pale); }
.cal-paie-courant { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--accent-fonce); }
/* Sur ce fond pâle, --muted tombe à 4,2:1 : le texte grisé passe en --accent-fonce
   (le « texte sur fond pâle » du système, 7,5:1). La pastille neutre garde son
   propre fond (--thead), où --muted atteint déjà 4,5:1. */
.cal-paie tr.est-courant .cal-paie-vide { color: var(--accent-fonce); }
/* Pastille neutre : « Proposée » et « Aucun cycle » ne demandent rien. */
.vd-neutre { background: var(--thead); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.cal-paie-motif { display: block; margin-top: 4px; font-size: var(--fs-2xs); color: var(--bad-ink); max-width: 260px; white-space: normal; text-wrap: pretty; }
/* « Hors cycle » : permis, donc ambre comme sa pastille, pas rouge. */
.cal-paie-motif.est-alerte { color: var(--warn-ink); }
/* Largeur FIXE : un champ de date par ligne, tous alignés, vide ou rempli. */
.cal-paie-date { width: 160px; max-width: 100%; padding: 6px 10px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
/* Sous le champ : la proposition et les fins de cycle, des repères pour la saisie. */
/* Retour a la ligne permis : avec des cycles d'une semaine, « Fins de cycle »
   aligne une douzaine de dates et elargissait toute la colonne. */
.cal-paie-indic { display: block; margin-top: 4px; max-width: 240px; font-size: var(--fs-2xs); line-height: 1.45; color: var(--muted); font-variant-numeric: tabular-nums; white-space: normal; text-wrap: pretty; }
/* Même raison que .cal-paie-vide : --muted tombe sous 4,5:1 sur le fond pâle. */
.cal-paie tr.est-courant .cal-paie-indic { color: var(--accent-fonce); }

/* ====================== Rapport du mois (Extractions) ======================
   Le bloc en tête de l'écran Extractions : un menu des mois (civils), un menu de la
   version (prévisionnel ou bilan) et le bouton du PDF, puis, après le garde-fou avant
   envoi, l'encadré de confirmation (le style flash-warn des avertissements, posé sous
   le bouton qui l'a déclenché). */
.rapport-mois-form { align-items: flex-end; flex-wrap: wrap; margin-top: 16px; }
.rapport-mois-form .form-group { flex: 0 1 440px; margin-bottom: 0; }
.rapport-mois-form .form-select { font-variant-numeric: tabular-nums; }
.rapport-mois-confirmer {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rapport-mois-confirmer p { margin: 0; text-wrap: pretty; }
.rapport-mois-confirmer p + p { margin-top: 4px; }
/* L'aperçu Paie n'est plus le premier bloc de la page. */
.rapport-mois-suite { margin-top: 24px; }

/* ====================== Vue Site en grille (lot G1, 20/10/2026) ======================
   Demande de Vai : « à la Skello ». Une ligne par agent, une case par jour, une
   étiquette par créneau, de hauteur FIXE quelle que soit la durée : toute la
   période se lit sans faire défiler les heures. Les étiquettes reprennent le
   dessin des blocs de la frise (fond doux sous voile blanc, bande pleine à gauche
   dans la couleur de l'agent, vacant hachuré rouge) : un seul code visuel.
   Placé AVANT le lot UI 3, qui doit fermer la feuille (test_couleurs_douces). */
.grille-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.grille-site {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.grille-site th, .grille-site td {
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 4px;
  vertical-align: top;
}
.grille-site tbody tr:last-child > * { border-bottom: 0; }
.grille-site thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.grille-site .g-jour { position: relative; min-width: 96px; padding: 7px 26px 7px 8px; text-align: left; }
.grille-site .g-jour b { color: var(--ink); }
.grille-site .g-jour:hover .day-add,
.grille-site .g-jour .day-add:focus-visible { opacity: 1; pointer-events: auto; }
.grille-site [data-debut-semaine] { border-left: 2px solid var(--muted-2); }
/* La colonne des noms reste en place quand la grille défile vers la droite. */
.grille-site .g-coin, .grille-site .g-agent {
  position: sticky;
  left: 0;
  z-index: 1;
  border-left: 0;
  text-align: left;
  background: var(--card);
}
.grille-site thead .g-coin { z-index: 3; background: #f8fafc; padding: 7px 10px; }
.grille-site .g-agent {
  min-width: 150px;
  max-width: 190px;
  padding: 8px 10px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.grille-site .g-agent i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}
.grille-site .g-puce { background: var(--c, #64748b); }
.g-ligne-trou .g-agent { color: var(--bad-ink); }
.grille-site .g-total {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
  padding: 8px 10px;
  vertical-align: middle;
}
.grille-site thead .g-total { color: var(--muted); font-weight: 500; }
.grille-site tbody tr:hover > * { background-color: #fbfcfe; }
.grille-site tbody tr:hover > .g-agent { background-color: #fbfcfe; }

/* Les repères d'une colonne (05/11/2026). Le fond suit la colonne de haut en bas, et
   l'emporte sur le survol de ligne : un jour reste lisible sous la souris. Dans cet
   ordre : un jour à la fois férié et aujourd'hui garde le ton d'aujourd'hui. */
.grille-site :is(thead, tbody, tfoot) .g-we,
.grille-site tbody tr:hover > .g-we { background-color: var(--hover); }
.grille-site :is(thead, tbody, tfoot) .g-ferie,
.grille-site tbody tr:hover > .g-ferie { background-color: #fff3e0; }
.grille-site :is(thead, tbody, tfoot) .g-auj,
.grille-site tbody tr:hover > .g-auj { background-color: var(--accent-pale); }
.grille-site .g-jour.g-auj b {
  display: inline-block;
  min-width: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-align: center;
}
.g-ferie-mot { display: block; font-size: var(--fs-xs); font-weight: 600; color: #8a4f00; }

/* Une case vide : toute la surface est le lien, le + ne paraît qu'au survol pour ne
   pas charger une grille déjà dense. */
.grille-site .g-case { position: relative; }
.g-ajout {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  transition: background-color .12s;
}
.g-ajout::before {
  content: "";
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  opacity: 0;
  transition: opacity .12s;
}
.g-ajout:hover { background-color: var(--accent-pale); box-shadow: inset 0 0 0 1px var(--accent-bord); }
.g-ajout:hover::before, .g-ajout:focus-visible::before { opacity: 1; }
.g-ajout:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  .g-ajout, .g-ajout::before { transition: none; }
}

/* La ligne de totaux par jour. */
.grille-site tfoot th, .grille-site tfoot td {
  border-top: 1px solid var(--muted-2);
  border-bottom: 0;
  background: var(--thead);
  vertical-align: middle;
}
.grille-site tfoot .g-agent { background: var(--thead); }
.g-pied-note { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.grille-site .g-pied { padding: 7px 8px; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* L'étiquette d'un créneau : le bloc de la frise, en version compacte. */
.g-etiq {
  --voile: rgba(255, 255, 255, .84);
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 6px 3px 9px;
  border-radius: var(--r-s);
  background: linear-gradient(var(--voile), var(--voile)), var(--c, #64748b);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .10);
  transition: filter .12s, box-shadow .12s;
}
.g-etiq + .g-etiq { margin-top: 3px; }
.g-etiq::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c, #64748b);
}
.g-etiq:hover { filter: brightness(.97); box-shadow: 0 2px 6px rgba(15, 23, 42, .16); }
.g-etiq:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
/* Au-delà de douze agents visibles, --c porte des hachures : on les redessine par-
   dessus le voile, comme sur la frise (mêmes angles que presentation._MOTIFS). */
.g-etiq[style*="gradient(135deg"], .g-etiq[style*="gradient(90deg"] {
  --hachure: 135deg;
  background: repeating-linear-gradient(var(--hachure), rgba(15, 23, 42, .16) 0 3px, transparent 3px 9px),
              linear-gradient(var(--voile), var(--voile)), var(--c);
}
.g-etiq[style*="gradient(90deg"] { --hachure: 90deg; }
.g-etiq.trou {
  background: repeating-linear-gradient(45deg, var(--bad-pale), var(--bad-pale) 6px, #fff 6px, #fff 12px);
  color: var(--bad);
  border: 1.5px dashed var(--bad);
  box-shadow: none;
  padding-left: 6px;
}
.g-etiq.trou::before { content: none; }
/* Absent ce jour-là : la couleur reste (on sait QUI manque), l'horaire est barré. */
.g-etiq.abandonne .g-h { text-decoration: line-through; text-decoration-color: var(--bad); }
.g-etiq .pp-badge, .g-etiq .abs-badge { position: static; flex: none; }
.g-etiq .note-puce { margin: 0 0 0 auto; flex: none; }
.grille-dense .g-jour { min-width: 64px; padding-right: 22px; }
.grille-dense .g-etiq { padding: 3px 4px 3px 7px; font-size: var(--fs-xs); }
.grille-vide { padding: 22px 14px; color: var(--muted); text-align: center; }
/* « Une seule couleur » : la grille grise comme la frise. */
body.mono .g-etiq:not(.trou) { background: linear-gradient(var(--voile), var(--voile)), #64748b; }
body.mono .g-etiq:not(.trou)::before, body.mono .grille-site .g-puce { background: #64748b; }
.vue-chips { margin-right: 4px; }

/* ====================== Lot UI 3 : couleurs d'agents adoucies (19/10/2026) ======================
   Choisi par Vai le 19/10 sur avant/après : les blocs de la frise (vue Site) passent d'un
   aplat saturé à texte blanc à un fond doux à texte sombre, avec une BANDE pleine à
   gauche dans la couleur de l'agent. Le VACANT garde ses hachures rouges : ce qui est à
   traiter doit rester ce qui crie le plus fort.

   Technique : le voile blanc est un CALQUE de fond posé sur --c, et la bande est dessinée
   par ::before avec la même valeur --c. Pas de color-mix() : au-delà de douze agents, --c
   porte des hachures (presentation._fond_agent), qu'un mélange de couleurs rendrait
   invalide.

   Les hachures elles-mêmes (deux agents de même couleur, 13 à 36 agents) : sous le voile
   elles ne se lisaient presque plus. Elles sont redessinées PAR-DESSUS, en traits sombres.
   On les reconnaît à leur angle dans le style en ligne (`--c:repeating-linear-gradient(
   135deg,...`), comme `.bloc[style*="--voies"]` plus haut : les deux angles possibles sont
   ceux de presentation._MOTIFS, verrouillés par test_couleurs_douces.

   Tout ce lot tient dans ce bloc, en fin de feuille : le retirer rend l'aspect d'avant. */
.bloc { --voile: rgba(255, 255, 255, .84); }
.bloc:not(.trou) {
  color: var(--ink);
  padding-left: 9px;
  background: linear-gradient(var(--voile), var(--voile)), var(--c, #64748b);
}
.bloc:not(.trou)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c, #64748b);
  pointer-events: none;
}
.bloc[style*="gradient(135deg"]:not(.trou),
.bloc[style*="gradient(90deg"]:not(.trou) {
  --hachure: 135deg;
  background: repeating-linear-gradient(var(--hachure), rgba(15, 23, 42, .16) 0 3px, transparent 3px 9px),
              linear-gradient(var(--voile), var(--voile)), var(--c);
}
.bloc[style*="gradient(90deg"]:not(.trou) { --hachure: 90deg; }
/* Une seule couleur : tout le monde en gris, hachures comprises, comme avant. */
body.mono .bloc:not(.trou),
body.mono .bloc[style*="gradient("]:not(.trou) { background: linear-gradient(var(--voile), var(--voile)), #64748b; }
body.mono .bloc:not(.trou)::before { background: #64748b; }
.bloc[style*="--voies"]:not(.trou) { padding-left: 7px; }
.bloc-serre:not(.trou) { padding-left: 5px; }
.bloc:not(.trou) .bloc-h { opacity: .78; }
/* Ce qui était blanc sur l'aplat passe en encre : poignées, filet d'observation,
   survol et focus du nom. */
.bloc:not(.trou) .poignee::after { background: rgba(15, 23, 42, .45); }
.bloc:not(.trou) .bloc-note { border-top-color: rgba(15, 23, 42, .15); }
.bloc:not(.trou) button.bloc-a:hover { background: rgba(15, 23, 42, .08); }
.bloc:not(.trou) button.bloc-a:focus-visible { outline-color: var(--ink); }
.bloc-prim:not(.trou):hover { filter: brightness(.97); }

/* ====================== Publication du planning (lot C3, 22/10/2026) ======================
   Vai publie le planning d'un MOIS ; l'écran dit ensuite qui a changé depuis, pour ne
   prévenir que ceux-là. Quatre onglets de mois (M-1 à M+2) portant chacun leur état,
   une carte d'en-tête (état du mois + bouton Publier), la liste des agents à prévenir,
   puis les agents à jour, repliés. Le surligneur jaune pâle des lignes « nouveau » est
   celui du PDF (export_pdf._SURLIGNE, en plus clair à l'écran) : nuance locale. */

/* --- Onglets des mois : le mois, puis son état (pastille de couleur + mots) --- */
.pub-onglets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pub-onglet {
  flex: 0 1 172px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  padding: 9px 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: background-color .15s ease-out, border-color .15s ease-out,
              color .15s ease-out, scale .12s ease-out;
}
.pub-onglet:hover { border-color: var(--muted-2); background: var(--hover); }
.pub-onglet:active { scale: .96; }
.pub-onglet.actif { background: var(--ink); border-color: var(--ink); color: #fff; }
.pub-onglet-mois { font-size: var(--fs-body); font-weight: 600; }
.pub-onglet-etat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pub-onglet-etat::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}
.pub-onglet-etat.pub-ton-publie::before { background: var(--ok); }
.pub-onglet-etat.pub-ton-modifie::before { background: var(--warn); }
.pub-onglet-etat.pub-ton-modifie { color: var(--warn-ink); font-weight: 600; }
.pub-onglet.actif .pub-onglet-etat { color: rgba(255, 255, 255, .82); }

/* --- En-tête du mois choisi : son état à gauche, le geste à droite --- */
.pub-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
/* Le texte cède la place, le bouton jamais : il reste à droite tant que la ligne
   d'état peut passer sur deux lignes. */
.pub-entete-txt { flex: 1 1 320px; min-width: 0; }
.pub-mois { margin: 0 0 7px; font-size: 18px; }
.pub-situation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.pub-derniere { font-variant-numeric: tabular-nums; }
.pub-etat {
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
/* Un contour en ombre portée intérieure, pas en bordure : les trois états gardent
   ainsi exactement la même hauteur. */
.pub-etat.pub-ton-brouillon { background: var(--thead); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pub-etat.pub-ton-publie { background: var(--ok-pale); color: var(--ok-ink); }
.pub-etat.pub-ton-modifie { background: var(--warn-pale); color: var(--warn-ink); }
.pub-publier { margin: 0; }
.pub-bouton { min-height: 40px; text-wrap: balance; }

/* --- États sans liste : rien ce mois-ci, ou tout est déjà publié --- */
.pub-vide {
  padding: 28px 22px;
  border: 1px dashed var(--line);
  border-radius: var(--r-l);
  background: var(--card);
  text-align: center;
}
.pub-vide h2 { margin: 0 0 6px; font-size: 17px; }
.pub-vide p { margin: 0 auto; max-width: 62ch; color: var(--muted); font-size: var(--fs-body); text-wrap: pretty; }
.pub-vide-ok { border-style: solid; border-color: var(--ok-bord); }
.pub-vide-ok h2 { color: var(--ok-ink); }

/* --- La liste des agents à prévenir --- */
/* Défilement horizontal sur écran étroit ; le petit débord garde l'ombre du tableau. */
.pub-table-zone { overflow-x: auto; margin: 0 -3px; padding: 0 3px 4px; }
.pub-table td { vertical-align: top; }
.pub-table .pub-changes { width: 100%; }
.pub-nom { font-weight: 600; white-space: nowrap; }
.pub-statut {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  white-space: nowrap;
}
.pub-statut-nouveau { background: var(--accent-pale); color: var(--accent-fonce); }
.pub-statut-modifie { background: var(--warn-pale); color: var(--warn-ink); }
/* Tout retiré : l'agent risque de se présenter pour rien — c'est le cas qui crie. */
.pub-statut-retire { background: var(--bad-pale); color: var(--bad-ink); }
.pub-muet { color: var(--muted); font-size: var(--fs-sm); }
.pub-table .num b { font-weight: 600; }
.pub-total-avant { color: var(--muted); }
.pub-fleche { color: var(--muted-2); }
.pub-doc { white-space: nowrap; text-align: right; }
/* Le bouton fait 26 px de haut : sa zone de clic est portée à 40 px, sans déborder
   sur la ligne voisine (11 px de marge de cellule de part et d'autre). */
.pub-doc .btn-ghost-sm { position: relative; }
.pub-doc .btn-ghost-sm::after { content: ""; position: absolute; inset: -7px -4px; }
/* Le th porte le positionnement : sans lui, ce libellé hors champ se placerait par
   rapport à la page et l'élargirait quand le tableau défile. */
.pub-table th { position: relative; }
.pub-th-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Le détail repliable : « 2 ajoutées · 1 retirée », puis les lignes elles-mêmes. */
.pub-diff > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: var(--r-s);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease-out;
}
.pub-diff > summary::-webkit-details-marker { display: none; }
.pub-diff > summary:hover { color: var(--accent-fonce); }
.pub-diff .remp-chevron { margin-left: 0; font-size: 18px; }
.pub-diff[open] > summary .remp-chevron { transform: translateY(-1px) rotate(90deg); }
.pub-compte-plus { padding: 1px 7px; border-radius: var(--r-s); background: #fef9c3; }
.pub-compte-moins { color: var(--muted); }
.pub-sep { color: var(--muted-2); }
.pub-lignes { display: grid; gap: 3px; margin: 8px 0 2px; padding: 0; list-style: none; }
/* Étiquette, jour, horaire en colonnes fixes (elles s'alignent d'une ligne à l'autre) ;
   le lieu prend le reste, et passe dessous plutôt que de s'écraser quand la cellule
   est étroite. */
.pub-l {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 5px 9px;
  border-radius: var(--r-s);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.pub-l-plus { background: #fef9c3; }
.pub-l-moins { color: var(--muted); }
.pub-l-moins .pub-l-jour,
.pub-l-moins .pub-l-h,
.pub-l-moins .pub-l-lieu { text-decoration: line-through; text-decoration-color: var(--muted-2); }
.pub-l-tag {
  flex: 0 0 4.6rem;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.pub-l-plus .pub-l-tag { color: var(--warn-ink); }
.pub-l-jour { flex: 0 0 7.8rem; white-space: nowrap; }
.pub-l-h { flex: 0 0 7.4rem; white-space: nowrap; }
.pub-l-lieu { flex: 1 1 11rem; min-width: 0; }

/* --- À jour (replié) --- */
.pub-ajour-aide { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); text-wrap: pretty; }

/* ====================== Espace agent : « Mon planning » (lot C4, 22/10/2026) ======================
   Le planning PUBLIÉ de l'agent, sur son téléphone, d'une main : un mois = un titre, ses
   dates de publication, puis une liste par jour (jamais un tableau : rien ne déborde à
   375 px). Les jours de repos ne sont pas listés. Une ligne nouvelle depuis la version
   précédente porte le surligneur jaune pâle du PDF (nuance locale, comme .pub-l-plus) ET
   le mot « Nouveau » : jamais la couleur seule. Le mois dernier est replié en bas. */
.esp-mois + .esp-mois {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.esp-mois-tete { margin: 0 0 12px; }
.esp-mois-titre {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}
.esp-mois-dates {
  margin: 3px 0 0;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* « mis à jour le » : c'est ce que l'agent doit remarquer en revenant. */
.esp-mois-maj { color: var(--warn-ink); font-weight: 600; }

/* Le mois dernier, replié : toute la ligne d'en-tête se touche (44 px au moins). */
.esp-mois-passe > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 0;
  border-radius: var(--r-m);
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.esp-mois-passe > summary::-webkit-details-marker { display: none; }
.esp-mois-passe > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.esp-mois-passe[open] > summary { margin-bottom: 12px; }
.esp-mois-passe .esp-mois-titre { color: var(--ink-2); }
.esp-mois-tete-txt { min-width: 0; }
/* Chevron dessiné (deux bordures), pas un caractère : il tourne d'un quart de tour. */
.esp-chevron {
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate .2s cubic-bezier(.2, 0, 0, 1), translate .2s cubic-bezier(.2, 0, 0, 1);
}
.esp-mois-passe[open] .esp-chevron { rotate: 225deg; translate: 0 2px; }

/* Le mot « Nouveau » : texte ambre foncé sur ambre clair (contraste > 6:1). */
.esp-tag-nouveau {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--warn-bord);
  color: var(--warn-ink);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.45;
  text-transform: uppercase;
  vertical-align: 1px;
}
.esp-legende {
  margin: 0 0 12px;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
.esp-legende .esp-tag-nouveau { margin-right: 4px; }

/* Un jour : sa date en colonne fixe à gauche (le nom au-dessus, le numéro dessous),
   ses créneaux à droite. 4,6 rem tiennent « MERCREDI » sans rogner. */
.esp-jours { list-style: none; margin: 0; padding: 0; }
.esp-jour {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0 10px;
  padding: 10px 0;
}
.esp-jour:first-child { padding-top: 0; }
.esp-jour + .esp-jour { border-top: 1px solid var(--line); }
.esp-jour-date {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding-top: 5px;
  line-height: 1.2;
}
.esp-jour-nom {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.esp-jour-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.esp-creneaux {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Horaire et durée sur la première ligne, le lieu dessous (il peut être long). */
.esp-creneau {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1px 10px;
  padding: 5px 8px;
  border-radius: var(--r-m);
}
/* L'horaire ne se coupe jamais (« 14:00 → » / « 22:00 » se lirait mal) : sur un
   écran étroit, c'est l'étiquette « Nouveau » qui passe au-dessus. */
.esp-creneau-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.esp-creneau-plage { white-space: nowrap; }
.esp-creneau-duree {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.esp-creneau-lieu {
  grid-column: 1 / -1;
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.esp-creneau-nouveau {
  background: #fef9c3;                 /* surligneur pâle, celui de .pub-l-plus */
  box-shadow: inset 0 0 0 1px var(--warn-bord);
}
.esp-creneau-nouveau .esp-creneau-duree { color: var(--ink-2); }
/* Un jour d'absence (congé, maladie) : son code en ambre, comme dans le PDF. */
.esp-creneau-absence .esp-creneau-h { color: var(--warn-ink); }

.esp-note {
  margin: 10px 0 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* Ce qui a disparu depuis la version précédente : barré, gris, mais lisible. */
.esp-retirees { margin-top: 16px; }
.esp-retirees-titre {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-2);
}
.esp-retirees-liste { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.esp-retire {
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.esp-retire del { text-decoration-color: var(--muted-2); text-decoration-thickness: 1px; }
.esp-retire-jour { font-weight: 600; }

.esp-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--thead);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-body);
  color: var(--ink-2);
}
.esp-total b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* « Télécharger en PDF » (et « Revenir à mon espace ») : pleine largeur, 44 px. */
.esp-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  color: var(--accent-fonce);
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .12s ease-out, border-color .12s ease-out, scale .12s ease-out;
}
.esp-pdf:active { scale: .96; }
.esp-pdf:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
@media (hover: hover) {
  .esp-pdf:hover { border-color: var(--accent-bord); background: var(--accent-pale); }
  .esp-mois-passe > summary:hover .esp-chevron { border-color: var(--ink-2); }
}
.esp-retour { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .esp-chevron, .esp-pdf { transition: none; }
  .esp-pdf:active { scale: 1; }
}

/* ====================== Publication : prévenir les agents (lot C5, 22/10/2026) ======================
   La liste des agents de la DERNIÈRE publication du mois : ce qu'il a vu dans son espace
   (C4), quand Vai l'a prévenu, et les deux gestes (WhatsApp, copier). Rien ne part seul. */
.pub-suivi { margin-top: 28px; }
.pub-suivi-aide {
  max-width: 82ch;
  margin: -4px 0 12px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.pub-suivi-aide b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pub-suivi-table .pub-envoi { color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; }
.pub-vu {
  color: var(--ok-ink);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pub-pas-vu { color: var(--muted); white-space: nowrap; }
.pub-prevenu { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Les colonnes d'état restent sur une ligne ; la colonne des gestes prend le reste
   de la largeur (comme « Ce qui change » plus haut), et ses boutons passent l'un sous
   l'autre seulement si la place manque vraiment. */
.pub-suivi-table th,
.pub-suivi-table td:not(.pub-gestes) { white-space: nowrap; }
.pub-suivi-table .pub-gestes { width: 100%; min-width: 230px; }
.pub-gestes-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pub-prevenir { margin: 0; }
/* Boutons de 28 px : zone de clic portée à ~38 px, sans chevaucher le voisin (8 px
   d'écart, 3 px de débord de chaque côté). */
.pub-gestes-ligne .btn-wa,
.pub-gestes-ligne .btn-copier { position: relative; }
.pub-gestes-ligne .btn-wa::after,
.pub-gestes-ligne .btn-copier::after { content: ""; position: absolute; inset: -5px -3px; }
.pub-sans-numero { color: var(--muted); font-size: var(--fs-sm); }
.pub-sans-lien {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: var(--r-s);
  background: var(--warn-pale);
  color: var(--warn-ink);
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-wrap: pretty;
}
.pub-sans-lien a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pub-message { margin-top: 6px; }
.pub-message > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: var(--r-s);
  font-size: var(--fs-xs);
  color: var(--muted);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease-out;
}
.pub-message > summary::-webkit-details-marker { display: none; }
.pub-message > summary:hover { color: var(--accent-fonce); }
.pub-message .remp-chevron { margin-left: 0; font-size: 18px; }
.pub-message[open] > summary .remp-chevron { transform: translateY(-1px) rotate(90deg); }
.pub-message-txt {
  max-width: 62ch;
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-s);
  background: var(--thead);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-line;               /* le récapitulatif : une ligne par changement */
  overflow-wrap: anywhere;
}
/* Sorti de l'effectif depuis la publication : la trace reste, grisée, sans geste. */
.pub-sorti td, .pub-sorti .pub-nom { color: var(--muted); }
.pub-sorti-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--thead);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--muted);
}

/* ====================== Créneaux proposés aux agents (lot C2b, 22/10/2026) ======================
   Vai propose un créneau à pourvoir aux agents éligibles, qui se portent volontaires depuis
   leur espace ; c'est elle qui attribue. Le VERT de marque (--abc-vert, 5,1:1 sous du blanc)
   signale ce qui attend sa décision : la pastille du menu, le point de la ligne repliée, le
   bloc des volontaires. Le violet reste l'action (« Proposer »), comme partout. */

/* --- La pastille verte du menu, à côté de la bulle rouge --- */
.side-badge + .side-badge { margin-left: -6px; }   /* 11 px d'écart de l'item - 6 = 5 px */
.side-badge-volontaires { background: var(--abc-vert); }
.side-item.actif .side-badge-volontaires { background: #fff; color: var(--abc-vert); }
/* Menu replié : la rouge se pose en haut de l'icône, la verte en bas. */
.shell.collapsed .side-badge-volontaires { top: auto; bottom: 2px; }

/* --- Sur la ligne du créneau : « Proposé le 22/10 à 5 agents · 2 volontaires » --- */
.offre-etat {
  flex-basis: 100%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.offre-point {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}
.offre-etat.a-decider { color: var(--ok-ink); }
.offre-etat.a-decider .offre-point {
  background: var(--abc-vert);
  box-shadow: 0 0 0 3px rgba(7, 126, 76, .16);
}
@media (min-width: 1100px) {
  .vue-remplacement .offre-etat { grid-column: 2 / -1; }
}
/* Repère du retour après un geste (#vac-<id>) : rien à voir, il ne fait que viser. */
.offre-ancre { display: block; height: 0; }

/* --- La proposition en cours : volontaires puis agents sollicités --- */
.offre-suivi {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--abc-vert);
  border-radius: var(--r-l);
  background: var(--card);
}
.offre-bloc + .offre-bloc {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.offre-titre { margin: 0 0 6px; font-size: var(--fs-body); color: var(--ok-ink); }
.offre-bloc + .offre-bloc .offre-titre { color: var(--ink-2); }
.offre-vide {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.offre-volontaires,
.offre-sollicites { list-style: none; margin: 0; padding: 0; }
.offre-volontaires li,
.offre-sollicites li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.offre-volontaires li:last-child,
.offre-sollicites li:last-child { border-bottom: none; }
.offre-volontaires .motif { color: var(--muted); font-size: var(--fs-sm); }
.offre-vol-ecarte > b { color: var(--ink-2); }
.offre-volontaires .remp-actions .form-affecter,
.offre-volontaires .remp-actions .form-forcer { margin-left: 0; }
.offre-nom { min-width: 0; overflow-wrap: anywhere; }
.offre-meta { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.offre-vu { color: var(--ok-ink); font-weight: 600; }
.offre-sans-numero { color: var(--muted); font-size: var(--fs-sm); }
.offre-sorti > b { color: var(--muted); }
.offre-prevenir { margin: 0; }
/* Boutons de 28 px : zone de clic portée à ~38 px sans chevaucher le voisin. */
.offre-gestes .btn-wa,
.offre-gestes .btn-copier { position: relative; }
.offre-gestes .btn-wa::after,
.offre-gestes .btn-copier::after { content: ""; position: absolute; inset: -5px -3px; }

/* Réponse d'un agent, et étiquette dans la liste des éligibles : jamais la couleur
   seule, le mot est toujours écrit. */
.offre-rep,
.offre-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.offre-rep-volontaire,
.offre-tag-volontaire { background: var(--ok-pale); color: var(--ok-ink); }
.offre-rep-indisponible,
.offre-tag-indisponible { background: var(--thead); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.offre-rep-attente { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.offre-tag-sollicite { background: var(--accent-pale); color: var(--accent-fonce); }
.offre-tag-sans-lien { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.offre-tag-ecarte { background: var(--warn-pale); color: var(--warn-ink); }

.offre-retirer { display: flex; justify-content: flex-end; margin: 10px 0 0; }
.btn-retirer-offre {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--bad-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--r-s);
  cursor: pointer;
  transition: border-color .12s ease-out, background-color .12s ease-out, scale .12s ease-out;
}
.btn-retirer-offre:hover { border-color: var(--bad-bord); background: var(--bad-pale); }

/* --- Les cases « proposer » devant chaque éligible --- */
.offre-coche {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px 0;
  border-radius: var(--r-s);
  cursor: pointer;
}
.offre-coche::after { content: ""; position: absolute; inset: -6px -4px; }   /* ~36 x 40 px */
.offre-coche input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.offre-coche input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.offre-coche:has(input:disabled) { cursor: not-allowed; }
.offre-coche input:disabled { cursor: not-allowed; opacity: .45; }
@media (hover: hover) {
  .offre-coche:has(input:not(:disabled)):hover { background: var(--accent-pale); }
}
.offre-coche-fait { cursor: default; }
.offre-coche-fait svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--abc-vert);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Avec la case, le message et la pastille « au-delà du contrat » repassent à la
   ligne SOUS LE NOM (case 28 + 9, rang 22 + 9 = 68 px), comme sans elle. */
.remp-classement.offre-cases .remp-msg { padding-left: 68px; }
.remp-classement.offre-cases li:has(.remp-au-dela) { padding-left: 68px; }
.remp-classement.offre-cases li:has(.remp-au-dela) .offre-coche { margin-left: -68px; }
.remp-classement.offre-cases li:has(.remp-au-dela) .remp-rang { margin-left: 0; }
.remp-classement.offre-cases li:has(.remp-au-dela) .remp-msg { padding-left: 0; }

.offre-proposer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 10px 0 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.btn-proposer {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 7px 14px;
  border-radius: var(--r-s);
  cursor: pointer;
  transition: background-color .12s ease-out, scale .12s ease-out;
}
.btn-proposer:hover { background: var(--accent-fonce); }
.btn-proposer:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-proposer:disabled { background: var(--muted-2); cursor: not-allowed; }
.btn-proposer:not(:disabled):active,
.btn-retirer-offre:active { scale: .96; }
.offre-aide {
  flex: 1 1 22rem;
  margin: 0;
  max-width: 72ch;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.offre-aide-seule { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .btn-proposer, .btn-retirer-offre { transition: none; }
  .btn-proposer:not(:disabled):active, .btn-retirer-offre:active { scale: 1; }
}

/* ====================== Espace agent : « Postes proposés » (lot C2b) ======================
   En tête de la page, seulement s'il y en a : c'est la seule partie qui attend une
   réponse. Un poste = un bloc teinté (pas une carte dans la carte), le créneau, la
   prime s'il la déclenche, deux boutons de 44 px. Téléphone d'abord, d'une main. */
.esp-postes-intro {
  margin: -4px 0 14px;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.esp-postes-liste { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.esp-poste {
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-l);
  background: var(--accent-pale);
  box-shadow: inset 0 0 0 1px var(--accent-bord);
}
/* Le jour ne se coupe jamais (« Samedi » / « 16/11 ») : faute de place, c'est
   l'étiquette d'état qui passe dessous. */
.esp-poste-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}
.esp-poste-jour {
  margin: 0;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.esp-poste-statut {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  white-space: nowrap;
}
.esp-poste-statut.volontaire { background: var(--ok-pale); color: var(--ok-ink); }
.esp-poste-statut.indispo,
.esp-poste-statut.pourvu { background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.esp-poste-statut.attribue { background: var(--abc-vert); color: #fff; }
.esp-poste-h {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.esp-poste-lieu {
  margin: 2px 0 0;
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.esp-poste-prime {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--warn-ink);
}
.esp-poste-prime::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pp);
}
.esp-poste-note {
  margin: 8px 0 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}
/* Déjà pourvu : l'information reste lisible, le bloc s'éteint. Attribué : vert. */
.esp-poste-deja_pourvu { background: var(--thead); box-shadow: inset 0 0 0 1px var(--line); }
.esp-poste-deja_pourvu .esp-poste-jour,
.esp-poste-deja_pourvu .esp-poste-h,
.esp-poste-deja_pourvu .esp-poste-lieu { color: var(--muted); }
.esp-poste-attribue { background: var(--ok-pale); box-shadow: inset 0 0 0 1px var(--ok-bord); }
.esp-poste-attribue .esp-poste-note { color: var(--ok-ink); font-weight: 600; }

/* Côte à côte quand chaque libellé tient sur UNE ligne (≈ 11,5 rem), l'un sous
   l'autre sinon : sur un téléphone de 375 px, deux boutons de 136 px coupaient
   « Je suis volontaire » en deux lignes. */
.esp-poste-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.esp-rep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-m);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color .12s ease-out, color .12s ease-out,
              box-shadow .12s ease-out, scale .12s cubic-bezier(.2, 0, 0, 1);
}
.esp-rep:active { scale: .96; }
.esp-rep:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.esp-rep-oui { background: var(--accent); color: #fff; }
.esp-rep-non { background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--accent-bord); }
/* La réponse donnée se voit sur le bouton : coche sur « volontaire » ; « pas
   disponible » choisi passe en plein, et « volontaire » redevient un simple choix. */
.esp-rep-coche {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.esp-rep-oui.est-choisi { background: var(--accent-fonce); }
.esp-rep-oui.est-choisi .esp-rep-coche { display: inline-block; }
.esp-rep-non.est-choisi { background: var(--ink-2); color: #fff; box-shadow: none; }
.esp-poste-form:has(.esp-rep-non.est-choisi) .esp-rep-oui {
  background: var(--card);
  color: var(--accent-fonce);
  box-shadow: inset 0 0 0 1px var(--accent-bord);
}
@media (hover: hover) {
  .esp-rep-oui:hover { background: var(--accent-fonce); }
  .esp-rep-non:not(.est-choisi):hover { box-shadow: inset 0 0 0 1px var(--accent); }
  .esp-poste-form:has(.esp-rep-non.est-choisi) .esp-rep-oui:hover { background: var(--card); box-shadow: inset 0 0 0 1px var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  .esp-rep { transition: none; }
  .esp-rep:active { scale: 1; }
}

/* ====================== Historique et état de la période (lot C6, 22/10/2026) ======================
   « Le planning fait preuve au moment des paies » (Vai, Omar). Deux écrans :
   - l'HISTORIQUE : le journal de toutes les écritures, en lecture seule. Une ligne par
     écriture, regroupées par jour ; l'heure en colonne, un petit carré arrondi (la
     forme du logo) dit l'action — vert créé, violet modifié, rouge supprimé — et le
     changement se lit « avant → après » ;
   - l'encadré « État de la période de paie » de l'écran Paie / heures : ouverte, ou
     finie (avertissement, rien n'est bloqué). */

/* --- Filtres : une seule rangée sur grand écran, qui se replie --- */
.hist-filtres {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(150px, 170px)) minmax(180px, 1.4fr) auto;
  align-items: end;
  gap: 12px 16px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.hist-filtres .form-group { margin: 0; min-width: 0; }
.hist-filtres .form-input { font-variant-numeric: tabular-nums; }
.hist-filtres-actions { display: flex; align-items: center; gap: 8px; }
.hist-filtres-actions .btn-ghost-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.hist-filtres-aide { grid-column: 1 / -1; margin: 0; }

/* --- Résultats --- */
.hist-resultats { margin-top: 20px; }
.hist-resultats-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 28px;
}
.hist-compte { margin: 0; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Le titre du jour reste visible pendant qu'on fait défiler ses lignes : sur une
   journée de déroulé de trame, des dizaines d'écritures se suivent. */
.hist-jour { margin-top: 14px; }
.hist-jour-titre {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 8px 2px;
  background: var(--bg);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.hist-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.hist-ligne {
  display: grid;
  grid-template-columns: 44px 8px minmax(0, 1fr);
  column-gap: 12px;
  padding: 12px 18px 13px 16px;
}
.hist-ligne + .hist-ligne { border-top: 1px solid var(--line); }
.hist-heure {
  padding-top: 1px;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* Centré sur la première ligne du texte (14 px × 1,4) : 8 px de carré à 6 px du haut. */
.hist-marque {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--muted-2);
}
.hist-creation .hist-marque { background: var(--ok); }
.hist-modification .hist-marque { background: var(--accent); }
.hist-suppression .hist-marque { background: var(--bad); }
.hist-corps { min-width: 0; }
.hist-quoi {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.hist-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
}
.hist-qui { color: var(--ink-2); font-weight: 600; overflow-wrap: break-word; }
.hist-auteur { min-width: 0; }
.hist-jours { font-variant-numeric: tabular-nums; }
.hist-jours-lbl {
  margin-right: 4px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
/* Le motif d'une écriture (dérogations, lot C7) : la voix de la planificatrice. */
.hist-motif { margin: 6px 0 0; font-size: var(--fs-sm); font-style: italic; color: var(--ink-2); text-wrap: pretty; }

/* « Champ : avant → après », deux colonnes alignées. Fond pâle et rayon plus petit que
   la liste : un détail posé dans la ligne, pas une carte de plus. */
.hist-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 14px;
  margin: 8px 0 0;
  padding: 8px 12px;
  background: var(--thead);
  border-radius: var(--r-m);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.hist-detail { display: contents; }
.hist-details dt { color: var(--muted); }
.hist-details dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
.hist-avant { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.hist-fleche { color: var(--muted-2); white-space: pre; }
.hist-apres { font-weight: 600; }

/* Création et suppression : valeurs repliées (un déroulé en pose des centaines). */
.hist-repli { margin-top: 4px; }
.hist-repli > summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-fonce);
  cursor: pointer;
  border-radius: var(--r-s);
}
.hist-repli > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.hist-repli > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hist-repli .hist-details { margin-top: 4px; }

.hist-vide {
  margin-top: 14px;
  padding: 28px 22px;
  border: 1px dashed var(--line);
  border-radius: var(--r-l);
  background: var(--card);
  text-align: center;
}
.hist-vide h2 { margin: 0 0 6px; font-size: 17px; }
.hist-vide p { margin: 0 auto; max-width: 62ch; color: var(--muted); font-size: var(--fs-body); text-wrap: pretty; }
.hist-suite { display: flex; justify-content: center; margin-top: 18px; }

@media (max-width: 1100px) {
  .hist-filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-filtres-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .hist-filtres { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .hist-ligne { grid-template-columns: 38px 8px minmax(0, 1fr); column-gap: 10px; padding: 12px; }
  .hist-details { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hist-details dd + dt { margin-top: 6px; }
}

/* --- État de la période de paie (écran Paie / heures) --- */
/* « Afficher » ramène à l'encadré : un peu d'air au-dessus de lui. */
.etat-periode { scroll-margin-top: 16px; }
.etat-periode-choix { align-items: flex-end; flex-wrap: wrap; gap: 12px 16px; margin-top: 14px; }
.etat-periode-choix .form-group { flex: 0 1 320px; margin-bottom: 0; }
.etat-periode-choix .form-select { font-variant-numeric: tabular-nums; }
.etat-periode-carte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-l);
  background: var(--thead);
  box-shadow: inset 0 0 0 1px var(--line);
}
.etat-periode-carte.est-finie { background: var(--accent-pale); box-shadow: inset 0 0 0 1px var(--accent-bord); }
/* Le texte cède la place, le bouton jamais. */
.etat-periode-txt { flex: 1 1 320px; min-width: 0; }
.etat-periode-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.etat-periode-mois { font-size: 16px; color: var(--ink); }
/* Contour en ombre intérieure, pas en bordure : les deux états gardent la même hauteur. */
.etat-periode-pastille {
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.etat-periode-pastille.est-ouverte { background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.etat-periode-pastille.est-finie { background: var(--accent); color: #fff; }
.etat-periode-detail { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; text-wrap: pretty; }
/* --muted tombe sous 4,5:1 sur le fond pâle violet : le texte prend la teinte du fond. */
.etat-periode-carte.est-finie .etat-periode-detail { color: var(--accent-fonce); }
.etat-periode-carte .etat-periode-detail.est-alerte { color: var(--warn-ink); }
.etat-periode-geste { margin: 0; }
.etat-periode-geste .btn { min-height: 40px; }
.etat-periode-liste { margin: 12px 0 0; }

/* Grille de la trame : une écriture qui touche une période de paie déclarée finie
   passe, et la réponse le signale (relecture du lot C6). Le message suit le succès,
   en ambre comme l'avertissement des pages (.flash-warn) : tons de la charte. */
.trame-toast.trame-toast-warning { background: var(--warn-pale); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn-bord); text-wrap: pretty; }

/* ====================== Période de paie close (lot C7, 22/10/2026) ======================
   La paie faite, la période se CLÔT : toute modification d'un créneau ou d'une absence
   qui la touche est refusée, sauf pendant une DÉROGATION motivée (trente minutes, tracée
   au journal). L'encadré « État de la période » de Paie / heures en porte les gestes, la
   dérive des chiffres et le récapitulatif pour le RH ; un bandeau ambre, sur chaque page,
   dit qu'une dérogation court. Tons de la charte : l'encre (--ink) pour ce qui est clos,
   l'ambre (--warn) pour l'exception en cours — la même voix que les avertissements. */

/* --- La carte d'état : « close » prend l'encre, la couleur du définitif --- */
.etat-periode-carte.est-close { background: var(--thead); box-shadow: inset 0 0 0 1px var(--muted-2); }
.etat-periode-pastille.est-close { display: inline-flex; align-items: center; gap: 5px; background: var(--ink); color: #fff; }
.etat-periode-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.etat-periode-gestes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* --- La dérogation en cours : l'exception, en ambre, avec de quoi la refermer --- */
.etat-periode-derogation {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin-top: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--r-l);
  background: var(--warn-pale);
  box-shadow: inset 0 0 0 1px var(--warn-bord);
  color: var(--warn-ink);
}
.etat-periode-derogation-ico {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.etat-periode-derogation-txt { flex: 1 1 280px; min-width: 0; }
.etat-periode-derogation-titre { margin: 0; font-size: var(--fs-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.etat-periode-derogation-motif { margin: 2px 0 0; font-size: var(--fs-sm); font-style: italic; overflow-wrap: break-word; text-wrap: pretty; }
/* Sur l'ambre, le gris de détail passe sous 4,5:1 : il prend l'encre de l'ambre. */
.etat-periode-derogation .etat-periode-detail { color: var(--warn-ink); }
.etat-periode-derogation .btn { min-height: 40px; }

/* --- Les deux gestes motivés : un repli chacun, le motif s'écrit dessous --- */
.etat-periode-motifs { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 12px; }
.etat-periode-motif[open] { flex-basis: 100%; }
.etat-periode-motif > summary { list-style: none; min-height: 40px; user-select: none; }
.etat-periode-motif > summary::-webkit-details-marker { display: none; }
.etat-periode-motif[open] > summary.btn-primary { background: var(--accent-fonce); }
.etat-periode-motif[open] > summary.btn-neutre { border-color: var(--ink); }
.etat-periode-motif-form {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-width: 640px;
  margin-top: 10px;
  padding: 14px 16px 16px;
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card);
}
.etat-periode-motif-form .form-label { margin: 0; }
.etat-periode-motif-form textarea { min-height: 64px; resize: vertical; text-wrap: pretty; }
.etat-periode-motif-form .form-hint { margin: 0 0 6px; }
.etat-periode-motif-form .btn { min-height: 40px; }
/* Le seul mouvement de l'encadré : le formulaire glisse en place quand on déplie. */
.etat-periode-motif[open] > .etat-periode-motif-form { animation: etat-periode-deplier .18s cubic-bezier(.2, 0, 0, 1); }
@keyframes etat-periode-deplier { from { opacity: 0; translate: 0 -4px; } }

/* --- La dérive des chiffres : ambre aussi — une paie transmise qui ne dit plus vrai --- */
.etat-periode-derive {
  margin-top: 16px;
  padding: 2px 16px 14px;
  border-radius: var(--r-l);
  background: var(--warn-pale);
  box-shadow: inset 0 0 0 1px var(--warn-bord);
  color: var(--warn-ink);
}
.etat-periode-derive-titre {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: var(--fs-body);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  text-wrap: balance;
}
.etat-periode-derive-titre::-webkit-details-marker { display: none; }
.etat-periode-derive-titre:hover { text-decoration: underline; text-underline-offset: 3px; }
.etat-periode-derive .etat-periode-ico { width: 16px; height: 16px; }
.etat-periode-derive .etat-periode-detail { margin: 0 0 10px; color: var(--warn-ink); }
.etat-periode-derive-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 0;
}
/* Rayon concentrique : le détail (r-m) dans l'encart (r-l). */
.etat-periode-derive-agent {
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--warn-bord);
}
.etat-periode-derive-agent dt { font-size: var(--fs-sm); font-weight: 700; overflow-wrap: break-word; }
.etat-periode-derive-agent dd { margin: 4px 0 0; }
.etat-periode-derive-agent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.etat-periode-derive-agent li { font-size: var(--fs-sm); line-height: 1.45; font-variant-numeric: tabular-nums; }
.etat-periode-derive-chiffre { color: var(--muted); }
.etat-periode-stable { margin: 14px 0 0; font-size: var(--fs-sm); color: var(--ok-ink); }

/* --- Le récapitulatif « Modifié depuis la clôture » (pour le RH, la compta) --- */
.etat-periode-recap { margin-top: 20px; }
.etat-periode-recap-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.etat-periode-recap-titre { margin: 0; font-size: var(--fs-body); font-weight: 700; color: var(--ink); text-wrap: balance; }
.etat-periode-compte { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.etat-periode-recap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.etat-periode-recap-actions .btn { min-height: 40px; }
/* La liste de l'Historique, posée dans l'encadré : sans ombre (elle est déjà dans une
   carte), la date entière dans la première colonne, et un plafond de hauteur — une
   dérogation peut couvrir un déroulé entier. */
.etat-periode-recap-liste { margin-top: 10px; box-shadow: none; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.etat-periode-recap-liste .hist-ligne { grid-template-columns: 118px 8px minmax(0, 1fr); }
.etat-periode-recap-liste .est-geste { background: var(--thead); }
.etat-periode-recap-liste .est-geste .hist-quoi { color: var(--ink-2); }
.etat-periode-recap-vide { margin: 10px 0 0; padding: 14px 16px; border-radius: var(--r-l); background: var(--thead); font-size: var(--fs-sm); color: var(--muted); }

/* Les gestes sur une période, à l'Historique comme au récapitulatif : l'encre pour la
   clôture, l'ambre pour l'exception (dérogation, réouverture), le gris pour sa fin. */
.hist-cloture .hist-marque { background: var(--ink); }
.hist-reouverture .hist-marque,
.hist-derogation_ouverte .hist-marque { background: var(--warn); }
.hist-derogation_refermee .hist-marque,
.hist-derogation_expiree .hist-marque { background: var(--muted-2); }

/* --- Le bandeau de toutes les pages, tant qu'une dérogation court --- */
.bandeau-derogation { display: grid; gap: 8px; margin: 0 0 16px; }
.bandeau-derogation-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-l);
  background: var(--warn-pale);
  box-shadow: inset 0 0 0 1px var(--warn-bord), var(--shadow-card);
  color: var(--warn-ink);
}
.bandeau-derogation-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bandeau-derogation-txt { flex: 1 1 320px; min-width: 0; margin: 0; font-size: var(--fs-sm); line-height: 1.45; text-wrap: pretty; font-variant-numeric: tabular-nums; }
.bandeau-derogation-motif { overflow-wrap: break-word; }
.bandeau-derogation-geste { margin: 0; }
/* Rayon concentrique : le bouton (r-s) dans le bandeau (r-l), 8 px d'écart autour. */
.bandeau-derogation-geste .btn { min-height: 36px; border-radius: var(--r-s); }

@media (max-width: 560px) {
  .etat-periode-recap-liste .hist-ligne { grid-template-columns: 8px minmax(0, 1fr); }
  .etat-periode-recap-liste .hist-heure { grid-column: 1 / -1; }
  .etat-periode-derive-liste { grid-template-columns: minmax(0, 1fr); }
  .bandeau-derogation-geste { flex: 1 1 100%; }
  .bandeau-derogation-geste .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .etat-periode-motif[open] > .etat-periode-motif-form { animation: none; }
}

/* --------------------------------------------------------------------------
   Pages d'erreur maison : 404, 405, 500 (lot dettes, 23/10/2026). La carte .mes-*
   de la connexion, un titre, une phrase, au plus un bouton. Le bouton entre juste
   apres l'en-tete, au second temps de l'entree echelonnee de ses jumeaux.
   -------------------------------------------------------------------------- */
/* Sans bouton (adresse inconnue de l'espace agent), l'en-tete clot la carte : sa
   marge basse doublerait le rembourrage de la carte. */
.err-carte .mes-head:last-child { margin-bottom: 0; }
.err-actions { animation: mes-entree .45s cubic-bezier(.16, 1, .3, 1) .07s both; }
@media (prefers-reduced-motion: reduce) {
  .err-actions { animation: none; }
}

/* Historique : le titre « Ce qui a changé » d'une modification, affichée à plat. Même
   taille, même graisse et même place que le <summary> d'une création repliée, mais en
   gris : il ne s'ouvre pas, il ne doit pas ressembler à un lien. */
.hist-details-titre {
  margin: 6px 0 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
}
.hist-details-titre + .hist-details { margin-top: 4px; }
