/* ==========================================================================
   Système de design — Passion Fruit Plannings
   CSS utilitaire écrit à la main : aucun build, aucun node_modules.
   La palette et les principes sont partagés avec l'outil de gestion des livraisons.
   Ordre du fichier : 1. jetons · 2. base · 3. coque · 4. composants · 5. écrans.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Police Inter, servie depuis le serveur du client (aucun appel externe)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/polices/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/polices/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   1. Jetons de design
   -------------------------------------------------------------------------- */
:root {
  /* Vert « fruit frais » : couleur de marque */
  --brand-50: #eefbf3;
  --brand-100: #d6f5e1;
  --brand-200: #aeebc5;
  --brand-300: #79d9a1;
  --brand-400: #43c079;
  --brand-500: #1fa35c;
  --brand-600: #15834a;
  --brand-700: #12683d;
  --brand-800: #125233;
  --brand-900: #0f442b;

  /* Orange « fruit de la passion » : accent rare, jamais un bouton */
  --accent-100: #ffedd5;
  --accent-500: #f97316;
  --accent-600: #ea580c;

  /* Neutres */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Sémantique */
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-500: #0ea5e9;
  --sky-700: #0369a1;

  --rayon: 10px;
  --rayon-lg: 14px;
  --ombre-carte: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --ombre-pop: 0 10px 30px -10px rgba(15, 23, 42, 0.35);
  --largeur-barre: 248px;
  --hauteur-onglets: 62px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--slate-800);
  background: var(--slate-100);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  color: var(--slate-900);
  letter-spacing: -0.011em;
}

h1 { font-size: 1.375rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }

p { margin: 0 0 0.6rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--brand-700);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

small { font-size: 0.8125rem; }

hr {
  border: 0;
  border-top: 1px solid var(--slate-200);
  margin: 1rem 0;
}

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

/* --------------------------------------------------------------------------
   3. Coque applicative : barre latérale sur PC, onglets bas sur téléphone
   -------------------------------------------------------------------------- */
.coque {
  min-height: 100vh;
}

.barre-laterale {
  display: none;
}

.entete-mobile {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
}

.entete-mobile .logo-pastille {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
}

.entete-mobile-titre {
  flex: 1;
  min-width: 0;
}

.entete-mobile-titre strong {
  display: block;
  font-size: 0.95rem;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entete-mobile-titre span {
  display: block;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.contenu {
  padding: 1rem 1rem calc(var(--hauteur-onglets) + 5.5rem);
  max-width: 1280px;
  margin: 0 auto;
}

/* Onglets bas (téléphone) */
.onglets {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: #fff;
  border-top: 1px solid var(--slate-200);
  padding-bottom: env(safe-area-inset-bottom);
}

.onglet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--hauteur-onglets);
  padding: 0.35rem 0.2rem;
  font-size: 0.6875rem;
  font-weight: 550;
  color: var(--slate-500);
  text-decoration: none;
  position: relative;
}

.onglet:hover { text-decoration: none; }
.onglet svg { width: 21px; height: 21px; }
.onglet.actif { color: var(--brand-600); }

.onglet .pastille {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red-600);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* Bouton flottant « Déclarer une absence » */
.bouton-flottant {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--hauteur-onglets) + 1rem + env(safe-area-inset-bottom));
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.15rem;
  border-radius: 26px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: var(--ombre-pop);
  border: 0;
  cursor: pointer;
}

.bouton-flottant:hover {
  background: var(--brand-700);
  text-decoration: none;
  color: #fff;
}

.bouton-flottant svg { width: 20px; height: 20px; }

/* Écrans larges : barre latérale, plus d'onglets bas */
@media (min-width: 1024px) {
  .coque {
    display: grid;
    grid-template-columns: var(--largeur-barre) 1fr;
  }

  .entete-mobile,
  .onglets {
    display: none;
  }

  .barre-laterale {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--slate-200);
    padding: 1.1rem 0.75rem;
    overflow-y: auto;
  }

  .contenu {
    padding: 1.75rem 2rem 3rem;
  }

  .bouton-flottant {
    display: none;
  }
}

