/* Jetons du design system de la cuisine, repris tels quels (préfixe --ds-). */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/polices/outfit-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/polices/plus-jakarta-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/polices/plus-jakarta-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/polices/plus-jakarta-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  --ds-green: hsl(155 32% 33%);
  --ds-green-deep: #084f37;
  --ds-sage: hsl(114 40% 93%);
  --ds-coral: #d7521e;
  --ds-coral-deep: #a8400f;
  --ds-orange-pale: #fcf1ed;
  --ds-yellow: #e1a430;
  --ds-warm: hsl(44 60% 94%);
  --ds-bg: hsl(40 50% 98%);
  --ds-text: hsl(160 30% 12%);
  --ds-text-muted: hsl(160 12% 32%);
  --ds-border: hsl(155 15% 88%);
  --ds-shadow: 0 4px 16px hsl(155 32% 20% / 0.1);

  /* Contour des champs : plus foncé que le filet du site pour passer 3:1. */
  --champ-contour: hsl(160 15% 52%);
  --police-titre: "Outfit", system-ui, sans-serif;
  --police-corps: "Plus Jakarta Sans", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--police-corps);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }

a { color: var(--ds-green); }

.aide { font-size: 14px; color: var(--ds-text-muted); }

/* Focus visible au clavier, partout. */
:focus-visible {
  outline: 3px solid var(--ds-green);
  outline-offset: 2px;
}

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

/* ---------- Mise en page ---------- */

.contenu {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
@media (min-width: 720px) {
  .contenu { padding: 32px 24px 64px; }
}

.bloc { margin: 0 0 32px; }
.bloc > h2 { margin-bottom: 16px; }
.nom-composant {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-text-muted);
}
.rangee { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- En-tête ---------- */

.entete {
  background: var(--ds-green-deep);
  color: var(--ds-bg);
}
.entete a { color: var(--ds-bg); }
.entete-interieur {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}
@media (min-width: 720px) {
  .entete-interieur { padding: 8px 24px; }
}
.entete-marque {
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}
@media (min-width: 720px) {
  .entete-marque { margin-right: 0; }
}

.navigation { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.navigation a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.navigation a:hover { background: hsl(40 50% 98% / 0.12); }
.navigation a[aria-current="page"] { background: hsl(40 50% 98% / 0.2); font-weight: 600; }
.entete :focus-visible { outline-color: var(--ds-bg); }

/* Pastilles de compteur de la navigation. */
.compteur {
  display: inline-block;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}
.compteur--corail { background: var(--ds-coral-deep); color: #fff; }
.compteur--creme { background: var(--ds-bg); color: var(--ds-green-deep); }

.entete-compte { margin-left: auto; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 12px; }

/* Deux navigations, une par largeur : un <details> ne reste pas ouvert de façon fiable sur ordinateur. */
.navigation-bureau { display: none; flex: 1; justify-content: center; }
.entete-menu { display: block; }
.entete-compte { display: none; }
/* Six entrées avec « Emails » : le bureau serre la navigation avant de couper un libellé. */
@media (min-width: 720px) and (max-width: 1199px) {
  .navigation a { padding: 0 8px; }
  .navigation { gap: 0; }
  .entete-interieur { gap: 12px; }
}
@media (min-width: 720px) {
  .navigation-bureau { display: flex; }
  .entete-menu { display: none; }
  .entete-compte { display: flex; margin-left: 0; }
}
.entete-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ds-bg);
  border-radius: 9999px;
  font-weight: 600;
}
.entete-menu summary::-webkit-details-marker { display: none; }
.entete-menu[open] summary { background: hsl(40 50% 98% / 0.15); }
.entete-menu-panneau {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 8px 16px 16px;
  background: var(--ds-green-deep);
  border-top: 1px solid hsl(40 50% 98% / 0.25);
}
.entete-menu .navigation { flex-direction: column; gap: 0; }
.entete-menu .navigation a { width: 100%; border-radius: 12px; }

/* Nom de la personne et déconnexion : dans l'en-tête sur ordinateur, dans le menu sur téléphone. */
.entete-menu-compte {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 12px 0;
  border-top: 1px solid hsl(40 50% 98% / 0.25);
  font-size: 14px;
}
.entete-compte form, .entete-menu-compte form { margin: 0; }
.entete-bouton {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  color: var(--ds-bg);
  border: 2px solid var(--ds-bg);
  border-radius: 9999px;
  font-family: var(--police-corps);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.entete-bouton:hover { background: hsl(40 50% 98% / 0.15); }

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

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: 9999px;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.bouton:hover { transform: translateY(-2px); }
.bouton--principal { background: var(--ds-coral-deep); border-color: var(--ds-coral-deep); color: #fff; }
.bouton--secondaire { background: transparent; border-color: var(--ds-coral); color: var(--ds-coral-deep); }
.bouton--secondaire:hover { background: var(--ds-orange-pale); }
.bouton--sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.bouton--block { display: flex; width: 100%; }
.bouton[disabled], .bouton[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .bouton:hover { transform: none; }
}

/* ---------- Champs ---------- */

/* Écrans à un seul formulaire (connexion, mot de passe). */
.colonne-formulaire { max-width: 360px; margin: 0 auto; }

.champ { display: block; margin: 0 0 16px; }
.champ-libelle { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.champ-saisie {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ds-text);
  border: 1px solid var(--champ-contour);
  border-radius: 12px;
  font-family: var(--police-corps);
  font-size: 16px;
  line-height: 1.4;
}
textarea.champ-saisie { min-height: 96px; resize: vertical; }
.champ-saisie:focus,
.champ-saisie:focus-visible {
  outline: none;
  border-color: var(--ds-green);
  box-shadow: 0 0 0 4px hsl(155 32% 33% / 0.15);
}
.champ-aide { margin: 4px 0 0; font-size: 14px; color: var(--ds-text-muted); }
.champ-erreur { margin: 4px 0 0; font-size: 14px; color: var(--ds-coral-deep); }

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

.carte {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--ds-shadow);
  padding: 20px;
}
.carte--cliquable { display: block; color: inherit; text-decoration: none; transition: transform 0.15s ease; }
.carte--cliquable:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .carte--cliquable:hover { transform: none; }
}

/* ---------- Pastilles ---------- */

.pastille {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}
.pastille--attente { background: var(--ds-warm); color: var(--ds-text); }
.pastille--attente::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-yellow);
}
.pastille--refusee { background: var(--ds-orange-pale); color: var(--ds-coral-deep); }

