/* ============================================================
   theme.css — Système visuel du portail Crème & Cie
   Direction « Comptoir » : outil de travail — neutre, dense en
   information, un seul accent : le bleu du logo.
   Ce fichier est la SEULE source des jetons de design.
   ============================================================ */

:root {
  /* Accent — le bleu du logo (#3F82AA, teinte 202°), un seul par écran.
     Assombri de 2 % de clarté : à sa valeur d'origine il ne donnait que 4,21:1
     sur blanc, sous le seuil de 4,5:1 exigé pour du texte courant. */
  --accent:       #3D7DA3;   /* 4,51:1 sur blanc */
  --accent-dark:  #336989;   /* survol / pressé */
  --accent-deep:  #29556F;   /* bandeau de connexion */
  --accent-tint:  #E9F1F6;   /* pastille, onglet actif, survol discret */
  --accent-line:  #B4CCDA;   /* bordure d'accent */

  /* Surfaces */
  --bg:          #f5f7f7;
  --surface:     #ffffff;
  --surface-alt: #fafbfb;
  --line:        #edf0f0;
  --line-strong: #dfe3e3;

  /* Texte */
  --ink:         #13100d;   /* texte principal — noir chaud */
  --ink-mid:     #6f6d6d;   /* texte secondaire lisible (4.5:1 sur blanc) */
  --ink-soft:    #8c8c8b;   /* labels, métadonnées — 12 px minimum */

  /* États — « fait / conforme » se dit en --accent ; aucun vert dans l'interface */
  --ok:          #3D7DA3;
  --ok-bg:       #e9f1f6;
  --ok-line:     #b4ccda;
  --warn:        #8a5a16;
  --warn-bg:     #fbf2e3;
  --warn-line:   #eedcb8;
  --danger:      #b4463c;
  --danger-bg:   #fdf2f1;
  --danger-line: #f0dad7;

  /* Typo */
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Formes */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow:    0 1px 2px rgba(19,16,13,.05);
  --shadow-lg: 0 18px 44px -18px rgba(19,16,13,.28);

  /* Rythme */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;

  /* Chrome de l'app */
  --appbar-h: 56px;
  --navbar-h: 60px;
  --rail-w:   232px;
}

/* ── BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ── TYPOGRAPHIE ────────────────────────────────────────── */
.t-page    { font-size: 22px; font-weight: 800; line-height: 1.2;  color: var(--ink); }
.t-section { font-size: 17px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.t-card    { font-size: 16px; font-weight: 700; line-height: 1.3;  color: var(--ink); }
.t-body    { font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--ink); }
.t-sub     { font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--ink-mid); }
.t-meta    { font-size: 12px; font-weight: 600; line-height: 1.2;  color: var(--ink-soft); }
.t-over {
  font-size: 11px; font-weight: 700; line-height: 1;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
}
.num, time, .tabular { font-variant-numeric: tabular-nums; }

/* ── ICÔNES ─────────────────────────────────────────────── */
.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: 300;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  flex-shrink: 0;
  user-select: none;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
.icon-lg { font-size: 24px; }
.icon-sm { font-size: 18px; }

/* ============================================================
   CHROME DE L'APPLICATION
   Téléphone : barre de titre en haut, barre d'onglets en bas.
   ≥ 900 px   : la barre d'onglets devient une barre latérale.
   ============================================================ */

/* ── BARRE DE TITRE ─────────────────────────────────────── */
.appbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--appbar-h);
  padding: var(--s3) var(--s4);
  padding-top: max(var(--s3), env(safe-area-inset-top));
  padding-left: max(var(--s4), env(safe-area-inset-left));
  padding-right: max(var(--s4), env(safe-area-inset-right));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin-left: -8px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s ease;
}
.appbar-back:hover { background: var(--surface-alt); }
.appbar-texte { flex: 1; min-width: 0; }
.appbar-titre {
  font-size: 18px; font-weight: 800; line-height: 1.25; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-sous {
  font-size: 13px; font-weight: 500; color: var(--ink-mid); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-action {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 40px;
  padding: 0 var(--s2);
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--accent);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s ease;
}
.appbar-action:hover { background: var(--accent-tint); }
/* Sur téléphone, la barre de titre doit garder le titre lisible : les actions
   secondaires perdent leur libellé et se réduisent à leur icône. */
@media (max-width: 599px) {
  .appbar-action .label { display: none; }
  .appbar-action { padding: 0 var(--s1); min-width: 40px; justify-content: center; }
}

.avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
}

/* ── NAVIGATION ───────────────────────────────────────────
   Téléphone : rangée défilante fixée en bas (.navbar-scroll).
   ≥ 900 px   : barre latérale groupée (.navbar-rail).
   Les deux listes coexistent dans le HTML ; une seule s'affiche.
   ─────────────────────────────────────────────────────── */