.marque {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.4rem 1rem;
}

.logo-pastille {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.marque-texte strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--slate-900);
  line-height: 1.2;
}

.marque-texte span {
  font-size: 0.75rem;
  color: var(--slate-500);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-titre {
  padding: 1rem 0.65rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
}

.nav-lien {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate-700);
}

.nav-lien:hover {
  background: var(--slate-100);
  text-decoration: none;
}

.nav-lien.actif {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

.nav-lien svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--slate-400);
}

.nav-lien.actif svg { color: var(--brand-600); }

.nav-lien .compteur-nav {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--red-600);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
}

.pied-barre {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
}

.carte-utilisateur {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--slate-200);
  color: var(--slate-700);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.carte-utilisateur div { min-width: 0; }

.carte-utilisateur strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carte-utilisateur span {
  font-size: 0.6875rem;
  color: var(--slate-500);
}

/* --------------------------------------------------------------------------
   4. Composants
   -------------------------------------------------------------------------- */

/* En-tête de page */
.entete-page {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.entete-page .sous-titre {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  color: var(--slate-500);
}

.entete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.retour {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--slate-500);
}
.retour svg { width: 15px; height: 15px; }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--rayon);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: var(--brand-600);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-700); color: #fff; }

.btn-secondary {
  background: #fff;
  border-color: var(--slate-300);
  color: var(--slate-700);
}
.btn-secondary:hover { background: var(--slate-50); color: var(--slate-900); }

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
}
.btn-ghost:hover { background: var(--slate-100); color: var(--slate-900); }

.btn-danger {
  background: var(--red-600);
  color: #fff;
}
.btn-danger:hover { background: var(--red-700); color: #fff; }

.btn-sm {
  min-height: 36px;
  padding: 0 0.7rem;
  font-size: 0.8125rem;
  border-radius: 8px;
}
.btn-sm svg { width: 15px; height: 15px; }

.btn-bloc { width: 100%; }

.btn-icone {
  min-height: 38px;
  width: 38px;
  padding: 0;
}

/* Cartes */
.carte {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--rayon-lg);
  box-shadow: var(--ombre-carte);
  padding: 1rem;
}

.carte + .carte { margin-top: 0.85rem; }

.carte-nu { padding: 0; overflow: hidden; }

.carte-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--slate-200);
}

.carte-entete h2,
.carte-entete h3 { font-size: 0.9375rem; }

.carte-entete .sous-titre {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 0.1rem;
}

.carte-corps { padding: 1rem; }
.carte-pied {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.pile > * + * { margin-top: 0.85rem; }
.pile-serree > * + * { margin-top: 0.5rem; }

/* Grilles */
.grille {
  display: grid;
  gap: 0.85rem;
}
.grille-2 { grid-template-columns: 1fr; }
.grille-3 { grid-template-columns: 1fr; }
.grille-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tuiles d'indicateur */
.tuile {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--rayon-lg);
  box-shadow: var(--ombre-carte);
  padding: 0.85rem 0.95rem;
}

.tuile-libelle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tuile-valeur {
  margin-top: 0.2rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tuile-valeur .sur {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-400);
}