/* ---------- Bandeau de confirmation ---------- */

.bandeau {
  margin: 0 0 24px;
  padding: 12px 16px;
  background: var(--ds-sage);
  color: var(--ds-green-deep);
  border-radius: 12px;
  font-weight: 600;
}
.bandeau--erreur { background: var(--ds-orange-pale); color: var(--ds-coral-deep); }

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

.tableau-conteneur { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; background: #fff; }
.tableau caption { text-align: left; padding: 0 0 8px; font-weight: 600; }
.tableau th, .tableau td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--ds-border);
  vertical-align: top;
}
.tableau thead th { font-size: 13px; font-weight: 600; color: var(--ds-text-muted); }
.tableau .nombre { text-align: right; }
.tableau tfoot th, .tableau tfoot td { font-weight: 600; border-bottom: 0; }

/* ---------- Carte de jour ---------- */

.jour {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  border-left: 4px solid transparent;
  box-shadow: var(--ds-shadow);
}
@media (min-width: 720px) {
  .jour { grid-template-columns: 1fr auto 1.2fr; align-items: center; gap: 24px; }
}
.jour--ouvert { border-left-color: var(--ds-green); }
.jour--attente { background: var(--ds-warm); }
.jour-titre { margin: 0 0 4px; font-family: var(--police-titre); font-weight: 700; font-size: 20px; }
.jour-echeance { margin: 0; font-size: 14px; color: var(--ds-text-muted); }
.jour-demande { margin: 8px 0 0; font-size: 14px; }
.jour-demande strong { font-weight: 600; }
.jour-pastille { margin: 8px 0 0; }
.jour-nombre { display: flex; align-items: center; justify-content: center; gap: 12px; }
.jour-valeur {
  width: 72px;
  min-height: 56px;
  padding: 0;
  text-align: center;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 36px;
  color: var(--ds-text);
  background: #fff;
  border: 1px solid var(--champ-contour);
  border-radius: 12px;
  -moz-appearance: textfield;
}
.jour-valeur::-webkit-outer-spin-button,
.jour-valeur::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.jour-valeur:focus { outline: none; border-color: var(--ds-green); box-shadow: 0 0 0 4px hsl(155 32% 33% / 0.15); }
.jour-valeur--lecture { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; }
.jour-pas.jour-pas--vide { background: none; border: 0; cursor: default; }
.jour-valeur--zero { color: var(--ds-text-muted); }
.jour-pas {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--ds-coral);
  border-radius: 9999px;
  background: transparent;
  color: var(--ds-coral-deep);
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.jour-pas:hover { background: var(--ds-orange-pale); }
.jour-pas[disabled] { opacity: 0.4; cursor: not-allowed; }
.jour-lien { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; }
.jour-observation .champ { margin: 0; }
.jour-observation textarea { min-height: 44px; field-sizing: content; resize: none; }
.jour-observation .champ-aide { margin-top: 4px; }
.jour-observation-texte { margin: 0; font-size: 16px; color: var(--ds-text); }

