/* =====================================================================================
   Hygiène sur place — système visuel (style suisse minimal, tablette de cuisine)
   Sens fixe des couleurs : marine = action · vert = OK · ambre = à faire · rouge = danger.
   La couleur double toujours un texte (jamais seule). Cibles tactiles ≥ 56 px (gants, mains mouillées).
   ===================================================================================== */
:root {
  color-scheme: light;                 /* cuisine éclairée : thème clair fixe, pas d'assombrissement auto */
  /* couleurs */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text: #0F172A;
  --text-2: #475569;                   /* 7,5:1 sur blanc */
  --border: #E2E8F0;
  --border-strong: #94A3B8;            /* bord des champs : 3:1 */
  --primary: #1E3A5F;                  /* marine : boutons d'action, en-tête */
  --primary-press: #152C49;
  --primary-soft: #E8EEF6;
  --on-primary: #FFFFFF;
  --ok: #047857;      --ok-bg: #D1FAE5;      --ok-border: #059669;
  --warn: #92400E;    --warn-bg: #FEF3C7;    --warn-border: #D97706;
  --danger: #B91C1C;  --danger-bg: #FEE2E2;  --danger-border: #DC2626;
  --info-bg: #E0F2FE;
  --focus: #F59E0B;                    /* anneau de focus ambre, visible sur marine et sur blanc */
  /* typo */
  --font-titre: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-texte: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* espacements (base 8) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  /* formes */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --ombre: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  /* tailles */
  --tap: 56px; --tap-sm: 48px;
  --ico-sm: 20px; --ico-md: 24px; --ico-lg: 32px;
  --t-rapide: 120ms;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font-texte); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-titre); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 var(--s3); }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
a { color: var(--primary); text-underline-offset: 3px; }
.muted { color: var(--text-2); } .small { font-size: 15px; }
.ph { font-size: var(--ico-md); line-height: 1; vertical-align: -0.15em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- en-tête */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3);
  min-height: 64px; padding: var(--s2) var(--s4); padding-top: max(var(--s2), env(safe-area-inset-top));
  background: var(--primary); color: var(--on-primary); }
.top a { color: inherit; text-decoration: none; }
.top .retour { display: inline-grid; place-items: center; width: var(--tap-sm); height: var(--tap-sm); margin-left: -8px;
  border-radius: var(--r-sm); }
.top .retour .ph { font-size: 28px; }
.top .retour:active { background: rgba(255, 255, 255, .16); }
.top .titre { font-family: var(--font-titre); font-weight: 600; font-size: 20px; display: inline-flex; align-items: center; gap: var(--s2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .droite { margin-left: auto; font-size: 15px; opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qui-top { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap-sm); padding: 0 var(--s4);
  border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 600; }
.qui-top small { font-weight: 500; opacity: .8; text-decoration: underline; }
.qui-top:active { background: rgba(255, 255, 255, .24); }
.qui-top + .droite { margin-left: var(--s3); }

main { max-width: 1080px; margin: 0 auto; padding: var(--s5) var(--s4) 80px;
  padding-left: max(var(--s4), env(safe-area-inset-left)); padding-right: max(var(--s4), env(safe-area-inset-right)); }

/* ---------------------------------------------------------------- messages */
.flash { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-radius: var(--r-md); margin-bottom: var(--s4);
  font-weight: 600; border: 1px solid; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.flash.err { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.flash.avert { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5);
  margin-bottom: var(--s4); box-shadow: var(--ombre); }
.card > h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- tuiles de l'accueil */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.tuile { position: relative; display: flex; flex-direction: column; gap: var(--s2); min-height: 168px; padding: var(--s5);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text);
  text-decoration: none; box-shadow: var(--ombre); transition: background-color var(--t-rapide), border-color var(--t-rapide); }
.tuile:active { background: var(--surface-2); }
.tuile .ico { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary); }
.tuile .ico .ph { font-size: var(--ico-lg); }
.tuile .nom { font-family: var(--font-titre); font-weight: 600; font-size: 21px; line-height: 1.25; margin-top: var(--s1); }
.tuile .info { color: var(--text-2); font-size: 15px; }
.tuile.orange { border: 2px solid var(--warn-border); background: var(--warn-bg); }
.tuile.orange .ico { background: #FDE68A; color: var(--warn); }
.tuile.rouge { border: 2px solid var(--danger-border); background: var(--danger-bg); }
.tuile.rouge .ico { background: #FECACA; color: var(--danger); }
.tuile .compte { position: absolute; top: var(--s4); right: var(--s4); min-width: 36px; height: 36px; padding: 0 10px;
  display: grid; place-items: center; border-radius: 999px; font-weight: 700; font-size: 17px; color: #fff; background: var(--danger-border); }
.tuile .compte.orange { background: var(--warn-border); }

/* ---------------------------------------------------------------- boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s5);
  border-radius: var(--r-md); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 17px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-rapide), border-color var(--t-rapide), opacity var(--t-rapide); }
.btn:active { background: var(--surface-2); }
.btn.prim { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.prim:active { background: var(--primary-press); }
.btn.vert { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.rouge { background: var(--danger-border); border-color: var(--danger-border); color: #fff; }
.btn.gros { min-height: 64px; font-size: 19px; width: 100%; }
.btn.petit { min-height: var(--tap-sm); padding: 0 var(--s4); font-size: 16px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.rangee { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- produits à étiqueter */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.produit { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s2); min-height: 104px; padding: var(--s4);
  border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 18px; line-height: 1.3; box-shadow: var(--ombre); }
.produit .d { font-weight: 500; color: var(--text-2); font-size: 15px; }
.produit:active { background: var(--primary-soft); border-color: var(--primary); }
.produit.libre { border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.categorie-titre { display: flex; align-items: center; gap: var(--s2); margin: var(--s5) 0 var(--s3); font-size: 1.15rem; }

/* ---------------------------------------------------------------- formulaires */
label { display: block; font-size: 15px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: var(--tap); background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border-strong); border-radius: var(--r-sm); padding: 10px 14px; font: inherit; font-size: 18px; }
input::placeholder { color: #64748B; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--primary); }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
/* connexion : mot de passe affichable en clair, « Rester connecté » */
.mdp-champ { position: relative; }
.mdp-champ input, .gerant .mdp-champ input { width: 100%; padding-right: 7.5em; }
.mdp-voir { position: absolute; top: 0; bottom: 0; right: 0; display: inline-flex; align-items: center;
  gap: 6px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--primary);
  font: inherit; font-size: .9em; cursor: pointer; transition: background .15s; }
.mdp-voir:hover { background: var(--primary-soft); }
.mdp-voir:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
label.rester { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: normal; cursor: pointer; }
label.rester input, .gerant label.rester input { width: 22px; height: 22px; min-height: 0; flex: none; margin: 0; accent-color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .mdp-voir { transition: none; } }
.plein { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); }
legend { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s5); border-radius: 999px;
  border: 2px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer;
  transition: background-color var(--t-rapide), border-color var(--t-rapide); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip.rouge input:checked + span { background: var(--danger-border); border-color: var(--danger-border); }
.compteur { display: inline-flex; align-items: center; gap: var(--s2); }
.compteur button { width: var(--tap); height: var(--tap); border-radius: var(--r-sm); border: 1.5px solid var(--border-strong);
  background: var(--surface); font-size: 26px; font-weight: 600; color: var(--text); cursor: pointer; }
.compteur button:active { background: var(--surface-2); }
.compteur input { width: 80px; text-align: center; font-weight: 700; font-size: 20px; }
.dlc-apercu { font-family: var(--font-titre); font-size: 30px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.btn { position: relative; margin: 0; color: var(--text); font-size: 16px; }
.photo-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 700; font-size: 15px; margin-left: var(--s2); }
details > summary { cursor: pointer; }

/* ---------------------------------------------------------------- listes */
.ligne { display: flex; gap: var(--s3); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ligne:last-child { border-bottom: 0; }
.ligne .grow { flex: 1; min-width: 220px; }
.ligne.rouge { background: var(--danger-bg); margin: 0 calc(-1 * var(--s5)); padding: var(--s4) var(--s5); border-bottom-color: #FECACA; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.b-rouge { background: var(--danger-bg); color: var(--danger); border-color: #FCA5A5; }
.b-orange { background: var(--warn-bg); color: var(--warn); border-color: #FCD34D; }
.b-jaune { background: #FEF9C3; color: #854D0E; border-color: #FDE047; }
.b-vert { background: var(--ok-bg); color: var(--ok); border-color: #6EE7B7; }
.b-gris { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.vignettes { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.vignettes img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--s3) var(--s2); border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; position: relative; }
.pied { margin-top: var(--s6); text-align: center; display: flex; gap: var(--s4); justify-content: center; flex-wrap: wrap; align-items: center; }
.pied form { display: inline; }
.pied a, .pied button { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-sm); padding: 0 var(--s3);
  background: none; border: 0; color: var(--text-2); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- planning du jour (Gantt) */
.planning .entete-planning { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.planning h2 { margin: 0; display: inline-flex; align-items: center; gap: var(--s2); }
.g-legende { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0 0 var(--s3); padding: 0; font-size: 14px; color: var(--text-2); }
.g-legende li { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 22px; height: 10px; border-radius: 3px; }
.lg.a_venir { background: var(--primary-soft); border: 1.5px solid var(--primary); }
.lg.a_faire { background: var(--warn-border); } .lg.en_retard { background: var(--danger-border); } .lg.fait { background: var(--ok-border); }
.lg.now { width: 3px; height: 16px; background: var(--danger-border); }
.gantt { --label-w: 250px; --heures: 12; --now: 0%; }
.g-echelle, .g-ligne a { display: grid; grid-template-columns: var(--label-w) 1fr; gap: var(--s3); align-items: center; }
.g-echelle { height: 30px; margin-bottom: var(--s1); }
.g-piste { position: relative; align-self: stretch; min-height: 40px;
  background-image: repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(100% / var(--heures))); }
.g-graduations { min-height: 30px; background: none; }
.g-heure { position: absolute; top: 4px; transform: translateX(-50%); font-size: 13px; font-weight: 600; color: var(--text-2);
  font-variant-numeric: tabular-nums; }
.g-heure:first-child { transform: none; }
.g-now-lbl { position: absolute; top: 0; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; z-index: 2;
  background: var(--danger-border); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-lignes .g-piste::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: var(--now); width: 2px;
  background: var(--danger-border); z-index: 1; }
.g-ligne a { min-height: 64px; padding: var(--s2) var(--s3); border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; transition: background-color var(--t-rapide); }
.g-ligne a:active { background: var(--surface-2); }
.g-label { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.g-ico { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary); }
.g-txt { display: flex; flex-direction: column; min-width: 0; }
.g-txt b { font-weight: 600; font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-sous { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.g-barre { position: absolute; top: 9px; bottom: 9px; border-radius: 6px; background: var(--primary-soft); border: 1.5px solid var(--primary); }
.g-fait { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; }
.g-fait .ph { font-size: 15px; }
.g-ligne.fait a { background: var(--surface-2); border-color: transparent; }
.g-ligne.fait .g-ico { background: var(--ok-bg); color: var(--ok); }
.g-ligne.fait .g-txt b { color: var(--text-2); }
.g-ligne.fait .g-sous { color: var(--ok); font-weight: 600; }
.g-barre.fait { background: var(--ok-bg); border-color: var(--ok-border); }
.g-ligne.a_faire a { border: 3px solid var(--warn-border); background: var(--warn-bg); animation: pouls 1.8s ease-in-out infinite; }
.g-ligne.a_faire .g-ico { background: #FDE68A; color: var(--warn); }
.g-ligne.a_faire .g-sous { color: var(--warn); font-weight: 700; }
.g-barre.a_faire { background: var(--warn-border); border-color: var(--warn-border); }
.g-ligne.en_retard a { border: 3px solid var(--danger-border); background: var(--danger-bg); animation: pouls 1.2s ease-in-out infinite; }
.g-ligne.en_retard .g-ico { background: #FECACA; color: var(--danger); }
.g-ligne.en_retard .g-sous { color: var(--danger); font-weight: 700; }
.g-barre.en_retard { background: var(--danger-border); border-color: var(--danger-border); }
@keyframes pouls { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .16); } }
.alerte-planning { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s3) var(--s4);
  background: var(--danger-border); color: #fff; font-weight: 700; font-size: 18px; text-decoration: none;
  position: sticky; top: 64px; z-index: 19; }
.alerte-planning .ph { font-size: 26px; }
.alerte-planning.orange { background: var(--warn-border); color: #1C1917; }
.jours { display: flex; gap: var(--s1); flex-wrap: wrap; }
.jours label { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 6px; font-size: 15px; color: var(--text); margin: 0; }
.jours input { width: 20px; height: 20px; min-height: 0; }

/* ---------------------------------------------------------------- qui êtes-vous ? */
.noms { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); max-width: 900px; margin: var(--s5) auto 0; }
.choix-nom { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); min-height: 140px;
  border-radius: var(--r-lg); border: 2px solid var(--border); background: var(--surface); font: inherit; font-family: var(--font-titre);
  font-size: 22px; font-weight: 600; color: var(--text); cursor: pointer; box-shadow: var(--ombre); transition: background-color var(--t-rapide), border-color var(--t-rapide); }
.choix-nom:active { border-color: var(--primary); background: var(--primary-soft); }
.choix-nom .init { width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 26px; }

/* ---------------------------------------------------------------- nettoyage : points */
.score { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; }
.score .pts { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--font-titre); font-size: 40px; font-weight: 700; color: var(--primary); }
.score .pts .ph { font-size: 34px; color: #CA8A04; }
.podium { list-style: none; margin: 0 0 0 auto; padding: 0; min-width: 260px; flex: 1; max-width: 440px; }
.podium li { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-sm); }
.podium li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.podium li.moi { background: var(--primary-soft); font-weight: 700; }
.rang { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2); }
.rang.r1 { background: #FDE68A; color: #78350F; } .rang.r2 { background: #E2E8F0; color: #334155; } .rang.r3 { background: #FED7AA; color: #7C2D12; }

/* ---------------------------------------------------------------- photos (galerie gérant) */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.galerie a { text-decoration: none; color: var(--text); font-size: 13px; }
.galerie img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; margin-bottom: 4px; }

/* ---------------------------------------------------------------- gérant & paramètres */
.gerant .top { background: #0F172A; }
.gerant main { max-width: 1200px; }
.gerant input, .gerant select { min-height: 44px; font-size: 16px; padding: 8px 12px; }
.gerant .btn { min-height: 44px; font-size: 15px; }
.gerant .el-ligne, .parametres .el-ligne { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: flex-end; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.gerant .el-ligne > div, .parametres .el-ligne > div { flex: 1 1 160px; min-width: 0; }
.gerant .el-ligne > div.rangee, .gerant .el-ligne > button, .parametres .el-ligne > div.rangee, .parametres .el-ligne > button { flex: 0 0 auto; }
.gerant .el-ligne label { font-size: 13px; margin-bottom: 2px; }
.el-detail { border-bottom: 1px solid var(--border); }
.el-detail > summary { list-style: none; display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-size: 18px; }
.el-detail > summary::-webkit-details-marker { display: none; }
.el-detail > summary .modif { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 15px; }
.el-detail[open] > summary { color: var(--primary); }
.nav-sec { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.nav-sec a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); text-decoration: none; font-size: 14px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.kpi .v { font-family: var(--font-titre); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 14px; color: var(--text-2); }
.kpi.rouge { border-color: var(--danger-border); } .kpi.rouge .v { color: var(--danger); }
.kpi.orange { border-color: var(--warn-border); } .kpi.orange .v { color: var(--warn); }
a.kpi { display: block; text-decoration: none; color: inherit; transition: border-color var(--t-rapide); }
a.kpi:hover { border-color: var(--border-strong); }
.titre-section { display: flex; align-items: center; gap: var(--s2); }
.titre-section .ph { font-size: 30px; color: var(--primary); }

/* ---------------------------------------------------------------- espace restaurateur (tableau de bord) */
/* fond gris, panneaux blancs arrondis qui « flottent » : menu à gauche, barre en haut, contenu */
.btn.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.btn.danger:hover { background: #FECACA; }
.compte-top { margin-left: auto; display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px 8px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.compte-top .avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-family: var(--font-titre); }
.compte-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.compte-txt b { font-size: 15px; } .compte-txt small { font-size: 13px; color: var(--text-2); }
.compte-top form { margin: 0; }
.sortir { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2); cursor: pointer; }
.sortir:hover { background: var(--surface-2); color: var(--danger); }
/* tablette et téléphone : le titre de la page passe avant le nom du compte (avatar seul) */
.gerant .top .titre { display: block; flex: 1 1 auto; min-width: 0; }
@media (max-width: 1099px) { .compte-txt { display: none; } .compte-top { border: 0; padding: 0; } .gerant .top .titre { font-size: 18px; } }

.burger { display: inline-grid; place-items: center; width: var(--tap-sm); height: var(--tap-sm); margin-left: -6px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; cursor: pointer; }
.burger .ph { font-size: 28px; }
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .45); }
.tiroir { position: fixed; top: 0; bottom: 0; right: 0; z-index: 50; width: min(320px, 88vw); overflow-y: auto;
  display: flex; flex-direction: column; background: #F8FAFC; border-left: 1px solid var(--border);
  padding-bottom: max(var(--s3), env(safe-area-inset-bottom)); transform: translateX(102%); transition: transform 180ms ease;
  visibility: hidden; }
.tiroir.ouvert { transform: none; visibility: visible; box-shadow: 0 10px 40px rgba(15, 23, 42, .25); }
.tiroir-tete { display: flex; align-items: center; gap: var(--s2); min-height: 72px; padding: var(--s3) var(--s2) var(--s2) var(--s4);
  padding-top: max(var(--s3), env(safe-area-inset-top)); }
.marque { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-titre); font-weight: 700; font-size: 22px; color: var(--text); }
.marque img { border-radius: 10px; }
.marque-txt { display: grid; line-height: 1.05; }
.marque-txt small { font-family: var(--font-texte); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #0F766E; }
.tiroir-fermer { margin-left: auto; display: inline-grid; place-items: center; width: var(--tap-sm); height: var(--tap-sm);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer; }
.resto-carte { margin: var(--s2) var(--s4) var(--s3); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.resto-carte select { border: 0; padding: 0; min-height: 30px; font-weight: 600; font-size: 16px; background-color: transparent; }
.resto-carte small { color: var(--text-2); font-size: 13px; }
.tiroir-liens { list-style: none; margin: 0; padding: 0 var(--s3); }
.tiroir-liens a, .tiroir-liens button { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 46px;
  padding: 0 var(--s3); border: 0; border-radius: var(--r-md); background: transparent; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; text-align: left; cursor: pointer; }
.tiroir-liens .ph { font-size: 22px; color: var(--text-2); }
.tiroir-liens a:hover, .tiroir-liens button:hover { background: #E9EDF2; }
.tiroir-liens a[aria-current="page"] { background: #E2E7EE; color: var(--text); font-weight: 700; }
.tiroir-liens a[aria-current="page"] .ph { color: var(--primary); }
.tiroir-bas { margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--border); }
body.tiroir-ouvert { overflow: hidden; }
/* barre d'outils : onglets segmentés, recherche, bouton « Nouveau » */
.barre { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s3); margin-bottom: var(--s3);
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--ombre); }
.barre .btn { min-height: 44px; }
.barre .btn.prim { margin-left: auto; }
.segments { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); max-width: 100%; }
.segments { overflow-x: auto; scrollbar-width: none; }
.segments a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.segments a .ph { font-size: 18px; }
.segments a:hover { color: var(--text); }
.segments a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--ombre); }
.recherche { flex: 1 1 200px; display: flex; align-items: center; gap: 6px; padding: 0 var(--s3); min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); }
.recherche .ph { font-size: 18px; color: var(--text-2); }
.recherche input { border: 0 !important; padding: 0 !important; min-height: 40px !important; background: transparent; outline: none; }
.periode { width: auto !important; font-weight: 600; }

/* liste à gauche + fiche à droite */
.md { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: var(--s3); align-items: start; }
.md-liste { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--ombre); max-height: calc(100vh - 210px); overflow-y: auto; position: sticky; top: 90px; }
.md-item { display: flex; align-items: center; gap: var(--s3); padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: #FBFCFD; color: var(--text); text-decoration: none; }
.md-item:hover { border-color: var(--border-strong); }
.md-item.actif { background: var(--primary-soft); border-color: var(--primary); }
.md-vign { flex: 0 0 auto; display: inline-grid; place-items: center; width: 52px; height: 52px; border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-sm); color: var(--text-2); overflow: hidden; background: var(--surface); }
.md-vign img { width: 100%; height: 100%; object-fit: cover; }
.md-vign.grand { width: 64px; height: 64px; }
.md-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.md-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-txt small { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastille { flex: 0 0 auto; padding: 3px 10px; border: 1px solid var(--primary); border-radius: 999px; color: var(--primary);
  font-size: 13px; font-weight: 600; background: var(--surface); }
.md-compte { text-align: center; margin: var(--s2) 0 0; }
.md-detail { padding: var(--s4) var(--s5); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--ombre); min-height: 320px; }
.md-retour { display: none; }
.md-vide { display: grid; place-items: center; gap: var(--s2); padding: var(--s6) var(--s4); text-align: center; color: var(--text-2); }
.md-vide .ph { font-size: 40px; }
.md-tete { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding-bottom: var(--s3); margin-bottom: var(--s2);
  border-bottom: 1px solid var(--border); }