.tuile-aide {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.tuile-alerte { border-color: var(--red-200); background: var(--red-50); }
.tuile-alerte .tuile-valeur { color: var(--red-700); }
.tuile-attention { border-color: var(--amber-200); background: var(--amber-50); }
.tuile-attention .tuile-valeur { color: var(--amber-700); }

/* Étiquettes */
.etiquette {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  background: var(--slate-100);
  color: var(--slate-700);
  white-space: nowrap;
}

.etiquette-verte { background: var(--brand-50); color: var(--brand-700); }
.etiquette-rouge { background: var(--red-100); color: var(--red-700); }
.etiquette-ambre { background: var(--amber-100); color: var(--amber-700); }
.etiquette-bleue { background: var(--sky-100); color: var(--sky-700); }
.etiquette-orange { background: var(--accent-100); color: var(--accent-600); }
.etiquette-contour {
  background: #fff;
  border: 1px solid var(--slate-300);
  color: var(--slate-600);
}

.point {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Bandeaux d'alerte */
.bandeau {
  display: flex;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--rayon);
  border: 1px solid;
  font-size: 0.875rem;
}

.bandeau svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.bandeau strong { display: block; margin-bottom: 0.1rem; }
.bandeau .detail { margin-top: 0.25rem; font-size: 0.8125rem; opacity: 0.85; }

.bandeau-info { background: var(--sky-50); border-color: #bae6fd; color: var(--sky-700); }
.bandeau-succes { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.bandeau-attention { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-700); }
.bandeau-danger { background: var(--red-50); border-color: var(--red-200); color: var(--red-700); }

.bandeau + .bandeau { margin-top: 0.5rem; }

/* Formulaires */
.champ { margin-bottom: 0.9rem; }
.champ:last-child { margin-bottom: 0; }

.libelle {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
}

.libelle .obligatoire { color: var(--red-600); }

.saisie,
select.saisie,
textarea.saisie {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--rayon);
  background: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--slate-900);
  appearance: none;
}

select.saisie {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 17px;
  padding-right: 2.1rem;
}

textarea.saisie { min-height: 84px; resize: vertical; }

.saisie:focus {
  outline: 0;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.saisie::placeholder { color: var(--slate-400); }

.aide {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--slate-500);
}

.erreur-champ {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  color: var(--red-600);
  font-weight: 500;
}

.case-a-cocher {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0;
  cursor: pointer;
}

.case-a-cocher input[type="checkbox"],
.case-a-cocher input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand-600);
  flex-shrink: 0;
}

.case-a-cocher span { font-size: 0.9rem; }
.case-a-cocher .aide { margin-top: 0.1rem; }

.ligne-champs {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .ligne-champs-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ligne-champs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.actions-formulaire {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
}

@media (min-width: 640px) {
  .actions-formulaire {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* Choix rapides (raccourcis de dates, types d'absence) */
.choix-rapides {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.puce {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--slate-300);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
}

.puce:hover { background: var(--slate-50); }

.puce.active {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-700);
}

/* Choix de type d'absence : grands blocs tactiles */
.grille-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .grille-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.choix-type {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--rayon);
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  text-align: left;
}

.choix-type input { position: absolute; opacity: 0; pointer-events: none; }
.choix-type:hover { background: var(--slate-50); }

.choix-type:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-800);
  box-shadow: 0 0 0 1px var(--brand-500);
}

.choix-type .point { width: 11px; height: 11px; }

/* Listes */
.liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.liste-element {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-200);
}

.liste-element:last-child { border-bottom: 0; }
.liste-element:hover { background: var(--slate-50); }

a.liste-element { color: inherit; text-decoration: none; }

.liste-corps { flex: 1; min-width: 0; }

.liste-titre {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.liste-detail {
  font-size: 0.8125rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.liste-fin {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.chevron { width: 17px; height: 17px; color: var(--slate-300); flex-shrink: 0; }

/* Tableaux */
.defilement-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tableau th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-500);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

.tableau td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: var(--slate-50); }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; }

/* État vide */
.etat-vide {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--slate-500);
}

.etat-vide svg {
  width: 34px;
  height: 34px;
  color: var(--slate-300);
  margin-bottom: 0.5rem;
}

.etat-vide strong {
  display: block;
  color: var(--slate-700);
  font-size: 0.9375rem;
  margin-bottom: 0.2rem;
}

.etat-vide p { font-size: 0.875rem; }

/* Navigation de date */
.nav-date {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-date .date-courante {
  flex: 1;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--slate-800);
}

