@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/polices/open-sans-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --encre: #1f2733;
  --encre-2: #56637a;
  --discret: #8793a6;
  --trait: #edf0f5;
  --trait-fort: #d6dce6;
  --menu: #0a2e63;
  --menu-fonce: #072349;
  --menu-texte: #a9bbdc;
  --menu-clair: #e3ebf8;
  --menu-actif: #45d3a8;
  /* Vert (accent) et bleu marine (menu, couleur secondaire). */
  --accent: #0e8668;
  --accent-fonce: #0b6e56;
  --accent-fond: #e2f4ee;
  --marine: #093672;
  --marine-fond: #e6ecf6;
  --graphe: #0e7572;
  --d-vert: linear-gradient(-135deg, #17a682 0%, #0e7572 100%);
  --d-marine: linear-gradient(-135deg, #2c5fb0 0%, #093672 100%);
  --d-rouge: linear-gradient(-135deg, #f48f36 0%, #f44236 100%);
  --d-ambre: linear-gradient(-135deg, #f9d423 0%, #fab219 100%);
  --d-bon: linear-gradient(-135deg, #7ed957 0%, #0ca30c 100%);
  --survol: rgba(14, 134, 104, 0.06);
  --ombre: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
  --ombre-haute: 0 8px 34px 0 rgba(69, 90, 100, 0.2);
  --bon: #0ca30c;
  --attention: #fab219;
  --critique: #d03b3b;
  --bon-fond: #e1f6e1;
  --bon-texte: #006300;
  --attention-fond: #fdf0cf;
  --attention-texte: #6b4a00;
  --critique-fond: #fbe4e4;
  --critique-texte: #9c2222;
  --neutre-fond: #eef1f5;
  --rayon: 5px;
  /* Échelle d'affichage du back-office (1 = taille réelle). Les hauteurs en vh sont divisées par cette valeur. */
  --zoom: 1;
}
/* Échelle réduite seulement sur grand écran d'ordinateur ; téléphone et tablette restent en taille réelle. */
@media (min-width: 1280px) {
  :root { --zoom: 0.67; }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #1c2230;
  --surface: #272e3f;
  --surface-2: #212838;
  --encre: #f1f4f9;
  --encre-2: #b9c3d6;
  --discret: #8793a6;
  --trait: #333c50;
  --trait-fort: #465168;
  --menu: #232a3a;
  --menu-fonce: #1b2130;
  --accent-fonce: #4fd1a5;
  --accent-fond: #12362e;
  --marine: #8fb0ea;
  --marine-fond: #1c2f52;
  --graphe: #2bb39a;
  --survol: rgba(255, 255, 255, 0.04);
  --ombre: 0 1px 20px 0 rgba(0, 0, 0, 0.25);
  --ombre-haute: 0 8px 34px 0 rgba(0, 0, 0, 0.5);
  --bon-fond: #173a1c;
  --bon-texte: #7fd67f;
  --attention-fond: #3f3210;
  --attention-texte: #fab219;
  --critique-fond: #472023;
  --critique-texte: #f3a3a3;
  --neutre-fond: #333c50;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--encre);
  font: 14px/1.5 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.admin, body.connexion { zoom: var(--zoom); }

a { color: var(--accent-fonce); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; font-weight: 400; }
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-bottom: 16px; }
small { font-size: 12px; }
kbd {
  font: 600 11px "Open Sans", system-ui, sans-serif;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--trait-fort);
  background: var(--surface);
  color: var(--encre-2);
}
.icone { flex: none; }
.discret, .aide, .mention, .vide { color: var(--discret); }
.aide, .mention { font-size: 13px; }

/* ---------- Structure : menu latéral, barre du haut, contenu ---------- */

.appli {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh / var(--zoom));
  transition: grid-template-columns 0.25s ease;
}
.menu {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh / var(--zoom));
  background: var(--menu);
  color: var(--menu-texte);
  box-shadow: 1px 0 20px 0 rgba(9, 54, 114, 0.3);
  overflow: hidden;
  z-index: 9;
}
.menu .marque {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 16px 12px 4px 16px;
  flex: none;
}
/* Le logo est toujours posé sur une plaque blanche. */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.45);
  color: #093672;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