.md-tete h2 { margin: 0; flex: 1 1 200px; }
.md-actions { display: flex; gap: var(--s2); margin-left: auto; }
.sect { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px dashed var(--border); }
.sect:last-child { border-bottom: 0; }
.sect-txt h3 { margin: 0 0 2px; font-size: 18px; }
.sect-txt p { margin: 0; color: var(--text-2); font-size: 14px; }
.sect-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); align-content: start; }
.sect-champs.large { grid-template-columns: 1fr; }
.sect-champs label { font-size: 14px; font-weight: 600; color: var(--text-2); }

/* accueil : tuiles d'indicateurs + panneaux */
.tuiles-tb { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.tb { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--s3); align-items: center;
  padding: var(--s4); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--ombre); color: var(--text);
  text-decoration: none; border: 1.5px solid transparent; }
.tb:hover { border-color: var(--border-strong); }
.tb-ico { grid-row: 1 / 3; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--ok-bg); color: var(--ok); }
.tb-v { font-family: var(--font-titre); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-l { font-size: 14px; color: var(--text-2); }
.tb.orange .tb-ico { background: var(--warn-bg); color: var(--warn); } .tb.orange .tb-v { color: var(--warn); }
.tb.rouge .tb-ico { background: var(--danger-bg); color: var(--danger); } .tb.rouge .tb-v { color: var(--danger); }
.tb:not(.vert):not(.orange):not(.rouge) .tb-ico { background: var(--primary-soft); color: var(--primary); }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--s3); }
.panneau { padding: var(--s4) var(--s5); margin-bottom: var(--s3); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--ombre); }
.grille-2 .panneau { margin-bottom: 0; }
.panneau h2 { display: flex; align-items: center; gap: var(--s2); font-size: 19px; }
.panneau h2 .ph { color: var(--primary); }
.rang-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-weight: 700; }