/* ---------- Ma semaine, Mon mois ---------- */

.visuellement-masque {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin: 0 0 16px; }
.entete-page h1 { margin: 0; }
.choix-structure { display: flex; align-items: flex-end; gap: 12px; }
.choix-structure .champ { margin: 0; }
select.champ-saisie { padding-right: 32px; }
/* Avec le script, le choix s'applique seul : le bouton ne sert plus. */
.agrement .choix-structure .bouton { display: none; }

.selecteur { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; }
.selecteur-libelle { margin: 0; min-width: 12ch; text-align: center; font-family: var(--police-titre); font-weight: 700; font-size: 20px; }
/* Neutre : le corail est réservé au bouton principal. */
.selecteur-fleche {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ds-border);
  border-radius: 9999px;
  background: #fff;
  color: var(--ds-text);
}
.selecteur-fleche:hover { background: var(--ds-warm); }
.selecteur-retour { font-size: 14px; font-weight: 600; }

.jours { display: grid; gap: 16px; margin: 0 0 24px; }
.jour-cellule-nombre { display: flex; flex-direction: column; align-items: center; }
.jour-erreur { max-width: 184px; margin-top: 8px; text-align: center; }
/* Sans le script, − et + ne font rien : ils gardent leur place mais ne se voient pas. */
html:not(.agrement) button.jour-pas { visibility: hidden; }

/* Demande de modification : le lien est dans la carte, le formulaire s'affiche sous la carte quand son ancre est ciblée. */
.jour-demande-panneau { display: none; grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--ds-border); }
.jour-demande-panneau:target, .jour-demande-panneau--ouvert { display: block; }
.jour-demande-champs { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 720px) {
  .jour-demande-champs { grid-template-columns: auto 1fr; align-items: start; gap: 24px; }
}
.jour-demande-aide { margin: 12px 0 0; }

/* Barre d'enregistrement : toujours visible sans le script, sinon seulement quand une valeur a changé. */
.barre-enregistrement {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 -2px 12px hsl(155 32% 20% / 0.12), var(--ds-shadow);
}
.barre-enregistrement[hidden] { display: none; }
.barre-compte { margin: 0; font-weight: 600; }
@media (max-width: 719px) {
  .barre-enregistrement { gap: 12px; padding: 12px; }
  .barre-compte { font-size: 14px; }
  .barre-enregistrement .bouton { flex: 1; padding: 0 12px; white-space: nowrap; }
}