.navbar { position: fixed; z-index: 70; }
.navbar-rail, .navbar-scroll { display: none; }

.navbar-item {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color .15s ease, background .15s ease;
}
.navbar-item.active { color: var(--accent); }
.navbar-badge {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px;
  text-align: center;
}
.navbar-bientot {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: 11px; font-weight: 600;
}

/* ── Téléphone : barre du bas ── */
@media (max-width: 899px) {
  .navbar {
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .navbar-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Le dégradé à droite dit qu'il reste des onglets. */
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .navbar-scroll::-webkit-scrollbar { display: none; }

  .navbar-scroll .navbar-item {
    flex: 0 0 76px;
    scroll-snap-align: start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: var(--navbar-h);
    padding: var(--s2) var(--s1);
    font-size: 11px;
  }
  .navbar-scroll .navbar-item .icon { font-size: 22px; }
  .navbar-scroll .navbar-label { white-space: nowrap; }
  .navbar-scroll .navbar-bientot { display: none; }
  .navbar-scroll .navbar-badge {
    position: absolute;
    top: 6px; left: 50%;
    margin-left: 6px;
    min-width: 16px; height: 16px;
    font-size: 10px; line-height: 16px;
  }
}

/* ── ≥ 900 px : barre latérale ── */
@media (min-width: 900px) {
  body { padding-left: var(--rail-w); }

  .navbar {
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
  }
  .navbar-rail {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: var(--s4) var(--s3);
    padding-top: max(var(--s4), env(safe-area-inset-top));
    padding-bottom: max(var(--s4), env(safe-area-inset-bottom));
  }
  .navbar-logo {
    display: block;
    width: 128px; height: auto;
    margin: var(--s2) var(--s2) var(--s5);
  }
  .navbar-groupe {
    font-size: 11px; font-weight: 700; line-height: 1;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-soft);
    padding: var(--s4) var(--s3) 6px;
  }
  .navbar-rail .navbar-item {
    gap: var(--s3);
    min-height: 44px;
    padding: 0 var(--s3);
    border-radius: var(--r-md);
    font-size: 15px;
    color: var(--ink);
  }
  .navbar-rail .navbar-item:hover { background: var(--surface-alt); }
  /* Un libellé long ne doit ni passer sous la pastille, ni faire grandir la ligne. */
  .navbar-rail .navbar-label {
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .navbar-rail .navbar-bientot { flex-shrink: 0; margin-left: var(--s2); }
  .navbar-rail .navbar-item.active { background: var(--accent-tint); color: var(--accent); }
  .navbar-rail .navbar-badge { margin-left: auto; }
  /* Le petit carré « nouvel onglet » d'un lien vers un autre site. */
  .navbar-rail .navbar-externe { margin-left: auto; color: var(--ink-soft); }
  .navbar-deco { margin-top: auto; color: var(--ink-mid) !important; }
  .navbar-deco:hover { background: var(--surface-alt); }
}

/* ── SURFACE DE LA PAGE ─────────────────────────────────── */
/*
 * Le conteneur de tout contenu d'écran. Il porte trois choses que rien
 * d'autre ne porte :
 *   1. la gouttière latérale (le contenu ne touche jamais le bord de l'écran) ;
 *   2. l'espacement vertical entre les blocs — d'où le `gap` plutôt que des
 *      marges sur chaque composant, qui se seraient contredites ;
 *   3. le dégagement sous la barre d'onglets fixe, sinon le dernier bouton de
 *      la page (« Terminer l'ouverture »…) se retrouve caché derrière elle.
 */
.ecran {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
  padding-left:  max(var(--s4), env(safe-area-inset-left));
  padding-right: max(var(--s4), env(safe-area-inset-right));
  padding-bottom: calc(var(--navbar-h) + var(--s6) + env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  .ecran {
    max-width: 1040px;
    gap: var(--s4);
    padding: var(--s5);
    padding-bottom: var(--s6);
  }
}

/* Intertitre d'une section de page : « À surveiller aujourd'hui », « Rapports »… */
.section-label {
  font-size: 11px; font-weight: 700; line-height: 1;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: var(--s2);
}

/* ── CHOIX EN PASTILLES ─────────────────────────────────── */
/*
 * Une liste fermée où l'on coche : météo d'un bordereau, allergie d'une
 * commande. Partagé par plusieurs pages, donc ici plutôt que dupliqué dans
 * le <style> de chacune — c'est ce qui avait fait diverger les copies.
 * Marche avec une case à cocher comme avec un bouton radio.
 */
.meteo-choix, .cmd-allergie-choix { display: flex; flex-wrap: wrap; gap: var(--s2); }
.meteo-case {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--s3);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-mid);
  letter-spacing: normal; text-transform: none; margin-bottom: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.meteo-case:hover { background: var(--surface-alt); }
.meteo-case input { display: none; }
.meteo-coche { color: transparent; font-size: 16px; transition: color .15s ease; }
.meteo-case:has(input:checked) {
  border-color: var(--accent); background: var(--accent-tint); color: var(--accent);
}
.meteo-case:has(input:checked) .meteo-coche { color: var(--accent); }

/* Deux colonnes qui se replient sur téléphone. */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 599px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ── CARTE ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--s5);
}
.card-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ink);
  margin-bottom: var(--s4);
}