/* Capitale à l'initiale uniquement : « mercredi 9 septembre 2026 ».
   `text-transform: capitalize` mettrait une majuscule à chaque mot, ce qui n'est
   pas l'usage français. */
.capitale-initiale::first-letter {
  text-transform: uppercase;
}

.nav-date .date-courante::first-letter {
  text-transform: uppercase;
}

/* Sur téléphone, la date passe sur sa propre ligne : elle n'écrase plus les flèches. */
@media (max-width: 639px) {
  .nav-date {
    flex-wrap: wrap;
  }

  .nav-date .date-courante {
    order: -1;
    flex: 1 0 100%;
    margin-bottom: 0.35rem;
  }

  /* La flèche « précédent » reste à gauche, le reste est poussé à droite. */
  .nav-date > a:first-of-type {
    margin-right: auto;
  }
}

/* Barre de segments (mois / semaine) */
.segments {
  display: inline-flex;
  padding: 3px;
  background: var(--slate-200);
  border-radius: 10px;
  gap: 2px;
}

.segment {
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-600);
}

.segment:hover { text-decoration: none; color: var(--slate-900); }

.segment.actif {
  background: #fff;
  color: var(--slate-900);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

/* Barre de progression d'effectif */
.jauge {
  height: 6px;
  border-radius: 3px;
  background: var(--slate-200);
  overflow: hidden;
  margin-top: 0.5rem;
}

.jauge span {
  display: block;
  height: 100%;
  background: var(--brand-500);
  border-radius: 3px;
}

.jauge.alerte span { background: var(--red-500); }

/* Dialogue (remplace confirm()) */
dialog.modale {
  border: 0;
  padding: 0;
  border-radius: var(--rayon-lg);
  box-shadow: var(--ombre-pop);
  width: min(520px, calc(100vw - 2rem));
  color: var(--slate-800);
}

dialog.modale::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.modale-entete {
  padding: 1rem 1.15rem 0.5rem;
}

.modale-corps { padding: 0 1.15rem 1rem; font-size: 0.9rem; }

.modale-pied {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
}

@media (min-width: 640px) {
  .modale-pied { flex-direction: row; justify-content: flex-end; }
}

/* Sur téléphone, la modale devient un panneau bas */
@media (max-width: 639px) {
  dialog.modale {
    width: 100vw;
    max-width: 100vw;
    margin: auto auto 0;
    border-radius: var(--rayon-lg) var(--rayon-lg) 0 0;
  }
}

/* Notifications */
.zone-messages {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0.75rem;
  z-index: 60;
  width: min(460px, calc(100vw - 1.5rem));
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   5. Écrans spécifiques
   -------------------------------------------------------------------------- */

/* Connexion */
.page-connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 15% 0%, var(--brand-100), transparent 45%),
    radial-gradient(circle at 85% 100%, var(--brand-50), transparent 40%),
    var(--slate-100);
}

.bloc-connexion {
  width: min(400px, 100%);
}

.bloc-connexion .marque {
  justify-content: center;
  padding-bottom: 1.25rem;
}

/* Vue du jour : carte de service */
.carte-service {
  display: block;
  color: inherit;
}

.carte-service:hover { text-decoration: none; }

.entete-service {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.entete-service h3 { font-size: 0.9375rem; }

.chiffre-presence {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-900);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chiffre-presence .sur {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-400);
}

.carte-service.en-alerte {
  border-color: var(--red-200);
  background: var(--red-50);
}

.carte-service.en-alerte .chiffre-presence { color: var(--red-700); }

.absents-service {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--slate-200);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ligne-absent {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
}