/* historique */
.h-ligne { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.h-ligne:last-child { border-bottom: 0; }
/* historique des inventaires : une carte dépliable par inventaire, tableau par catégorie */
.inv-resume { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2); margin-bottom: var(--s3); }
.inv-resume-liste { display: grid; gap: 2px; padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.inv-resume-liste.fait { border-color: var(--ok-border); background: var(--ok-bg); }
.inv-resume-liste.fait .small { color: var(--ok); font-weight: 600; }
.inv-h { border-bottom: 1px solid var(--border); }
.inv-h:last-child { border-bottom: 0; }
.inv-h > summary { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; cursor: pointer; list-style: none; }
.inv-h > summary::-webkit-details-marker { display: none; }
.inv-h-titre { flex: 1; display: grid; gap: 2px; min-width: 0; }
.inv-h-titre b { font-size: 17px; }
.inv-h-fleche { transition: transform .15s; color: var(--text-2); }
.inv-h[open] .inv-h-fleche { transform: rotate(180deg); }
.inv-h-table { width: 100%; margin-bottom: var(--s3); }
.inv-h-table td, .inv-h-table th { padding: 6px 10px; }
.inv-h-table tbody tr:nth-child(odd):not(.inv-h-cat) { background: var(--surface-2, rgba(15, 23, 42, .025)); }
.inv-h-cat th { text-align: left; padding-top: var(--s3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.inv-ecart { font-size: 12.5px; font-weight: 700; }
.inv-h-unite { display: block; font-size: 12.5px; color: var(--text-2); }
.inv-h-table td.num { white-space: nowrap; }
.inv-ecart.plus { color: var(--ok); }
.inv-ecart.moins { color: var(--warn); }
.h-quand { flex: 0 0 120px; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.h-photo { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }

@media (max-width: 900px) {
  .md { grid-template-columns: 1fr; }
  .md-liste { max-height: none; position: static; }
  .md:not(.a-choix) .md-detail, .md.a-choix .md-liste { display: none; }
  .md-retour { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--s3); text-decoration: none; font-weight: 600; }
  .md-detail { padding: var(--s4); }
  .sect { grid-template-columns: 1fr; gap: var(--s2); }
  .barre .btn.prim { margin-left: 0; }
  .h-ligne { flex-wrap: wrap; } .h-quand { flex-basis: 100%; }
}

.centre { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); }
.centre .card { width: 100%; max-width: 420px; }

/* ---------------------------------------------------------------- adaptations */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .tuiles { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .tuile { min-height: 140px; padding: var(--s4); }
  .tuile .nom { font-size: 18px; }
  .card { padding: var(--s4); }
  .ligne.rouge { margin: 0 calc(-1 * var(--s4)); padding: var(--s4); }
  .g-echelle, .g-ligne a { grid-template-columns: 1fr; gap: var(--s2); }
  .g-vide { display: none; }
  .g-ligne .g-piste { min-height: 26px; }
  .g-barre { top: 6px; bottom: 6px; }
  .top .droite { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .top, .rangee .btn, .pied, .alerte-planning { display: none !important; }
  body, .card { background: #fff; box-shadow: none; }
}
.action-photo input { flex: 1 1 260px; width: auto; }

/* imprimante */
.formats { display: grid; gap: var(--s2); }
.format-choix { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s3) var(--s4); margin: 0;
  border: 2px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; }
.format-choix input { width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; accent-color: var(--primary); }
.format-choix > span { display: flex; flex-direction: column; gap: 2px; }
.format-choix:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.etapes { margin: 0; padding-left: 1.4em; display: grid; gap: var(--s3); }
.etapes .os { display: grid; gap: var(--s2); margin-top: var(--s2); }
.etapes .os > div { padding: var(--s3); border-radius: var(--r-sm); background: var(--surface-2); }
.depannage { display: grid; gap: var(--s3); }
.depannage > div { display: grid; gap: 2px; padding: var(--s3) var(--s4); border-left: 4px solid var(--warn-border); background: var(--warn-bg); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.depannage span { color: var(--text-2); }

/* admin avancé */
.allergenes-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px var(--s2); }
.allergenes-choix label { display: flex; align-items: center; gap: 6px; min-height: 40px; margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.allergenes-choix input { width: 22px; height: 22px; min-height: 0; accent-color: var(--primary); }
.el-ligne > div:has(.allergenes-choix) { flex-basis: 100%; }
.photo-champ { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.photo-champ img { border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--border); }
.photo-champ { min-width: 0; }
.photo-champ .photo-btn { max-width: 100%; white-space: normal; text-align: left; }
.gerant .el-ligne .photo-btn .muted { display: none; }   /* « (facultatif) » : place comptée dans les lignes de réglages */
.choix-nom.nouveau { border-style: dashed; color: var(--text-2); text-decoration: none; box-shadow: none; }
.choix-nom.nouveau .init { background: var(--surface-2); color: var(--primary); }
.tableau-allergenes table { font-size: 15px; }
.tableau-allergenes th.vert { height: 130px; vertical-align: bottom; padding: 0 2px 6px; }
.tableau-allergenes th.vert span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.tableau-allergenes td.c { text-align: center; padding: 6px 2px; }
.tableau-allergenes .present { color: var(--danger); font-size: 20px; }
.tableau-allergenes .absent { color: #CBD5E1; }
.tableau-allergenes tr.cat th { background: var(--surface-2); font-family: var(--font-titre); }
.tableau-allergenes tbody th[scope="row"] { font-weight: 600; white-space: nowrap; }
@media print { .tableau-allergenes { box-shadow: none; border: 0; } .tableau-allergenes .present { color: #000; } }

/* huiles : fiche unique + pavé numérique */
.fiche-huile { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }
.fh-gauche { display: grid; gap: var(--s4); }
.fh-droite { display: grid; gap: var(--s3); position: sticky; top: 80px; }
.fh-tete { display: flex; align-items: center; gap: var(--s3); }
.fh-tete img { border-radius: var(--r-md); object-fit: cover; border: 1px solid var(--border); }
.fh-tete h2 { margin-bottom: 4px !important; }
.fh-historique { grid-column: 1 / -1; }
.fh-mesures { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.mesure { margin: 0; display: grid; gap: 6px; }
.mesure span { display: inline-flex; align-items: center; gap: 6px; }
.mesure input { min-height: 72px; font-family: var(--font-titre); font-size: 34px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; caret-color: transparent; cursor: pointer; }
.mesure input.pave-actif { border: 3px solid var(--primary); background: var(--primary-soft); }
.interrupteurs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--tap); margin: 0;
  padding: 0 var(--s4); border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interrupteur i { flex: 0 0 auto; position: relative; width: 52px; height: 30px; border-radius: 999px; background: #CBD5E1;
  transition: background-color var(--t-rapide); }
.interrupteur i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--t-rapide); }
.interrupteur input:checked + i { background: var(--ok); }
.interrupteur input:checked + i::after { transform: translateX(22px); }
.interrupteur:has(input:checked) { border-color: var(--ok-border); background: var(--ok-bg); }
.interrupteur input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 2px; }
.photo-aide { color: var(--danger); font-weight: 700; }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.pave button { min-height: 64px; border-radius: var(--r-md); border: 1.5px solid var(--border-strong); background: var(--surface);
  font-family: var(--font-titre); font-size: 28px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background-color var(--t-rapide); }
.pave button:active { background: var(--primary-soft); }
.pave button .ph { font-size: 28px; }
/* badgeage : bouton vers la badgeuse + prénoms en poste */
.badgeage { display: grid; gap: var(--s5); }
.badgeage-action { display: grid; gap: var(--s2); justify-items: start; }
.presents { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.presents li { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4) 0 6px;
  border: 1.5px solid var(--ok-border); border-radius: 999px; background: var(--ok-bg); font-weight: 600; }
.presents .initiale { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ok); color: #fff; font-family: var(--font-titre); }
/* étiquettes : DLC supplémentaires d'un produit (décongélation, mariné, chauffé) */
.d-options { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.d-options span { padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 600; }
.choix-dlc .chip small { font-weight: 500; opacity: .8; }
/* produits jetés : grande zone photo (aperçu de la photo prise) */
.zone-photo { position: relative; display: grid; place-items: center; height: 220px; margin: 0; overflow: hidden; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); }
.zone-photo:has(img:not([hidden])) { border-style: solid; border-color: var(--ok-border); }
.zone-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.zone-photo-vide { display: grid; justify-items: center; gap: 6px; font-weight: 600; }
.zone-photo-vide .ph { font-size: 48px; color: var(--primary); }
.zone-photo:has(img:not([hidden])) .zone-photo-vide { position: absolute; bottom: var(--s2); right: var(--s2); padding: 6px 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .92); grid-auto-flow: column; align-items: center; font-size: 14px; }
.zone-photo:has(img:not([hidden])) .zone-photo-vide .ph { font-size: 20px; }
.jete-nombre { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: end; }
.jete-nombre fieldset { margin: 0; }
@media (max-width: 760px) { .jete-nombre { grid-template-columns: 1fr; } }
/* zone photo basse (bon de réception, étiquettes) + vignettes des photos prises, retirables */
.zone-photo-bas { height: 120px; }
.vignettes-saisie { display: flex; flex-wrap: wrap; gap: var(--s2); }
.vignettes-saisie:not(:empty) { margin-top: var(--s3); }
.vignettes-saisie button { position: relative; width: 96px; height: 96px; padding: 0; border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden; background: var(--surface); cursor: pointer; }
.vignettes-saisie img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignettes-saisie .ph { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(15, 23, 42, .75); color: #fff; font-size: 16px; }
.formulaire-etapes { display: grid; gap: var(--s2); }
.formulaire-etapes > .btn.gros { justify-self: start; }
.bloc-alerte { padding: var(--s4); border: 1.5px solid #FCA5A5; border-radius: var(--r-md); background: var(--danger-bg); }
.bloc-alerte legend { float: left; width: 100%; color: var(--danger); margin-bottom: var(--s3); }
.lignes { display: grid; gap: var(--s2); margin-bottom: var(--s3); clear: both; }
.ligne-saisie { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: var(--s2); align-items: center; }
@media (max-width: 760px) { .ligne-saisie { grid-template-columns: 1fr auto; } .ligne-saisie input:first-child { grid-column: 1 / -1; } }
.zone-photo:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) {
  .fiche-huile { grid-template-columns: 1fr; }
  .fh-droite { position: static; }
  .interrupteurs { grid-template-columns: 1fr; }
}

/* étiquettes : catalogue, éditeur, panier */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.catalogue-outils { display: grid; gap: var(--s3); margin-bottom: var(--s4); position: sticky; top: 64px; z-index: 5;
  background: var(--bg); padding: var(--s2) 0; }
.recherche { display: flex; align-items: center; gap: var(--s2); margin: 0; padding: 0 var(--s4); min-height: var(--tap);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-md); color: var(--text-2); }
.recherche input { border: 0; min-height: 52px; padding: 0; outline: none; background: transparent; }
.recherche:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.onglets-cat { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.onglets-cat button { flex: 0 0 auto; min-height: var(--tap-sm); padding: 0 var(--s4); border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 16px; }
.onglets-cat button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.listes-rapides { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.listes-rapides form { margin: 0; }
.grille-produits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); padding-bottom: 90px; }
.grille-produits .produit { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--s3); min-height: 88px; }
.vignette { flex: 0 0 auto; display: grid; place-items: center; width: 60px; height: 60px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); color: var(--text-2); }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.vignette .ph { font-size: 28px; }
.p-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-txt b { font-weight: 600; font-size: 17px; line-height: 1.25; }
.barre-panier { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 15;
  width: min(720px, calc(100% - 32px)); display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  border-radius: var(--r-lg); background: var(--text); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25); }