/* ── LISTE DE LIENS ─────────────────────────────────────── */
.liste {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.liste-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 60px;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  background: var(--surface);
  transition: background .15s ease;
}
.liste-item:last-child { border-bottom: none; }
.liste-item:hover { background: var(--surface-alt); }
.liste-item > .icon:first-child { color: var(--ink-mid); }
.liste-texte { flex: 1; min-width: 0; }
.liste-chevron { color: var(--ink-soft); margin-left: auto; }

/* ── TUILES DE CHIFFRES ─────────────────────────────────── */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.tuile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--s4);
  text-decoration: none;
  display: block;
  transition: border-color .15s ease;
}
.tuile:hover { border-color: var(--line-strong); }
.tuile-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s3);
}
.tuile-nom { font-size: 13px; font-weight: 600; color: var(--ink-mid); }
.tuile-tete .icon { color: var(--ink-soft); font-size: 18px; }
.tuile-chiffre {
  font-size: 30px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-bottom: var(--s2);
}
.tuile-note { font-size: 12px; font-weight: 500; color: var(--ink-mid); text-wrap: pretty; }
.tuile.alerte .tuile-chiffre,
.tuile.alerte .tuile-note,
.tuile.alerte .tuile-tete .icon { color: var(--danger); }

/* ── BOUTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 20px;
  border-radius: var(--r-md);
  font: 700 15px/1 var(--font-ui);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--ink-mid); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-alt); color: var(--ink); }
.btn-quiet   { background: transparent; color: var(--ink-mid); border-color: transparent; }
.btn-quiet:hover { background: var(--surface-alt); color: var(--ink); }
.btn-danger  { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-block   { width: 100%; }
.btn-icon    { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: var(--r-sm); }
.btn-sm      { min-height: 40px; padding: 0 var(--s3); font-size: 13px; }
.btn-icon.is-delete:hover { color: var(--danger); background: var(--danger-bg); }

/* Action principale ancrée au-dessus de la barre d'onglets */
.barre-action {
  position: sticky;
  bottom: 0;
  margin: var(--s4) calc(var(--s4) * -1) 0;
  padding: var(--s3) var(--s4);
  padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
@media (max-width: 899px) {
  .barre-action { bottom: calc(var(--navbar-h) + env(safe-area-inset-bottom)); }
}
@media (min-width: 900px) {
  .barre-action {
    position: static;
    margin: var(--s5) 0 0;
    padding: 0;
    background: none;
    border-top: none;
  }
  .barre-action .btn { max-width: 320px; }
  /* Un bouton pleine largeur sur 880 px est une cible démesurée */
  .card .btn-block, .carte-quart .btn { max-width: 320px; }
}

/* ── CHAMPS ─────────────────────────────────────────────── */
:where(input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="email"], input[type="tel"],
select, textarea, .form-input) {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  font: 500 15px/1 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
:where(textarea) { padding: var(--s3) 14px; line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus, .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,125,163,.16);
}
input.invalid, .invalid { border-color: var(--danger); }
input:disabled, input[readonly] { background: var(--surface-alt); color: var(--ink-mid); }

.form-group { margin-bottom: var(--s4); }
label, .form-label {
  display: block;
  font-size: 13px; font-weight: 600; line-height: 1.2;
  color: var(--ink-mid);
  margin-bottom: var(--s2);
}

/* ── PASTILLE ───────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font: 600 12px/1 var(--font-ui);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip .icon { font-size: 15px; }
.chip-ok     { background: var(--ok-bg);     border-color: var(--ok-line);     color: var(--ok); }
.chip-warn   { background: var(--warn-bg);   border-color: var(--warn-line);   color: var(--warn); }
.chip-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.chip-accent { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }

/* Compat : anciennes classes .badge-* */
.badge        { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px;
                font: 600 12px/1 var(--font-ui); border: 1px solid var(--line);
                background: var(--surface-alt); color: var(--ink-mid); }