.historique { margin: 0 0 24px; }
.historique > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--ds-green); }
.historique-liste { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.historique-liste li { padding: 8px 0; border-bottom: 1px solid var(--ds-border); }

.carte--tableau { padding: 8px 0 0; overflow-x: auto; }
.carte--tableau .tableau caption { padding: 12px 16px; }
.tableau .nombre--zero { color: var(--ds-text-muted); }
.observation-mobile { display: none; margin-top: 4px; font-weight: 400; }
.observation-mobile summary { cursor: pointer; font-size: 14px; color: var(--ds-green); }
.observation-mobile p { margin: 4px 0 0; font-size: 14px; }
@media (max-width: 719px) {
  .colonne-observation { display: none; }
  .observation-mobile { display: block; }
}

/* Sans observation, la zone vide ne doit pas ajouter un espace sous la carte. */
.jour-observation:empty { display: none; }
@media (min-width: 720px) {
  .jour-observation:empty { display: block; }
}

/* ---------- Gestionnaire : la semaine ---------- */

.gs-feuille-etat { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-weight: 600; }
.gs-feuille-etat .aide { margin: 0; font-weight: 400; }

.gs-conteneur { margin: 0 0 24px; }
.gs-tableau { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 16px; box-shadow: var(--ds-shadow); overflow: hidden; }
.gs-tableau th, .gs-tableau td { padding: 0; border-bottom: 1px solid var(--ds-border); vertical-align: top; text-align: left; }
.gs-tableau thead th { padding: 12px 12px; font-size: 13px; font-weight: 600; color: var(--ds-text-muted); }
.gs-tableau .gs-colonne--total { width: 10%; text-align: right; }
.gs-tableau .gs-structure { width: 19%; padding: 12px 16px; }
.gs-structure-nom { display: block; font-family: var(--police-titre); font-weight: 700; }
.gs-rien { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--ds-coral-deep); }
.gs-cellule--hors { background: hsl(155 15% 94%); }
.gs-cellule--attente { background: var(--ds-warm); }
.gs-lien { display: block; min-height: 44px; padding: 12px; text-align: left; color: inherit; text-decoration: none; }
.gs-lien:hover { background: hsl(155 32% 33% / 0.07); }
.gs-lien:focus-visible { outline-offset: -3px; }
.gs-nombre { display: block; font-family: var(--police-titre); font-weight: 700; font-size: 20px; line-height: 1.3; }
.gs-nombre--zero { color: var(--ds-text-muted); }
.gs-obs { display: block; font-size: 14px; line-height: 1.35; color: var(--ds-text-muted); overflow-wrap: anywhere; }
.gs-tableau .gs-cellule--total { padding: 12px; text-align: right; font-weight: 600; }
/* Les totaux par jour restent sous les nombres du jour ; seul le total de la semaine est à droite. */
@media (min-width: 720px) { .gs-tableau tfoot .gs-cellule--total:not(:last-child) { text-align: left; } }
.gs-tableau tfoot th, .gs-tableau tfoot td { border-bottom: 0; background: hsl(155 15% 96%); }
.gs-tableau tbody tr:last-child th, .gs-tableau tbody tr:last-child td { border-bottom: 1px solid var(--ds-border); }
.gs-jour-libelle { display: none; }

@media (max-width: 719px) {
  /* Une carte par structure : les jours en liste dedans, les jours non servis disparaissent. */
  .gs-tableau, .gs-tableau tbody, .gs-tableau tfoot, .gs-tableau tr, .gs-tableau th, .gs-tableau td { display: block; }
  .gs-tableau { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .gs-tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gs-tableau tr { margin: 0 0 16px; padding: 4px 0; background: #fff; border-radius: 16px; box-shadow: var(--ds-shadow); overflow: hidden; }
  .gs-tableau th, .gs-tableau td, .gs-tableau tbody tr:last-child td { border-bottom: 0; }
  .gs-tableau tfoot th, .gs-tableau tfoot td { background: transparent; }
  .gs-tableau .gs-structure { width: auto; padding: 12px 16px 8px; }
  .gs-tableau .gs-cellule--hors { display: none; }
  .gs-tableau .gs-cellule { border-top: 1px solid var(--ds-border); }
  .gs-cellule--attente { background: var(--ds-warm); }
  .gs-lien { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; padding: 12px 16px; }
  .gs-lien .gs-jour-libelle { grid-column: 1; grid-row: 1; text-align: left; }
  .gs-lien .gs-nombre { grid-column: 2; grid-row: 1; }
  .gs-lien .gs-obs { grid-column: 1 / -1; text-align: left; }
  .gs-jour-libelle { display: block; font-weight: 500; font-size: 16px; }
  .gs-tableau .gs-cellule--total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; }
}

/* ---------- Gestionnaire : saisie, demandes, à transmettre ---------- */

.gs-jour-titre { margin: 0; font-family: var(--police-titre); font-weight: 700; font-size: 20px; }
.gs-attente { margin: 0 0 16px; background: var(--ds-warm); }
.gs-attente-texte { margin: 8px 0 4px; }
.gs-attente-texte strong { font-weight: 600; }
.gs-saisie { margin: 0 0 24px; }
.gs-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.gs-actions form { margin: 0; }

.gs-demandes { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .gs-demandes { grid-template-columns: repeat(2, 1fr); }
}
.gs-demande { background: var(--ds-warm); display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.gs-demande h2 { margin: 8px 0 4px; }
.gs-demande-jour { margin: 0; font-weight: 600; }
.gs-demande-nombre { margin: 4px 0; font-family: var(--police-titre); font-weight: 700; font-size: 36px; line-height: 1.2; }
.gs-demande-obs { margin: 0 0 4px; }
@media (max-width: 719px) {
  .gs-actions { flex-direction: column; }
  .gs-actions form, .gs-actions .bouton { width: 100%; }
}

.gs-groupe { margin: 0 0 24px; }
.gs-groupe h2 { margin-bottom: 8px; }
.gs-lignes { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 16px; box-shadow: var(--ds-shadow); }
.gs-ligne { display: flex; align-items: flex-start; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--ds-border); }
.gs-ligne:last-child { border-bottom: 0; }
.gs-ligne form { margin: 0; flex: none; }
.gs-ligne-texte { min-width: 0; flex: 1; }
.gs-ligne-texte p { margin: 0; }
.gs-ligne-nombre { font-family: var(--police-titre); font-weight: 700; }
.gs-ligne-obs { overflow-wrap: anywhere; }
.gs-case {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px;
  background: transparent; border: 0; color: var(--ds-text); font-family: var(--police-corps); font-size: 14px; font-weight: 600; cursor: pointer;
}
.gs-case-boite {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--champ-contour); border-radius: 6px; background: #fff; color: var(--ds-green-deep); font-size: 16px; line-height: 1;
}
.gs-case:hover .gs-case-boite { border-color: var(--ds-green); }
.gs-ligne--cochee .gs-case-boite { background: var(--ds-sage); border-color: var(--ds-green); }
.gs-deja[open] > summary { margin-bottom: 8px; }
@media (max-width: 719px) {
  .gs-ligne { flex-direction: column; gap: 4px; }
}