.barre-panier .btn { border-color: transparent; }
.editeur { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.editeur-actions { display: grid; gap: var(--s4); position: sticky; top: 80px; }   /* impression toujours à l'écran */
.editeur-plus { display: grid; gap: var(--s4); margin-top: var(--s4); }
.editeur .allergenes-choix { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
main:has(> form.editeur) { padding-bottom: var(--s4); }   /* pas de barre du panier ici : rien à faire défiler */
.deux-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.deux-boutons .btn.gros { font-size: 17px; padding: 0 var(--s3); white-space: normal; text-align: center; }
.apercu-eti { background: #fff; border: 2px solid #0F172A; border-radius: 10px; padding: var(--s3) var(--s4); color: #000;
  box-shadow: 0 4px 0 #E2E8F0; max-width: 420px; }
.ae-haut { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); border-bottom: 2px solid #000;
  padding-bottom: 4px; }
.ae-haut b { font-family: var(--font-titre); font-size: 24px; line-height: 1.15; }
.ae-haut img { border-radius: 6px; object-fit: cover; }
.ae-ligne { display: flex; justify-content: space-between; gap: var(--s2); font-size: 15px; padding: 3px 0; }
.ae-dlc { display: flex; align-items: center; gap: var(--s2); margin-top: 6px; padding-top: 6px; border-top: 2px solid #000;
  font-family: var(--font-titre); font-size: 22px; font-weight: 700; }
.nb-copies { min-width: 40px; text-align: center; font-family: var(--font-titre); font-size: 22px; font-weight: 700; }
.compteur form { margin: 0; }
@media (max-width: 760px) {
  .editeur { grid-template-columns: 1fr; }
  .editeur-actions { position: static; }
  .deux-boutons { grid-template-columns: 1fr; }
}

/* tâches à sous-étapes */
.tache-tete { display: flex; align-items: center; gap: var(--s4); }
.g-ico.grand { width: 64px; height: 64px; }
.g-ico.grand .ph { font-size: 34px; }
.etapes-liste { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.etape { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) var(--s3);
  border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.etape:has(input:checked) { border-color: var(--ok-border); background: var(--ok-bg); }
.etape-case { flex: 1 1 240px; display: flex; align-items: center; gap: var(--s3); min-height: 60px; margin: 0;
  color: var(--text); font-size: 18px; font-weight: 600; cursor: pointer; }
.etape-case input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.etape-case i { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 2px solid var(--border-strong); background: #fff; color: transparent; }
.etape-case i .ph { font-size: 24px; }
.etape-case input:checked + i { background: var(--ok); border-color: var(--ok); color: #fff; }
.etape-case input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 2px; }
.etape-case:has(input:checked) span { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ok); }
.reporter { display: grid; gap: var(--s3); }
.etapes-edit { margin: var(--s3) 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.etapes-edit h3 { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.tableau-allergenes tbody th { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.tableau-allergenes tr.cat th { font-size: 15px; color: var(--text-2); }

/* ---------------------------------------------------------------- Gantt façon Secureat */
.gantt2 { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scroll-behavior: smooth; }
.gantt2:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.g2-grille { position: relative; min-width: 100%; }
.g2-axe, .g2-ligne { display: grid; grid-template-columns: var(--col-nom) 1fr; }
.g2-coin, .g2-nom { position: sticky; left: 0; z-index: 3; }
.g2-coin { background: var(--surface); border-bottom: 1px solid var(--border); }
.g2-axe { height: 40px; }
.g2-heures { position: relative; border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(to right, var(--border-strong) 0 1px, transparent 1px var(--px-h)),
                    repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(var(--px-h) / 4));
  background-size: 100% 8px; background-repeat: no-repeat; background-position: 0 100%; }
.g2-h { position: absolute; top: 8px; transform: translateX(-50%); font-family: var(--font-titre); font-weight: 600; font-size: 15px;
  color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.g2-ligne { border-bottom: 1px dashed var(--border-strong); }
.g2-nom { display: flex; align-items: center; padding: var(--s2) var(--s3); font-weight: 700; font-size: 15px; line-height: 1.2;
  box-shadow: 1px 0 0 var(--border); }
.g2-ligne .g2-piste { position: relative;
  background-image: repeating-linear-gradient(to right, rgba(15, 23, 42, .08) 0 1px, transparent 1px var(--px-h)); }
/* une couleur douce par catégorie (comme les lignes teintées de Secureat) */
.cat-temperatures .g2-nom, .cat-temperatures .g2-piste { background-color: #E0F2FE; } .cat-temperatures .g2-nom { color: #075985; }
.cat-huiles .g2-nom, .cat-huiles .g2-piste { background-color: #FEF9C3; } .cat-huiles .g2-nom { color: #854D0E; }
.cat-reception .g2-nom, .cat-reception .g2-piste { background-color: #DCFCE7; } .cat-reception .g2-nom { color: #166534; }
.cat-etiquettes .g2-nom, .cat-etiquettes .g2-piste { background-color: #FFEDD5; } .cat-etiquettes .g2-nom { color: #9A3412; }
.cat-nettoyage .g2-nom, .cat-nettoyage .g2-piste { background-color: #EDE9FE; } .cat-nettoyage .g2-nom { color: #5B21B6; }
.cat-autre .g2-nom, .cat-autre .g2-piste { background-color: #F1F5F9; } .cat-autre .g2-nom { color: #334155; }
/* barres : nom de la tâche dedans, couleur + icône = état */
.g2-barre { position: absolute; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden;
  border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.15;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .18); transition: filter var(--t-rapide); }
.g2-barre:active { filter: brightness(.92); }
.g2-barre:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 2; }
.g2-barre .ph { flex: 0 0 auto; font-size: 20px; }
.g2-txt { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.g2-barre.a_venir { background: var(--primary); color: #fff; }
.g2-barre.a_faire { background: var(--warn-border); color: #1C1917; animation: pouls 1.8s ease-in-out infinite; }
.g2-barre.en_retard { background: var(--danger-border); color: #fff; animation: pouls 1.2s ease-in-out infinite; }
.g2-barre.fait { background: var(--ok-bg); color: var(--ok); border: 1.5px solid var(--ok-border); box-shadow: none; }
/* trait rouge « maintenant » avec son pastille */
.g2-maintenant { position: absolute; top: 30px; bottom: 0; width: 2px; margin-left: -1px; background: var(--danger-border); z-index: 2;
  pointer-events: none; }
.g2-maintenant::before { content: ""; position: absolute; top: -5px; left: -5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger-border); }
.g2-maintenant-h { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px;
  background: var(--danger-border); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lg.a_venir { background: var(--primary); border: 0; }
@media (max-width: 600px) { .g2-nom { font-size: 13px; padding: var(--s2); } .g2-barre { font-size: 14px; } }

/* ---------------------------------------------------------------- inventaire (envoyé à Pilotage 360) */
.tuile.vert { border-color: var(--ok-border); }
.inv-avancement { margin: 0 0 var(--s3); font-size: 17px; }
.tuile .inv-dernier { font-size: 13.5px; margin-top: 2px; }
.tuile.vert .inv-dernier { color: var(--ok); font-weight: 600; }
.tuile .inv-dernier.inv-attente { color: var(--warn); font-weight: 600; }
.tuile.vert .compte { background: var(--ok-border); }
.inv-cat { margin: var(--s5) 0 var(--s2); font-size: 18px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.inv-ligne { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s2);
  background: var(--surface, #fff); border: 1px solid var(--border, #E2E8F0); border-radius: var(--r-md, 12px); }
.inv-nom { flex: 1; display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 17px; cursor: pointer; }
.inv-unite { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--primary, #1E3A5F); }
.inv-saisie { display: flex; align-items: center; gap: var(--s2); }
.inv-saisie input { width: 92px; min-height: 56px; text-align: center; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-saisie .btn { min-width: 56px; min-height: 56px; padding: 0; justify-content: center; font-size: 22px; }
.inv-pied { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) 0; margin-top: var(--s4); background: var(--bg, #F8FAFC); border-top: 1px solid var(--border, #E2E8F0); }
@media (max-width: 600px) { .inv-ligne { flex-wrap: wrap; } .inv-saisie { width: 100%; justify-content: flex-end; } }
.inv-photo { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--surface-2); }

/* ---------- clôture de caisse ---------- */
.caisse { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s3); }
.caisse-champ { display: grid; gap: 6px; margin: 0; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); }
.caisse-champ.plateforme { background: var(--surface-2); }
.caisse-lib { display: flex; align-items: center; gap: var(--s2); font-weight: 700; }
.caisse-saisie { display: flex; align-items: center; gap: var(--s2); font-size: 20px; font-weight: 700; }
.caisse-saisie input { font-size: 22px; font-weight: 700; text-align: right; min-height: var(--tap); }
.caisse-net { font-size: 14px; }
.caisse-fond { margin-top: var(--s3); }
.caisse-fond .caisse-champ { border-style: dashed; }
.caisse-total { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3); margin: var(--s4) 0;
  padding: var(--s4); border-radius: var(--r-md); background: var(--primary-soft); }
.caisse-total > div { display: grid; gap: 2px; }
.caisse-total b { font-size: 22px; font-family: var(--font-titre); }
.caisse-total .grand b { font-size: 28px; color: var(--primary); }
.caisse-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); margin-bottom: var(--s2); }
.caisse-photos .zone-photo img { max-height: 220px; object-fit: contain; }
.chip .jour-choisi { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- notifications obligatoires + réglage de l'écran ---------- */
.alerte-notifs { border: 2px solid var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.alerte-notifs .an-tete { display: flex; align-items: center; gap: var(--s2); font-size: 20px; }
.alerte-notifs .an-tete i { font-size: var(--ico-lg); }
.alerte-notifs p, .alerte-notifs ol { color: var(--text); }
.alerte-notifs ol { margin: 0 0 var(--s3); padding-left: 22px; line-height: 1.6; }
.proposition-ecran { border: 2px solid var(--primary); }
.pe-choix { display: flex; align-items: flex-start; gap: var(--s3); margin: var(--s2) 0; padding: var(--s3); min-height: var(--tap);
  border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; }
.pe-choix input { width: 28px; height: 28px; min-height: 0; flex: none; margin-top: 2px; }
.pe-choix > span { display: grid; gap: 2px; }
#pe-conseils { margin: var(--s3) 0 0; padding-left: 22px; line-height: 1.6; color: var(--warn); font-weight: 600; }

/* ---------- accueil compact : planning + les 13 tuiles sur un seul écran de tablette, sans défiler ---------- */
main:has(> .accueil) { max-width: 1600px; padding: var(--s2) max(var(--s3), env(safe-area-inset-right)) var(--s2) max(var(--s3), env(safe-area-inset-left)); }
.accueil { display: flex; flex-direction: column; gap: var(--s2); }
.accueil > .card { margin: 0; }
.accueil .planning { padding: var(--s2) var(--s3); display: flex; flex-direction: column; min-height: 0; }
.accueil .entete-planning { gap: var(--s2); margin-bottom: var(--s2); flex-wrap: nowrap; }
.accueil .planning h2 { font-size: 18px; white-space: nowrap; }
.accueil .g-legende { flex: 0 1 auto; min-width: 0; margin: 0 0 0 auto; gap: 0 var(--s3); justify-content: flex-end; font-size: 12.5px; line-height: 1.35; }
.accueil .g-legende li { white-space: nowrap; }
.accueil .entete-planning .btn.petit { flex: none; min-height: 40px; padding: 0 var(--s3); font-size: 14px; }
.accueil .gantt2 { overflow-y: auto; min-height: 0; }
.accueil .g2-axe { height: 26px; }
.accueil .g2-h { top: 4px; font-size: 13px; }
.accueil .g2-maintenant { top: 20px; }
.accueil .g2-maintenant-h { top: -20px; font-size: 12px; padding: 1px 7px; }
.accueil .g2-nom { padding: 0 var(--s2); font-size: 13px; line-height: 1.1; }
.accueil .g2-barre { height: 24px; gap: 4px; padding: 0 7px; border-radius: 6px; font-size: 12.5px; }
.accueil .g2-barre .ph { font-size: 15px; }
.accueil .g2-txt { display: block; white-space: nowrap; text-overflow: ellipsis; }
.accueil .tuiles { flex: none; grid-template-columns: repeat(var(--nb-tuiles, 13), minmax(0, 1fr)); gap: 6px; }
.accueil .tuile { min-height: 0; gap: 3px; padding: var(--s2) 4px; align-items: center; text-align: center; border-radius: var(--r-md); }
.accueil .tuile .ico { width: 38px; height: 38px; }
.accueil .tuile .ico .ph { font-size: 23px; }
.accueil .tuile .nom { margin: 0; font-size: clamp(11.5px, 1.05vw, 14px); line-height: 1.15; overflow-wrap: anywhere; }
.accueil .tuile .nom-court { display: none; }
.accueil .tuile .info { font-size: 11.5px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2; }
.accueil .tuile .compte { top: 3px; right: 3px; min-width: 22px; height: 22px; padding: 0 5px; font-size: 12px; }
.accueil .pied { flex: none; margin-top: 0; gap: var(--s2); }
/* accueil : « À faire maintenant » en très gros, avant le planning (le planning se réduit d'autant) */
.maintenant { display: flex; gap: var(--s2); flex: none; }
.maintenant:empty { display: none; }
.m-carte { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s3); align-items: center;
  padding: var(--s2) var(--s4); min-height: 72px; border: 2px solid; border-radius: var(--r-lg); text-decoration: none; color: var(--text); }
.m-carte .ph { grid-row: 1 / 3; font-size: 34px; }
.m-carte b { font-family: var(--font-titre); font-size: 20px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-carte span { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.m-carte:active { transform: scale(.98); }
.m-carte.rouge { background: var(--danger-bg); border-color: var(--danger-border); } .m-carte.rouge .ph, .m-carte.rouge span { color: var(--danger); }
.m-carte.orange { background: var(--warn-bg); border-color: var(--warn-border); } .m-carte.orange .ph, .m-carte.orange span { color: var(--warn); }
.m-carte.vert { background: var(--ok-bg); border-color: var(--ok-border); } .m-carte.vert .ph, .m-carte.vert span { color: var(--ok); }
.m-plus { flex: none; align-self: center; padding: 0 var(--s2); font-weight: 700; color: var(--text-2); }
@media (max-width: 760px) { .maintenant { flex-direction: column; } }
.accueil .pied a, .accueil .pied button { min-height: 32px; font-size: 13px; }
/* tablette 10 pouces (~ 960 à 1200 px) : noms courts, pas de sous-texte (la pastille garde le nombre à traiter) */
@media (max-width: 1199px) {
  .accueil .tuile .nom-long, .accueil .tuile .info { display: none; }
  .accueil .tuile .nom-court { display: inline; }
  .accueil .entete-planning .btn.petit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .accueil .entete-planning .btn.petit { padding: 0 10px; }
}
@media (max-width: 899px) { .accueil .tuiles { grid-template-columns: repeat(7, minmax(0, 1fr)); } .accueil .g-legende { display: none; } }
/* toutes les tablettes en largeur (7 à 13 pouces) : l'accueil prend juste la hauteur de l'écran. Le planning garde sa
   hauteur (au moins 150 px, il défile en lui-même au besoin) et les tuiles prennent tout le reste : plus l'écran est haut,
   plus elles sont grandes ; s'il reste beaucoup de place, deux rangées avec les noms complets et les détails. */
@media (min-width: 600px) and (min-height: 460px) {
  .accueil { height: calc(100dvh - 64px - 2 * var(--s2)); }
  .accueil .planning { flex: 0 1 auto; min-height: 150px; }
  .accueil .tuiles-cadre:has(> .tuiles:not(.grandes)) { flex: 1 1 0; min-height: 92px; display: flex; container: tuiles / size; }
  .accueil .tuiles-cadre > .tuiles:not(.grandes) { flex: 1; grid-auto-rows: minmax(0, 1fr); }
  .accueil .tuiles-cadre .tuile { justify-content: center; overflow: hidden; }
}
@container tuiles (min-height: 120px) and (max-height: 169px) {   /* une rangée un peu haute : icônes plus grandes */
  .accueil .tuile .ico { width: 48px; height: 48px; }
  .accueil .tuile .ico .ph { font-size: 28px; }
}
@container tuiles (min-height: 170px) {   /* de quoi faire deux rangées : tuiles deux fois plus larges */
  .accueil .tuiles { grid-template-columns: repeat(var(--nb-tuiles-2), minmax(0, 1fr)); }
}
@container tuiles (min-height: 250px) {   /* deux rangées hautes : noms complets et détails */
  .accueil .tuiles { gap: var(--s2); }
  .accueil .tuile .info { display: block; }
  .accueil .tuile .nom-long { display: inline; }
  .accueil .tuile .nom-court { display: none; }
  .accueil .tuile .nom { font-size: clamp(14px, 1.5vw, 19px); }
  .accueil .tuile .info { font-size: clamp(12px, 1.1vw, 14px); }
}
@container tuiles (min-height: 400px) {
  .accueil .tuile { gap: var(--s2); }
  .accueil .tuile .ico { width: 64px; height: 64px; }
  .accueil .tuile .ico .ph { font-size: 36px; }
  .accueil .tuile .nom { font-size: clamp(16px, 1.4vw, 22px); }
  .accueil .tuile .info { font-size: clamp(13px, 1vw, 16px); }
  .accueil .tuile .compte { min-width: 28px; height: 28px; font-size: 15px; }
}
/* tablette sans le module Hygiène (pas de planning) : peu de tuiles, en grand */
.accueil .tuiles.grandes { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.accueil .tuiles.grandes .tuile { min-height: 200px; gap: var(--s2); padding: var(--s5); justify-content: center; }
.accueil .tuiles.grandes .tuile .ico { width: 72px; height: 72px; }
.accueil .tuiles.grandes .tuile .ico .ph { font-size: 40px; }
.accueil .tuiles.grandes .tuile .nom { font-size: 22px; }
.accueil .tuiles.grandes .tuile .nom-long, .accueil .tuiles.grandes .tuile .info { display: block; }
.accueil .tuiles.grandes .tuile .nom-court { display: none; }
.accueil .tuiles.grandes .tuile .info { font-size: 15px; }
.accueil .tuiles.grandes .tuile .compte { top: var(--s2); right: var(--s2); min-width: 28px; height: 28px; font-size: 15px; }

/* tableau des allergènes : en-têtes (noms des allergènes) et colonne Produit toujours visibles quand on fait défiler */
.tableau-allergenes.table-wrap { padding: 0; margin-bottom: 0; overflow: auto; max-height: calc(100dvh - 64px - 150px); overscroll-behavior: contain; }
.tableau-allergenes caption { padding: var(--s3) var(--s4) var(--s2); }
.tableau-allergenes thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.tableau-allergenes thead th:first-child { left: 0; z-index: 3; vertical-align: bottom; }
.tableau-allergenes tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); }
.tableau-allergenes tr.cat th { position: sticky; left: 0; }
.tableau-allergenes th:first-child, .tableau-allergenes td:first-child { padding-left: var(--s4); }
@media print { .tableau-allergenes.table-wrap { max-height: none !important; overflow: visible; } .tableau-allergenes thead th { position: static; } }
main:has(> .tableau-allergenes) { padding-bottom: var(--s3); }
/* « Quand ? » (relevé ou étiquette oubliés) : puces + date et heure modifiables */
.quand { margin: 0; }
/* molette « Quand ? » : l'heure au centre est choisie (Maintenant en haut, puis heure par heure en arrière) */
.roue-quand { position: relative; height: 150px; max-width: 320px; overflow-y: auto; padding: 51px 0; scroll-snap-type: y mandatory;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  overscroll-behavior: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.roue-quand::-webkit-scrollbar { display: none; }
.roue-item { display: block; width: 100%; height: 48px; padding: 0; border: 0; background: none; font: inherit; font-size: 18px;
  color: var(--text-2); scroll-snap-align: center; cursor: pointer; }
.roue-item[aria-selected="true"] { color: var(--text); font-weight: 700; background: var(--primary-soft); border-radius: var(--r-sm); }
.roue-quand:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* impression rapide dans l'appli : écran de chargement (identique à celui de la page d'impression) */
.chargement-impression { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 22px; background: #F4F6FA; font: 700 24px system-ui, sans-serif; color: #1E3A5F; }
.chargement-impression[hidden] { display: none; }
.chargement-impression .roue { width: 64px; height: 64px; border-radius: 50%; border: 7px solid #D6DEEA; border-top-color: #1E3A5F;
  animation: tourne-impr .8s linear infinite; }
@keyframes tourne-impr { to { transform: rotate(360deg); } }

/* espace restaurateur : proposer le mode appli (icône sur l'écran d'accueil du téléphone) */
.installer-appli { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.installer-appli[hidden] { display: none; }
.installer-appli img { border-radius: 12px; flex: none; }
.installer-appli .ia-texte { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.installer-appli .rangee { margin: 0; }

/* espace restaurateur : titres de catégorie dans la liste des produits */
.md-groupe { margin: var(--s2) 0 0; padding: 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.md-groupe:first-child { margin-top: 0; }
.md-groupe[hidden] { display: none; }

/* tablette, Paramètres → Produits : filtre et titres de catégorie */
.cats-tablette { margin-bottom: var(--s3); }
.cats-tablette a { min-height: 48px; font-size: 17px; }
.groupe-cat { margin: var(--s4) 0 var(--s2); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }

/* photo à côté du nom (Paramètres de la tablette, fiche du back office) : toucher = prendre la photo */
.el-vign { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 52px; height: 52px; margin: 6px 4px 6px 0; border-radius: 12px; background: var(--surface-2); color: var(--text-2);
  vertical-align: middle; cursor: pointer; overflow: visible; }
.el-vign img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.el-vign .ph { font-size: 24px; }
.el-vign-cam { position: absolute; right: -6px; bottom: -6px; display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; border: 2px solid var(--surface); }
.el-vign-cam .ph { font-size: 13px; }
.el-vign.envoi, .md-vign.envoi { opacity: .5; }
.md-vign.avec-cam { position: relative; cursor: pointer; overflow: visible; }
.md-vign.avec-cam img { border-radius: inherit; }
.md-vign.avec-cam .el-vign-cam { width: 28px; height: 28px; }

/* Paramètres de la tablette : « + Nouveau produit » ouvre le formulaire d'ajout */
.ajout-replie { padding: var(--s3); }
.ajout-replie > summary { list-style: none; display: inline-flex; width: auto; cursor: pointer; }
.ajout-replie > summary::-webkit-details-marker { display: none; }
.ajout-replie[open] > summary { margin-bottom: var(--s3); }
.ajout-replie:not([open]) { background: transparent; border: 0; box-shadow: none; padding: 0; }

/* températures : saisie (bouton ± pour les congélateurs), relevé à compléter mis en évidence */
.saisie-temp { width: 190px; }
.saisie-temp .signe { min-width: 48px; font-size: 20px; font-weight: 700; padding: 0; }
.ligne.a-revoir { background: var(--danger-bg, #FEF2F2); border-radius: var(--r-md); outline: 2px solid var(--danger, #B42318); outline-offset: -2px; }
.erreur-temp { margin: 4px 0 0; color: var(--danger, #B42318); font-weight: 600; }
/* action à rattraper : « Annuler » pendant 5 s, en bas au centre */
.annuler { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: var(--s3); width: min(640px, calc(100% - 32px)); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  border-radius: var(--r-lg); background: var(--text); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(15, 23, 42, .3); }
.annuler span { flex: 1; min-width: 0; }
.annuler b { flex: none; font-variant-numeric: tabular-nums; }
.annuler .btn { flex: none; background: #fff; color: var(--text); border-color: #fff; }
/* bouton principal d'un formulaire : toujours visible en bas de l'écran, même en faisant défiler */
main form > .btn.prim.gros:last-child { position: sticky; bottom: max(var(--s3), env(safe-area-inset-bottom)); z-index: 6;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .18); }
/* traçabilité : codes-barres scannés (facultatif) */
.scan-codes { display: grid; gap: var(--s2); margin-top: var(--s3); }
.scan-codes [data-scan] { justify-self: start; }
.code-ligne { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s2); align-items: center;
  padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.code-ligne select { min-width: 0; }
@media (max-width: 560px) { .code-ligne { grid-template-columns: 1fr auto; } .code-ligne select { grid-column: 1 / -1; grid-row: 2; } }
/* saisies gardées sans wifi : pastille en bas à gauche, rouge si le serveur en a refusé une */
.hors-ligne { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30;
  min-height: 44px; padding: 0 var(--s4); border-radius: 999px; border: 2px solid var(--warn-border); background: var(--warn-bg);
  color: var(--warn); font-weight: 700; box-shadow: var(--ombre); }
.hors-ligne.refus { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.flash.hl { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
/* réception : température à la livraison */
.temps-reception { display: grid; gap: var(--s3); }
.t-rec { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s3); align-items: center; padding: var(--s2) var(--s3);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.t-rec label { margin: 0; }
.t-saisie { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 20px; }
.t-saisie input { width: 110px; text-align: center; font-weight: 700; font-size: 22px; }
.t-moins { font-size: 26px; }
.t-etat { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.t-etat:empty { display: none; }
.t-rec.ok { border-color: var(--ok-border); } .t-rec.ok .t-etat { color: var(--ok); }
.t-rec.tolere { border-color: var(--warn-border); background: var(--warn-bg); } .t-rec.tolere .t-etat { color: var(--warn); }
.t-rec.hors { border-color: var(--danger-border); background: var(--danger-bg); } .t-rec.hors .t-etat { color: var(--danger); }
.t-aide { color: var(--danger); font-weight: 600; }
@media (max-width: 560px) { .t-rec { grid-template-columns: 1fr; } }

/* Badgeuse 360 intégrée (espace restaurateur) : une ligne par service, corrigeable */
.service-ligne { display: grid; grid-template-columns: 130px 1fr 1fr 80px; gap: 8px 14px; align-items: end; padding: 12px 0; border-top: 1px solid var(--border); }
.service-ligne:first-of-type { border-top: 0; }
.service-ligne .sl-heure input { max-width: 120px; display: inline-block; margin-right: 6px; }
.service-ligne .sl-duree { font-weight: 700; text-align: right; padding-bottom: 10px; }
.service-ligne .sl-note, .service-ligne .sl-actions { grid-column: 1 / -1; }
.service-ligne .sl-pauses { grid-column: 1 / -1; display: grid; gap: 6px; }
.service-ligne .sl-pause { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-left: 130px; }
.service-ligne .sl-pause input[type=time] { max-width: 120px; }
@media (max-width: 700px) { .service-ligne .sl-pause { padding-left: 0; } }
.service-ligne .sl-actions { margin: 0; gap: 6px; }
.vign-pointage { height: 38px; border-radius: 6px; vertical-align: middle; margin-left: 6px; }
.vign-pointage.sign { background: #fff; border: 1px solid var(--border); padding: 2px; }
@media (max-width: 700px) { .service-ligne { grid-template-columns: 1fr 1fr; } .service-ligne .sl-jour { grid-column: 1 / -1; } }
tr.ligne-lien { cursor: pointer; }
tr.ligne-lien:hover td { background: var(--surface-2); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn.carre { width: 44px; padding: 0; flex: none; }

/* clôtures du mois : une ligne par journée */
.cl-liste th, .cl-liste td { padding: 8px 6px; font-size: 15px; }
.cl-liste td .small { font-size: 12px; }
.cl-liste .vignettes img { width: 40px; height: 40px; }
.cl-liste .cl-fleche { width: 24px; color: var(--text-2); font-size: 18px; }
.cl-liste tr.ligne-lien:hover .cl-fleche { color: var(--primary); }

/* clôture d'une journée : tout tient sur un écran */
.cl-tete { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.cl-nav { display: flex; align-items: center; gap: var(--s2); }
.cl-nav h1 { margin: 0; font-size: 26px; text-transform: capitalize; white-space: nowrap; }
.cl-nav h1 .muted { font-weight: 500; }
.cl-qui { display: flex; gap: var(--s2); flex-wrap: wrap; margin-left: auto; }
.cl-grille { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "comptes total" "comptes cote";
  grid-template-rows: auto 1fr; gap: var(--s3); align-items: start; }
.cl-total { grid-area: total; background: var(--primary); color: #fff; border-radius: var(--r-lg); padding: var(--s4) var(--s5); }
.cl-grand span, .cl-sous span { display: block; font-size: 13px; opacity: .8; }
.cl-grand b { display: block; font-family: var(--font-titre); font-size: 40px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cl-sous { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid rgba(255,255,255,.22); }
.cl-sous b { font-family: var(--font-titre); font-size: 20px; font-variant-numeric: tabular-nums; }
.cl-sous small { display: block; font-size: 12px; opacity: .75; }
.cl-comptes { grid-area: comptes; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--ombre); padding: var(--s2) var(--s4) var(--s3); }
.cl-table th, .cl-table td { padding: 6px 4px; font-size: 15px; }
.cl-table thead th { font-size: 12px; }
.cl-table tbody th { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); }
.cl-table tbody th .ph { color: var(--text-2); margin-right: 4px; }
.cl-coef { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--text-2); font-weight: 600; }
.cl-table .cl-groupe th { padding-top: 12px; border-bottom: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.cl-table .cl-groupe th .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.cl-table .cl-st th, .cl-table .cl-st td { background: var(--surface-2); font-weight: 700; }
.cl-table .cl-fond th, .cl-table .cl-fond td { color: var(--text-2); border-bottom: 0; }
.cl-cote { grid-area: cote; display: grid; gap: var(--s3); }
.cl-photos { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.cl-photo { position: relative; display: block; height: 200px; padding: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface-2); font: inherit; cursor: zoom-in; }
.cl-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cl-photo span { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(15,23,42,.78); color: #fff; font-size: 13px; }
.cl-photo.vide { display: grid; place-items: center; align-content: center; gap: 6px; color: var(--text-2); cursor: default; font-size: 14px; text-align: center; }
.cl-photo.vide .ph { font-size: 28px; }
.cl-photo.vide span { position: static; background: none; color: inherit; padding: 0 var(--s2); }
.cl-corriger { margin-top: var(--s4); }
.cl-corriger > summary { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-weight: 700; font-size: 17px; list-style: none; }
.cl-corriger > summary::-webkit-details-marker { display: none; }
.cl-corriger[open] > summary { color: var(--primary); margin-bottom: var(--s2); }
.cl-sous-titre { display: flex; align-items: center; gap: var(--s2); margin: var(--s3) 0 var(--s2); font-size: 16px; }
.cl-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.cl-champ { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.cl-champ .caisse-saisie input { width: 100%; }
.cl-note { margin: 0; padding: var(--s3); border-radius: var(--r-md); background: var(--warn-bg); font-size: 15px; }
.cl-aide { margin: 0; font-size: 13px; }
.visionneuse { max-width: min(96vw, 1100px); max-height: 94vh; padding: var(--s3); border: 0; border-radius: var(--r-lg); background: var(--surface); }
.visionneuse::backdrop { background: rgba(15,23,42,.72); }
.visionneuse form { margin: 0 0 var(--s2); text-align: right; }
.visionneuse img { display: block; max-width: 100%; max-height: calc(94vh - 110px); margin: 0 auto; }
.visionneuse p { margin: var(--s2) 0 0; text-align: center; color: var(--text-2); font-size: 14px; }
@media (max-width: 760px) {
  .cl-tete { gap: var(--s2); margin-bottom: var(--s2); }
  .cl-grille { grid-template-columns: 1fr; grid-template-areas: "total" "comptes" "cote"; gap: var(--s2); }
  .cl-nav { order: -1; width: 100%; justify-content: space-between; }
  .cl-nav h1 { font-size: 21px; }
  .cl-qui { flex: 1; margin-left: 0; }
  .cl-total { padding: var(--s3) var(--s4); }
  .cl-grand b { font-size: 30px; }
  .cl-sous { margin-top: var(--s2); padding-top: var(--s2); }
  .cl-sous b { font-size: 18px; }
  .cl-comptes { padding: var(--s1) var(--s3) var(--s2); }
  .cl-table th, .cl-table td { padding: 5px 2px; font-size: 14.5px; }
  .cl-table .cl-groupe th { padding-top: 8px; }
  .cl-photo { height: 130px; }
}
@media print { .cl-tete .btn, .cl-photo span, .cl-corriger { display: none; } .cl-total { color: #000; background: none; border: 1px solid #000; } }
.vign-btn { padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0; border-radius: var(--r-sm); }
.cl-liste .cl-total-mois td { background: var(--surface-2); border-bottom: 0; }
/* imprimante : Wi-Fi ou Bluetooth */
.mode-imp { border: 0; padding: 0; margin: var(--s4) 0 var(--s3); }
.mode-imp legend { font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.mode-imp .segments { display: inline-flex; }
.mode-imp label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; }
.mode-imp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-imp label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.mode-imp label:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.zone-imp > label { display: block; font-weight: 600; margin-bottom: 4px; }
.zone-imp .format-choix span { display: grid; }
/* Paramètres de la tablette : annonce des tâches (bip / voix) */
.annonces { margin-top: var(--s4); }
.annonces .segments { display: inline-flex; flex-wrap: wrap; }
.annonces .segments label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; }
.annonces .segments input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.annonces .segments label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.annonces .segments label:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
/* documents du restaurant (PMS, DUER, déclaration d'activité) */
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s3); align-items: start; }
.doc { margin: 0; display: grid; gap: var(--s3); }
.doc-tete { display: flex; align-items: flex-start; gap: var(--s3); }
.doc-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md); background: var(--ok-bg); color: var(--ok); font-size: 26px; }
.doc-manquant .doc-ico, .doc-a_revoir .doc-ico { background: var(--warn-bg); color: var(--warn); }
.doc-manquant { border: 2px dashed var(--warn-border); }
.doc-titre { flex: 1; min-width: 0; }
.doc-titre h2 { font-size: 19px; margin: 0; }
.doc-titre p { margin: 2px 0 var(--s2); }
.doc-fichier p, .doc-vide { margin: var(--s2) 0 0; }
.doc-image { display: block; position: relative; width: 100%; height: 200px; padding: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface-2); cursor: zoom-in; font: inherit; }
.doc-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.doc-image span { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(15,23,42,.78); color: #fff; font-size: 13px; }
.doc-depot { display: grid; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--border); }
.doc-depot label { font-size: 14px; font-weight: 600; }
.doc-depot input[type=file] { width: 100%; }
.doc-depot .btn { justify-self: start; }
.doc-plus summary { cursor: pointer; font-size: 14px; color: var(--text-2); }
.doc-plus form { margin-top: var(--s2); }
.doc-anciens { margin: var(--s2) 0 0; padding-left: 18px; font-size: 14px; }
.docs-alerte { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); text-decoration: none; color: var(--warn);
  background: var(--warn-bg); border: 1.5px solid var(--warn-border); }
.docs-alerte span { flex: 1; color: var(--text); }
.docs-alerte .ph { font-size: 22px; }
/* appli : tirer la page vers le bas pour la recharger */
.tirer-recharger { position: fixed; top: 0; left: 50%; z-index: 200; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--surface); color: var(--primary); font-size: 24px; box-shadow: 0 4px 14px rgba(15,23,42,.22);
  opacity: 0; transform: translate(-50%, -50px); transition: opacity .12s; pointer-events: none; }
.tirer-recharger.pret { background: var(--primary); color: #fff; }
.tirer-recharger.charge i { animation: rh-tourne .8s linear infinite; }
@keyframes rh-tourne { to { transform: rotate(360deg); } }
/* back office : transfert d'un restaurant vers un autre client */
.transfert { padding: 4px 0 10px; border-bottom: 1px solid var(--border); }
.transfert summary { cursor: pointer; padding: 4px 0; }
.transfert form { margin: 8px 0; }

/* espace restaurateur : étapes d'une tâche (check-list de la tablette) */
.etapes-gerant { margin-top: var(--s4); padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--ombre); }
.etapes-gerant h3 { display: flex; align-items: center; gap: var(--s2); margin: 0 0 4px; }
.etapes-gerant > p { margin: 0 0 var(--s3); }
.etapes-liste { margin: 0; padding-left: 22px; }
.etapes-liste li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.etapes-liste li > span { display: inline-block; min-width: 0; margin-right: var(--s2); }
.etapes-liste li form { display: inline-flex; gap: 4px; vertical-align: middle; float: right; }
.etapes-liste li::after { content: ""; display: block; clear: both; }
.etapes-liste .etapes-vide { list-style: none; margin-left: -22px; border: 0; }
.etapes-ajout { margin-top: var(--s3); }
.etapes-ajout input { flex: 1; min-width: 200px; }

/* fiche d'une tâche : jours et heures (rappels de la tablette) */
.horaire-ajout { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-top: var(--s3); }
.horaire-ajout label, .horaire-ajout .lib { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.horaire-ajout .jours label { display: inline-flex; font-weight: 500; margin: 0; }
.horaires-liste { padding-left: 0; list-style: none; }
.cat-taches { margin: 20px 0 0; padding-top: 12px; border-top: 2px solid var(--border); font-size: 21px; }
.card > .cat-taches:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }
.horaire-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.horaire-ligne input[type=time] { width: auto; min-width: 120px; }

/* traçabilité : appareil photo dans la page (plusieurs photos à la suite) et produit relié à chaque photo */
.rafale { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; }
.rafale video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.rafale-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.rafale.clic .rafale-flash { animation: rafale-flash .25s ease-out; }
@keyframes rafale-flash { from { opacity: .8; } to { opacity: 0; } }
.rafale-msg { position: absolute; top: 30%; left: 0; right: 0; margin: 0 auto; max-width: 420px; padding: 0 var(--s4); color: #fff;
  text-align: center; display: grid; gap: var(--s3); justify-items: center; }
.rafale-bas { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4) max(var(--s4), env(safe-area-inset-bottom)); background: rgba(0,0,0,.85); }
.rafale-vignettes { display: flex; gap: 6px; overflow-x: auto; min-width: 0; }
.rafale-vignettes img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; flex: none; }
.rafale-declencher { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.rafale-declencher span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.rafale-declencher:active span { transform: scale(.88); }
.rafale-fin { justify-self: end; }
.rafale-fin b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--primary); }
.vign-produit { display: grid; gap: 4px; width: 132px; }
.vign-produit .photo-produit { min-height: 36px; font-size: 13px; padding: 4px 6px; }
.photo-legende { display: block; font-size: 12px; color: var(--text-2); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vignettes figure { margin: 0; }

/* modules de la plateforme : menu « Découvrir », page Mes modules, fiche client du back office */
.tiroir-liens a.decouvrir { color: var(--text-2); }
.tiroir-liens a.decouvrir small { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 8px; }
.mods { display: grid; gap: var(--s3); }
.mod { display: flex; align-items: center; gap: var(--s4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s4) var(--s5); }
.mod-ico { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary); font-size: 28px; }
.mod-ouvert .mod-ico { background: var(--ok-bg); color: var(--ok); }
.mod-txt { flex: 1; min-width: 0; }
.mod-txt h2 { margin: 0 0 var(--s1); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: 20px; }
.mod-txt p { margin: 0; }
.mod-action { flex: none; }
.mod-decouvrir { border-style: dashed; border-color: var(--border-strong); }
.mod-choisi { box-shadow: 0 0 0 3px var(--focus); }
@media (max-width: 600px) { .mod { flex-wrap: wrap; } .mod-action { width: 100%; } .mod-action .btn { width: 100%; } }
.mod-admin { display: grid; gap: var(--s3); margin: var(--s3) 0; }
.mod-ligne { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.mod-ligne.ferme { background: var(--surface-2); }
.mod-tete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.mod-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2) var(--s3); }
.mod-fonctions { grid-column: 1 / -1; border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.mod-fonctions legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: var(--s1); }
.mod-fonctions label { display: flex; align-items: center; gap: var(--s2); font-weight: 400; margin: 0; min-height: 40px; }
.mod-fonctions input[type=checkbox] { flex: none; width: 22px; height: 22px; min-height: 0; margin: 0; }
.decouvrir-hygiene { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s4); text-decoration: none; color: inherit; }
.decouvrir-hygiene > i:last-child { margin-left: auto; }
.tb-ico + .tb-l:last-child { grid-row: 1 / 3; font-size: 16px; font-weight: 600; color: var(--text); }   /* tuile sans chiffre */
.mod-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s4); margin: var(--s3) 0;
  padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--primary-soft); color: var(--text); }
.mod-total b { font-size: 18px; }
.mod-total .muted.small { flex-basis: 100%; }
.mod-txt p.mod-prix { margin-top: var(--s1); font-weight: 600; }
.mod-journal ul { margin: var(--s2) 0 0; padding-left: var(--s4); }

/* ---------------------------------------------------------------- module Chiffres */
.segments.ch-periodes a { min-height: 34px; font-size: 14px; }
.segments.ch-periodes { margin-bottom: var(--s2) !important; }
.ch-perso { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s4);
  padding: var(--s2) var(--s3); border-radius: var(--r-md); border: 1.5px solid transparent; }
.ch-perso.actif { border-color: var(--primary); background: var(--primary-soft); }
.ch-perso label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.ch-perso input[type=date] { width: auto; min-height: 38px; }
.ch-kpis { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.ch-kpis .tb-v { font-size: 26px; white-space: nowrap; }
.ch-kpis .tb-l { display: flex; flex-direction: column; gap: 2px; }
/* Chiffres : « Aujourd'hui, en direct » (journée en cours lue dans Splash) */
.ch-direct { border-left: 4px solid var(--ok); }
.ch-direct-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s3); margin-bottom: var(--s3); }
.ch-direct-tete h2 { display: flex; align-items: center; gap: var(--s2); margin: 0; }
.ch-pouls { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok-border); animation: ch-pouls 2s ease-out infinite; }
@keyframes ch-pouls { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ch-pouls { animation: none; } }
.ch-direct-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s2); }
.ch-direct-chiffres > div { display: flex; flex-direction: column; gap: 2px; }
.ch-direct-chiffres > div:first-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .ch-direct-chiffres > div:first-child { grid-column: auto; } }
.ch-canaux { display: flex; flex-wrap: wrap; gap: 2px var(--s4); margin: 0; }
.ch-canaux span { white-space: nowrap; }
.ch-etat { color: var(--text-2); }
.ch-erreur { color: var(--warn); font-weight: 600; }
.ch-erreur:empty { display: none; }
.ch-direct .table-wrap { margin-bottom: 0; }
/* une panne (Splash occupé, compte refusé…) ne ressemble pas à « tout va bien » */
.ch-direct.en-panne { border-left-color: var(--warn-border); }
.ch-direct.en-panne .ch-pouls { background: var(--warn-border); animation: none; }
.ch-direct.en-panne .ch-etat { color: var(--warn); font-weight: 600; }
/* Commandes du jour : chaque fournisseur à confirmer (passée / pas besoin) pour arrêter les rappels */
.cmd-jour { border-left: 4px solid var(--warn-border); }
.cmd-jour-liste { list-style: none; margin: 0; padding: 0; }
.cmd-jour-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.cmd-jour-ligne:first-child { border-top: 0; }
.cmd-jour-nom { flex: 1 1 180px; display: flex; flex-direction: column; gap: 2px; }
.cmd-jour-actions { align-items: center; gap: var(--s2); margin: 0; }
.cmd-jour-ligne.a-faire .cmd-jour-nom b { color: var(--warn); }
@media (max-width: 480px) { .cmd-jour-actions .btn:not(.petit) { flex: 1 1 auto; } }
.ch-estimation { display: flex; gap: var(--s2); align-items: flex-start; margin: var(--s3) 0 0; color: var(--text-2); }
.ch-estimation .ph { flex: none; margin-top: 2px; }
.ch-estimation ul { margin: var(--s1) 0; padding-left: var(--s4); }
.ch-estimation b { white-space: nowrap; }
.ch-evo { display: block; font-size: 13px; color: var(--text); }
.ch-evo b { white-space: nowrap; font-weight: 700; }
.ch-evo .muted { font-weight: 400; }
/* une barre par jour (une seule série : une seule couleur, pas de légende ; le tableau est dessous) */
.ch-barres { display: flex; align-items: stretch; gap: 2px; height: 200px; padding-top: var(--s5);
  border-bottom: 1px solid var(--border); }
.ch-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; outline: none; cursor: default; }
.ch-barre { display: block; width: 100%; max-width: 28px; min-height: 2px; background: var(--primary); border-radius: 4px 4px 0 0; }
.ch-col.vide .ch-barre { background: var(--border); }
.ch-x { position: absolute; top: 100%; margin-top: 4px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.ch-barres { margin-bottom: 22px; }
.ch-col:hover .ch-barre, .ch-col:focus-visible .ch-barre { background: var(--primary-press); }
.ch-col:hover::after, .ch-col:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% - 18px);
  left: 50%; transform: translateX(-50%); z-index: 2; padding: 4px 8px; border-radius: 6px; background: var(--text);
  color: var(--surface); font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.ch-col:first-child:hover::after, .ch-col:first-child:focus-visible::after { left: 0; transform: none; }
.ch-col:last-child:hover::after, .ch-col:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
.ch-table { margin-top: var(--s3); }
.ch-ligne { display: flex; align-items: center; gap: var(--s3); padding: 5px 0; }
.ch-lib { flex: 0 0 96px; font-weight: 600; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-piste { flex: 1; height: 12px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ch-plein { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.ch-val { flex: 0 0 auto; min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.ch-lib.entier { flex: 1 1 auto; }   /* ligne sans barre (canaux) : le libellé entier */
/* stock et commandes */
.ch-avis { display: flex; gap: var(--s3); align-items: flex-start; background: var(--info-bg); }
.ch-avis > i { font-size: 26px; color: var(--primary); }
.ch-avis span { display: block; margin-top: 2px; }
.ch-appel { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: inherit; border: 1.5px solid var(--warn-border); }
.ch-appel > i:first-child { font-size: 24px; color: var(--warn); }
.ch-appel > i:last-child { margin-left: auto; }
.ch-sugg .rangee { align-items: center; }
.metro-article { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 2.5fr) 110px auto; gap: var(--s3); align-items: end;
  padding: var(--s3) 0; border-top: 1px solid var(--border); }
.metro-article-nom { display: grid; gap: 2px; align-self: center; }
.metro-prix-diff { color: var(--warn); font-weight: 600; }
.metro-article select, .metro-article input { width: 100%; }
.metro-faits { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s2); }
.metro-faits li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.metro-traites { margin-top: var(--s3); }
.metro-traites summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.metro-traites summary::before { content: "▸"; margin-right: var(--s2); }
.metro-traites[open] summary::before { content: "▾"; }
@media (max-width: 1000px) { .metro-article { grid-template-columns: minmax(0, 1fr) 110px; }
  .metro-article-nom, .metro-article .rangee { grid-column: 1 / -1; } }
@media (max-width: 480px) { .metro-article { grid-template-columns: minmax(0, 1fr); } }
.ch-sugg-lignes { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 6px; }
.ch-sugg-lignes li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
input.ch-qte { width: 90px; min-height: 40px; text-align: right; display: inline-block; }
.ch-texte { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.45; resize: vertical; }
.ch-ligne-four summary { cursor: pointer; }
.ch-ligne-four .ch-four { margin-top: var(--s3); }
tr.choisi td { background: var(--primary-soft); }

/* ------------------------------------------------------------ module Communication (boîte unique des avis et messages) */
.co-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.co-pastille { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; }
.co-filtres { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-bottom: var(--s3); }
.co-filtres select { width: auto; min-height: 44px; }
.co-liste { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.co-ligne { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); color: inherit; text-decoration: none; min-width: 0; }
.co-ligne:hover { border-color: var(--border-strong); }
.co-ligne.urgent { border: 2px solid var(--danger-border); background: var(--danger-bg); }
.co-ligne.traite { background: var(--surface-2); }
.co-ligne > i:last-child { margin-left: auto; color: var(--text-2); flex: none; }
.co-src { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary); font-size: 22px; }
.co-google { background: #E8F0FE; color: #1A56C4; } .co-ubereats { background: #DCFCE7; color: #166534; }
.co-deliveroo { background: #CCFBF1; color: #0F766E; } .co-justeat { background: #FFEDD5; color: #9A3412; }
.co-tripadvisor { background: #D1FAE5; color: #065F46; } .co-instagram { background: #FCE7F3; color: #9D174D; }
.co-facebook { background: #DBEAFE; color: #1E40AF; } .co-qr { background: var(--warn-bg); color: var(--warn); }
.co-corps { display: grid; gap: 4px; min-width: 0; flex: 1; }
.co-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s2); }
.co-etoiles { color: var(--warn); letter-spacing: 1px; white-space: nowrap; }
.co-etoiles.grand { font-size: 22px; margin-left: auto; }
.co-texte { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--text-2); }
.co-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.co-chips:empty { display: none; }
.co-chips .badge { min-height: 26px; font-size: 13px; }
.co-alertes { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.co-alertes .tb-v { font-size: 26px; }
.co-vide h2 { display: flex; align-items: center; gap: var(--s2); }
.co-vide h2 .ph { color: var(--ok); }
.co-appel { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: inherit; border: 1.5px solid var(--warn-border); }
.co-appel > i:first-child { font-size: 24px; color: var(--warn); } .co-appel > i:last-child { margin-left: auto; }
.co-fiche { display: grid; gap: var(--s3); }
.co-fiche .card { margin-bottom: 0; }
.co-tete-fiche { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.co-texte-plein { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.55; }
.co-urgent { color: var(--danger); font-weight: 600; }
.co-conseil { display: flex; gap: var(--s2); padding: var(--s3); border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); margin-bottom: 0; }
.co-conseil .ph { font-size: 22px; flex: none; }
.co-fiche textarea, .co-ajout textarea, .co-reglages textarea, .co-mot textarea { width: 100%; font: inherit; line-height: 1.5; }
.co-fiche h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.co-plateformes, .co-note { display: flex; flex-wrap: wrap; gap: var(--s2); border: 0; padding: 0; margin: 0 0 var(--s4); }
.co-plateformes legend, .co-note legend { width: 100%; }
.co-choix { margin: 0; font-weight: 600; color: var(--text); }
.co-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.co-choix span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3); border: 1.5px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.co-choix input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.co-choix input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.co-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--s3); }
.co-deux .card { margin-bottom: 0; } .co-deux + .co-deux { margin-top: var(--s3); }
.co-barre-note { display: grid; grid-template-columns: 44px 1fr 36px; align-items: center; gap: var(--s2); margin-bottom: 6px; }
.co-barre-note b { text-align: right; font-variant-numeric: tabular-nums; }
.co-jauge { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.co-jauge span { display: block; height: 100%; background: var(--warn-border); border-radius: 999px; }
.co-table { width: 100%; border-collapse: collapse; }
.co-table td, .co-table th { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); }
.co-table td:not(:first-child), .co-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.co-theme { display: flex; justify-content: space-between; gap: var(--s3); margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.co-reglages h2 { display: flex; align-items: center; gap: var(--s2); font-size: 19px; }
@media print {
  .top, .hub, .bande, .tiroir, .voile, .flash, .pas-imprime { display: none !important; }
  body.avec-menu main, main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
}
.co-cache { position: absolute; left: -9999px; }
.co-connexions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.co-connexions .card { margin-bottom: 0; }
.co-connexions .co-tete-fiche .badge { margin-left: auto; }
.co-connexions details p { margin: 0 0 8px; }
.co-connexions form { margin: 0; }
.co-mail { background: var(--surface-2); color: var(--text-2); }
.co-adresse { display: flex; gap: var(--s2); margin-bottom: 6px; }
.co-adresse input { flex: 1; min-width: 0; font-weight: 600; }
.co-tete-fiche .co-corps { flex: 1 1 180px; }
.co-ligne { transition: border-color .15s ease, transform .15s ease; }
.co-ligne:active { transform: scale(.995); }
@media (prefers-reduced-motion: reduce) { .co-ligne { transition: none; } .co-ligne:active { transform: none; } }
.co-fiche summary, .co-reglages summary, .co-connexions summary { min-height: 44px; display: flex; align-items: center; gap: var(--s2); cursor: pointer; }
.co-kpis { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.co-table td a { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; text-align: right; }
.co-robot { min-width: 560px; }
.co-robot td.co-relier, .co-robot th.co-relier { text-align: left; }
.co-robot .co-relier select { max-width: 280px; }
@media (max-width: 600px) { #reponse .co-actions .btn { flex: 1 1 100%; } }

/* restaurants visibles d'un restaurateur (Comptes & tablettes) */
.portee { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; align-items: center; }
.portee label { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.portee input { width: 22px; height: 22px; min-height: 0; accent-color: var(--primary); }
.portee-restos { display: flex; flex-wrap: wrap; gap: 0 14px; padding-left: 4px; }
.portee:has(input[value="tous"]:checked) .portee-restos { opacity: .55; }

/* tâche Réception / Commandes, rappel Réception : « Pas de commande aujourd'hui » */
.sans-objet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.sans-objet h2 { margin: 0; }
.sans-objet .btn.gros { width: auto; max-width: 100%; white-space: normal; text-align: center; }

/* fournisseurs : heure limite et délai de livraison pour chaque jour de commande */
.ch-horaires { border: 0; padding: 0; margin: 0; }
.ch-horaire { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: var(--s1) 0; border-top: 1px solid var(--border); }
.ch-horaire label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.ch-horaire .ch-jour { min-width: 76px; min-height: 44px; }
.ch-horaire .ch-jour input { width: 22px; height: 22px; min-height: 0; accent-color: var(--primary); }
.ch-horaire input[type=time] { width: 112px; }
.ch-horaire input[type=number] { width: 68px; }
.ch-horaire:has(.ch-jour input:not(:checked)) label:not(.ch-jour) { display: none; }

/* =====================================================================================
   Espace restaurateur : 4 pôles, comme les intercalaires d'un classeur.
   Chaque pôle a sa couleur, froide pour ne jamais se confondre avec le sens fixe des états
   (vert = OK, ambre = à faire, rouge = danger). --primary suit le pôle : boutons, liens et
   surfaces de toutes les pages prennent sa couleur sans toucher aux gabarits.
   ===================================================================================== */
.avec-menu { --encre: #14233A; --c-hygiene: #0B6E7F; --c-chiffres: #2A4DB0; --c-badgeage: #6A3C9C; --c-com: #B8265F;
  --pole: var(--encre); --pole-fond: #F1F3F6; }
.pole-hygiene { --pole: var(--c-hygiene); --primary: var(--c-hygiene); --primary-press: #085866; --primary-soft: #DFF0F3; --pole-fond: #EFF5F6; }
.pole-chiffres { --pole: var(--c-chiffres); --primary: var(--c-chiffres); --primary-press: #1F3A8A; --primary-soft: #E5EAFA; --pole-fond: #F0F2F9; }
.pole-badgeage { --pole: var(--c-badgeage); --primary: var(--c-badgeage); --primary-press: #54307D; --primary-soft: #EEE6F7; --pole-fond: #F4F1F8; }
.pole-com { --pole: var(--c-com); --primary: var(--c-com); --primary-press: #94194A; --primary-soft: #FAE4ED; --pole-fond: #F9F1F4; }
html:has(body.avec-menu), body.avec-menu { background: var(--pole-fond); min-height: 100vh; }
.avec-menu main { max-width: 1320px; padding: var(--s5) var(--s5) 80px; }

/* en-tête encre : marque, restaurant, intercalaires */
.hub { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0 var(--s4); padding: var(--s2) var(--s5) 0;
  padding-top: max(var(--s2), env(safe-area-inset-top)); background: var(--encre); color: #fff; }
.hub-marque { display: inline-flex; align-items: center; gap: 10px; min-width: 44px; min-height: 52px; padding-bottom: var(--s2); color: #fff; text-decoration: none;
  font-family: var(--font-titre); font-weight: 600; font-size: 18px; white-space: nowrap; }
.hub-marque img { border-radius: 9px; }
.hub-resto { display: flex; align-items: center; min-height: 52px; padding-bottom: var(--s2); min-width: 0; }
.hub-resto b { font-weight: 500; font-size: 16px; opacity: .85; }
.hub-resto select { width: auto; max-width: 230px; min-height: 44px; padding: 4px 28px 4px 12px; font-size: 15px; font-weight: 500; color: #fff; border: 0;
  border-radius: var(--r-sm); background-color: rgba(255, 255, 255, .12); appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat; }
.hub-resto select option { color: var(--text); }
.hub .burger { margin: 0 -8px 2px 0; color: #fff; align-self: center; }
.hub .burger:hover { background: rgba(255, 255, 255, .12); }
.intercalaires { display: flex; align-items: flex-end; gap: 4px; margin-left: auto; align-self: stretch; }
.interc { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 12px 12px 0 0; color: #fff; text-decoration: none; font-family: var(--font-titre); font-weight: 600; font-size: 16px;
  transition: height var(--t-rapide); }
.interc .ph { font-size: 20px; }
.interc:hover { height: 50px; }
.interc[aria-current="page"] { height: 54px; }
.interc:focus-visible { outline-color: #fff; outline-offset: -4px; }
.interc-accueil { display: none; }
.interc-hygiene { background: var(--c-hygiene); } .interc-chiffres { background: var(--c-chiffres); }
.interc-badgeage { background: var(--c-badgeage); } .interc-com { background: var(--c-com); }
.interc.a-decouvrir { background: transparent; box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .35), inset 1.5px 0 0 rgba(255, 255, 255, .35), inset -1.5px 0 0 rgba(255, 255, 255, .35); color: #D5DCE6; }
.interc-nb { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--encre);
  font-family: var(--font-texte); font-size: 13px; font-variant-numeric: tabular-nums; }

/* barre du pôle : sa couleur descend de l'intercalaire, ses pages dedans */
body.avec-menu::before { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 25; height: env(safe-area-inset-top, 0px); background: var(--encre); }
.bande { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 6px var(--s5);
  background: var(--pole); overflow-x: auto; scrollbar-width: none; }
.bande::-webkit-scrollbar { display: none; }
.bande a { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm);
  color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.bande a:hover { background: rgba(255, 255, 255, .16); }
.bande a[aria-current="page"] { background: #fff; color: var(--pole); font-weight: 600; }
.bande a:focus-visible { outline-color: #fff; outline-offset: -3px; }
.bande a[aria-current="page"]:focus-visible { outline-color: var(--focus); }
.bande-sep { flex: 0 0 1px; height: 22px; margin: 0 var(--s2); background: rgba(255, 255, 255, .35); }
.bande-nb { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--pole); font-size: 13px; text-align: center; }
.bande a[aria-current="page"] .bande-nb { background: var(--pole); color: #fff; }
@media (min-width: 1100px) { .bande { flex-wrap: wrap; overflow: visible; } .bande a { padding: 0 8px; } .bande-sep { margin: 0 4px; } }
@media (min-width: 1100px) and (max-width: 1359px) { .bande { padding-left: var(--s4); padding-right: var(--s4); } .bande a { padding: 0 7px; font-size: 14.5px; } }
.avec-menu .md-liste { top: 68px; max-height: calc(100vh - 88px); }
html:has(body.avec-menu) { scroll-padding-top: 68px; }
@media (min-width: 1100px) and (max-width: 1279px) { html:has(body.avec-menu) { scroll-padding-top: 116px; } }
.avec-menu .hors-ligne { z-index: 31; }

/* tiroir : compte et réglages du restaurant */
.tiroir-tete { gap: var(--s3); padding-right: var(--s2); }
.tiroir-tete .avatar { flex: 0 0 auto; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--encre); color: #fff; font-weight: 700; font-family: var(--font-titre); }
.tiroir-tete .compte-txt { display: flex; }
.tiroir-tete .compte-txt small { overflow: hidden; text-overflow: ellipsis; }
.tiroir-titre { margin: var(--s4) var(--s4) var(--s1); padding: 0 var(--s3); font-family: var(--font-texte); font-size: 14px; font-weight: 600; color: var(--text-2); }
.tiroir-sortir { margin: auto var(--s4) 0; padding-top: var(--s4); }
.tiroir-sortir .btn { width: 100%; }

/* accueil : le mur des 4 pôles, ce qu'il faut regarder en premier dans chacun */
.avec-menu main:has(> .mur) { max-width: none; padding: 0; }
.avec-menu main:has(> .mur) > :not(.mur):not(h1) { margin: var(--s3); }
.mur { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 3px; min-height: calc(100vh - 60px); background: var(--encre); }
.mur > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.bloc { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; padding: clamp(20px, 2.6vw, 40px); color: #fff; }
.bloc-hygiene { background: var(--c-hygiene); } .bloc-chiffres { background: var(--c-chiffres); }
.bloc-badgeage { background: var(--c-badgeage); } .bloc-com { background: var(--c-com); }
.bloc-nom { display: flex; align-items: center; gap: var(--s2); margin: 0; font-family: var(--font-titre); font-size: 18px; font-weight: 500; }
.bloc-nom .ph { font-size: 22px; }
.bloc-titre { display: flex; align-items: flex-start; gap: var(--s3); min-height: 44px; margin-top: auto; color: #fff; text-decoration: none; font-family: var(--font-titre);
  font-size: clamp(28px, 3.5vw, 50px); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bloc-titre:hover span:last-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.bloc-etat { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border-radius: 50%; background: #fff; font-size: clamp(26px, 2.6vw, 36px); }
.bloc-etat .ph { font-size: .72em; font-weight: 700; vertical-align: 0; }
.ton-rouge { color: var(--danger); } .ton-orange { color: var(--warn); } .ton-vert { color: var(--ok); }
.bloc-sous { margin: 0; font-size: 16px; opacity: .92; }
.bloc-faits { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 0 var(--s5); margin: var(--s2) 0 0; padding: 0; }
.bloc-faits a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 46px; border-top: 1px solid rgba(255, 255, 255, .28);
  color: #fff; text-decoration: none; font-size: 15px; }
.bloc-faits a:hover span { text-decoration: underline; }
.bloc-faits b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bloc-faits b[class*="ton-"] { padding: 2px 10px; border-radius: 999px; background: #fff; }
.bloc :focus-visible { outline-color: #fff; }
.bloc.a-decouvrir { justify-content: center; background: var(--surface); color: var(--text); text-decoration: none; }
.bloc.a-decouvrir .bloc-nom { font-size: 26px; font-weight: 600; }
.bloc-hygiene.a-decouvrir .bloc-nom { color: var(--c-hygiene); } .bloc-chiffres.a-decouvrir .bloc-nom { color: var(--c-chiffres); }
.bloc-badgeage.a-decouvrir .bloc-nom { color: var(--c-badgeage); } .bloc-com.a-decouvrir .bloc-nom { color: var(--c-com); }
.bloc-accroche { max-width: 46ch; color: var(--text-2); }
.bloc.a-decouvrir .btn { align-self: flex-start; }

/* tous mes restaurants : une ligne par restaurant, une colonne par pôle */
.restos { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.resto-ligne { display: grid; grid-template-columns: minmax(180px, 1.1fr) repeat(auto-fit, minmax(170px, 1fr)); gap: 3px; overflow: hidden;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--ombre); }
.resto-nom { display: flex; flex-direction: column; justify-content: center; padding: var(--s4); color: var(--text); text-decoration: none; }
.resto-nom b { font-family: var(--font-titre); font-size: 19px; font-weight: 600; }
.resto-nom small { color: var(--text-2); font-size: 14px; }
.resto-nom:hover b { text-decoration: underline; }
.resto-pole { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s4); color: #fff; text-decoration: none; }
.resto-pole:hover .resto-pole-etat > span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.resto-pole:focus-visible { outline-color: #fff; outline-offset: -4px; }
.resto-hygiene { background: var(--c-hygiene); } .resto-chiffres { background: var(--c-chiffres); }
.resto-badgeage { background: var(--c-badgeage); } .resto-com { background: var(--c-com); }
.resto-pole-nom { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.resto-pole-nom .ph { font-size: 18px; }
.resto-pole-etat { display: flex; align-items: flex-start; gap: var(--s2); font-family: var(--font-titre); font-size: 18px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.resto-pole-etat .bloc-etat { font-size: 22px; }

/* tablette : les intercalaires passent sous la marque, à parts égales */
@media (max-width: 1099px) {
  .hub { padding-left: var(--s4); padding-right: var(--s4); }
  .mur { min-height: calc(100vh - 118px); }
  .hub-marque, .hub-resto { padding-bottom: 0; }
  .hub .burger { margin-left: auto; }
  .intercalaires { order: 3; flex: 1 0 100%; margin: var(--s1) 0 0; height: 54px; }
  .interc { flex: 1 1 0; padding: 0 var(--s2); min-width: 0; }
  .bande { padding-left: var(--s4); padding-right: var(--s4); }
  .avec-menu main { padding-left: var(--s4); padding-right: var(--s4); }
  .resto-ligne { grid-template-columns: 1fr 1fr; } .resto-nom { grid-column: 1 / -1; }
}
/* téléphone : les pôles descendent sous le pouce, avec l'accueil */
@media (max-width: 699px) {
  html:has(body.avec-menu) { overflow-x: clip; scroll-padding-bottom: 88px; }
  .avec-menu .btn { white-space: normal; text-align: center; padding-top: 6px; padding-bottom: 6px; }
  .avec-menu .hors-ligne { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .hub { flex-wrap: nowrap; gap: var(--s2); padding-bottom: var(--s1); align-items: center; }
  .hub-marque { min-height: 48px; flex: 0 0 auto; } .hub-marque span { display: none; }
  .hub-resto { flex: 1 1 auto; min-height: 48px; } .hub-resto select { width: 100%; max-width: none; }
  .hub-resto b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .intercalaires { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: auto; margin: 0; gap: 0; align-items: stretch;
    padding: 4px 4px max(4px, env(safe-area-inset-bottom)); background: var(--encre); box-shadow: 0 -4px 16px rgba(15, 23, 42, .18); }
  .interc, .interc:hover, .interc[aria-current="page"] { height: 56px; }
  .interc { flex-direction: column; gap: 2px; padding: 0 2px; border-radius: var(--r-sm); background: transparent !important; box-shadow: none !important;
    font-family: var(--font-texte); font-size: 12px; font-weight: 500; color: #D5DCE6; }
  .interc .ph { font-size: 22px; }
  .interc-accueil { display: inline-flex; }
  .interc-accueil[aria-current="page"] { background: rgba(255, 255, 255, .16) !important; color: #fff; }
  .interc-hygiene[aria-current="page"] { background: var(--c-hygiene) !important; color: #fff; }
  .interc-chiffres[aria-current="page"] { background: var(--c-chiffres) !important; color: #fff; }
  .interc-badgeage[aria-current="page"] { background: var(--c-badgeage) !important; color: #fff; }
  .interc-com[aria-current="page"] { background: var(--c-com) !important; color: #fff; }
  .interc.a-decouvrir { opacity: .7; }
  .interc-nb { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; background: var(--c-com); color: #fff; }
  .interc-com[aria-current="page"] .interc-nb { background: #fff; color: var(--c-com); }
  .bande { min-height: 52px; padding: 4px var(--s2); }
  .bande a { padding: 0 var(--s3); }
  .avec-menu main { padding: var(--s4) var(--s3) calc(104px + env(safe-area-inset-bottom, 0px)); }
  .avec-menu main:has(> .mur) { padding: 0 0 calc(72px + env(safe-area-inset-bottom, 0px)); }
  .mur { grid-template-columns: 1fr; grid-auto-rows: auto; min-height: 0; }
  .bloc { padding: var(--s4); gap: var(--s2); }
  .bloc-titre { margin-top: var(--s1); font-size: 28px; }
  .bloc-etat { font-size: 25px; }
  .resto-ligne { grid-template-columns: 1fr; }
}
/* papier : ni couleur de pôle ni texte blanc sur fond absent */
@media print {
  body.avec-menu { --primary: #1E3A5F; --primary-soft: #E8EEF6; --pole-fond: #fff; }
  html:has(body.avec-menu), body.avec-menu, .mur { background: #fff; }
  .bloc, .resto-pole, .bloc a, .bloc-titre, .bloc-faits a { background: none; color: #000; }
}