.badge-blue   { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }
.badge-green  { background: var(--ok-bg);       border-color: var(--ok-line);     color: var(--ok); }
.badge-orange { background: var(--warn-bg);     border-color: var(--warn-line);   color: var(--warn); }
.badge-red    { background: var(--danger-bg);   border-color: var(--danger-line); color: var(--danger); }
.badge-gray   { background: var(--surface-alt); border-color: var(--line);        color: var(--ink-mid); }

/* ── LISTE DE TÂCHES ────────────────────────────────────── */
.task-legend { font-size: 12px; font-weight: 500; color: var(--ink-soft); padding: 0 var(--s1); }

.task-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.task-item {
  display: flex; align-items: flex-start; gap: var(--s4);
  padding: var(--s5);
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background .15s ease;
}
.task-item:last-child { border-bottom: none; }
.task-item.state-done { background: var(--ok-bg); }
.task-item.state-skip { background: var(--danger-bg); }
.task-item.drag-over  { box-shadow: inset 0 2px 0 var(--accent); }
.task-item.dragging   { opacity: .4; }

.task-toggle-btn {
  position: relative;
  width: 28px; height: 28px;
  margin-top: 1px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background .15s ease, border-color .15s ease;
}
.task-toggle-btn::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 48px; height: 48px; transform: translate(-50%, -50%);
}
.task-toggle-btn .icon { font-size: 19px; color: #fff; opacity: 0; }
.task-toggle-btn.state-done { background: var(--ok);     border-color: var(--ok); }
.task-toggle-btn.state-skip { background: var(--danger); border-color: var(--danger); }
.task-toggle-btn.state-done .icon,
.task-toggle-btn.state-skip .icon { opacity: 1; }

.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.task-text.completed { text-decoration: line-through; color: var(--ink-soft); }
.task-text.skipped   { text-decoration: line-through; color: var(--danger); }
.task-meta { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: var(--s1); }
.task-freq {
  display: inline-flex; align-items: center;
  margin-left: var(--s2);
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-alt); border: 1px solid var(--line); color: var(--ink-mid);
  font-size: 11px; font-weight: 600;
}
.task-actions { display: flex; gap: var(--s1); margin-left: auto; flex-shrink: 0; }
@media (max-width: 599px) {
  /* Les outils du superviseur ne doivent pas écraser le texte de la tâche */
  .task-item { gap: var(--s3); padding: var(--s4); }
  .task-actions .btn-icon { width: 36px; height: 36px; min-height: 36px; }
}

.drag-handle {
  display: flex; align-items: center;
  color: var(--ink-soft);
  cursor: grab;
  user-select: none;
  transition: opacity .15s ease;
  margin-top: 2px;
}
.drag-handle:active { cursor: grabbing; }
@media (hover: hover) and (pointer: fine) {
  .drag-handle { opacity: 0; }
  .task-item:hover .drag-handle, tr:hover .drag-handle { opacity: 1; }
}

/* ── BARRE DE SESSION ───────────────────────────────────── */
.session-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--s4) var(--s5);
}
.session-bar-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s3);
}
.session-bar-info { font-size: 13px; font-weight: 600; color: var(--ink); }
.session-bar-compte { font-size: 13px; font-weight: 500; color: var(--ink-mid); font-variant-numeric: tabular-nums; }

/* ── BARRE DE PROGRESSION ───────────────────────────────── */
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width .35s ease; }
.progress-text {
  font-size: 13px; font-weight: 500; color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s2);
}