/* ---------- La feuille de la semaine ---------- */

.gs-feuille-statut { margin: 0 0 12px; font-weight: 600; }
.gs-feuille-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 12px; }
.gs-feuille-actions form { margin: 0; }
@media (max-width: 719px) {
  .gs-feuille-actions .bouton, .gs-feuille-actions form { width: 100%; }
}
/* Sans le script, le bouton « Imprimer » ne ferait rien : une phrase le remplace. */
html:not(.agrement) [data-imprimer] { display: none; }
.agrement .sans-agrement { display: none; }

.feuille { background: #fff; border-radius: 16px; box-shadow: var(--ds-shadow); padding: 16px; margin: 0 0 24px; }
.feuille-titre { margin: 0 0 12px; }
.feuille-tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.feuille-tableau th, .feuille-tableau td { border: 1px solid var(--ds-text); padding: 8px; vertical-align: top; text-align: left; }
.feuille-tableau thead th { font-weight: 600; text-align: center; }
.feuille-tableau .feuille-jour { white-space: nowrap; text-align: left; }
.feuille-tableau .feuille-nombre { text-align: right; width: 64px; }
.feuille-tableau tbody td, .feuille-tableau tbody th { height: 52px; }
.feuille-tableau .feuille-ajouts { min-width: 180px; width: 20%; }
.feuille-tableau tfoot th, .feuille-tableau tfoot td { font-weight: 600; }
.feuille-hors { background: hsl(155 15% 94%); }
.feuille-pied { margin: 12px 0 0; font-size: 14px; color: var(--ds-text-muted); }

@page { size: A4 landscape; margin: 10mm; }
@media print {
  html, body { background: #fff; color: #000; }
  .entete, .hors-feuille { display: none !important; }
  .contenu { max-width: none; margin: 0; padding: 0; }
  .feuille { padding: 0; margin: 0; border-radius: 0; box-shadow: none; }
  .feuille .tableau-conteneur { overflow: visible; }
  .feuille-titre { font-size: 18px; margin: 0 0 6mm; color: #000; }
  .feuille-tableau { font-size: 12px; }
  .feuille-tableau th, .feuille-tableau td { border-color: #000; padding: 4px 6px; color: #000; }
  .feuille-tableau tbody td, .feuille-tableau tbody th { height: 16mm; }
  .feuille-hors { background: #fff; }
  .feuille-pied { color: #000; font-size: 12px; margin-top: 4mm; }
  .feuille-tableau tr { break-inside: avoid; }
}

/* ---------- Gestionnaire : le mois ---------- */

.gm-nombre { font-family: var(--police-titre); font-weight: 700; font-size: 16px; }
.gm-nombre--zero { color: var(--ds-text-muted); }
.gm-obs { display: block; font-size: 14px; line-height: 1.35; color: var(--ds-text-muted); overflow-wrap: anywhere; }
.gm-tableau tbody th { white-space: nowrap; font-weight: 500; }
.gm-hors { background: hsl(155 15% 94%); }
.gm-tableau tfoot td { font-family: var(--police-titre); font-weight: 700; }
.gm-mobile { display: none; }
@media (max-width: 719px) {
  .gm-bureau { display: none; }
  .gm-mobile { display: block; }
}
.gm-carte { margin: 0 0 16px; }
.gm-carte h2 { margin-bottom: 8px; }
.gm-liste { list-style: none; margin: 0; padding: 0; }
.gm-liste li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; padding: 8px 0; border-top: 1px solid var(--ds-border); }
.gm-liste-jour { font-weight: 500; }
.gm-liste .gm-obs { flex-basis: 100%; }
.gm-liste-total { font-weight: 600; }
.gm-general { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 24px; padding: 0 20px; font-weight: 600; }

/* ---------- Gestionnaire : les comptes ---------- */

.cp-liste { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.cp-ligne { padding: 16px 20px; }
.cp-ligne--inactive { background: hsl(155 15% 96%); box-shadow: none; border: 1px solid var(--ds-border); }
.cp-resume { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.cp-nom { margin: 0; font-family: var(--police-titre); font-weight: 700; font-size: 16px; }
.cp-detail { margin: 2px 0 0; overflow-wrap: anywhere; }
.cp-etat { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.cp-ligne--inactive .cp-etat { color: var(--ds-text-muted); }
@media (max-width: 719px) {
  .cp-resume { flex-direction: column; gap: 8px; }
}
.cp-modifier { margin-top: 8px; }
.cp-modifier > summary, .cp-ajout > summary { cursor: pointer; list-style: none; }
.cp-modifier > summary::-webkit-details-marker, .cp-ajout > summary::-webkit-details-marker { display: none; }
.cp-modifier > summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ds-green); }
.cp-panneau { padding-top: 12px; display: grid; gap: 12px; }
.cp-panneau form { margin: 0; }
.cp-ajout[open] > summary { margin-bottom: 12px; }
.cp-panneau.carte { padding: 20px; }
.cp-cases { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.cp-cases legend { padding: 0; margin: 0 0 4px; }
.cp-cases .champ-erreur { flex-basis: 100%; }
.cp-case {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  background: #fff; border: 1px solid var(--champ-contour); border-radius: 9999px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cp-case input { width: 20px; height: 20px; margin: 0; accent-color: var(--ds-green); }
.cp-case:has(input:checked) { background: var(--ds-sage); border-color: var(--ds-green); }
.cp-case:has(input:focus-visible) { outline: 3px solid var(--ds-green); outline-offset: 2px; }

/* Le mot de passe provisoire : lisible à la dictée, sélectionnable d'un clic. */
.cp-mdp { max-width: 520px; margin: 0 0 24px; }
.cp-mdp-valeur { margin: 16px 0; padding: 16px; background: hsl(155 15% 96%); border: 1px solid var(--ds-border); border-radius: 12px; text-align: center; }
.cp-mdp-valeur code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 28px; font-weight: 600; letter-spacing: 0.08em; user-select: all; overflow-wrap: anywhere; }
.cp-mdp-consigne { margin: 16px 0 0; font-weight: 600; }
/* Sans le script, « Copier » ne ferait rien : le mot de passe reste sélectionnable à la main. */
html:not(.agrement) [data-copier] { display: none; }

/* ---------- Emails de démonstration ---------- */

.em-liste { display: grid; gap: 16px; margin-top: 24px; }
.em-email h2 { margin: 4px 0 12px; font-size: 18px; }
.em-texte { margin: 0; padding: 12px 16px; background: hsl(155 15% 96%); border-radius: 12px; font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Utilitaires (la CSP interdit les attributs style) ---------- */

.icone-ligne { vertical-align: -2px; }
.titre-espace { margin-bottom: 16px; }
.texte-fort { font-weight: 600; }
.sans-marge { margin: 0; }
.espace-haut-16 { margin-top: 16px; }
.espace-haut-24 { margin-top: 24px; }
.largeur-360 { max-width: 360px; }
.largeur-480 { max-width: 480px; }
.fond-entete { background: var(--ds-green-deep); padding: 12px; border-radius: 12px; width: fit-content; }