.ligne-absent .nom {
  font-weight: 550;
  color: var(--slate-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ligne-absent .motif { color: var(--slate-500); margin-left: auto; white-space: nowrap; }

/* Planning */
.cadre-planning {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--rayon-lg);
  border: 1px solid var(--slate-200);
  background: #fff;
  box-shadow: var(--ombre-carte);
}

table.planning {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 0.8125rem;
}

table.planning th,
table.planning td {
  border-bottom: 1px solid var(--slate-100);
  border-right: 1px solid var(--slate-100);
}

table.planning thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--slate-50);
  padding: 0.35rem 0.2rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--slate-500);
  min-width: 30px;
  border-bottom: 1px solid var(--slate-200);
}

table.planning thead th .num {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--slate-700);
}

table.planning thead th.we { background: var(--slate-100); }
table.planning thead th.ferie { background: var(--accent-100); color: var(--accent-600); }
table.planning thead th.ferie .num { color: var(--accent-600); }
table.planning thead th.aujourdhui { background: var(--brand-100); }
table.planning thead th.aujourdhui .num { color: var(--brand-800); }

/* Colonne des noms figée */
table.planning th.col-nom,
table.planning td.col-nom {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  min-width: 148px;
  max-width: 148px;
  padding: 0.35rem 0.6rem;
  text-align: left;
  border-right: 1px solid var(--slate-200);
}

table.planning thead th.col-nom { z-index: 4; background: var(--slate-50); }

table.planning td.col-nom .nom {
  font-weight: 600;
  color: var(--slate-800);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

table.planning td.col-nom .meta {
  font-size: 0.6875rem;
  color: var(--slate-400);
}

table.planning tr.ligne-groupe td {
  background: var(--slate-100);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  left: 0;
}

table.planning td.case {
  padding: 0;
  height: 30px;
  min-width: 30px;
  text-align: center;
  vertical-align: middle;
}

.case-contenu {
  display: block;
  width: 100%;
  height: 30px;
  line-height: 30px;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
}

.case-travail { background: #fff; }
.case-repos { background: var(--slate-100); }
.case-repos .case-contenu { color: var(--slate-300); font-weight: 500; }
.case-chome { background: repeating-linear-gradient(45deg, var(--slate-200), var(--slate-200) 4px, var(--slate-100) 4px, var(--slate-100) 8px); }
.case-we { background: var(--slate-50); }
.case-attente { position: relative; }
.case-attente .case-contenu { opacity: 0.6; }
.case-demi { background-image: linear-gradient(to bottom, transparent 50%, rgba(255, 255, 255, 0.55) 50%); }

.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  font-size: 0.75rem;
  color: var(--slate-600);
}

.legende span { display: inline-flex; align-items: center; gap: 0.35rem; }

.pastille-legende {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

/* Journal d'audit */
.ligne-audit .horodatage {
  font-size: 0.75rem;
  color: var(--slate-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.diff {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
}

.diff-ligne {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.diff-cle { color: var(--slate-500); min-width: 110px; }
.diff-avant { color: var(--red-600); text-decoration: line-through; }
.diff-apres { color: var(--brand-700); font-weight: 600; }

/* Utilitaires ponctuels */
.texte-secondaire { color: var(--slate-500); }
.texte-petit { font-size: 0.8125rem; }
.texte-danger { color: var(--red-600); }
.texte-succes { color: var(--brand-700); }
.gras { font-weight: 650; }
.centre { text-align: center; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.rangee { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rangee-serree { display: flex; align-items: center; gap: 0.3rem; }
.pousse { margin-left: auto; }
.sans-marge { margin: 0; }
.masque-mobile { display: none; }
.nombre-tabulaire { font-variant-numeric: tabular-nums; }

@media (min-width: 768px) {
  .masque-mobile { display: revert; }
  .masque-bureau { display: none; }
}

@media print {
  .barre-laterale,
  .onglets,
  .entete-mobile,
  .bouton-flottant,
  .entete-actions { display: none !important; }
  body { background: #fff; }
  .contenu { padding: 0; max-width: none; }
  .carte, .tuile, .cadre-planning { box-shadow: none; break-inside: avoid; }
}