/* ── NOTIFICATION ───────────────────────────────────────── */
.notification {
  position: fixed;
  top: calc(var(--appbar-h) + 12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: var(--s2);
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font: 600 14px/1.3 var(--font-ui);
  z-index: 2000;
}
.notification.active { display: inline-flex; animation: toastIn .2s ease; }
.notification.error  { background: var(--danger); }
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(-8px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.notif {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.notif-ok  { background: var(--ok-bg);     border-color: var(--ok-line);     color: var(--ok); }
.notif-err { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }

/* ── POPUP ──────────────────────────────────────────────── */
.popup-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(19,16,13,.5);
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.popup-overlay.active { display: flex; align-items: center; justify-content: center; padding: var(--s5); }
.popup {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s6);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.popup-title {
  font-size: 17px; font-weight: 700; line-height: 1.25; color: var(--ink);
  margin-bottom: var(--s5);
  display: flex; align-items: center; gap: var(--s2);
}
.popup-actions { display: flex; gap: var(--s2); margin-top: var(--s6); justify-content: flex-end; }
@media (max-width: 599px) {
  .popup-overlay.active { align-items: flex-end; padding: 0; }
  .popup {
    max-width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: max(var(--s6), calc(var(--s4) + env(safe-area-inset-bottom)));
  }
  .popup-actions { flex-direction: column-reverse; }
  .popup-actions .btn { width: 100%; }
}

/* ── TABLEAUX ───────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card > .table-wrap {
  border: none; border-radius: 0; box-shadow: none;
  margin: 0 calc(var(--s5) * -1) calc(var(--s5) * -1);
}
.card > .table-wrap th:first-child,
.card > .table-wrap td:first-child { padding-left: var(--s5); }
.card > .table-wrap th:last-child,
.card > .table-wrap td:last-child  { padding-right: var(--s5); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  background: var(--surface-alt);
  font-size: 11px; font-weight: 700; line-height: 1;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-alt); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── ÉTAT VIDE ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--s8) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.empty-state-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--s4);
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.empty-state-icon .icon { font-size: 26px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: var(--s2); }
.empty-state-text  { font-size: 14px; font-weight: 500; color: var(--ink-mid); text-wrap: pretty; max-width: 42ch; margin: 0 auto var(--s4); }

.loading { text-align: center; padding: var(--s6); font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ── MOUVEMENT ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   TABLEAU DE BORD D'ACCUEIL
   ============================================================ */

/* ── Carte du quart ── */
.carte-quart .quart-tete {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.carte-quart .quart-pastille {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-tint);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.carte-quart .quart-pastille .icon { font-size: 22px; }
.carte-quart .quart-texte { flex: 1; min-width: 0; }
.carte-quart .quart-nom { font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.carte-quart .quart-compte {
  font-size: 13px; font-weight: 500; color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.carte-quart .quart-prochaine {
  font-size: 13px; font-weight: 500; color: var(--ink-mid);
  margin-top: var(--s3);
  text-wrap: pretty;
}
.carte-quart .quart-prochaine strong { color: var(--ink); font-weight: 600; }
.carte-quart .btn { margin-top: var(--s4); }

/* ── Listes détaillées (gâteaux, gélatos) ── */
.bloc-liste {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bloc-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 14px var(--s5);
  border-bottom: 1px solid var(--line);
}
.bloc-titre { font-size: 16px; font-weight: 700; color: var(--ink); }
.bloc-lien { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.bloc-lien:hover { text-decoration: underline; }
.bloc-vide { padding: var(--s5); font-size: 14px; font-weight: 500; color: var(--ink-mid); }

.bloc-ligne {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 64px;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}
.bloc-ligne:last-child { border-bottom: none; }
.bloc-ligne:hover { background: var(--surface-alt); }
.bloc-corps { flex: 1; min-width: 0; }
.bloc-nom { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.bloc-detail { display: block; font-size: 13px; font-weight: 500; color: var(--ink-mid); margin-top: 2px; text-wrap: pretty; }

/* Point de statut d'une commande */
.bloc-point { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--line-strong); }
.bloc-point.prete { background: var(--accent); }
.bloc-point.preparation { background: var(--warn); }

/* Bloc date d'un gélato qui expire */
.bloc-date {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.bloc-date .jour { font-size: 16px; font-weight: 800; line-height: 1; color: var(--ink); }
.bloc-date .mois { font-size: 10px; font-weight: 700; line-height: 1; text-transform: uppercase; color: var(--ink-mid); margin-top: 2px; }
.bloc-date.danger { background: var(--danger-bg); border-color: var(--danger-line); }
.bloc-date.danger .jour, .bloc-date.danger .mois { color: var(--danger); }
.bloc-date.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.bloc-date.warn .jour, .bloc-date.warn .mois { color: var(--warn); }

.bloc-echeance { font-size: 13px; font-weight: 700; white-space: nowrap; }
.bloc-echeance.danger { color: var(--danger); }
.bloc-echeance.warn { color: var(--warn); }

/* Deux colonnes dès qu'il y a la place */
.listes-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--s3);
}

/* ============================================================
   FEUILLE COMPTE (téléphone)
   ============================================================ */
.feuille-compte .popup { padding: 0 0 var(--s4); }
.feuille-poignee {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: var(--s3) auto var(--s2);
}
.feuille-tete {
  padding: var(--s3) var(--s5) var(--s4);
  border-bottom: 1px solid var(--line);
}
.feuille-nom { font-size: 16px; font-weight: 700; color: var(--ink); }
.feuille-role { font-size: 13px; font-weight: 500; color: var(--ink-mid); margin-top: 2px; }
.feuille-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 52px;
  padding: 0 var(--s5);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background .15s ease;
}
.feuille-item:hover { background: var(--surface-alt); }
.feuille-item .icon { color: var(--ink-mid); }

/* Sur grand écran, tout est déjà dans la barre latérale. */
@media (min-width: 900px) {
  .avatar { pointer-events: none; }
  .feuille-compte { display: none !important; }
}


/* ============================================================
   COMPOSANTS DES PAGES DE SECTION
   Ils vivaient dans le <style> d'operations.php ; depuis le découpage en
   pages, ils sont partagés ici — ouverture, fermeture, températures,
   qualité, gélatos, hebdo et tâche autre les utilisent.
   ============================================================ */
/* ── ÉCRAN D'IDENTIFICATION ── */
/* Écran d'identification — une porte d'entrée, pas un formulaire perdu dans un coin :
   la carte est centrée et son en-tête aussi. Les champs, eux, restent alignés à
   gauche : on remplit mieux une colonne qu'un texte centré. */
.lock-screen {
  max-width: 420px;
  margin-inline: auto;
  padding: var(--s6) var(--s5) var(--s5);
}
.lock-screen-glyphe {
  width: 52px; height: 52px;
  margin: 0 auto var(--s4);
  border-radius: var(--r-md);
  background: var(--accent-tint);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.lock-screen-glyphe .icon { font-size: 26px; }
.lock-screen-title {
  font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--ink);
  text-align: center;
  margin-bottom: var(--s1);
}
.lock-screen-subtitle {
  font-size: 13px; font-weight: 500; color: var(--ink-mid);
  text-align: center;
  text-wrap: pretty;
  margin-bottom: var(--s5);
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6d6d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  cursor: pointer;
}

.lock-emp-list { margin-bottom: var(--s3); }
.lock-emp-list:empty { margin-bottom: 0; }
.lock-emp-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-tint);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px; font-weight: 600;
    margin: 0 var(--s1) var(--s1) 0;
}
.lock-emp-tag .remove-emp { display: inline-flex; cursor: pointer; color: var(--ink-soft); font-size: 16px; }
.lock-emp-tag .remove-emp:hover { color: var(--danger); }

.tasks-wrapper, .temp-form-wrapper { display: none; }
.tasks-wrapper.unlocked, .temp-form-wrapper.unlocked { display: block; }
.tasks-wrapper > * + *, .temp-form-wrapper > * + * { margin-top: var(--s3); }

.week-display {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    padding: var(--s3) var(--s4);
    text-align: center;
    font-size: 13px; font-weight: 600; color: var(--ink-mid);
    font-variant-numeric: tabular-nums;
}
.week-display strong { color: var(--ink); font-weight: 700; }

/* ── GÉLATOS ── */
.gelato-group-title {
    display: flex; align-items: center; gap: var(--s2);
    font-size: 11px; font-weight: 700; line-height: 1;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
    margin-top: var(--s5);
}
/* Le sous-titre d'un groupe : ce que « présentoir » et « congélateur »
   veulent dire, une fois pour toutes, au-dessus des cartes. */
.gelato-group-note {
    margin-left: auto;
    letter-spacing: normal; text-transform: none;
    font-size: 11px; font-weight: 600; color: var(--ink-soft);
}
.gelato-card { padding: var(--s5); }
.gelato-card.urgent  { border-color: var(--danger-line); }
.gelato-card.warning { border-color: var(--warn-line); }
.gelato-name { font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.gelato-info { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }

/* Où se trouve le gélato : une ligne, un pictogramme, une couleur.
   C'est la première question qu'on se pose devant la liste. */
.gelato-etat { margin-top: var(--s3); }
.gelato-lieu {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.gelato-lieu.froid { color: var(--ink-mid); }
.gelato-lieu.chaud { color: var(--accent); }

.gelato-dates {
    font-size: 13px; font-weight: 500; color: var(--ink-mid);
    font-variant-numeric: tabular-nums; margin-top: var(--s2);
}
.gelato-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.gelato-actions {
    display: flex; align-items: center; gap: var(--s2);
    margin-top: var(--s4); padding-top: var(--s4);
    border-top: 1px solid var(--line);
}
.gelato-actions .spacer { margin-left: auto; }

/* ── SÉLECTEUR DE QUART ── */
.temp-period-selector, .qualite-period-selector {
    display: flex;
    gap: var(--s1);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s1);
}
.temp-period-btn, .qualite-period-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
    min-height: 44px;
    padding: 0 var(--s3);
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink-mid);
    font: 600 14px/1 var(--font-ui);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.temp-period-btn.active, .qualite-period-btn.active {
    background: var(--accent);
    color: #fff;
}

/* ── TEMPÉRATURES ── */
.temp-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.temp-section-head {
    padding: var(--s4) var(--s5) var(--s3);
    border-bottom: 1px solid var(--line);
    background: var(--surface-alt);
}
.temp-section-label {
    font-size: 11px; font-weight: 700; line-height: 1;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
    margin-bottom: var(--s2);
}
.temp-norme { display: flex; flex-wrap: wrap; gap: var(--s2); }

.temp-appareil-card {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    border-bottom: 1px solid var(--line);
    min-height: 68px;
}
.temp-appareil-card:last-child { border-bottom: none; }
.temp-appareil-name { flex: 1; min-width: 140px; font-size: 15px; font-weight: 500; color: var(--ink); }
.temp-input-row { display: flex; align-items: center; gap: var(--s2); }
.temp-input {
    width: 88px;
    min-height: 44px;
    padding: 0 var(--s3);
    font: 700 15px/1 var(--font-ui);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.temp-unite { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.temp-alerte-badge { display: none; }
.temp-alerte-badge.danger, .temp-alerte-badge.warning, .temp-alerte-badge.ok { display: inline-flex; }
.temp-action-line {
    flex-basis: 100%;
    font-size: 12px; font-weight: 600; color: var(--danger);
    margin-top: calc(var(--s2) * -1);
}
.temp-action-line.is-warn { color: var(--warn); }
.temp-action-line:empty { display: none; }

.temp-historique-title {
    font-size: 11px; font-weight: 700; line-height: 1;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
    margin-top: var(--s8);
    margin-bottom: var(--s3);
}
.temp-historique-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: var(--s5);
    margin-bottom: var(--s3);
}
.temp-historique-header {
    display: flex; justify-content: space-between; align-items: baseline;
    flex-wrap: wrap; gap: var(--s2);
    margin-bottom: var(--s3); padding-bottom: var(--s2);
    border-bottom: 1px solid var(--line);
}
.temp-historique-label { font-size: 15px; font-weight: 700; color: var(--ink); }
.temp-historique-emp { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.temp-historique-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: var(--s3);
    padding: var(--s2) 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.temp-historique-row:last-child { border-bottom: none; }
.temp-historique-appareil { color: var(--ink); }
.temp-historique-val { font-variant-numeric: tabular-nums; }

/* ── QUALITÉ ── */
.qualite-instructions {
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-radius: var(--r-md);
    padding: var(--s4);
    font-size: 13px; font-weight: 500; line-height: 1.5;
    color: var(--ink);
    text-wrap: pretty;
}
.qualite-table { font-size: 15px; }
.qualite-table td { vertical-align: middle; }

.qualite-toggle-group { display: inline-flex; }
.qualite-btn {
    min-height: 44px;
    padding: 0 var(--s4);
    border: 1.5px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-mid);
    font: 600 13px/1 var(--font-ui);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.qualite-btn.bon     { border-radius: var(--r-md) 0 0 var(--r-md); }
.qualite-btn.pas_bon { border-radius: 0 var(--r-md) var(--r-md) 0; margin-left: -1.5px; }
.qualite-btn.bon.active     { background: var(--ok);     border-color: var(--ok);     color: #fff; }
.qualite-btn.pas_bon.active { background: var(--danger); border-color: var(--danger); color: #fff; }

.qualite-saveur-input { display: block; max-width: 260px; min-height: 40px; margin-top: var(--s2); font-size: 14px; }
.qualite-machine-label {
    display: block; margin-top: var(--s1);
    font-size: 11px; font-weight: 700; line-height: 1;
    letter-spacing: .12em; text-transform: uppercase; color: var(--warn);
}

@media (max-width: 719px) {
    .qualite-table, .qualite-table tbody, .qualite-table tr, .qualite-table td { display: block; width: 100%; }
    .qualite-table thead { display: none; }
    .qualite-table { border-collapse: separate; }
    .qualite-table tr {
        border-bottom: 1px solid var(--line);
        padding: var(--s5);
        display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
    }
    .qualite-table tr:last-child { border-bottom: none; }
    .qualite-table tbody tr:hover td { background: transparent; }
    .qualite-table td { border: none; padding: 0; width: auto; }
    .qualite-table td:first-child { flex: 1 1 100%; font-weight: 500; }
    .qualite-table .qualite-toggle-group { width: 100%; }
    .qualite-table .qualite-btn { flex: 1; }
    .qualite-saveur-input { max-width: 100%; }
}

/* ============================================================
   RAPPORTS
   ============================================================ */
.filtres-titre {
  font-size: 11px; font-weight: 700; line-height: 1;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: var(--s3);
}
.periode-choix + .filtres-dates { margin-top: var(--s4); }
.filtres .filtres-titre:not(:first-child) { margin-top: var(--s5); }

/*
 * Les cinq périodes passent à la ligne plutôt que de défiler : sur un
 * téléphone de 375 px, « Sur mesure » sortait du cadre sans rien pour
 * laisser deviner qu'il restait un choix à droite.
 */
.periode-choix {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s1);
}
.periode-btn {
  flex: 1;
  min-width: 72px;
  min-height: 40px;
  padding: 0 var(--s3);
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-mid);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.periode-btn.active { background: var(--accent); color: #fff; }

.filtres-dates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
/* Sans min-width: 0, un <input type="date"> impose sa largeur intrinsèque
   et déborde de la carte sur écran étroit. */
.filtres-dates .form-group { margin-bottom: 0; min-width: 0; }
.filtres-dates input { min-width: 0; }

/* Le rapport choisi explique ce qu'il contient, juste sous la liste. */
.rapport-desc {
  font-size: 13px; font-weight: 500; line-height: 1.45;
  color: var(--ink-mid);
  text-wrap: pretty;
  margin-top: var(--s2);
}
.rapport-desc:empty { display: none; }

/* Le résumé du filtre par employé reprend le bloc « employé actuel » des
   quarts : même composant, même geste, rien de neuf à apprendre. */
#emp-bloc { margin-bottom: 0; }
#emp-panneau { margin-top: var(--s3); }
/* La liste défile au lieu de pousser le reste de la page vers le bas :
   le bouton qui l'a ouverte reste à portée, quelle que soit la taille
   de l'équipe. */
#emp-panneau .employe-cases { max-height: 46vh; overflow-y: auto; }
/* Un compte en pause ou supprimé reste proposé — autant dire lequel. */
.emp-etat { font-size: 12px; font-weight: 500; color: var(--ink-soft); }

/* Résultat */
#resultat { margin-top: var(--s5); }
.resultat-tete {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s3);
}
.resultat-titre { font-size: 18px; font-weight: 800; color: var(--ink); }
.resultat-periode { font-size: 13px; font-weight: 500; color: var(--ink-mid); margin-top: 2px; }
.resultat-resume { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.resultat-resume .chip strong { font-weight: 800; }
.resultat-exports { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }

.table-rapport { font-size: 13px; }
.table-rapport td { padding: 10px 14px; white-space: nowrap; }
.table-rapport td:last-child { white-space: normal; }

/* ── Impression : le PDF, c'est cette feuille ── */
@media print {
  .appbar, .navbar, .filtres, .section-label,
  .resultat-exports, #fermer-resultat, .notification, .feuille-compte { display: none !important; }
  body { padding-left: 0; background: #fff; }
  .ecran { max-width: none; padding: 0; }
  .resultat-tete { margin-bottom: 8px; }
  .resultat-titre { font-size: 16pt; }
  .table-wrap { border: none; box-shadow: none; overflow: visible; }
  .table-rapport { font-size: 9pt; width: 100%; }
  .table-rapport td, .table-rapport th { white-space: normal; padding: 4px 6px; }
  .table-rapport thead { display: table-header-group; }   /* l'en-tête se répète à chaque page */
  .table-rapport tr { break-inside: avoid; }
  .chip { border: 1px solid #ccc !important; background: #fff !important; color: #000 !important; }
}

/* Témoin d'enregistrement — dit que la base a bien reçu, sans bouton à cliquer */
.qualite-enregistre {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ok);
}

/* ============================================================
   CHAMP « EMPLOYÉ » DES ÉCRANS D'IDENTIFICATION
   Le nom connecté est affiché ; la liste ne sort qu'à la demande.
   ============================================================ */
.employe-actuel {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 48px;
  padding: 0 var(--s3);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-alt);
}
.employe-actuel .icon { color: var(--ink-soft); }
.employe-nom { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: var(--ink);
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employe-changer {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 var(--s2);
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--accent);
  font: 600 13px/1 var(--font-ui);
  cursor: pointer;
  transition: background .15s ease;
}
.employe-changer:hover { background: var(--accent-tint); }

/* ── Panneau d'ajout : plusieurs personnes d'un coup ── */
.panneau-ajout {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  padding: var(--s4);
  margin-bottom: var(--s3);
}
.panneau-titre {
  font-size: 13px; font-weight: 600; color: var(--ink-mid);
  margin-bottom: var(--s3);
}
.panneau-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s4);
}

.employe-cases { display: flex; flex-direction: column; gap: var(--s1); }
.employe-case {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 48px;
  padding: 0 var(--s3);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15px; font-weight: 500; color: var(--ink);
  letter-spacing: normal; text-transform: none; margin-bottom: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.employe-case:hover { background: var(--surface-alt); }
.employe-case input { display: none; }
.employe-coche {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: transparent;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.employe-case:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.employe-case:has(input:checked) .employe-coche {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.employe-vide { font-size: 14px; font-weight: 500; color: var(--ink-mid); }

/* La liste des personnes ajoutées ne prend de la place que si elle en a */
.lock-emp-list:not(.a-du-monde) { margin-bottom: 0; }