a.logo:hover { text-decoration: none; }
.marque-texte {
  grid-column: 1 / -1;
  color: var(--menu-texte);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.menu-bouton { display: grid; padding: 6px; border: none; border-radius: 4px; background: none; color: var(--menu-texte); cursor: pointer; }
.menu-bouton:hover { background: var(--menu-fonce); color: #fff; }
.menu nav { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.menu-section { display: flex; flex-direction: column; }
.menu-titre {
  padding: 22px 22px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--menu-clair);
}
.menu nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 22px;
  color: var(--menu-texte);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.menu nav a:hover { color: var(--menu-actif); text-decoration: none; }
.menu nav a.active { background: var(--menu-fonce); color: var(--menu-actif); }
.menu nav a.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--menu-actif); }
.menu-libelle { flex: 1; }
.menu-compteur {
  min-width: 24px;
  padding: 0 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 19px;
  text-align: center;
}
.menu-compteur.attention { background: #f44236; }
/* Menu replié (grand écran seulement : sur téléphone et tablette, le menu est escamotable). */
@media (min-width: 1025px) {
  .menu-replie .appli { grid-template-columns: 76px minmax(0, 1fr); }
  .menu-replie .menu-bouton .icone { transform: scaleX(-1); }
  .menu-replie .menu .marque { grid-template-columns: auto; justify-items: center; gap: 6px; padding: 14px 0 0; }
  .menu-replie .logo { padding: 8px; }
  .menu-replie .logo span,
  .menu-replie .marque-texte,
  .menu-replie .menu-libelle,
  .menu-replie .menu-compteur,
  .menu-replie .menu-titre { display: none; }
  .menu-replie .menu nav a { justify-content: center; padding: 14px 0; }
}
/* Bouton ☰ et voile du menu escamotable : cachés sur grand écran. */
.ouvrir-menu, .voile { display: none; }

.contenu { min-width: 0; display: flex; flex-direction: column; }
.barre-haut {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 70px;
  padding: 0 30px;
  background: var(--page);
}
.fil { display: flex; align-items: center; gap: 8px; color: var(--discret); font-size: 13px; white-space: nowrap; }
.fil a { display: grid; color: var(--discret); }
.fil strong { color: var(--encre); font-weight: 600; }
.recherche-rapide {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 420px;
  margin-left: 18px;
  margin-right: auto;
  padding: 8px 10px 8px 13px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--ombre);
  color: var(--discret);
  font: inherit;
  cursor: pointer;
}
.recherche-rapide span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recherche-rapide:hover { border-color: var(--accent); }
.barre-date { color: var(--encre-2); font-size: 13px; white-space: nowrap; }
.bouton-icone,
.notifications .deroulant-bouton {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--encre-2);
  font: inherit;
  cursor: pointer;
}
.bouton-icone:hover,
.notifications .deroulant-bouton:hover,
.notifications.ouvert .deroulant-bouton { background: var(--surface); color: var(--accent-fonce); }
.theme-clair, .theme-sombre { display: grid; }
:root[data-theme='dark'] .theme-clair, :root:not([data-theme='dark']) .theme-sombre { display: none; }
.deroulant { position: relative; }
.pastille-nombre {
  position: absolute;
  top: -2px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f44236;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.deroulant-panneau { display: none; }
.deroulant.ouvert .deroulant-panneau {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 400px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-haute);
  animation: monter 0.2s ease-out both;
}
.notifications .entete-carte { margin-bottom: 4px; }
.notifications .deroulant-bouton.avatar.profil,
.notifications .deroulant-bouton.avatar.profil:hover { background: var(--d-marine); color: #fff; font-size: 12px; font-weight: 700; }
.notifications.compte.ouvert .deroulant-panneau { width: 250px; }
.notifications.compte .deroulant-panneau strong { font-weight: 600; }
.notifications.compte .deroulant-panneau .discret { margin: -6px 0 6px; font-size: 12px; }
.notifications.compte .bouton { width: 100%; }

main { padding: 8px 30px 50px; min-width: 0; }

/* Titre de page : titre à gauche, boutons à droite. Le premier de la page est le plus grand. */
.titre-liste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.titre-liste > h2, .titre-liste > div:first-child { margin: 0 auto 0 0; }
.titre-liste h2 { margin-bottom: 0; font-size: 18px; }
main > .titre-liste:first-of-type h2 { font-size: 22px; }
.titre-liste > div:first-child .discret { display: block; margin-top: 2px; font-size: 13px; }
.titre-liste h2 a { color: var(--discret); }
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hors-impression > .titre-liste { margin-top: 34px; }
main h2[id], main > h2, .hors-impression > h2 { margin: 30px 0 14px; font-size: 18px; scroll-margin-top: 90px; }

.message { margin: 0 0 20px; padding: 10px 12px; border-radius: var(--rayon); font-size: 13px; }
.message.ok { background: var(--bon-fond); color: var(--bon-texte); }
.message.err { background: var(--critique-fond); color: var(--critique-texte); }
.message.info { display: flex; align-items: center; gap: 8px; background: var(--marine-fond); color: var(--marine); }
.avertissement { margin: 0; padding: 10px 12px; border-radius: var(--rayon); font-size: 13px; }
.avertissement.critique { background: var(--critique-fond); color: var(--critique-texte); }

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

.carte, .defilement {
  background: var(--surface);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
.carte { padding: 22px 25px; margin-bottom: 30px; }
.entete-carte { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.entete-carte h2 { margin: 0; }
.entete-carte .discret { font-size: 13px; }
.lien-carte { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
/* Trait vert à gauche du titre de carte */
.titre-barre, .carte > h2:first-child { position: relative; }
.titre-barre::before, .carte > h2:first-child::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 1px;
  width: 4px;
  height: 22px;
  background: var(--accent);
}
.indicateur > h2:first-child::before { content: none; }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 30px; margin-bottom: 30px; }
.bento > .carte { margin: 0; animation: monter 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.bento > :nth-child(2) { animation-delay: 0.05s; }
.bento > :nth-child(3) { animation-delay: 0.1s; }
.bento > :nth-child(n + 4) { animation-delay: 0.15s; }
.b-3 { grid-column: span 3; }
.b-4 { grid-column: span 4; }
.b-6 { grid-column: span 6; }
.b-8 { grid-column: span 8; }
.b-12 { grid-column: span 12; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 30px; align-items: start; }

@keyframes monter { from { opacity: 0; transform: translateY(14px); } }
@keyframes etirer { from { transform: scaleX(0); } }
@keyframes pouls {
  0% { box-shadow: 0 0 0 0 rgba(14, 134, 104, 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(14, 134, 104, 0); }
}

/* ---------- Chiffres clés ---------- */

.etiquette { font-size: 14px; color: var(--encre-2); }
.indicateur h2 { margin-bottom: 14px; }
.indicateur-ligne { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.indicateur-ligne strong { flex: 1; font-size: 27px; font-weight: 300; white-space: nowrap; font-variant-numeric: tabular-nums; }
.indicateur-ligne strong em { font-style: normal; font-size: 16px; color: var(--discret); }
.indicateur-icone { display: grid; }
.indicateur-icone.accent { color: var(--accent); }
.indicateur-icone.critique { color: #f44236; }
.indicateur-icone.marine { color: var(--marine); }
.indicateur-icone.attention { color: var(--attention); }
.indicateur-part { color: var(--encre-2); font-size: 13px; white-space: nowrap; }
.indicateur small { display: block; margin-top: 8px; }
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 30px; margin-bottom: 30px; }
.indicateurs > .carte { margin: 0; }
.tendance { font-weight: 600; }
.tendance.hausse { color: var(--bon-texte); }
.tendance.baisse { color: var(--critique-texte); }

.progression { display: block; height: 7px; background: var(--neutre-fond); overflow: hidden; margin: 12px 0 0; }
.progression > span {
  display: block;
  height: 100%;
  background: var(--d-vert);
  box-shadow: 0 6px 10px -3px rgba(14, 134, 104, 0.45);
  transform-origin: left;
  animation: etirer 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.progression > span.marine { background: var(--d-marine); }
.progression > span.critique { background: var(--d-rouge); }
.progression > span.attention { background: var(--d-ambre); }
.progression > span.bon { background: var(--d-bon); }

.direct { display: inline-flex; align-items: center; gap: 8px; color: var(--encre-2); font-size: 13px; }
.direct i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pouls 1.8s infinite; }

/* ---------- Listes à avatars ---------- */

.carte.liste { padding: 0; overflow: hidden; }
.liste .entete-carte { margin: 0; padding: 20px 25px; border-bottom: 1px solid var(--trait); }
.liste .titre-barre::before { left: -25px; }
.lignes { list-style: none; margin: 0; padding: 0; }
.lignes li { display: flex; align-items: center; gap: 18px; padding: 15px 25px; border-bottom: 1px solid var(--trait); }
.lignes li:last-child { border-bottom: none; }
.lignes li:hover { background: var(--survol); }
.lignes small { display: block; color: var(--discret); }
.ligne-nom { flex: 1; min-width: 0; }
.ligne-nom a { color: var(--encre); font-weight: 600; }
.ligne-nom a, .ligne-nom small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-etat { display: flex; align-items: flex-start; gap: 9px; min-width: 128px; font-size: 13px; color: var(--encre-2); }
.point { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--discret); }
.point.bon { background: var(--bon); }
.point.attention { background: var(--attention); }
.point.critique { background: #f44236; }
.point.marine { background: var(--marine); }
.liste > .vide { margin: 0; padding: 26px 25px; text-align: center; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-fond);
  color: var(--accent-fonce);
  font-weight: 700;
  font-size: 13px;
}
.avatar.bon { background: var(--bon-fond); color: var(--bon-texte); }
.avatar.attention { background: var(--attention-fond); color: var(--attention-texte); }
.avatar.critique { background: var(--critique-fond); color: var(--critique-texte); }
.avatar.marine { background: var(--marine-fond); color: var(--marine); }
.avatar.profil { width: 36px; height: 36px; background: var(--d-marine); color: #fff; }
.identite { display: flex; align-items: center; gap: 14px; }
.identite strong { display: block; font-weight: 600; }
.identite strong a { color: var(--encre); }
.identite small { display: block; color: var(--discret); }

.alertes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alerte-carte {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  background: var(--surface-2);
  color: var(--encre);
  transition: transform 0.15s, box-shadow 0.15s;
}
.alerte-carte:hover { text-decoration: none; transform: translateX(3px); box-shadow: var(--ombre); }
.alerte-carte strong, .alerte-carte small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alerte-carte strong { font-weight: 600; }
.alerte-carte small { color: var(--encre-2); }
.alerte-carte .icone { color: var(--discret); }
.alerte-icone { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.alerte-carte.critique .alerte-icone { background: var(--critique-fond); color: var(--critique-texte); }
.alerte-carte.attention .alerte-icone { background: var(--attention-fond); color: var(--attention-texte); }
.alerte-carte.info .alerte-icone { background: var(--marine-fond); color: var(--marine); }
.carte > .vide { margin: 0; padding: 20px 0 6px; text-align: center; }

/* ---------- Graphiques ---------- */

/* Colonnes : axe des heures à gauche, une colonne par jour, une date chaque lundi. */
.graphe { display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: 220px auto; gap: 6px 8px; }
.graphe-axe { position: relative; color: var(--discret); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.graphe-axe span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.graphe-zone { position: relative; display: flex; align-items: flex-end; gap: 3px; }
.graphe-ligne { position: absolute; left: 0; right: 0; height: 1px; background: var(--trait); }
.graphe-colonne { position: relative; z-index: 1; display: flex; flex: 1; align-items: flex-end; justify-content: center; height: 100%; border-radius: 3px; }
.graphe-colonne:hover { background: var(--survol); }
.graphe-barre { width: 100%; max-width: 28px; border-radius: 4px 4px 0 0; background: var(--graphe); transform-origin: bottom; animation: pousser 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.graphe-colonne:hover .graphe-barre { filter: brightness(0.88); }
.graphe-dates { grid-column: 2; display: flex; gap: 3px; }
.graphe-dates span { position: relative; flex: 1; height: 15px; }
.graphe-dates b { position: absolute; left: 50%; transform: translateX(-50%); color: var(--encre-2); font-size: 11px; font-weight: 400; white-space: nowrap; }
@keyframes pousser { from { transform: scaleY(0); } }
.barres { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 0; padding: 0; list-style: none; }
.barre-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; }
.barre-libelle { color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.barre-libelle:hover { color: var(--accent-fonce); }
.barre-valeur { font-weight: 600; font-variant-numeric: tabular-nums; }
.barre-ligne .progression { grid-column: 1 / -1; height: 5px; margin-top: 7px; }
#infobulle {
  position: fixed;
  z-index: 1000;
  padding: 7px 11px;
  border-radius: 4px;
  background: var(--menu);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--ombre-haute);
  pointer-events: none;
}

/* Carte en direct : la bibliothèque de carte travaille à l'échelle 1, d'où le zoom inverse. */
#carte { zoom: calc(1 / var(--zoom)); height: 300px; z-index: 0; border-radius: 0 0 var(--rayon) var(--rayon); font: inherit; }
.legende-carte { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--encre-2); }
.legende-carte li { display: flex; align-items: center; gap: 6px; }
.repere { display: block; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: #c5c8d2; box-shadow: 0 0 0 1px rgba(20, 22, 40, 0.28); }
.legende-carte .repere { width: 12px; height: 12px; }
.repere.sur_site { background: var(--bon); }
.leaflet-marker-icon .repere.sur_site { animation: pouls 1.8s infinite; }
.repere.termine { background: #093672; }
.repere.a_venir { background: #fff; border-color: #093672; border-width: 4px; }
.repere.alerte { background: #f44236; }
.bulle-carte a { display: block; font-weight: 600; color: #1f2733; }
.bulle-carte small { color: #56637a; }

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

.defilement { overflow-x: auto; margin-bottom: 30px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--trait); vertical-align: middle; white-space: nowrap; }
thead th {
  padding: 13px 14px;
  background: var(--surface-2);
  border-bottom-color: var(--trait-fort);
  color: var(--encre-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
tbody tr:hover { background: var(--survol); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
td .heure { display: inline-block; min-width: 42px; font-variant-numeric: tabular-nums; }
.action { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--encre-2); cursor: pointer; }
.action:hover { background: var(--surface-2); color: var(--accent-fonce); }
.remarque { display: inline-flex; vertical-align: middle; color: var(--marine); }

table.annee td, table.annee thead th { text-align: center; }
table.annee thead th:first-child { text-align: left; }
table.annee thead th a { color: inherit; }
table.annee tbody th, table.annee tfoot th { min-width: 250px; font-weight: 600; text-align: left; }
table.annee td a { display: block; }
table.annee td a:hover { text-decoration: none; }
table.annee td strong { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
table.annee td small { color: var(--discret); }
table.annee td.vide { color: var(--trait-fort); }
table.annee tfoot th, table.annee tfoot td { background: var(--surface-2); border-top: 1px solid var(--trait-fort); border-bottom: none; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 11px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--neutre-fond);
  color: var(--encre-2);
}
.badge.vert { background: var(--bon-fond); color: var(--bon-texte); }
.badge.orange { background: var(--attention-fond); color: var(--attention-texte); }
.badge.rouge { background: var(--critique-fond); color: var(--critique-texte); }
.badge.bleu { background: var(--marine-fond); color: var(--marine); }
a:has(> .badge):hover { text-decoration: none; filter: brightness(0.96); }

/* ---------- Boutons et formulaires ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 6px 12px -4px rgba(14, 134, 104, 0.55);
  color: #fff;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, filter 0.15s;
}
.bouton:hover { text-decoration: none; filter: brightness(1.1); }
.bouton.clair { border-color: var(--trait-fort); background: var(--surface); box-shadow: none; color: var(--encre); font-weight: 400; }
.bouton.clair:hover { background: var(--surface-2); filter: none; }
.bouton.danger { color: var(--critique-texte); }
.bouton.danger:hover { background: var(--critique-fond); border-color: var(--critique); }
button.lien { border: none; background: none; padding: 4px 0; color: var(--accent-fonce); font: inherit; cursor: pointer; }
button.lien:hover { text-decoration: underline; }
button.lien.danger { color: var(--critique-texte); }

input, select, textarea {
  font: inherit;
  color: var(--encre);
  background: var(--surface);
  border: 1px solid var(--trait-fort);
  border-radius: 4px;
  padding: 8px 11px;
  max-width: 100%;
}
input[type='checkbox'] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.formulaire { max-width: 640px; }
.colonnes .formulaire, .bento .formulaire { max-width: none; }
.formulaire label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--encre-2); }
.formulaire label input, .formulaire label select { width: 100%; font-size: 14px; }
.formulaire label.case { flex-direction: row; align-items: center; gap: 8px; color: var(--encre); font-size: 14px; }
.formulaire label.case input { width: 16px; }
.formulaire .deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.formulaire .bouton { margin-right: 10px; }
.boutons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.formulaire .boutons .bouton { margin-right: 0; }
.en-ligne { display: inline-block; margin-right: 14px; }

fieldset.jours { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; border: 0; }
fieldset.jours legend { margin-bottom: 6px; padding: 0; font-size: 13px; color: var(--encre-2); }
.formulaire fieldset.jours label { margin: 0; }
.formulaire fieldset.jours label input { position: absolute; width: auto; opacity: 0; }
fieldset.jours span { display: block; padding: 5px 12px; border: 1px solid var(--trait-fort); border-radius: 30px; color: var(--encre); font-size: 13px; cursor: pointer; }
fieldset.jours input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
fieldset.jours input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filtres input, .filtres select { width: auto; }
.resume { display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; margin: 0 0 14px; color: var(--encre-2); }
.resume strong { font-weight: 600; color: var(--encre); }
.recherche {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 280px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--ombre);
  color: var(--discret);
}
.recherche:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.recherche input { flex: 1; min-width: 0; border: none; background: none; padding: 8px 0; outline: none; }

.plannings { margin: 0 0 18px; padding: 0; list-style: none; }
.plannings li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.plannings strong { font-weight: 600; }
.plannings small { display: block; color: var(--discret); }
.photo-preuve { display: block; max-width: 360px; width: 100%; border-radius: var(--rayon); }
.qr svg { display: block; width: 240px; height: 240px; padding: 8px; border-radius: var(--rayon); background: #fff; }
.lien-qr { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--discret); word-break: break-all; }

/* ---------- Agenda mensuel : une case par jour, une étiquette par prestation ---------- */

.agenda { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 1050px; margin-bottom: -1px; }
.agenda .jour-semaine {
  padding: 13px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--trait-fort);
  color: var(--encre-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.agenda .jour { min-height: 140px; padding: 7px; border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.agenda .jour:nth-child(7n) { border-right: 0; }
.agenda .jour.hors { background: var(--surface-2); }
.agenda .numero { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.agenda .numero b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; }
.agenda .aujourdhui .numero b { background: var(--accent); color: #fff; }
.agenda .numero small { color: var(--discret); }
.evenement {
  display: block;
  margin-bottom: 5px;
  padding: 4px 7px;
  border-left: 3px solid var(--c);
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 24%, var(--surface));
  color: var(--encre);
  font-size: 12px;
  line-height: 1.35;
}
.evenement:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 40%, var(--surface)); }
.evenement strong, .evenement small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evenement strong { font-weight: 600; }
.evenement small { color: var(--encre-2); font-size: 11px; }
.evenement.a-verifier { outline: 1.5px solid var(--critique); outline-offset: -1.5px; }
/* Passage planifié sans pointage : pointillés (rouges s'il est manqué ou non commencé). */
.evenement.prevu { padding-top: 3px; padding-bottom: 3px; border: 1px dashed var(--trait-fort); border-left: 3px solid var(--c); background: none; color: var(--encre-2); }
.evenement.prevu:hover { background: var(--survol); }
.evenement.prevu.manque, .evenement.prevu.non_commence { border-color: var(--critique); color: var(--encre); }

.pastilles { display: flex; flex-wrap: wrap; gap: 10px; }
.pastille {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
  color: var(--encre);
}
.pastille:hover { text-decoration: none; color: var(--accent-fonce); }
.pastille i { width: 12px; height: 12px; border-radius: 50%; }
.pastille .icone { color: var(--discret); }

/* ---------- Documentation ---------- */

.doc { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 30px; align-items: start; }
.doc-sommaire { position: sticky; top: 85px; margin: 0; max-height: calc(100vh / var(--zoom) - 110px); overflow-y: auto; }
.doc-sommaire ol { display: flex; flex-direction: column; gap: 7px; margin: 0; padding-left: 20px; color: var(--discret); }
.doc-sommaire a { color: var(--encre); }
.doc-sommaire a:hover { color: var(--accent-fonce); }
.doc-contenu { min-width: 0; max-width: 1000px; }
.doc section { scroll-margin-top: 85px; }
.doc h3 { margin: 22px 0 8px; font-size: 15px; font-weight: 600; }
.doc p, .doc li { line-height: 1.65; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 5px; }
.doc section > :last-child { margin-bottom: 0; }
.doc table { margin: 4px 0 14px; }
.doc th, .doc td { white-space: normal; vertical-align: top; }
.doc td:first-child { min-width: 200px; }
.doc code { padding: 1px 5px; border-radius: 3px; background: var(--surface-2); font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
.doc pre { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--rayon); background: var(--surface-2); font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-x: auto; }
.doc .note { padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--rayon) var(--rayon) 0; background: var(--accent-fond); }
.doc ol.etapes { padding: 0; list-style: none; counter-reset: etape; }
.doc ol.etapes li { position: relative; min-height: 26px; margin-bottom: 10px; padding-left: 40px; counter-increment: etape; }
.doc ol.etapes li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--d-marine);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Recherche rapide (Ctrl K) ---------- */

.palette-fond {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  padding: calc(14vh / var(--zoom)) 16px 16px;
  background: rgba(31, 39, 51, 0.5);
}
.palette-fond[hidden] { display: none; }
.palette { width: min(600px, 100%); overflow: hidden; background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre-haute); animation: monter 0.22s ease-out both; }
.palette-champ { display: flex; align-items: center; gap: 10px; padding: 6px 18px; border-bottom: 1px solid var(--trait); color: var(--discret); }
.palette-champ input { flex: 1; border: none; outline: none; padding: 12px 0; font-size: 16px; background: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 380px; overflow-y: auto; }
.palette li button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--encre);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.palette li button.actif { background: var(--accent-fond); }
.palette-icone { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--encre-2); }
.palette li button.actif .palette-icone { background: var(--accent); color: #fff; }
.palette-libelle { flex: 1; font-weight: 600; }
.palette li small { color: var(--discret); }
.palette-vide { padding: 22px; text-align: center; color: var(--discret); }
.palette footer { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--trait); color: var(--discret); font-size: 12px; }

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

body.connexion {
  min-height: calc(100vh / var(--zoom));
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(23, 166, 130, 0.45), transparent 70%),
    radial-gradient(55% 50% at 90% 90%, rgba(44, 95, 176, 0.5), transparent 70%),
    #0a2e63;
}
.connexion-carte {
  width: min(410px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 34px 30px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: monter 0.35s ease-out both;
}
.connexion-carte .logo { align-self: center; padding: 0 0 6px; box-shadow: none; background: none; font-size: 26px; color: var(--marine); }
.connexion-carte .logo .embleme { width: 46px; height: 46px; }
.connexion-carte p.discret { margin: -8px 0 6px; }
.connexion-carte label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--encre-2); }
.connexion-carte input { padding: 11px 12px; font-size: 14px; }
.connexion-carte .bouton { margin-top: 6px; padding: 12px; }

/* ---------- Parcours de pointage de l'agent (téléphone) : bandeau du site, étapes, clavier ---------- */

body.agent { font-size: 16px; }
.hero {
  padding: 20px 20px 62px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(70% 90% at 12% 0%, rgba(23, 166, 130, 0.5), transparent 70%),
    radial-gradient(65% 90% at 95% 100%, rgba(44, 95, 176, 0.6), transparent 70%),
    #0a2e63;
}
.hero .logo { display: inline-flex; padding: 8px 14px; font-size: 16px; }
.hero .logo .embleme { width: 26px; height: 26px; }
.hero h1 { margin: 18px 0 2px; font-size: 25px; font-weight: 600; line-height: 1.25; }
.hero .adresse { margin: 0; color: #a9bbdc; }
.hero .horloge { margin: 12px 0 0; color: #e3ebf8; font-size: 14px; }
.hero .horloge strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

body.agent main { max-width: 460px; margin: -42px auto 0; padding: 0 14px 40px; text-align: center; }
body.agent .carte { margin: 0 0 14px; padding: 22px 18px; border-radius: 16px; box-shadow: 0 10px 30px -12px rgba(9, 54, 114, 0.35); }
body.agent label { display: block; margin-bottom: 14px; font-size: 17px; font-weight: 600; }
body.agent textarea { width: 100%; margin-bottom: 14px; padding: 12px; border-radius: 10px; resize: vertical; }
body.agent .mention { margin: 14px 0 0; font-size: 13px; }
body.agent .message { font-size: 15px; }
body.agent .etat { margin: 0 0 14px; font-size: 16px; }
body.agent .info { min-height: 22px; margin: 14px 0 0; font-weight: 600; }
body.agent .info.erreur { padding: 12px 14px; border-radius: 10px; background: var(--critique-fond); color: var(--critique-texte); }
body.agent .info:empty { display: none; }
body.agent form:not(.carte) { text-align: center; }
body.agent button.lien { padding: 8px; font-size: 15px; }
body.agent .gros { border-radius: 12px; }

/* Étapes : Code → Position → Pointage */
.parcours { display: flex; margin: 0 0 14px; padding: 12px 10px; list-style: none; border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px -12px rgba(9, 54, 114, 0.35); }
.parcours li { position: relative; flex: 1; color: var(--discret); font-size: 12px; font-weight: 600; }
.parcours li span { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 4px; border-radius: 50%; background: var(--neutre-fond); color: var(--encre-2); font-size: 13px; transition: background 0.3s, color 0.3s; }
.parcours li + li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--neutre-fond); }
.parcours li.actif { color: var(--marine); }
.parcours li.actif span { background: var(--d-marine); color: #fff; box-shadow: 0 5px 10px -3px rgba(9, 54, 114, 0.5); }
.parcours li.fait { color: var(--accent-fonce); }
.parcours li.fait span { background: var(--accent); color: #fff; font-size: 0; }
.parcours li.fait span::after { content: "✓"; font-size: 14px; }
.parcours li.fait + li::before { background: var(--accent); }

/* Saisie du code : six points et un clavier à chiffres */
.saisie-code input.code { width: 100%; padding: 13px; font-size: 22px; font-weight: 700; letter-spacing: 0.35em; text-align: center; }
.saisie-code input.masque { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.points { display: flex; justify-content: center; gap: 14px; margin: 4px 0 18px; }
.points[hidden] { display: none; }
.points i { width: 16px; height: 16px; border: 2px solid var(--trait-fort); border-radius: 50%; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.points i.plein { border-color: var(--marine); background: #093672; transform: scale(1.15); }
.saisie-code.refuse .points { animation: secouer 0.4s; }
.saisie-code.refuse .points i { border-color: #f44236; }
@keyframes secouer {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto 16px; }
.clavier[hidden] { display: none; }
.clavier button {
  height: 62px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--encre);
  font: inherit;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, background 0.15s;
}
.clavier button:active { transform: scale(0.94); background: var(--marine-fond); }
.clavier .effacer { display: grid; place-items: center; background: none; color: var(--encre-2); }
.clavier .effacer .icone { pointer-events: none; }

/* Accueil de l'agent identifié */
body.agent .bonjour { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 16px; text-align: left; }
body.agent .bonjour .avatar { width: 46px; height: 46px; font-size: 15px; }
body.agent .bonjour span:last-child { color: var(--discret); font-size: 13px; }
body.agent .bonjour strong { display: block; color: var(--encre); font-size: 18px; font-weight: 600; }
body.agent .etat.en-cours { padding: 14px; border-radius: 12px; background: var(--marine-fond); color: var(--marine); }
body.agent .etat.en-cours span { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
body.agent .etat.en-cours strong { display: block; font-size: 26px; font-weight: 300; font-variant-numeric: tabular-nums; }

/* ---------- Pages simples (erreurs de pointage) ---------- */

body.simple { font-size: 16px; }
body.simple main { max-width: 440px; margin: 0 auto; padding: 24px 16px 48px; text-align: center; }
body.simple .marque { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 24px; color: var(--marine); font-size: 21px; font-weight: 800; }
body.simple h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
body.simple .adresse { color: var(--discret); margin: 0 0 20px; }
body.simple .carte { margin-top: 20px; padding: 24px 18px; }
body.simple label { display: block; font-weight: 600; margin-bottom: 8px; }
body.simple input { width: 100%; font-size: 22px; text-align: center; padding: 13px; margin-bottom: 16px; }
body.simple textarea { width: 100%; margin-bottom: 16px; padding: 11px; resize: vertical; }
body.simple .bonjour { font-size: 18px; margin: 0 0 16px; }
body.simple .etat { font-size: 17px; margin: 0 0 16px; }
body.simple .info { min-height: 24px; font-weight: 600; margin: 14px 0 8px; }
body.simple .info.erreur { padding: 12px 14px; border-radius: 8px; background: var(--critique-fond); color: var(--critique-texte); }
body.simple .message { font-size: 15px; }
body.simple input.code { letter-spacing: 0.35em; font-weight: 700; }
body.simple button.lien { margin-top: 14px; font-size: 15px; }

/* Prestation en cours : chronomètre */
body.simple .etat.en-cours { padding: 14px; border-radius: 8px; background: var(--marine-fond); color: var(--marine); }
body.simple .etat.en-cours span { display: block; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
body.simple .etat.en-cours strong { display: block; font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; }

/* État de la localisation, toujours visible : recherche, sur place, trop loin, refusée */
.gps { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); text-align: left; transition: background 0.3s; }
.gps strong { display: block; font-size: 15px; font-weight: 600; }
.gps small { display: block; color: var(--encre-2); font-size: 13px; }
.gps-voyant { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--discret); }
.gps[data-etat="recherche"] .gps-voyant { background: var(--attention); animation: pouls-ambre 1.4s infinite; }
.gps[data-etat="ok"] { background: var(--bon-fond); }
.gps[data-etat="ok"] .gps-voyant { background: var(--bon); }
.gps[data-etat="loin"], .gps[data-etat="refus"] { background: var(--critique-fond); }
.gps[data-etat="loin"] .gps-voyant, .gps[data-etat="refus"] .gps-voyant { background: #f44236; }
@keyframes pouls-ambre {
  0% { box-shadow: 0 0 0 0 rgba(250, 178, 25, 0.6); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(250, 178, 25, 0); }
}

.aide-position { margin-top: 12px; padding: 14px; border-radius: 8px; background: var(--surface-2); text-align: left; font-size: 14px; }
.aide-position p { margin: 0 0 8px; }
.aide-position .gros { margin-top: 6px; }

label.photo { display: block; margin: 0 0 16px; padding: 14px; border: 2px dashed var(--trait-fort); border-radius: 8px; color: var(--encre-2); font-weight: 600; cursor: pointer; }
label.photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.photo span { display: inline-flex; align-items: center; gap: 8px; }
label.photo.prise { border-style: solid; border-color: var(--bon); background: var(--bon-fond); color: var(--bon-texte); }

/* Confirmation finale */
.pointage.reussi { padding: 34px 18px; }
.coche { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--d-bon); color: #fff; font-size: 44px; font-weight: 700; box-shadow: 0 10px 22px -8px rgba(12, 163, 12, 0.6); animation: apparaitre 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.confirmation { margin: 0 0 10px; font-size: 19px; font-weight: 600; }
@keyframes apparaitre { from { opacity: 0; transform: scale(0.4); } }
.gros { display: block; width: 100%; padding: 20px 16px; border: 0; border-radius: 8px; color: #fff; font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; }
.gros.vert { background: var(--d-vert); box-shadow: 0 8px 16px -6px rgba(14, 134, 104, 0.6); }
.gros.rouge { background: var(--d-rouge); box-shadow: 0 8px 16px -6px rgba(244, 66, 54, 0.6); }
.gros.bleu { background: var(--d-marine); box-shadow: 0 8px 16px -6px rgba(9, 54, 114, 0.5); padding: 15px; font-size: 17px; }
.gros { transition: transform 0.08s, filter 0.15s; -webkit-tap-highlight-color: transparent; }
.gros:active { transform: scale(0.98); filter: brightness(0.95); }
.gros:disabled { opacity: 0.75; }
.gros.occupe::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; border: 3px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; vertical-align: -2px; animation: tourner 0.8s linear infinite; }
.gros.confirmer { background: var(--d-ambre); color: #3d2a00; box-shadow: 0 8px 16px -6px rgba(250, 178, 25, 0.6); }
@keyframes tourner { to { transform: rotate(360deg); } }

/* ---------- Portail client ---------- */

.bandeau { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 30px; padding: 18px 24px; background: #0a2e63; color: #fff; box-shadow: 0 1px 20px 0 rgba(9, 54, 114, 0.3); }
.bandeau .logo { padding: 9px 14px; font-size: 17px; }
.bandeau .logo .embleme { width: 28px; height: 28px; }
.bandeau h1 { font-size: 22px; }
.bandeau p { margin: 0; color: #a9bbdc; }
body.portail main { max-width: 1000px; margin: 0 auto; padding: 28px 16px 48px; }
body.portail .message { display: flex; align-items: center; gap: 10px; }

/* ---------- Écrans étroits ---------- */

@media (max-width: 1250px) {
  .b-3 { grid-column: span 6; }
  .b-4, .b-6, .b-8 { grid-column: span 12; }
  .barre-date { display: none; }
}

/* ---------- Tablette et téléphone : menu escamotable ---------- */

@media (max-width: 1024px) {
  .appli { display: block; }
  .menu {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(290px, 84vw);
    height: auto;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .menu-ouvert .menu { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35); }
  .menu nav { overscroll-behavior: contain; }
  .menu nav a { padding: 14px 22px; font-size: 15px; }
  #replier { display: none; }
  .voile { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(10, 20, 40, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .menu-ouvert .voile { opacity: 1; pointer-events: auto; }
  .menu-ouvert body { overflow: hidden; }
  .ouvrir-menu {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--ombre);
    color: var(--encre);
    cursor: pointer;
  }
  .barre-haut { gap: 10px; height: 64px; padding: 0 18px; }
  .recherche-rapide { margin-left: 0; min-width: 0; }
  main { padding: 6px 18px 40px; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .doc-sommaire { position: static; max-height: none; }
  /* Tablette : les tableaux tiennent dans la largeur (retour à la ligne dans les cellules). */
  th, td { padding: 10px; white-space: normal; }
  thead th { padding: 12px 10px; }
  td .heure { display: block; min-width: 0; }
  .identite { gap: 10px; }
  .identite .avatar { width: 34px; height: 34px; font-size: 12px; }
  /* Tablette : l'agenda garde sa grille, à la largeur de l'écran. */
  .agenda { grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 0; }
  .agenda .jour { padding: 5px; }
  .agenda .jour-semaine { padding: 10px 6px; font-size: 10px; }
  .evenement { padding: 3px 5px; font-size: 12px; }
}
.fermer-menu { display: none; }
@media (max-width: 1024px) {
  .fermer-menu { display: grid; }
}

/* ---------- Téléphone ---------- */

@media (max-width: 700px) {
  .fil, .recherche-rapide kbd { display: none; }
  .barre-haut { gap: 8px; padding: 0 12px; }
  .recherche-rapide { padding: 9px 10px; }
  .notifications .deroulant-bouton, .bouton-icone { width: 38px; height: 38px; }
  /* Le panneau de notifications prend la largeur de l'écran, sous la barre. */
  .notifications.ouvert:not(.compte) .deroulant-panneau { position: fixed; top: 62px; left: 10px; right: 10px; width: auto; max-height: calc(100vh - 80px); overflow-y: auto; }
  main { padding: 4px 12px 36px; }

  .titre-liste { margin-bottom: 16px; }
  main > .titre-liste:first-of-type h2 { font-size: 20px; }
  .titre-liste .outils, .titre-liste > .bouton, .titre-liste > .direct { width: 100%; }
  .titre-liste > .bouton { justify-content: center; }
  .outils .recherche { width: 100%; }
  .outils > .bouton { flex: 1; justify-content: center; }
  .recherche { width: 100%; }

  .carte { padding: 18px 16px; margin-bottom: 16px; }
  .titre-barre::before, .carte > h2:first-child::before { left: -16px; }
  .liste .entete-carte { padding: 16px; }
  .liste .titre-barre::before { left: -16px; }
  .entete-carte { flex-wrap: wrap; }
  .bento, .colonnes, .indicateurs { gap: 14px; margin-bottom: 16px; }
  .b-3 { grid-column: span 12; }
  .indicateurs { grid-template-columns: minmax(0, 1fr); }
  .lignes li { flex-wrap: wrap; gap: 8px 12px; padding: 13px 16px; }
  .ligne-nom { flex-basis: calc(100% - 60px); }
  .ligne-etat { min-width: 0; margin-left: 52px; }
  .alerte-carte { gap: 10px; padding: 11px 12px; }
  .alerte-carte strong, .alerte-carte small { white-space: normal; }
  #carte { height: 260px; }
  .graphe { grid-template-rows: 170px auto; grid-template-columns: 32px minmax(0, 1fr); }
  .graphe-zone, .graphe-dates { gap: 2px; }

  .formulaire .deux { grid-template-columns: minmax(0, 1fr); }
  .formulaire .bouton { margin: 0 0 8px; }
  .filtres > * { flex: 1 1 140px; }
  .filtres input, .filtres select { width: 100%; }
  .filtres > .bouton.clair:first-child, .filtres > a.bouton.clair { flex: 0 0 auto; }
  .resume { font-size: 14px; }
  input, select, textarea { font-size: 16px; } /* 16 px : l'iPhone ne zoome plus sur le champ touché */
  .qr svg { width: 210px; height: 210px; }
  .lien-qr { font-size: 11px; }

  /* Tableaux en fiches : une fiche par ligne, chaque valeur précédée du nom de sa colonne. */
  .defilement:not(.garder), main table:not(.annee) { overflow: visible; }
  .defilement:not(.garder) { background: none; box-shadow: none; }
  main .defilement:not(.garder) table, main .doc table { display: block; }
  main .defilement:not(.garder) thead, main .doc thead { display: none; }
  main .defilement:not(.garder) tbody, main .doc tbody { display: flex; flex-direction: column; gap: 12px; }
  main .defilement:not(.garder) tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 14px 16px;
    border-radius: var(--rayon);
    background: var(--surface);
    box-shadow: var(--ombre);
  }
  main .defilement:not(.garder) tr:hover { background: var(--surface); }
  main .defilement:not(.garder) td { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 8px; grid-column: 1 / -1; padding: 6px 0; border-bottom: 1px solid var(--trait); white-space: normal; text-align: right; }
  main .defilement:not(.garder) td::before { content: attr(data-label); flex: none; margin-right: auto; color: var(--discret); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; }
  main .defilement:not(.garder) td:first-child { grid-column: 1; justify-content: flex-start; padding: 0 0 10px; text-align: left; }
  main .defilement:not(.garder) td:first-child::before { content: none; }
  /* Colonne « Action » : à droite du titre de la fiche, sans libellé. */
  main .defilement:not(.garder) td:last-child:has(.action) { grid-column: 2; grid-row: 1; align-self: start; padding: 0; border: 0; }
  main .defilement:not(.garder) td:last-child:has(.action)::before { content: none; }
  main .defilement:not(.garder) td:nth-last-child(2):has(+ td .action), main .defilement:not(.garder) tr > td:last-child:not(:has(.action)) { border-bottom: 0; }
  main .defilement:not(.garder) td > a:has(> .badge) { margin-left: 6px; }
  main .defilement:not(.garder) td .heure { min-width: 0; }
  main .doc tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--trait); }
  main .doc td { display: block; padding: 2px 0; border: 0; }
  main .doc td:first-child { min-width: 0; font-weight: 600; }
  main .doc td[data-label]:not(:first-child)::before { content: attr(data-label) " : "; color: var(--discret); font-size: 13px; }

  /* Agenda : liste des jours qui ont des passages (et aujourd'hui), au lieu de la grille du mois. */
  .defilement.garder:has(.agenda) { overflow: visible; background: none; box-shadow: none; }
  .agenda { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; }
  .agenda .jour-semaine, .agenda .jour.hors, .agenda .jour:not(:has(.evenement)):not(.aujourdhui) { display: none; }
  .agenda.sans-passage .jour.aujourdhui { display: none; }
  .agenda .jour { min-height: 0; padding: 12px; border: 0 !important; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); }
  .agenda .numero { margin-bottom: 8px; }
  .agenda .numero b { display: none; }
  .agenda .jour-nom { display: inline; flex: 1; font-weight: 600; }
  .agenda .aujourdhui .jour-nom::after { content: " · aujourd'hui"; color: var(--accent-fonce); }
  .evenement { padding: 8px 10px; font-size: 14px; }
  .evenement small { font-size: 12px; }
  .pastilles .pastille { flex: 1 1 100%; }

  .doc ol.etapes li { padding-left: 36px; }
  .doc-sommaire ol { columns: 2; column-gap: 18px; display: block; }
  .doc-sommaire li { margin-bottom: 6px; break-inside: avoid; }
}
.jour-nom, .agenda-vide { display: none; }
@media (max-width: 700px) {
  .agenda .jour-nom { display: inline; }
  .agenda-vide { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Impression du back-office (agenda) : paysage, sans menu ni boutons ---------- */

.impression-seule { display: none; }
@page agenda { size: A4 landscape; margin: 8mm; }
@media print {
  .impression-seule { display: inline; }
  /* Échelle choisie pour qu'un mois de cinq semaines à trois passages par jour tienne sur une page. */
  body.admin { zoom: 0.55; page: agenda; background: #fff; }
  .appli { display: block; min-height: 0; }
  .menu, .barre-haut, .titre-liste .outils, .filtres, .message, .hors-impression, #infobulle, .palette-fond { display: none !important; }
  main { padding: 0; }
  .titre-liste { margin-bottom: 6px; }
  .defilement { overflow: visible; box-shadow: none; }
  .agenda { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .agenda .jour { min-height: 24mm; break-inside: avoid; }
  .agenda, .evenement, .avatar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Documentation : portrait, texte lisible, sommaire en tête. */
@page doc { size: A4 portrait; margin: 14mm 12mm; }
@media print {
  body.admin.imprime-portrait { zoom: 0.8; page: doc; }
  .doc { display: block; }
  .doc-sommaire { position: static; max-height: none; margin-bottom: 8mm; }
  .doc .carte { margin-bottom: 6mm; padding: 0; box-shadow: none; }
  .doc .carte > h2:first-child::before { content: none; }
  .doc h2, .doc h3 { break-after: avoid; }
  .doc tr, .doc li, .doc .note { break-inside: avoid; }
  .doc .note, .doc ol.etapes li::before, .doc .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Affiche A4 ---------- */

body.affiche { background: #8793a6; }
.affiche .outils { justify-content: center; margin: 16px 0; }
.affiche .outils a:not(.bouton) { color: #fff; }
.feuille { width: 210mm; min-height: 297mm; margin: 0 auto 30px; padding: 22mm 20mm; background: #fff; color: #1f2733; text-align: center; }
.feuille .logo { display: block; padding: 0; box-shadow: none; font-size: 22pt; color: #093672; margin: 0 0 10mm; }
.feuille h1 { font-size: 46pt; font-weight: 800; line-height: 1.05; text-transform: uppercase; color: #0e8668; margin: 0 0 12mm; }
.feuille h1 span { display: block; color: #093672; }
.feuille .consignes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6mm;
  list-style: none;
  counter-reset: consigne;
  padding: 0;
  margin: 0 0 10mm;
  font-size: 11pt;
  text-transform: uppercase;
}
.feuille .consignes li { counter-increment: consigne; }
.feuille .consignes li::before {
  content: counter(consigne);
  display: block;
  width: 12mm;
  height: 12mm;
  line-height: 12mm;
  margin: 0 auto 3mm;
  border-radius: 50%;
  background: #093672;
  color: #fff;
  font-size: 15pt;
  font-weight: 700;
}
.feuille .obligatoire { font-size: 15pt; font-weight: 800; text-transform: uppercase; color: #d03b3b; margin: 0 0 12mm; }
.feuille .obligatoire span { white-space: nowrap; }
.feuille .site { font-size: 19pt; font-weight: 700; text-transform: uppercase; margin: 0 0 8mm; }
.feuille .qr svg { width: 85mm; height: 85mm; margin: 0 auto; padding: 0; }
.feuille .mode-emploi { font-size: 12pt; color: #56637a; margin-top: 8mm; }

@page { size: A4; margin: 0; }
@media print {
  body.affiche { background: #fff; }
  .affiche .outils { display: none; }
  .feuille { margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
