/* =========================================================================
   RIVIERAE STOCK MANAGER — Design tokens
   Palette : navy profond (identité "cahier des charges"), amande/ambre
   (chaleur de la restauration), fond neutre clair pour la lisibilité des
   données. Typo système (évite toute dépendance CDN de police, cohérent
   avec la CSP stricte définie côté serveur).
   ========================================================================= */
/* Police des CHIFFRES uniquement (Inter, licence OFL — public/fonts/inter/LICENSE) :
   `unicode-range` la restreint aux chiffres et à leur ponctuation (séparateur
   décimal, espaces insécables des milliers fr-FR, / : % + −), toutes les lettres
   gardent leur police. Servie localement, comme le reste, pour fonctionner hors ligne.
   Les chiffres Georgia, elzéviriens, montaient et descendaient d'un chiffre à l'autre. */
@font-face { font-family: "Inter Chiffres"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/fonts/inter/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0030-0039, U+002B-002F, U+003A, U+0025, U+00A0, U+202F, U+2009, U+2212; }
@font-face { font-family: "Inter Chiffres"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/fonts/inter/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0030-0039, U+002B-002F, U+003A, U+0025, U+00A0, U+202F, U+2009, U+2212; }
@font-face { font-family: "Inter Chiffres"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/fonts/inter/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0030-0039, U+002B-002F, U+003A, U+0025, U+00A0, U+202F, U+2009, U+2212; }
@font-face { font-family: "Inter Chiffres"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/fonts/inter/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0030-0039, U+002B-002F, U+003A, U+0025, U+00A0, U+202F, U+2009, U+2212; }

:root {
  --navy-950: #101d30;
  --navy-900: #16283e;
  --navy-800: #1f3864;
  --navy-700: #2e4d7a;
  --navy-100: #e7ecf4;
  --amber-600: #c97a1f;
  --amber-500: #db8a2e;
  --amber-100: #fbead2;
  --green-600: #2f8f5b;
  --green-100: #e3f5ea;
  --red-600: #c4432f;
  --red-100: #fbe7e3;
  --grey-900: #1c2430;
  --grey-700: #4a5568;
  --grey-500: #8592a6;
  --grey-200: #e2e6ec;
  --grey-100: #f4f6f8;
  --white: #ffffff;

  --font-ui: "Inter Chiffres", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Inter Chiffres", Georgia, "Times New Roman", serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 29, 48, 0.06), 0 4px 16px rgba(16, 29, 48, 0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* L'attribut natif `hidden` (utilisé par app.js pour basculer entre l'écran
   de connexion et l'application : #login-screen.hidden = true/false) n'a
   qu'une spécificité CSS d'attribut. Toute règle de classe qui fixe
   `display` (ex. `.login-screen { display: flex }`, `.app { display: flex }`
   ci-dessous) l'emporte sinon sur la feuille de style du navigateur — dès
   lors `hidden` ne cache plus rien et les deux écrans s'affichent l'un
   au-dessus de l'autre en même temps. Cette règle garantit que `hidden`
   gagne toujours, quelle que soit la règle de classe présente ailleurs.  */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--grey-900);
  background: var(--grey-100);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}
/* Chiffres de même largeur : colonnes et totaux parfaitement alignés. */
td, th, .card-value, .card-sub, input[type="number"], .suivi-table { font-variant-numeric: lining-nums tabular-nums; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--navy-900); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--navy-800); }

/* ---------------- Écran de connexion ---------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(219,138,46,0.18), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(46,77,122,0.35), transparent 45%),
    var(--navy-950);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-mark {
  width: 46px; height: 46px; border-radius: 10px;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.5px;
}
.login-mark.small { width: 34px; height: 34px; font-size: 14px; border-radius: 8px; }
.login-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--navy-900); line-height: 1.1; }
.login-subtitle { font-size: 11px; letter-spacing: 2px; color: var(--amber-600); font-weight: 700; }
#login-form, #suivi-form, #register-form { display: flex; flex-direction: column; gap: 14px; }
#login-form label, #suivi-form label, #register-form label { font-size: 13px; font-weight: 600; color: var(--grey-700); display: flex; flex-direction: column; gap: 6px; }
#login-form input, #suivi-form input, #register-form input {
  padding: 11px 12px; border-radius: 8px; border: 1.5px solid var(--grey-200);
  font-size: 14px; outline: none; transition: border-color .15s;
}
#login-form input:focus, #suivi-form input:focus, #register-form input:focus { border-color: var(--navy-700); }

/* Page publique de suivi de commande : sobre — un formulaire court, puis le statut,
   une chronologie et les plats. Préfixe « track- » (« suivi- » sert au Suivi cantines). */
.track-card { max-width: 440px; }
.track-card.register-card { max-width: 480px; }
#register-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 520px) { #register-form .form-row { grid-template-columns: 1fr; } .login-card { padding: 32px 22px; } }
#register-form .btn { margin-top: 4px; }
.track-intro { font-size: 13.5px; color: var(--grey-500); margin: 0 0 18px; line-height: 1.5; }
.track-optional { font-weight: 400; color: var(--grey-500); }
.track-hint { font-weight: 400; font-size: 12px; color: var(--grey-500); line-height: 1.4; }
.track-back { display: block; margin: 18px auto 0; background: none; border: none; font-size: 13px; color: var(--grey-500); }
.track-back:hover { color: var(--navy-800); text-decoration: underline; }
.track-result { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--grey-200); text-align: left; }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.track-num { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--navy-900); }
.track-date { font-size: 12.5px; color: var(--grey-500); margin-top: 2px; }
.track-timeline { list-style: none; margin: 18px 0 6px; padding: 0; }
.track-timeline li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 0 0 12px 20px; font-size: 13.5px; color: var(--grey-500); }
.track-timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--grey-200); }
.track-timeline li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -1px; width: 1px; background: var(--grey-200); }
.track-timeline li:last-child { padding-bottom: 0; }
.track-timeline li:last-child::after { display: none; }
.track-timeline li.current { color: var(--grey-900); font-weight: 600; }
.track-timeline li.current::before { background: var(--navy-800); }
.track-timeline time { font-weight: 400; font-size: 12.5px; color: var(--grey-500); white-space: nowrap; }
.track-note { margin: 14px 0 0; font-size: 12.5px; color: var(--grey-500); line-height: 1.5; }
.track-items { margin-top: 16px; }
.track-items tbody tr { background: none; }
.track-items .num { text-align: right; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--grey-500); text-align: center; }
.error-text { color: var(--red-600); font-size: 13px; margin: 0; }

/* ---------------- Boutons ---------------- */
.btn {
  border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .15s;
}
.btn-primary { background: var(--navy-800); color: var(--white); }
.btn-primary:hover { background: var(--navy-700); }
.btn-amber { background: var(--amber-500); color: var(--white); }
.btn-amber:hover { background: var(--amber-600); }
.btn-ghost { background: transparent; color: var(--grey-700); border: 1.5px solid var(--grey-200); }
.btn-ghost:hover { background: var(--grey-100); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
/* Boutons « doux » : fond pastel + texte de même teinte, pour distinguer les actions sans alourdir. */
.btn-soft-navy  { background: var(--navy-100);  color: var(--navy-800); }
.btn-soft-navy:hover  { background: #d9e2f0; }
.btn-soft-green { background: var(--green-100); color: var(--green-600); }
.btn-soft-green:hover { background: #cdebd9; }
/* « Vendre » : vert plein, pour ne jamais se confondre avec « Produire » (marine plein). */
.btn-vendre { background: var(--green-600); color: var(--white); }
.btn-vendre:hover { background: #257a4c; }
.btn-action { min-width: 104px; }

/* ---------------- Layout applicatif ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--navy-950); color: var(--white);
  display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 9px; padding: 16px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-brand-text strong { font-family: var(--font-display); font-size: 14.5px; }
.sidebar-brand-text span { font-size: 9.5px; letter-spacing: 1.5px; color: var(--amber-500); font-weight: 700; }

/* Le menu ne doit quasiment jamais avoir besoin de défiler (disposition
   resserrée ci-dessous) ; `overflow-y: auto` ne reste qu'en filet de
   sécurité pour les très petites fenêtres, avec une scrollbar fine et
   discrète plutôt que la barre large par défaut du navigateur. */
.nav {
  flex: 1; overflow-y: auto; padding: 8px 8px; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }

.nav-group { display: flex; flex-direction: column; gap: 1px; padding-top: 10px; }
.nav-group:first-child { padding-top: 0; }
.nav-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.38);
  padding: 0 8px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px;
  color: rgba(255,255,255,0.78); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
  line-height: 1.3;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active { background: var(--amber-500); color: var(--white); }
.nav-icon { width: 17px; text-align: center; opacity: 0.9; font-size: 14px; }
.nav-item-label { flex: 1; }
.nav-badge {
  flex-shrink: 0; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--red-600); color: var(--white); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.35); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 32px; background: var(--white); border-bottom: 1px solid var(--grey-200);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 22px; }
.content { padding: 28px 32px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------------- Zone utilisateur (topbar, en haut à droite) ---------------- */
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 4px 4px 5px;
  border-radius: 30px; background: var(--grey-100); border: 1px solid var(--grey-200);
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
}
#user-info { line-height: 1.3; }
#user-info strong { display: block; font-size: 12.5px; color: var(--navy-900); }
.role-badge {
  display: inline-block; margin-top: 2px; font-size: 10px; padding: 1px 8px; border-radius: 20px;
  background: var(--amber-100); color: var(--amber-600); font-weight: 700; letter-spacing: .3px;
}

/* Bouton de déconnexion : pastille rouge pleine dans la pastille utilisateur,
   volontairement voyant (dégradé, halo, icône qui glisse au survol). */
.user-chip-logout {
  height: 30px; padding: 0 14px 0 11px; border-radius: 30px; flex-shrink: 0; margin-left: 3px;
  border: none; color: var(--white); cursor: pointer;
  background: linear-gradient(135deg, #e2513a, var(--red-600) 55%, #a8321f);
  box-shadow: 0 2px 8px rgba(196, 67, 47, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.user-chip-logout svg { transition: transform .18s; }
.user-chip-logout:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(196, 67, 47, .6), inset 0 1px 0 rgba(255, 255, 255, .3); }
.user-chip-logout:hover svg { transform: translateX(3px); }
.user-chip-logout:active { transform: scale(0.96); }
.user-chip-logout:focus-visible { outline: 3px solid rgba(196, 67, 47, .35); outline-offset: 2px; }

/* ---------------- Cartes / grilles ---------------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border: 1px solid var(--grey-200);
}
.card-title { font-size: 13px; font-weight: 600; color: var(--grey-700); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.card-value { font-family: var(--font-display); font-size: 24px; color: var(--navy-900); font-weight: 600; }
.card-value.alert { color: var(--red-600); }
.card-value.warn { color: var(--amber-600); }
.card-sub { font-size: 12.5px; color: var(--grey-500); margin-top: 4px; }

/* Cartes de statistiques du Tableau de bord : fond teinté selon l'état
   (neutre / ok / avertissement / alerte). */
.stat-card { background: var(--navy-100); border-color: #d5deec; box-shadow: none; }
.stat-card.tone-ok    { background: var(--green-100); border-color: #c6e8d3; }
.stat-card.tone-warn  { background: var(--amber-100); border-color: #f3d9b0; }
.stat-card.tone-alert { background: var(--red-100);   border-color: #f2c9c1; }
.stat-card .card-title { font-size: 12px; }
.stat-card .card-value { font-size: clamp(18px, 2vw, 24px); line-height: 1.15; white-space: nowrap; }

/* Suivi des cantines : trois tableaux sur fond blanc, en-têtes teintés, survol des
   lignes, alertes en pastilles colorées et petite barre proportionnelle sous le CA. */
.suivi-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 22px; }
.suivi-filtres label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grey-700); }
/* Sélecteur de cantines à afficher (bornage des tableaux « Plats restants »/« Stock des
   ingrédients » quand il y a beaucoup de cantines) : même famille que .site-group. */
.cantines-filtre { position: relative; }
.cantines-filtre summary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--grey-200); background: var(--white); font-size: 13px; font-weight: 600; color: var(--navy-800); cursor: pointer; list-style: none; }
.cantines-filtre summary::-webkit-details-marker { display: none; }
.cantines-filtre summary::after { content: "▾"; color: var(--grey-500); }
.cantines-filtre[open] summary { border-color: var(--navy-700); }
.cantines-filtre-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 260px; padding: 10px; background: var(--white); border: 1px solid var(--grey-200); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,29,48,.14); }
.cantines-filtre-actions { display: flex; gap: 12px; padding: 2px 6px 8px; margin-bottom: 6px; border-bottom: 1px solid var(--grey-100); }
.cantines-filtre-actions button { background: none; border: none; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--navy-700); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cantines-filtre-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.cantines-filtre-list label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13px; font-weight: 400; cursor: pointer; }
.cantines-filtre-list label:hover { background: var(--grey-100); }
.cantines-filtre-list input { width: 15px; height: 15px; cursor: pointer; }
.suivi-filtres input[type="date"] { padding: 7px 9px; border-radius: 8px; border: 1.5px solid var(--grey-200); font-size: 13px; background: var(--white); }
.suivi-bloc { background: var(--white); border: 1px solid var(--grey-200); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.suivi-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--navy-900); border-bottom: 1px solid var(--grey-200); }
.suivi-titre::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--amber-500); margin-right: 10px; flex-shrink: 0; }
.suivi-titre > span:first-child { flex: 1; }
.suivi-titre .suivi-legende { display: flex; gap: 8px; font-family: var(--font-ui); font-size: 12px; font-weight: 500; }
.suivi-scroll { overflow-x: auto; }
.suivi-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.suivi-table th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--navy-700); background: var(--navy-100); padding: 10px 20px; white-space: nowrap; }
.suivi-table td { padding: 11px 20px; border-bottom: 1px solid var(--grey-100); color: var(--grey-900); }
.suivi-table tbody tr:last-child td { border-bottom: none; }
.suivi-table tbody tr:hover td { background: #edf1f7; }
.suivi-table td:first-child { font-weight: 600; color: var(--navy-900); }
.suivi-table .num { text-align: right; }
.suivi-table tbody tr.fourn-groupe td { background: var(--navy-100); color: var(--navy-900); font-weight: 700; border-bottom: none; }
.suivi-table tbody tr.fourn-groupe:hover td { background: var(--navy-100); }
.suivi-table tbody tr.fourn-groupe .muted { font-weight: 400; }
.suivi-table tfoot td { font-weight: 700; color: var(--navy-900); background: var(--amber-100); border-top: 1px solid #f0d9b3; padding-top: 12px; padding-bottom: 12px; }
/* En-têtes à deux niveaux (cantine, puis Total / Restant ou Total / Consommé / Reste) :
   un filet vertical sépare les groupes de colonnes de chaque cantine. */
.suivi-table th.groupe { text-align: center; }
.suivi-table th.sous { font-size: 10.5px; padding-top: 6px; padding-bottom: 8px; }
.suivi-table .g-debut { border-left: 1px solid var(--grey-200); }
/* Variante compacte (Stock des ingrédients, jusqu'à 3 colonnes par cantine) : tout tient
   en largeur sans défilement horizontal, ingrédient sur une seule ligne (tronqué au besoin,
   nom complet au survol). */
.suivi-table.compact { font-size: 12.5px; }
.suivi-table.compact th { padding: 8px 8px; }
.suivi-table.compact th.groupe { white-space: normal; }
.suivi-table.compact th.sous { padding-left: 6px; padding-right: 6px; }
.suivi-table.compact td { padding: 8px 8px; }
.suivi-table.compact td.ing { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.suivi-table.compact .unite { font-size: 10.5px; }
.suivi-table.compact .q-chip { min-width: 0; padding: 1px 7px; }
/* Colonne du nom (plat/ingrédient) figée : avec beaucoup de cantines en colonnes, le tableau
   défile loin horizontalement et on perdrait sinon le repère de la ligne. */
.suivi-table.compact th:first-child, .suivi-table.compact td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--grey-200); }
.suivi-table.compact th:first-child { background: var(--navy-100); z-index: 2; }
.suivi-table.compact td:first-child { background: var(--white); }
.suivi-table.compact tbody tr:hover td:first-child { background: #edf1f7; }
.suivi-titre .suivi-cumul { margin-left: 8px; font-family: var(--font-ui); font-size: 12px; font-weight: 400; color: var(--grey-500); }
.suivi-table .vide { color: #c1c8d3; font-weight: 400; }
.suivi-table .unite { font-weight: 400; color: var(--grey-500); font-size: 12px; }
.suivi-table .zero { color: #b5bdc9; }
.suivi-table .q-chip .zero { color: inherit; }
.devise { margin-left: 3px; font-size: .78em; font-weight: 600; color: var(--grey-500); }
.suivi-table tfoot .devise { color: var(--amber-600); }
.q-chip { display: inline-block; min-width: 42px; padding: 2px 10px; border-radius: 999px; font-weight: 700; text-align: center; }
.q-rupture { color: var(--red-600); background: var(--red-100); }
.q-bas { color: var(--amber-600); background: var(--amber-100); }
.ca-val { font-weight: 700; color: var(--navy-900); }
.ca-bar { height: 4px; border-radius: 2px; background: var(--grey-100); margin-top: 5px; margin-left: auto; width: 120px; overflow: hidden; }
.ca-bar i { display: block; height: 100%; background: var(--amber-500); border-radius: 2px; }

.section { margin-bottom: 30px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h2 { font-size: 17px; }

.chart-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--grey-200); }
.chart-card canvas { max-height: 260px; }

/* ---------------- Tableaux ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--grey-500); padding: 10px 12px; border-bottom: 2px solid var(--grey-200);
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--grey-200); color: var(--grey-900); }
/* Lignes paires légèrement teintées (zébrage), survol un cran plus foncé pour
   rester visible aussi sur une ligne teintée. */
tbody tr:nth-child(even) { background: #f7f9fc; }
tbody tr:hover { background: #edf1f7; }
.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--grey-200); overflow-x: auto; }

/* Aperçu des ingrédients d'un plat dans le tableau Recettes (colonne
   "Ingrédients") — tronqué avec ellipsis, liste complète dispo au survol
   via l'attribut title natif du <span>. */
.ing-preview {
  display: block; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--grey-700); font-size: 13.5px;
}

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.badge-green { background: var(--green-100); color: var(--green-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-grey { background: var(--grey-200); color: var(--grey-700); }

/* ---------------- Formulaires ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .form-grid.cols-3 { grid-template-columns: 1fr; } }
/* Formulaires repliés : rangée des boutons « + Nouveau… » qui déplient le formulaire. */
.form-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
/* Boutons d'action principaux de l'onglet Mouvements : taille modérée, l'entrée en plein et le transfert en contour. */
.mvt-toolbar .btn { padding: 7px 14px; font-size: 13px; }
.mvt-toolbar .btn-primary { box-shadow: 0 2px 6px rgba(31, 56, 100, .28); }
.card-title.section.spaced { margin: 30px 0 10px; }
/* Ligne d'article sur UNE rangée ; lot/péremption (.mvt-extra) n'apparaissent que si utiles. */
.mvt-line { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.mvt-line .form-field { flex: 1 1 120px; }
.mvt-line .mvt-produit-field { flex: 2 1 200px; }
.mvt-extra { flex: 1 1 100%; display: flex; gap: 10px; }
.mvt-extra .form-field { flex: 1 1 160px; }
.link-btn { background: none; border: none; padding: 9px 4px; font-size: 12.5px; font-weight: 600; color: var(--navy-700); }
.link-btn:hover { text-decoration: underline; }
/* Saisie par étapes liées (onglets) : étapes suivantes verrouillées tant que la courante n'est pas validée. */
.step-tabs { margin-bottom: 14px; }
.pill-tab.locked { opacity: .45; pointer-events: none; }
.pill-tab.done:not(.active)::after { content: " ✓"; color: var(--green-600); }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12.5px; font-weight: 700; color: var(--grey-700); }
.form-field input, .form-field select, .form-field textarea {
  padding: 9px 11px; border-radius: 8px; border: 1.5px solid var(--grey-200); font-size: 13.5px; outline: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--navy-700); }
.form-actions { display: flex; gap: 10px; margin-top: 4px; grid-column: 1 / -1; }
.form-hint { font-size: 12.5px; color: var(--grey-500); margin: -4px 0 14px; line-height: 1.5; }
.field-optional { font-weight: 400; color: var(--grey-500); text-transform: none; letter-spacing: 0; }
.input-error { border-color: var(--red-600) !important; background: var(--red-100); }
.required-field label::after { content: " *"; color: var(--red-600); }

/* ---------------- Sélecteur client (voir clientPickerHtml/bindClientPicker) ---------------- */
.client-picker-results {
  position: absolute; z-index: 20; margin-top: 2px; width: 100%; max-height: 220px; overflow-y: auto;
  background: var(--white); border: 1.5px solid var(--grey-200); border-radius: 8px; box-shadow: var(--shadow);
}
.client-picker-item { padding: 8px 11px; font-size: 13.5px; cursor: pointer; }
.client-picker-item:hover { background: var(--grey-100); }
.client-picker-item.muted { color: var(--grey-500); cursor: default; }
.client-picker-create { font-weight: 600; color: var(--navy-700); }
.client-picker-item.muted:hover { background: transparent; }

/* ---------------- Pagination / barre de filtres (voir app.js) ---------------- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 4px; font-size: 12.5px; color: var(--grey-700); }
.pagination-info { color: var(--grey-500); }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.pg-btn { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 7px; border: 1.5px solid var(--grey-200); background: var(--white); color: var(--grey-700); font-size: 12.5px; cursor: pointer; }
.pg-btn:hover:not(:disabled) { background: var(--grey-100); }
.pg-btn.active { background: var(--navy-950); color: var(--white); border-color: var(--navy-950); }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-ellipsis { padding: 0 4px; color: var(--grey-500); }
.pagination-per-page { padding: 6px 9px; border-radius: 7px; border: 1.5px solid var(--grey-200); font-size: 12.5px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.filter-bar .form-field { gap: 4px; min-width: 150px; }
.filter-bar .form-field label { font-size: 11.5px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--grey-200); font-size: 13px; }
.filter-bar .filter-search { min-width: 220px; }
/* Barre de filtres sur UNE seule ligne : les champs se partagent la largeur (la recherche en prend
   deux fois plus) ; on ne repasse à la ligne que sur petit écran, où la ligne unique déborderait. */
.filter-bar.oneline { flex-wrap: nowrap; }
.filter-bar.oneline .form-field { flex: 1 1 0; min-width: 0; }
.filter-bar.oneline .filter-search { flex: 2 1 0; min-width: 0; }
.filter-bar.oneline input, .filter-bar.oneline select { width: 100%; min-width: 0; }
@media (max-width: 900px) { .filter-bar.oneline { flex-wrap: wrap; } .filter-bar.oneline .form-field { flex: 1 1 150px; } }

/* ---------------- Regroupement par site (voir renderStockTab "magasin") ---------------- */
.site-group { border: 1px solid var(--grey-200); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.site-group + .site-group { margin-top: 12px; }
.site-group summary { padding: 14px 18px; font-weight: 700; font-size: 13.5px; cursor: pointer; list-style: none; }
.site-group summary::-webkit-details-marker { display: none; }
.site-group summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--grey-500); transition: transform .12s; }
.site-group[open] summary::before { transform: rotate(90deg); }
.site-group .table-wrap { box-shadow: none; border-top: 1px solid var(--grey-200); border-radius: 0; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--grey-500); font-size: 13.5px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--navy-950); color: var(--white);
  padding: 13px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 50; max-width: 340px;
}
.toast.error { background: var(--red-600); }
.toast.success { background: var(--green-600); }

/* ---------------- Fenêtre modale (générique, voir openModal() dans app.js) ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(16, 29, 48, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: modal-fade-in .15s ease-out;
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: 100%; max-width: 520px; max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--white); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(16, 29, 48, 0.35);
  padding: 20px; animation: modal-box-in .15s ease-out;
}
@keyframes modal-box-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy-900); }
.modal-close {
  border: none; background: transparent; color: var(--grey-500); font-size: 15px; line-height: 1;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--grey-100); color: var(--grey-900); }

/* Une ligne d'ingrédient éditable = une petite carte, plutôt que trois
   champs alignés au fil de l'eau sans repère visuel entre eux. */
.ing-row {
  display: flex; gap: 10px; align-items: center; padding: 6px 8px 6px 12px; margin-bottom: 8px;
  background: var(--grey-100); border: 1px solid var(--grey-200); border-radius: 8px;
}
.ing-row .ing-produit { flex: 1; padding: 8px 10px; border-radius: 6px; border: 1.5px solid var(--grey-200); background: var(--white); font-size: 13.5px; }
.ing-row .ing-unite { flex: 0 0 auto; min-width: 34px; color: var(--grey-500); font-size: 12px; font-weight: 700; text-align: center; }
.ing-remove {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
  color: var(--grey-500); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.ing-remove:hover { background: var(--red-100); color: var(--red-600); }

/* Saisie d'un plat : une seule rangée (nom + Ajouter), Entrée pour enchaîner. */
.plat-add { display: flex; gap: 8px; max-width: 460px; margin-bottom: 18px; }
.plat-add input {
  flex: 1; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--grey-200);
  background: var(--white); font-size: 14px; outline: none; transition: border-color .15s;
}
.plat-add input:focus { border-color: var(--navy-700); }

.pill-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-tab {
  padding: 7px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--grey-200); color: var(--grey-700); background: var(--white);
}
.pill-tab.active { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }

code.hash { font-size: 11px; color: var(--grey-500); word-break: break-all; }

/* ------------------------- Fiche du jour (impression) ------------------------- */
.fiche-print h2 { margin: 0 0 2px; font-size: 17px; }
.fiche-print .fiche-entete p { margin: 0 0 14px; color: var(--grey-500); font-size: 12.5px; }
.fiche-print h3 { margin: 16px 0 6px; font-size: 13px; color: var(--grey-700); }
.fiche-print table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fiche-print th, .fiche-print td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--grey-200); }
.fiche-print ul { margin: 0; padding-left: 18px; font-size: 13px; }

/* À l'impression, on masque tout sauf la fiche affichée dans la modale — le
   reste de l'application (menu, barre du haut, autres modales) ne doit
   jamais se retrouver sur le papier. */
@media print {
  body * { visibility: hidden; }
  .fiche-print, .fiche-print *, .suivi-print, .suivi-print * { visibility: visible; }
  .fiche-print, .suivi-print { position: absolute; top: 0; left: 0; width: 100%; }
}

/* Suivi des cantines — version imprimée : en-tête, tableaux bordés à en-tête grisé,
   lignes alternées, couleurs d'alerte conservées, paysage pour les colonnes nombreuses. */
.suivi-print-entete { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .suivi-print { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #000; background: #fff; font-size: 12px; }
  .suivi-print-entete { display: block; border-bottom: 2px solid var(--navy-900); padding-bottom: 8px; margin-bottom: 16px; }
  .suivi-print-entete h1 { font-size: 22px; color: #000; }
  .suivi-print-entete p { margin: 4px 0 0; font-size: 12px; color: var(--grey-700); }
  .suivi-print-entete .suivi-print-periode { margin-top: 6px; font-size: 15px; font-weight: 700; color: #000; }
  .suivi-print .suivi-bloc { margin-bottom: 18px; background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; }
  .suivi-print .suivi-bloc:not(:last-child) { break-inside: avoid; }
  .suivi-print .suivi-titre { color: var(--navy-900); font-family: var(--font-ui); font-size: 13px; text-transform: uppercase; border-bottom: none; padding: 0 0 8px; }
  .suivi-print .suivi-table { font-size: 12px; border: 1px solid #8a94a3; }
  .suivi-print .suivi-table thead { display: table-header-group; }
  .suivi-print .suivi-table th { background: var(--navy-100); color: var(--navy-900); border: 1px solid #8a94a3; padding: 6px 8px; }
  .suivi-print .suivi-table td { border: 1px solid #c3c9d3; padding: 5px 8px; }
  .suivi-print .suivi-table .g-debut { border-left: 2px solid #8a94a3; }
  .suivi-print .suivi-cumul { text-transform: none; }
  .suivi-print .suivi-table tbody tr:nth-child(even) td { background: #f4f6f8; }
  .suivi-print .ca-bar { display: none; }
  .suivi-print .suivi-table tr { break-inside: avoid; }
  .suivi-print .suivi-table tfoot td { background: var(--navy-100); border: 1px solid #8a94a3; }
}

/* =========================================================================
   Refonte des formulaires et tableaux (lisibilité) — voir plan « 12 observations »
   ========================================================================= */
.muted { color: var(--grey-500); font-size: 12px; }
td .muted { display: inline-block; line-height: 1.35; }
.num { text-align: right; white-space: nowrap; }
th.num { text-align: right; }

/* Bouton contour (actions secondaires) : sobre, sans aplat de couleur. */
.btn-outline { background: transparent; color: var(--navy-800); border: 1.5px solid var(--navy-800); }
.btn-outline:hover { background: var(--navy-100); }
.link-btn.danger { color: var(--red-600); }
.link-btn.disabled, .link-btn[aria-disabled="true"] { color: var(--grey-500); cursor: default; text-decoration: none; opacity: .6; pointer-events: none; }
.row-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.row-actions-end { justify-content: flex-end; gap: 8px; }
.row-sep { width: 1px; height: 18px; background: var(--grey-200); flex-shrink: 0; }

/* Filtres secondaires repliés. */
.more-filters { margin: -6px 0 14px; font-size: 12.5px; }
.more-filters > summary { cursor: pointer; color: var(--navy-700); font-weight: 600; list-style: none; padding: 2px 0; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::before { content: "▸ "; }
.more-filters[open] > summary::before { content: "▾ "; }
.more-filters .filter-bar { margin: 8px 0 0; }

/* Plats de la commande (modal « Ouvrir ») : replié par défaut ouvert, reste visible quel que soit l'onglet actif. */
.cmd-plats { margin: 0 0 14px; }
.cmd-plats > summary { cursor: pointer; color: var(--navy-700); font-weight: 600; font-size: 13px; list-style: none; padding: 2px 0; }
.cmd-plats > summary::-webkit-details-marker { display: none; }
.cmd-plats > summary::before { content: "▾ "; }
.cmd-plats:not([open]) > summary::before { content: "▸ "; }
.cmd-plats .cmd-toolbar { margin-top: 10px; }

/* Ligne de détail dépliable d'un tableau (lot, péremption, utilisateur…). */
.detail-toggle { background: none; border: none; color: var(--grey-500); cursor: pointer; padding: 0 6px; font-size: 12px; }
.detail-toggle:hover { color: var(--navy-800); }
tr.detail-row { background: #f7f9fc; }
tr.detail-row td { padding: 6px 12px 10px 24px; font-size: 12.5px; color: var(--grey-700); border-bottom: 1px solid var(--grey-200); }

/* Récapitulatif avant enregistrement (dernière étape d'un formulaire par étapes). */
.recap { display: flex; flex-direction: column; gap: 12px; }
.recap-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13.5px; }
.recap-meta dt { color: var(--grey-500); }
.recap-meta dd { margin: 0; font-weight: 600; color: var(--grey-900); }
.recap table { font-size: 13px; }
.recap .recap-total { text-align: right; font-size: 15px; font-weight: 700; color: var(--navy-900); }
.recap-note { font-size: 12.5px; color: var(--grey-500); margin: 0; }

/* Aide repliable « Comment lire… ? » */
.aide { margin: 0 0 16px; font-size: 13px; }
.aide > summary { cursor: pointer; color: var(--navy-700); font-weight: 600; }
.aide dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.aide dt { font-weight: 700; color: var(--grey-900); }
.aide dd { margin: 0; color: var(--grey-700); }
@media (max-width: 700px) { .aide dl, .recap-meta { grid-template-columns: 1fr; } }

/* Résumé « stock actuel » (fiche de stock produit). */
.stock-resume { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 4px 0 18px; }
.stock-resume .stock-qte { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--navy-900); }
.stock-resume .stock-unite { font-size: 15px; color: var(--grey-700); }
.stock-sites { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--grey-700); margin: -8px 0 16px; }

/* Modal large (détail de commande, besoins). */
.modal-box.wide { max-width: 860px; }

/* Retard de retour de matériel. */
.retard { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: var(--red-100); color: var(--red-600); white-space: nowrap; }
.retard.ok { background: var(--grey-100); color: var(--grey-700); }
.relancer { display: inline-flex; gap: 10px; white-space: nowrap; }
.relancer a { font-size: 12.5px; font-weight: 600; color: var(--navy-700); text-decoration: none; }
.relancer a:hover { text-decoration: underline; }
.relancer .off { font-size: 12.5px; color: var(--grey-500); cursor: help; }

/* Production et vente : sélecteur de site, suivi par approvisionnement (une ligne dépliable par réception). */
/* Matériel prêté : un prêt = une ligne, ses articles l'un sous l'autre ; en-tête de prêt dans le formulaire de retour. */
.pret-article { line-height: 1.6; }
tr.groupe-row td { background: var(--grey-100); font-size: 13px; }
.prod-qte-line .inline-qte { font-size: 20px; font-weight: 700; max-width: 180px; }
.prod-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.prod-extra { max-width: 260px; margin: 8px 0; }
.prod-ingredients { margin-top: 10px; }

/* Bandeau « commandes clients à prendre en charge » (haut de l'écran Commandes). */
.alerte-commandes { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--amber-100); color: var(--grey-900); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.toast[data-cliquable] { cursor: pointer; }
.prod-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.prod-toolbar .form-field { min-width: 260px; }
.cycles-table .cycle-row { cursor: pointer; }
.cycles-table .cycle-row.en-cours td:first-child { box-shadow: inset 3px 0 0 var(--amber-500); }
.cycles-table td, .cycles-table th { vertical-align: middle; }
.avance { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--grey-700); }
.avance .ca-bar { margin: 0; width: 120px; height: 6px; }

/* ---------------- Espace client (connecté) ---------------- */
.client-app { min-height: 100vh; background: var(--grey-100); }
.client-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--white); border-bottom: 1px solid var(--grey-200); position: sticky; top: 0; z-index: 5;
}
.client-brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); color: var(--navy-900); }
.client-tabs { margin: 0; }
.client-user { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--grey-700); }
.client-content { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }

/* Ligne de total en pied de tableau (commandes, reçus, bons). */
tfoot td { padding: 11px 12px; border-top: 2px solid var(--grey-200); font-size: 13.5px; color: var(--grey-900); }
.suivi-table tfoot td { padding: 12px 20px; }

/* Accueil de l'espace client : bienvenue, trois chiffres, commandes à venir, carte des plats. */
.client-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.client-hero h2 { font-size: 22px; }
.client-hero p { margin: 4px 0 0; font-size: 13.5px; color: var(--grey-500); }
.client-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
@media (max-width: 640px) { .client-stats { grid-template-columns: 1fr; } }
.client-stats .stat-card { padding: 16px 18px; }
.client-stats .card-value { font-size: 24px; }
.client-section { margin-bottom: 28px; }
.client-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.client-section-head h3 { font-size: 16px; }
.client-encours { display: grid; gap: 12px; }
.client-encours-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; }
.client-encours-item .track-num { font-size: 15px; }
.client-encours-meta { font-size: 13px; color: var(--grey-500); margin-top: 3px; }
.client-progress { display: flex; gap: 4px; margin-top: 10px; }
.client-progress i { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--grey-200); }
.client-progress i.on { background: var(--navy-800); }
.client-carte { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.client-plat { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.client-plat strong { font-family: var(--font-display); font-size: 14.5px; color: var(--navy-900); }
.client-plat .prix { font-size: 13px; color: var(--grey-700); margin-top: 2px; }
.client-alert { border-color: #f3d9b0; background: var(--amber-100); }
.client-alert.late { border-color: #f2c9c1; background: var(--red-100); }
.client-empty-cta { text-align: center; padding: 34px 20px; }

/* ---------------- Recherche dans les listes de sélection (voir js/select-search.js) ----------------
   Liste courte : le <select> natif reste tel quel (l'enveloppe disparaît de la mise en page).
   Liste longue : le <select> est masqué (mais garde valeur et validation) et un bouton ouvre le panneau de recherche. */
.ss:not(.ss-active) { display: contents; }
.ss:not(.ss-active) > .ss-display { display: none; }
.ss.ss-active { position: relative; display: block; min-width: 0; }
.ss.ss-active > select { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ss-display {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 8px; border: 1.5px solid var(--grey-200); background: var(--white);
  color: var(--grey-900); font-size: 13.5px; font-family: inherit; line-height: normal; cursor: pointer;
}
.ss-display:hover:not(:disabled) { border-color: var(--grey-500); }
.ss-display:focus-visible { outline: none; border-color: var(--navy-700); }
.ss-display:disabled { opacity: .6; cursor: not-allowed; }
.ss-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-chevron { flex-shrink: 0; font-size: 11px; color: var(--grey-500); }
.filter-bar .ss-display { padding: 8px 10px; font-size: 13px; }
.ss-panel {
  position: fixed; z-index: 1000; background: var(--white); border: 1px solid var(--grey-200); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(16, 29, 48, .22); padding: 8px; box-sizing: border-box;
}
.ss-search { width: 100%; padding: 8px 10px; border: 1.5px solid var(--grey-200); border-radius: 8px; font-size: 13.5px; outline: none; box-sizing: border-box; }
.ss-search:focus { border-color: var(--navy-700); }
.ss-list { list-style: none; margin: 6px 0 0; padding: 0; overflow-y: auto; }
.ss-opt, .ss-empty { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; color: var(--grey-900); }
.ss-opt { cursor: pointer; }
.ss-opt.ss-current { background: var(--navy-100); }
.ss-opt.ss-selected { font-weight: 700; color: var(--navy-800); }
.ss-opt.ss-disabled { color: var(--grey-500); cursor: default; }
.ss-empty { color: var(--grey-500); }

/* Bouton qui ouvre un document à imprimer (ex. bon de commande) : contour + icône d'imprimante. */
.btn-imprimer { display: inline-flex; align-items: center; gap: 7px; }
.btn-imprimer svg { flex-shrink: 0; }

/* =========================================================================
   DESIGN SYSTEM v2 — 24/09/2026
   Une seule définition par composant : jetons (espacements, typo, rayons,
   ombres), contrôles de formulaire, boutons, alertes (.notice), tableaux,
   cartes, navigation repliable / tiroir mobile. Ce bloc complète et
   uniformise les règles ci-dessus (même palette marine ; l'orange reste
   réservé aux badges et à l'indicateur du menu).
   ========================================================================= */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-md: 13.5px; --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 22px;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 29, 48, 0.06);
  --shadow-md: 0 1px 2px rgba(16, 29, 48, 0.05), 0 6px 20px rgba(16, 29, 48, 0.07);
  --shadow-lg: 0 20px 60px rgba(16, 29, 48, 0.30);
  --border: #dfe4ec;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --focus-ring: 0 0 0 3px rgba(46, 77, 122, 0.22);
  --info-100: #e8f0fb;
  --info-600: #2e5fa8;
  --z-topbar: 5; --z-nav: 40; --z-toast: 60; --z-modal: 100; --z-select: 1000;
}

/* ---- Utilitaires (remplacent les style="" en ligne) ---- */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 16px; }
.form-hint-tight { margin-top: -6px; }
.cell-sub { font-size: 12px; color: var(--grey-500); font-weight: 400; }
.section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Contrôles de formulaire : bordure fine, rayon, anneau de focus communs ---- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea {
  font-family: inherit; color: var(--grey-900); background-color: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus,
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
#login-form input:focus, #suivi-form input:focus, #register-form input:focus, .plat-add input:focus {
  outline: none; border-color: var(--navy-700); box-shadow: var(--focus-ring);
}
input::placeholder, textarea::placeholder { color: #a3adbd; }
input:disabled, select:disabled, textarea:disabled { background: var(--grey-100); color: var(--grey-500); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--navy-800); }
.form-field input, .form-field select, .form-field textarea, .filter-bar input, .filter-bar select, .plat-add input,
#login-form input, #suivi-form input, #register-form input { border-width: 1px; border-color: var(--border); }
.form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select { min-height: 38px; }
.form-field label { font-size: var(--fs-sm); color: var(--grey-700); }
.ss-display, .pagination-per-page, .pg-btn { border-width: 1px; border-color: var(--border); }
.ss-display { min-height: 38px; }
.filter-bar .ss-display { min-height: 36px; }
.form-hint { font-size: var(--fs-sm); }

/* ---- Boutons ---- */
.btn { border-radius: var(--radius-md); line-height: 1.2; }
.btn:focus-visible, .link-btn:focus-visible, .nav-item:focus-visible, .pill-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { box-shadow: var(--shadow-sm); }
.btn-ghost { border-width: 1px; border-color: var(--border); }
.btn-outline { border-width: 1px; }
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--grey-200); border-top-color: var(--navy-800); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Alertes : un seul composant (.notice) ---- */
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; border-radius: var(--radius-md); font-size: var(--fs-md); line-height: 1.45; }
.notice-ico { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-weight: 700; }
.notice-text { opacity: .92; }
.notice-action { flex-shrink: 0; align-self: center; }
.notice-info    { background: var(--info-100);  border-color: #cddcf3; color: #1f3f73; }
.notice-success { background: var(--green-100); border-color: #c6e8d3; color: #1d6b40; }
.notice-warning { background: var(--amber-100); border-color: #f3d9b0; color: #8a4f0d; }
.notice-danger  { background: var(--red-100);   border-color: #f2c9c1; color: #9c2f1e; }
/* Bandeau des commandes clients (en attendant sa refonte au lot « commandes ») : même langage que .notice. */
.alerte-commandes { border: 1px solid #f3d9b0; border-radius: var(--radius-md); }
.client-alert { border-radius: var(--radius-md); }

/* ---- Cartes et tableaux : un seul style ---- */
.card, .suivi-bloc, .chart-card, .table-wrap, .site-group { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.suivi-bloc { overflow: hidden; }
.card { padding: 20px 22px; }
.card-title { color: var(--grey-700); letter-spacing: .5px; }
.section-header h2 { font-size: var(--fs-xl); }
.suivi-titre::before { width: 3px; background: var(--navy-700); }
.suivi-titre { font-size: var(--fs-lg); }

table { font-size: var(--fs-md); }
thead th { background: var(--surface-2); color: var(--grey-700); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .5px; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 12px 14px; border-bottom: 1px solid #edf0f5; }
tbody tr:nth-child(even) { background: transparent; }
tbody tr:hover { background: #f5f8fc; }
tbody tr:last-child td { border-bottom: 0; }
tr.detail-row { background: var(--surface-2); }
.suivi-table th { background: var(--surface-2); color: var(--grey-700); border-bottom: 1px solid var(--border); padding: 11px 20px; }
.suivi-table th.sous { padding: 6px 20px 9px; }
.suivi-table td { border-bottom-color: #edf0f5; }
.suivi-table tbody tr:hover td { background: #f5f8fc; }
.suivi-table.compact th, .suivi-table.compact td { padding-left: 8px; padding-right: 8px; }
tfoot td { background: var(--surface-2); }
.badge { letter-spacing: .2px; }
.empty-state { color: var(--grey-500); }
.empty-state.loading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--grey-200); border-top-color: var(--navy-700); animation: spin .7s linear infinite; }

/* ---- Modale et toast ---- */
.modal-overlay { z-index: var(--z-modal); }
.modal-box { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; }
.toast { z-index: var(--z-toast); border-radius: var(--radius-md); }
.ss-panel { z-index: var(--z-select); }
@media (max-width: 640px) { .modal-overlay { padding: 12px; } .modal-box { padding: 16px; } .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; } }

/* ---- Navigation : icônes SVG, repère orange discret, menu repliable / tiroir ---- */
.sidebar { transition: width .2s ease; }
.nav-item { position: relative; gap: 12px; padding: 8px 12px; border-radius: var(--radius-md); }
.nav-item.active { background: rgba(255, 255, 255, 0.11); color: var(--white); }
.nav-item.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber-500); }
.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; opacity: .92; }
.nav-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-badge { background: var(--red-600); }
.menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; margin-right: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--grey-700); padding: 0; }
.menu-toggle:hover { background: var(--grey-100); }
.menu-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.menu-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.topbar { z-index: var(--z-topbar); }
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-2xl); }
.nav-scrim { display: none; }

/* Grand écran : menu replié en icônes (choix mémorisé). */
.app.collapsed .sidebar { width: 68px; }
.app.collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app.collapsed .sidebar-brand-text, .app.collapsed .nav-item-label, .app.collapsed .nav-group-label { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.app.collapsed .nav-badge { position: absolute; top: 3px; right: 8px; min-width: 15px; height: 15px; font-size: 9.5px; padding: 0 4px; }

/* Écran étroit : le menu devient un tiroir ouvert par le bouton ☰. */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: var(--z-nav); width: 264px !important; transform: translateX(-100%); transition: transform .22s ease; }
  .app.collapsed .sidebar-brand-text, .app.collapsed .nav-item-label, .app.collapsed .nav-group-label { display: revert; }
  .app.collapsed .nav-item { justify-content: flex-start; padding: 8px 12px; }
  .app.collapsed .nav-badge { position: static; min-width: 17px; height: 17px; font-size: 10px; padding: 0 5px; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: calc(var(--z-nav) - 1); background: rgba(16, 29, 48, 0.45); }
  .topbar { padding: 12px 16px; gap: 10px; }
  .content { padding: 18px 16px 48px; }
}
@media (max-width: 640px) {
  .topbar h1 { font-size: var(--fs-lg); }
  .user-chip #user-info, .user-chip-logout span { display: none; }
  .user-chip-logout { padding: 0 10px; margin-left: 0; }
  #topbar-actions:empty { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .section-header { flex-wrap: wrap; gap: 10px; }
}

/* ---- Écran Droits ---- */
.droits-wrap { max-height: 68vh; overflow: auto; }
.droits-table { border-collapse: separate; border-spacing: 0; }
/* Fond opaque obligatoire : sans lui, un `th` sticky sans fond laisse voir les lignes
   (et leurs cases à cocher) défiler derrière le nom du profil au lieu de le masquer. */
.droits-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
.droits-col-perm { position: sticky; left: 0; z-index: 2; min-width: 250px; background: var(--surface); text-align: left; }
.droits-table thead .droits-col-perm { z-index: 4; background: var(--surface-2); }
.droits-col-role { min-width: 104px; text-align: center; white-space: normal; text-transform: none; font-size: var(--fs-sm); letter-spacing: 0; color: var(--grey-900); }
.droits-col-role .link-btn { display: block; margin: 2px auto 0; padding: 0; font-size: 11.5px; font-weight: 500; }
.droits-lock { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--grey-500); }
.droits-cell { text-align: center; }
.droits-cell input { width: 16px; height: 16px; cursor: pointer; }
.droits-cell input:disabled { cursor: not-allowed; }
.droits-cell.chg { background: var(--info-100); }
.droits-table tbody tr:hover .droits-col-perm { background: #f5f8fc; }
.droits-table tr.droits-groupe:hover { background: transparent; }
.droits-groupe th { background: var(--navy-100); color: var(--navy-900); text-align: left; font-size: var(--fs-xs); letter-spacing: .5px; text-transform: uppercase; padding: 8px 14px; position: static; }

/* ---- Permissions individuelles d'un utilisateur : cartes aérées par groupe (pas le tableau
   comparatif multi-rôles de l'écran Droits, qui n'a de sens que pour comparer plusieurs colonnes). ---- */
.perm-groupes { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.perm-groupe { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface); }
.perm-groupe h3 { margin: 0 0 8px; font-size: var(--fs-xs); letter-spacing: .5px; text-transform: uppercase; color: var(--navy-900); }
.perm-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.perm-item:hover { background: #f5f8fc; }
.perm-item input { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.perm-item.chg { background: var(--info-100); }
.perm-item.chg:hover { background: var(--info-100); }

/* ---- Écran Utilisateurs : zébrage pour repérer une ligne d'un coup d'œil ---- */
#users-list tbody tr:nth-child(even) { background: #f7f9fc; }
#users-list tbody tr:hover { background: #edf1f7; }

/* ---- Tableau de bord, mini-tableaux « Dernières entrées / sorties » : même zébrage ---- */
#dash-entrees tbody tr:nth-child(even), #dash-sorties tbody tr:nth-child(even) { background: #f7f9fc; }
#dash-entrees tbody tr:hover, #dash-sorties tbody tr:hover { background: #edf1f7; }

/* ---- Fenêtre d'export (voir js/export.js) ---- */
.export-cols { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; margin-bottom: 14px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.export-col { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); }
.export-col:hover { background: var(--grey-100); }
.export-col label { display: flex; align-items: center; gap: 8px; flex: 1; font-size: var(--fs-md); cursor: pointer; }
.export-move { display: flex; gap: 2px; }
.export-move .link-btn { padding: 2px 6px; color: var(--grey-500); }
.export-move .link-btn:disabled { opacity: .3; cursor: default; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.export-etat { min-height: 18px; margin-top: 10px; font-size: var(--fs-sm); color: var(--grey-500); }

/* Barre d outils au-dessus d une liste (bouton Exporter). */
.table-tools { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: -2px 0 8px; }
.table-tools:empty { display: none; }

/* Une seule couleur pour les actions principales : le marine. L orange reste reserve aux badges. */
.btn-amber { background: var(--navy-800); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-amber:hover { background: var(--navy-700); }

/* ---- Lot B : bouton « + », saisie de lignes en tableau, formulaire produit ---- */
.field-with-plus { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.field-with-plus > select, .field-with-plus > .ss { flex: 1; min-width: 0; }
.btn-plus { flex-shrink: 0; width: 38px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--navy-100); color: var(--navy-800); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: background .15s, border-color .15s; }
.btn-plus:hover { background: #d9e2f0; border-color: var(--navy-700); }
.btn-plus:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-plus .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.filter-bar .btn-plus { width: 36px; }

.pf-full { grid-column: 1 / -1; }
.pf-check { align-self: end; padding-bottom: 8px; }
.pf-check label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: 600; color: var(--grey-900); }
.quickadd-form .form-actions { justify-content: flex-end; }
.rayon-add { display: flex; gap: 8px; margin-top: 14px; }
.rayon-add input { flex: 1; padding: 8px 11px; }
.input-inline { width: 90px; padding: 5px 8px; border-radius: 6px; }
.cout-display { cursor: pointer; }
.cout-display:hover { text-decoration: underline dotted; }

/* Saisie de lignes : barre d'ajout puis tableau (voir js/forms.js, lignesTable). */
.lt-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.lt-bar .lt-choice { flex: 2 1 240px; min-width: 0; }
.lt-bar .lt-num { flex: 1 1 110px; min-width: 96px; }
.lt-bar .lt-add { flex-shrink: 0; height: 38px; }
.lt-extras { margin-top: 6px; }
.lt-extras-fields { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-md); }
.lt-extras-fields .form-field { flex: 1 1 180px; }
.lt-per-req { font-weight: 400; color: var(--grey-500); text-transform: none; }
.lt-list { margin-top: 12px; }
.lt-empty { padding: 22px 12px; text-align: center; font-size: var(--fs-md); color: var(--grey-500); border: 1px dashed var(--border); border-radius: var(--radius-md); }
.lt-table td { vertical-align: middle; }
.lt-cell { width: 110px; padding: 6px 8px; text-align: right; }
.lt-table .lt-remove { padding: 4px 10px; }
.lt-table tfoot td { font-weight: 700; color: var(--navy-900); }
@media (max-width: 640px) { .lt-bar .lt-add { width: 100%; } .lt-cell { width: 84px; } }
.ing-row .field-with-plus { flex: 1; }

/* ---- Lot C : exécution des commandes, fiche de service, retour par état, alerte flottante ---- */
.exec-progress { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.exec-progress .ca-bar { flex: 1; margin: 0; width: auto; height: 8px; border-radius: 4px; }
.exec-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.exec-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); }
.exec-list li.todo { background: var(--surface-2); }
.exec-list li.ok { background: var(--green-100); }
.exec-dot { flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.exec-list li.ok .exec-dot { background: var(--green-600); border-color: var(--green-600); }
.exec-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.exec-histo { font-size: var(--fs-sm); color: var(--grey-700); padding-left: 18px; margin: 12px 0 0; }

/* Fiche de service (impression : réutilise la règle @media print de .fiche-print). */
.fiche-service .fiche-meta { display: grid; grid-template-columns: repeat(2, max-content 1fr); column-gap: 28px; row-gap: 4px; margin: 0 0 6px; font-size: 13.5px; }
@media (max-width: 640px) { .fiche-service .fiche-meta { grid-template-columns: max-content 1fr; } }
@media print { .fiche-service .fiche-meta { grid-template-columns: max-content 1fr; } }
.fiche-service .fiche-meta dt { color: var(--grey-500); }
.fiche-service .fiche-meta dd { margin: 0; font-weight: 600; }
.fiche-service .fiche-note { font-size: 12px; color: var(--grey-500); margin: 10px 0 0; }
.fiche-service .fiche-lignes i { display: block; height: 26px; border-bottom: 1px solid var(--grey-500); }

/* Retour de matériel par état. */
.ret-in { width: 74px; padding: 6px 8px; text-align: right; }
.ret-note-row td { padding-top: 0; }
.ret-note { width: 100%; padding: 6px 10px; }
.ret-resume { text-align: left; margin: 14px 0 4px; }
tr[data-retour-row] .ret-end:not([value="0"]), tr[data-retour-row] .ret-perdu:not([value="0"]) { border-color: #f3d9b0; }

/* Alerte flottante des commandes clients à prendre en charge. */
.alerte-flottante { position: fixed; right: 24px; bottom: 24px; z-index: calc(var(--z-toast) - 1); width: min(390px, calc(100vw - 32px)); background: var(--surface); border: 1px solid #f3d9b0; border-left: 5px solid var(--amber-500); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 14px 16px; animation: af-entree .35s ease-out; }
@keyframes af-entree { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.af-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--navy-900); }
.af-head strong { flex: 1; font-size: var(--fs-lg); }
.af-pulse { position: relative; width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; background: var(--red-600); }
.af-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--red-600); animation: af-pulse 1.6s ease-out infinite; }
@keyframes af-pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(3.2); opacity: 0; } }
.af-btn { width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%; background: transparent; color: var(--grey-500); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.af-btn:hover { background: var(--grey-100); color: var(--grey-900); }
.af-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.af-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; background: var(--amber-100); border-radius: var(--radius-md); font-size: var(--fs-md); }
.af-list li > div { min-width: 0; }
.af-tout { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .af-pulse::after, .alerte-flottante { animation: none; } }
@media (max-width: 640px) { .alerte-flottante { right: 16px; bottom: 76px; } }
.alerte-flottante { width: min(430px, calc(100vw - 32px)); }
.af-list .btn { white-space: nowrap; }

/* ---- Lot D : bande « À surveiller » du tableau de bord ---- */
.atiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 14px; }
.atile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--grey-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.atile header { display: flex; align-items: center; gap: 10px; }
.atile h3 { font-size: var(--fs-md); font-family: var(--font-ui); font-weight: 600; color: var(--grey-700); text-transform: uppercase; letter-spacing: .4px; }
.atile-ico { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--grey-100); color: var(--grey-700); flex-shrink: 0; }
.atile-ico .ico { width: 17px; height: 17px; }
.atile-count { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--navy-900); line-height: 1.1; }
.atile-sub { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 500; color: var(--grey-500); }
.atile-vide { margin: 6px 0 0; font-size: var(--fs-md); color: var(--green-600); font-weight: 600; }
.atile-go { margin-top: auto; align-self: flex-start; padding: 6px 0 0; }
.atile-warn { border-top-color: var(--amber-500); }
.atile-warn .atile-ico { background: var(--amber-100); color: var(--amber-600); }
.atile-alert { border-top-color: var(--red-600); }
.atile-alert .atile-ico { background: var(--red-100); color: var(--red-600); }
.atile-alert .atile-count { color: var(--red-600); }
.atile-ok { border-top-color: var(--green-600); }
.atile-ok .atile-ico { background: var(--green-100); color: var(--green-600); }
.atile-ok .atile-count { color: var(--grey-500); }
.prix-hausse { color: var(--red-600); font-weight: 700; }
.prix-baisse { color: var(--green-600); font-weight: 700; }

/* Toast centre en bas : il ne recouvre plus la carte d alerte des commandes (a droite). */
.toast { left: 50%; right: auto; transform: translateX(-50%); bottom: 24px; text-align: center; }
@media (max-width: 640px) { .toast { left: 12px; right: 12px; transform: none; } }

/* ---- Produits : formulaire soigné, puces de rayons, action Modifier ---- */
.pf-caption { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--grey-500); padding-bottom: 4px; border-bottom: 1px solid var(--border); margin-top: 4px; }
.pf-caption:first-child { margin-top: 0; }
.pf-hint { margin-top: 5px; font-size: var(--fs-sm); color: var(--grey-500); line-height: 1.4; }
.pf-hint strong { color: var(--navy-800); font-family: var(--font-display); letter-spacing: .3px; }
.pf-check.pf-full { align-self: auto; padding-bottom: 0; }
.pf-check label { font-weight: 600; }
.pf-form { gap: 14px 16px; }
.pf-actions { justify-content: flex-end; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); }
.rayon-add select { padding: 8px 11px; max-width: 220px; }

.chip-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--grey-700); font: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--navy-700); color: var(--navy-800); }
.chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.chip-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--grey-100); color: var(--grey-700); font-size: var(--fs-xs); font-weight: 700; text-align: center; }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip.active .chip-n { background: rgba(255,255,255,.2); color: #fff; }
.chip-off { opacity: .65; font-style: italic; }

.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--grey-500); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-icon:hover { background: var(--navy-100); color: var(--navy-800); }
.btn-icon:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-icon .ico { width: 17px; height: 17px; }
.lock-mark { display: inline-flex; vertical-align: middle; color: var(--grey-500); cursor: help; }
.lock-mark .ico { width: 13px; height: 13px; }
select.input-inline { min-width: 130px; padding: 6px 8px; }
.table-wrap td .link-btn { white-space: nowrap; }

/* ---- Remise de matériel : équipe sélectionnée, bon imprimable ---- */
.srv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; min-height: 8px; }
.chip-static { cursor: default; padding-right: 6px; background: var(--navy-100); border-color: transparent; color: var(--navy-800); }
.chip-static:hover { border-color: transparent; }
.chip-x { border: 0; background: rgba(31,56,100,.12); color: var(--navy-800); width: 20px; height: 20px; border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.chip-x:hover { background: var(--red-100); color: var(--red-600); }
.equipe-gerer { margin-top: 8px; }
.fiche-service .fiche-blanc { min-width: 90px; height: 26px; }
.fiche-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; font-size: 12.5px; color: var(--grey-700); }
.fiche-signatures span { display: block; font-weight: 600; margin-bottom: 34px; }
.fiche-signatures i { display: block; border-bottom: 1px solid var(--grey-500); }
.fiche-print .num { text-align: right; }

/* =========================================================================
   Lot C — navigation moderne : menu par sections, fil d'Ariane, palette Ctrl+K,
   squelettes de chargement, transitions, pile de notifications
   ========================================================================= */

/* ---- Menu par sections repliables (une ouverte à la fois) ---- */
.nav { padding: 10px 8px 12px; gap: 2px; }
.nav-group { padding-top: 0; gap: 0; }
.nav-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px 8px; border: 0; border-radius: var(--radius-md);
  background: transparent; color: rgba(255,255,255,.5); font: inherit; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-group-head:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.85); }
.nav-group-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(219,138,46,.7); }
.nav-group-label { flex: 1; padding: 0; font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: inherit; }
.nav-group.open > .nav-group-head { color: rgba(255,255,255,.85); }
.nav-group.current:not(.open) > .nav-group-head .nav-group-label::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--amber-500); vertical-align: middle; }
.nav-chevron { width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.nav-group.open > .nav-group-head .nav-chevron { transform: rotate(180deg); }
.nav-group-head .nav-badge { margin-left: 2px; }
.nav-items { display: none; flex-direction: column; gap: 1px; padding: 0 0 6px; }
.nav-group.open > .nav-items { display: flex; animation: nav-deplie .18s ease-out; }
@keyframes nav-deplie { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
a.nav-item { text-decoration: none; padding: 7px 12px; }
a.nav-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(219,138,46,.8); }
.nav-item-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Menu replié en icônes : toutes les entrées en colonne d'icônes, sans en-têtes de section. */
.app.collapsed .nav-group-head { display: none; }
.app.collapsed .nav-items { display: flex; padding: 0; animation: none; }
.app.collapsed .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }
.app.collapsed a.nav-item { justify-content: center; padding: 9px 0; }
@media (max-width: 900px) {
  .app.collapsed .nav-group-head { display: flex; }
  .app.collapsed .nav-items { display: none; }
  .app.collapsed .nav-group.open > .nav-items { display: flex; }
  .app.collapsed .nav-group + .nav-group { margin-top: 0; padding-top: 0; border-top: 0; }
  .app.collapsed a.nav-item { justify-content: flex-start; padding: 7px 12px; }
}

/* ---- En-tête : fil d'Ariane, titre, recherche rapide ---- */
.topbar { backdrop-filter: saturate(1.4) blur(8px); background: rgba(255,255,255,.92); }
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.topbar-title h1 { flex: none; }
.breadcrumb { display: flex; align-items: center; gap: 4px; min-height: 16px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--grey-500); white-space: nowrap; overflow: hidden; }
.breadcrumb svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.breadcrumb span:last-child { color: var(--navy-700); }
.palette-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); color: var(--grey-500); font: inherit; font-size: var(--fs-md); cursor: pointer; transition: border-color .15s, background .15s; }
.palette-btn:hover { border-color: var(--navy-700); background: var(--surface); color: var(--grey-700); }
.palette-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.palette-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.palette-btn kbd, .palette kbd, .palette-pied kbd { font: inherit; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--grey-700); }
@media (max-width: 1100px) { .palette-btn span, .palette-btn kbd { display: none; } .palette-btn { width: 36px; padding: 0; justify-content: center; } }

/* ---- Palette de commandes (Ctrl+K) ---- */
.palette-overlay { position: fixed; inset: 0; z-index: calc(var(--z-modal) + 10); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(16,29,48,.5); animation: modal-fade-in .12s ease-out; }
.palette { width: 100%; max-width: 580px; max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-box-in .16s ease-out; }
.palette-champ { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-champ svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--grey-500); stroke-width: 2.2; stroke-linecap: round; }
.palette-champ input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--fs-lg); color: var(--grey-900); padding: 2px 0; box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer; }
.palette li.actif { background: var(--navy-100); }
.palette li.pal-vide { cursor: default; color: var(--grey-500); justify-content: center; padding: 22px 10px; }
.pal-ico { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--grey-100); color: var(--navy-700); flex-shrink: 0; }
.pal-ico .nav-ico { width: 17px; height: 17px; }
.pal-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pal-txt strong { font-size: var(--fs-md); color: var(--grey-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-txt small { font-size: var(--fs-sm); color: var(--grey-500); }
.pal-type { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--grey-500); }
.palette-pied { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: var(--fs-sm); color: var(--grey-500); }
.palette-pied kbd { margin-right: 3px; }

/* ---- Chargement : squelettes et entrée douce du contenu ---- */
.skeleton-page { display: flex; flex-direction: column; gap: 22px; }
.sk { border-radius: var(--radius-md); background: linear-gradient(90deg, var(--grey-100) 25%, #e9edf3 45%, var(--grey-100) 65%); background-size: 240% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
.sk-title { width: 220px; height: 26px; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sk-card { height: 96px; border-radius: var(--radius-lg); }
.sk-table { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.sk-line { height: 18px; }
.sk-line:nth-child(3n) { width: 82%; }
@keyframes sk-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes vue-entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.content.view-enter { animation: vue-entree .2s ease-out; }
@media (max-width: 640px) { .sk-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .content.view-enter, .nav-group.open > .nav-items, .palette, .palette-overlay, .toast { animation: none !important; }
  .sk { animation: none; }
  .nav-chevron, .sidebar { transition: none; }
}

/* ---- Notifications empilées (plus de message écrasé) ---- */
.toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: min(92vw, 420px); }
.toast-stack .toast { position: static; transform: none; left: auto; right: auto; bottom: auto; max-width: 100%; pointer-events: auto; animation: toast-entree .18s ease-out; }
.toast-stack .toast.toast-out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .toast-stack { left: 12px; right: 12px; bottom: 12px; transform: none; width: auto; max-width: none; } }

/* ---- Finitions : onglets de page au clavier, survol des tableaux, cartes ---- */
.pill-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pill-tabs:not(.step-tabs) .pill-tab { transition: background .15s, border-color .15s, color .15s; }
tbody tr { transition: background .12s; }
.card, .table-wrap { transition: box-shadow .2s; }
.palette-champ input, .palette-champ input:focus { border: 0; box-shadow: none; background: transparent; padding-left: 0; }

/* =========================================================================
   DESIGN SYSTEM v3 — 21/09/2026 — « logiciel moderne » (bleu-vert, cartes flottantes)
   Ce bloc redéfinit les jetons historiques (--navy-*, --grey-*, rayons, ombres) : les noms
   sont conservés, seules les VALEURS changent, si bien que toutes les règles ci-dessus
   se recolorent d'elles-mêmes. --navy-* désigne désormais la famille « bleu marque / ardoise ».
   L'ambre ne sert plus qu'aux avertissements. Impression : inchangée (noir sur blanc).
   ========================================================================= */
:root {
  --brand-blue: #1a9bd7;        /* décor : avatars, icônes, dégradés doux */
  --brand-blue-600: #1279b8;    /* texte/fond sous texte blanc (contraste ≥ 4,5:1) */
  --brand-green: #1ca65e;
  --brand-green-600: #17864f;
  --grad-brand: linear-gradient(135deg, #1279b8 0%, #17864f 100%);
  --grad-brand-soft: linear-gradient(135deg, #1a9bd7 0%, #1ca65e 100%);
  --grad-green: linear-gradient(135deg, #1ca65e 0%, #17864f 100%);

  --navy-950: #0e2a3b;
  --navy-900: #12344a;
  --navy-800: #1279b8;
  --navy-700: #2a80ae;
  --navy-100: #e5f2f8;
  --green-600: #17864f;
  --green-100: #e0f4ea;
  --grey-900: #17252f;
  --grey-700: #43566a;
  --grey-500: #73869a;
  --grey-200: #e0e8ee;
  --grey-100: #eef3f7;

  --font-display: var(--font-ui);
  --radius: 16px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --radius-xl: 24px;
  --shadow: 0 1px 2px rgba(16, 42, 67, .04), 0 10px 28px rgba(16, 42, 67, .06);
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, .05), 0 2px 10px rgba(16, 42, 67, .04);
  --shadow-md: 0 1px 2px rgba(16, 42, 67, .05), 0 10px 28px rgba(16, 42, 67, .08);
  --shadow-lg: 0 24px 64px rgba(14, 42, 59, .28);
  --border: #e1e9ef;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --focus-ring: 0 0 0 3px rgba(26, 155, 215, .25);
  --info-100: #e5f2f8;
  --info-600: #1279b8;
}

body {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(26, 155, 215, .11), transparent 62%),
    radial-gradient(900px 520px at -8% 108%, rgba(28, 166, 94, .09), transparent 62%),
    #eef3f7;
  background-attachment: fixed;
}
h1, h2, h3 { letter-spacing: -.01em; }
a { color: var(--brand-blue-600); }
::selection { background: rgba(26, 155, 215, .25); }

/* ---------------- Cadre : menu flottant, en-tête en carte ---------------- */
.app { padding: 14px; gap: 16px; min-height: 100vh; }
.sidebar {
  width: 250px; height: calc(100vh - 28px); top: 14px; background: var(--surface); color: var(--grey-700);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); border: 1px solid rgba(20, 52, 74, .05); overflow: hidden;
}
.sidebar-brand { border-bottom: 1px solid var(--border); padding: 18px 18px 16px; }
.sidebar-brand-text strong { color: var(--navy-900); font-size: 16px; letter-spacing: -.01em; }
.sidebar-brand-text span { color: var(--brand-green-600); }
.login-mark { background: var(--grad-brand-soft); box-shadow: 0 6px 16px rgba(26, 155, 215, .28); }

.nav { scrollbar-color: rgba(20, 52, 74, .18) transparent; padding: 12px 10px 14px; }
.nav::-webkit-scrollbar-thumb { background: rgba(20, 52, 74, .18); }
.nav-group-head { color: var(--grey-500); }
.nav-group-head:hover { background: var(--surface-2); color: var(--navy-900); }
.nav-group-head:focus-visible { box-shadow: var(--focus-ring); }
.nav-group.open > .nav-group-head { color: var(--navy-900); }
.nav-group.current:not(.open) > .nav-group-head .nav-group-label::after { background: var(--brand-green); }
.nav-item, a.nav-item { color: var(--grey-700); border-radius: var(--radius-md); padding: 9px 12px; font-weight: 600; }
.nav-item:hover, a.nav-item:hover { background: var(--navy-100); color: var(--navy-900); }
.nav-item.active, a.nav-item.active { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 18px rgba(18, 121, 184, .28); }
.nav-item.active::before { display: none; }
a.nav-item:focus-visible { box-shadow: var(--focus-ring); }
.nav-icon { opacity: 1; }
.nav-item.active .nav-badge { background: #fff; color: var(--red-600); }
.app.collapsed .sidebar { width: 76px; }
.app.collapsed .nav-group + .nav-group { border-top-color: var(--border); }

.main { gap: 0; }
.topbar {
  top: 14px; margin: 0 0 18px; padding: 12px 20px; border: 1px solid rgba(20, 52, 74, .05); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .88); box-shadow: var(--shadow); backdrop-filter: saturate(1.5) blur(10px);
}
.topbar-title { flex-direction: row; align-items: center; gap: 14px; }
.topbar-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.page-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; background: var(--grad-brand-soft); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(26, 155, 215, .3); }
.page-icon:empty { display: none; }
.page-icon .nav-ico { width: 22px; height: 22px; }
.breadcrumb { color: var(--brand-blue-600); letter-spacing: .8px; font-weight: 700; }
.breadcrumb span:last-child { color: var(--brand-blue-600); }
.breadcrumb svg { opacity: .55; }
.topbar h1 { font-size: 20px; line-height: 1.15; color: var(--navy-900); }
.page-subtitle { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--grey-500); }
.page-subtitle:empty { display: none; }
.menu-toggle { border-radius: var(--radius-md); background: var(--surface-2); border-color: var(--border); }
.palette-btn { border-radius: 999px; background: var(--surface); }
.user-chip { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.user-avatar { background: var(--grad-brand-soft); }
#user-info strong { color: var(--navy-900); }
.role-badge { background: var(--navy-100); color: var(--brand-blue-600); }
/* Déconnexion : bouton rond discret (plus de gros dégradé rouge). */
.user-chip-logout { width: 34px; height: 34px; padding: 0; margin-left: 2px; justify-content: center; background: var(--surface); color: var(--red-600); border: 1px solid var(--border); box-shadow: none; }
.user-chip-logout span { display: none; }
.user-chip-logout:hover { background: var(--red-100); border-color: #f0c6bd; filter: none; transform: none; box-shadow: none; }
.user-chip-logout:hover svg { transform: scale(1.1); }
.content { padding: 4px 6px 64px; max-width: 1320px; }
.section-header h2 { font-size: 20px; }
.section-header { margin-bottom: 16px; }

/* ---------------- Boutons : pastilles, dégradé de marque ---------------- */
.btn { border-radius: 999px; padding: 10px 20px; letter-spacing: .1px; }
.btn-sm { padding: 7px 14px; }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 18px rgba(18, 121, 184, .24); }
.btn-primary:hover { background: var(--grad-brand); filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(18, 121, 184, .3); }
.btn-primary:active { transform: none; }
.btn-ghost, .btn-outline { background: var(--surface); color: var(--grey-700); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-outline { color: var(--navy-800); }
.btn-ghost:hover, .btn-outline:hover { background: #f3f9fc; border-color: var(--brand-blue); color: var(--navy-800); }
.btn-amber { background: var(--amber-100); color: var(--amber-600); }
.btn-amber:hover { background: #f6dcb6; }
.btn-soft-navy { background: var(--navy-100); color: var(--navy-800); }
.btn-soft-navy:hover { background: #d3e9f3; }
.btn-soft-green { background: var(--green-100); color: var(--green-600); }
.btn-vendre { background: var(--grad-green); box-shadow: 0 8px 18px rgba(23, 134, 79, .24); }
.btn-vendre:hover { background: var(--grad-green); filter: brightness(1.07); }
.btn-block.btn-primary { padding-top: 13px; padding-bottom: 13px; }
.mvt-toolbar .btn-primary { box-shadow: 0 8px 18px rgba(18, 121, 184, .24); }
.btn-plus { border-radius: var(--radius-md); background: var(--navy-100); color: var(--navy-800); }
.btn-plus:hover { background: #d3e9f3; border-color: var(--brand-blue); }
.btn-icon { border-radius: 10px; }
.btn-icon:hover { background: var(--navy-100); color: var(--navy-800); }
.btn-icon.danger { color: var(--red-600); }
.btn-icon.danger:hover { background: var(--red-100); color: var(--red-600); }
.link-btn { color: var(--brand-blue-600); }

/* ---------------- Cartes, tableaux, onglets, pastilles ---------------- */
.card, .chart-card, .table-wrap, .suivi-bloc, .site-group {
  background: var(--surface); border: 1px solid rgba(20, 52, 74, .05); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.card { padding: 22px 24px; }
.card-title { font-size: 11.5px; letter-spacing: .8px; color: var(--grey-500); }
.card-value { color: var(--navy-900); }
.stat-card { background: var(--navy-100); border-color: transparent; }
.stat-card.tone-ok { background: var(--green-100); border-color: transparent; }
.stat-card.tone-warn { background: var(--amber-100); border-color: transparent; }
.stat-card.tone-alert { background: var(--red-100); border-color: transparent; }
.suivi-titre::before { width: 4px; background: var(--grad-brand-soft); }
.suivi-table tfoot td { background: var(--navy-100); border-top: 1px solid #cfe6f0; color: var(--navy-900); }
.suivi-table tfoot .devise { color: var(--brand-blue-600); }
.ca-bar i { background: var(--grad-brand-soft); }
.site-group { overflow: hidden; }

table { font-size: var(--fs-md); }
thead th { background: transparent; color: var(--grey-500); font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; padding: 14px 16px; border-bottom: 1px solid var(--border); }
tbody td { padding: 14px 16px; border-bottom: 1px solid #edf2f6; }
tbody tr:hover { background: #f2f8fb; }
.suivi-table th { background: var(--surface-2); color: var(--grey-500); }
.suivi-table tbody tr:hover td { background: #f2f8fb; }
.table-wrap { overflow-x: auto; }

.pill-tabs { display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 4px; border-radius: 999px; background: #e6eef4; margin-bottom: 18px; }
.pill-tab { border: 0; background: transparent; color: var(--grey-700); padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; transition: background .15s, color .15s, box-shadow .15s; }
.pill-tab:hover:not(.active):not(.locked) { background: rgba(255, 255, 255, .7); color: var(--navy-900); }
.pill-tab.active { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 14px rgba(18, 121, 184, .28); }
.pill-tab.done:not(.active)::after { color: var(--brand-green-600); }
.client-tabs { background: #e6eef4; }

.badge { padding: 4px 11px; border-radius: 999px; }
.badge-green { background: var(--green-100); color: var(--green-600); }
.badge-grey { background: #e8eef3; color: var(--grey-700); }
.chip { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
.chip:hover { border-color: var(--brand-blue); color: var(--navy-800); }
.chip.active { background: var(--grad-brand); border-color: transparent; box-shadow: 0 6px 14px rgba(18, 121, 184, .26); }
.chip-static { background: var(--navy-100); box-shadow: none; }
.chip-n { background: #edf3f7; }
.pg-btn { border-radius: 10px; border-color: var(--border); }
.pg-btn.active { background: var(--grad-brand); border-color: transparent; color: #fff; }
.pagination-per-page { border-radius: 10px; }

/* ---------------- Formulaires ---------------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea { border-radius: var(--radius-md); border-color: #d9e3ea; }
.form-field input, .form-field select, .form-field textarea { padding: 10px 13px; border-radius: var(--radius-md); }
.form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select { min-height: 42px; }
.form-field label { color: var(--grey-700); font-weight: 600; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: var(--brand-blue); box-shadow: var(--focus-ring);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-blue-600); }
.filter-bar input, .filter-bar select { border-radius: 999px; padding: 9px 14px; border-color: #d9e3ea; background: var(--surface); }
.filter-bar .ss-display { border-radius: 999px; }
.ss-display { border-radius: var(--radius-md); }
.more-filters > summary { color: var(--brand-blue-600); }
.pf-caption { color: var(--brand-blue-600); border-bottom-color: var(--border); }
.pf-actions { border-top-color: var(--border); }
.pf-hint strong { color: var(--brand-blue-600); }

/* ---------------- Alertes, modales, notifications, palette ---------------- */
.notice { border-radius: var(--radius-md); }
.notice-info { background: var(--navy-100); border-color: #c7e2ee; color: #0f4d75; }
.notice-success { background: var(--green-100); border-color: #bfe6cf; color: #146b3e; }
.modal-overlay { background: rgba(14, 42, 59, .45); backdrop-filter: blur(3px); }
.modal-box { border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow-lg); }
.modal-close { border-radius: 10px; }
.toast { background: var(--navy-950); border-radius: 14px; }
.toast.success { background: var(--brand-green-600); }
.palette { border-radius: var(--radius-xl); }
.palette li.actif { background: var(--navy-100); }
.pal-ico { background: var(--navy-100); color: var(--brand-blue-600); }
.skeleton-page .sk-table, .sk-card { border-radius: var(--radius-lg); }
.atile { border-radius: var(--radius-lg); box-shadow: var(--shadow); border-color: rgba(20, 52, 74, .05); }
.atile-ico { border-radius: 10px; }
.alerte-flottante { border-radius: var(--radius-lg); }

/* ---------------- Connexion, suivi public, espace client ---------------- */
.login-screen {
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(26, 155, 215, .24), transparent 62%),
    radial-gradient(800px 520px at 92% 92%, rgba(28, 166, 94, .22), transparent 62%),
    #eef3f7;
}
.login-card { border-radius: var(--radius-xl); border: 1px solid rgba(20, 52, 74, .05); box-shadow: 0 28px 70px rgba(16, 42, 67, .16); }
.login-title { color: var(--navy-900); }
.login-subtitle { color: var(--brand-green-600); }
#login-form input, #suivi-form input, #register-form input { border-radius: var(--radius-md); border-color: #d9e3ea; }
#login-form input:focus, #suivi-form input:focus, #register-form input:focus { border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.track-timeline li.current::before { background: var(--brand-green); }
.client-app { background: transparent; }
.client-topbar { background: rgba(255, 255, 255, .9); border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.client-brand { color: var(--navy-900); }

/* ---------------- Écran étroit ---------------- */
@media (max-width: 900px) {
  .app { padding: 8px; gap: 0; }
  .sidebar { top: 0; height: auto; border-radius: 0 var(--radius-xl) var(--radius-xl) 0; overflow-y: auto; }
  .topbar { top: 8px; margin-bottom: 14px; padding: 10px 14px; }
  .content { padding: 2px 2px 48px; }
  .page-icon { width: 38px; height: 38px; border-radius: 12px; }
}
@media (max-width: 640px) {
  .topbar h1 { font-size: 18px; }
  .page-icon { display: none; }
  .pill-tabs { width: 100%; overflow-x: auto; border-radius: var(--radius-lg); }
  .pill-tab { white-space: nowrap; }
}

/* Grilles : les cartes (graphiques compris) ne débordent plus ; une colonne sur téléphone. */
.grid > * { min-width: 0; }
.chart-card { min-width: 0; overflow: hidden; }
@media (max-width: 640px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } .breadcrumb svg, .breadcrumb span:first-child { display: none; } }
.content { max-width: 1480px; }

/* =========================================================================
   Lot « défilement, commande compacte, paiement » — 21/09/2026
   ========================================================================= */
/* Fenêtres : l'en-tête reste visible, seul le corps défile, la page derrière ne bouge plus. */
.modal-overlay { overscroll-behavior: contain; }
.modal-box { display: flex; flex-direction: column; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; }
.modal-header { flex: 0 0 auto; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -10px; padding: 2px 10px; scrollbar-width: thin; scrollbar-color: rgba(20, 52, 74, .25) transparent; }
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(20, 52, 74, .22); border-radius: 4px; }
/* Barre d'actions des fenêtres de lecture / impression : toujours atteignable en bas. */
.modal-foot { position: sticky; bottom: -2px; z-index: 2; margin: 14px -10px -2px; padding: 12px 10px 4px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 28%); }
@media (max-width: 640px) { .modal-box { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); } }
@media print {
  body { overflow: visible !important; }
  .modal-overlay, .modal-box, .modal-body { position: static !important; display: block !important; max-height: none !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; backdrop-filter: none !important; }
  .modal-foot { display: none !important; }
}

/* Prix des portions : en-tête de tableau collant, champ prix compact. */
.modal-body .table-wrap.portions-table { overflow: visible; }
.portions-table thead th { position: sticky; top: -3px; z-index: 1; background: var(--surface-2); }
.portion-input { width: 110px; padding: 6px 10px; text-align: right; }

/* Tableau compact : lignes de 30 px, sans cadre lourd (détail de commande, récapitulatifs, prix des portions). */
.table-wrap.compact { box-shadow: none; border: 1px solid var(--border); border-radius: var(--radius-md); overflow-x: auto; }
.table-compact { font-size: 13px; }
.table-compact thead th { padding: 7px 10px; font-size: 10.5px; letter-spacing: .6px; background: var(--surface-2); }
.table-compact tbody td { padding: 6px 10px; }
.table-compact tfoot td { padding: 8px 10px; background: var(--navy-100); border-top: 1px solid #cfe6f0; font-size: 13px; }
.table-compact .num { white-space: nowrap; }

/* Détail de commande : pastilles de contexte et barre d'outils fine. */
.cmd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.meta-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--grey-700); font-size: var(--fs-sm); font-weight: 600; }
.cmd-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.cmd-count { font-size: var(--fs-sm); font-weight: 700; color: var(--grey-500); letter-spacing: .3px; }
.cmd-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* « Marquer payée » : action principale de la ligne, bien visible. */
.btn-payer { white-space: nowrap; }
.btn-payer .ico { width: 15px; height: 15px; stroke-width: 2.6; }

/* Formulaire produit en étapes : actions sur une ligne (Annuler à gauche), récapitulatif aéré. */
.pf-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; }
.pf-actions .pf-cancel { margin-right: auto; }
.pf-form .recap { margin-bottom: 4px; }
.quickadd-form .pill-tabs.step-tabs { margin-bottom: 16px; }

/* Retour de matériel : une ligne compacte par article, stepper − / +, « abîmé ou perdu » déplié à la demande. */
.ret-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ret-compte { font-size: var(--fs-sm); font-weight: 700; color: var(--grey-500); letter-spacing: .3px; }
.ret-list { display: flex; flex-direction: column; gap: 8px; }
.ret-groupe { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 8px 2px 0; font-size: var(--fs-sm); }
.ret-item { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color .15s, background .15s; }
.ret-item.ret-fait { border-color: #bfe6cf; background: #f4fbf7; }
.ret-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ret-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ret-name strong { font-size: var(--fs-lg); color: var(--navy-900); }
.ret-name .muted { font-size: var(--fs-sm); }
.ret-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.ret-foot { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.ret-foot .link-btn { padding: 4px 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); overflow: hidden; }
.stepper button { width: 32px; height: 34px; border: 0; background: transparent; color: var(--navy-800); font-size: 18px; line-height: 1; cursor: pointer; }
.stepper button:hover { background: var(--navy-100); }
.stepper input { width: 44px; height: 34px; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0; font-weight: 700; box-shadow: none !important; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.stepper input.input-error { background: var(--red-100); }
.ret-abime { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 10px; }
.ret-abime-champs { display: flex; gap: 18px; flex-wrap: wrap; }
.ret-abime-champs label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--grey-700); }
.ret-note { width: 100%; padding: 8px 12px; }
.ret-date { max-width: 220px; margin-top: 14px; }
.retour-form .ret-resume { margin: 12px 0 0; }
@media (max-width: 640px) { .ret-head { align-items: flex-start; } .ret-ctrl { width: 100%; justify-content: space-between; } }

/* Production et vente : tableau des plats (prêt à vendre, réalisable, Produire / Vendre). */
#plat-board td { vertical-align: middle; }
.prod-toolbar .prod-filtre { min-width: 0; width: 190px; }
.prod-toolbar .prod-filtre select { width: 100%; }
.prod-real { font-size: var(--fs-lg); color: var(--navy-900); }
.prod-real-sub { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--grey-500); line-height: 1.35; }
.prod-actions { display: inline-flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------------- Page de garde (avant la connexion) ----------------
   Sobre : fond clair, marine + une touche d'ambre, une illustration abstraite (aucun chiffre inventé).
   Tient dans la hauteur de l'écran, sans défilement : contenu volontairement réduit à l'essentiel
   (un titre, une phrase, un CTA, une bande de fonctionnalités) pour que chaque élément ait de l'air. */
.lp {
  height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 480px at 88% -8%, rgba(219,138,46,0.13), transparent 60%),
    radial-gradient(800px 520px at -6% 0%, rgba(46,77,122,0.10), transparent 60%),
    var(--white);
}
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(10px, 2vh, 20px) 24px; flex: none; }
.lp-brand { display: flex; align-items: center; gap: 10px; }
.lp-brand strong { font-family: var(--font-display); font-size: 16px; color: var(--navy-900); letter-spacing: .3px; }
.lp-brand span { font-size: 10.5px; letter-spacing: 2px; font-weight: 700; color: var(--amber-600); padding-left: 10px; border-left: 1px solid var(--grey-200); }
.lp-nav-actions { display: flex; align-items: center; gap: 8px; }
.lp-nav-actions .btn, .lp-brand { white-space: nowrap; }
@media (max-width: 700px) { .lp-brand span { display: none; } }

.lp-main { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.lp-hero { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 48px; padding: clamp(8px, 2vh, 32px) 0; }
.lp-hero h1 { font-size: clamp(28px, min(4.8vw, 7vh), 52px); line-height: 1.12; letter-spacing: -0.02em; color: var(--navy-900); }
.lp-hero h1 em { font-style: normal; color: var(--navy-700); }
.lp-lead { margin: clamp(14px, 2.8vh, 24px) 0 0; max-width: 480px; font-size: clamp(15px, 2.2vh, 17.5px); line-height: 1.55; color: var(--grey-700); }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 4.2vh, 36px); }
.lp-cta .btn { padding: 12px 22px; font-size: 14.5px; border-radius: 10px; }

.lp-visual { min-height: 0; display: flex; justify-content: center; }
.lp-visual svg { display: block; width: 100%; height: auto; max-height: 46vh; overflow: visible; }
.lp-v-card { fill: var(--white); stroke: var(--grey-200); stroke-width: 1.5; filter: drop-shadow(0 18px 40px rgba(16, 29, 48, 0.12)); }
.lp-v-line { fill: var(--navy-900); } .lp-v-line.soft { fill: var(--grey-200); }
.lp-v-bars rect { fill: var(--navy-100); }
.lp-v-bars rect.hi { fill: var(--navy-800); }
.lp-v-trend { fill: none; stroke: var(--amber-500); stroke-width: 3; stroke-linecap: round; }
.lp-v-dot { fill: var(--white); stroke: var(--amber-500); stroke-width: 3; }

.lp-features { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px clamp(24px, 4vw, 56px); padding: clamp(16px, 3.2vh, 32px) 0 clamp(10px, 2vh, 20px); border-top: 1px solid var(--grey-200); }
.lp-feature { display: flex; align-items: center; gap: 10px; }
.lp-ico { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: var(--navy-100); color: var(--navy-800); flex: none; }
.lp-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lp-feature h3 { font-size: 14px; font-weight: 600; color: var(--navy-900); }

.lp-foot { flex: none; padding: clamp(8px, 1.6vh, 18px) 24px; text-align: center; font-size: 12px; color: var(--grey-500); border-top: 1px solid var(--grey-200); }

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; align-content: center; }
  .lp-visual { display: none; }
}
@media (max-width: 560px) {
  .lp-nav { padding: 12px 16px; } .lp-main { padding: 0 16px; }
  .lp-brand span, .lp-suivi-btn { display: none; }
  .lp-features { gap: 10px 20px; }
  .lp-feature h3 { font-size: 13px; }
  .lp-cta .btn { flex: 1 1 100%; }
  .lp-foot { padding: 10px 16px; }
}

/* Menu latéral : police légèrement agrandie pour la lecture (entrées 14 → 15px, titres de section 11 → 12px). */
.nav-item, a.nav-item { font-size: 15px; }
.nav-group-label { font-size: 12px; }

/* Tous les tableaux : lignes paires et impaires bien distinctes, survol plus marqué (les lignes de détail dépliées gardent leur fond). */
tbody tr:nth-child(even) { background: #eef4f9; }
tbody tr:hover { background: #e2edf6; }
tbody tr.detail-row { background: var(--surface-2); }

/* Menu latéral plus net : texte plus foncé (le gris clair sur blanc paraissait flou). */
.nav-item, a.nav-item { color: var(--navy-900); }
.nav-group-head { color: var(--grey-700); }
.nav-group-label { font-weight: 700; }

/* Survol du menu bien visible : fond bleu marqué, texte bleu et liseré à gauche (l'entrée active garde son dégradé). */
.nav-item:not(.active):hover, a.nav-item:not(.active):hover { background: #d4e9f5; color: var(--brand-blue-600); box-shadow: inset 3px 0 0 var(--brand-blue-600); }
.nav-group-head:hover { background: #e3eef6; color: var(--navy-900); }
/* Colonne figée des tableaux de suivi compacts : suit la couleur de sa ligne. */
.suivi-table.compact tbody tr:nth-child(even) td:first-child { background: #eef4f9; }
.suivi-table.compact tbody tr:hover td:first-child { background: #e2edf6; }

/* Titres de section du menu : 13px, graisse réelle 700 (le 800 était une graisse simulée, floue), espacement resserré et lissage net. */
.nav-group-head { padding: 10px 12px 9px; }
.nav-group-label { font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .07em; line-height: 1.2; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Stock par salle (magasin principal) : détail dépliable d'un produit rangé dans plusieurs salles. */
.salles-detail { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.salles-fiche { align-items: center; }
.salles-fiche .btn { margin-left: auto; }

/* Stock actuel : une barre de filtres, un tableau continu (voir renderStockActuel). */
.stock-filtres { align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; }
.stock-filtres .form-field { margin: 0; }
.label-like { display: block; font-size: 12px; font-weight: 600; color: var(--grey-700); margin-bottom: 4px; }
.segmente { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.segmente button { border: 0; background: transparent; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--grey-700); cursor: pointer; }
.segmente button + button { border-left: 1px solid var(--border); }
.segmente button:hover { background: var(--surface-2); color: var(--navy-900); }
.segmente button.active { background: var(--grad-brand); color: #fff; }
.segmente button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.stock-valo { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-bottom: 9px; cursor: pointer; }
.stock-actions { display: flex; gap: 8px; margin-left: auto; padding-bottom: 4px; }
.stock-total { margin: 0 0 10px; font-size: 14px; color: var(--grey-700); }
#stock-actuel:not(.avec-valeurs) .valorisation-col { display: none; }
.stock-table { max-height: 70vh; overflow: auto; }
.stock-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
tr.groupe td { background: var(--navy-100); color: var(--navy-900); font-weight: 700; padding-top: 10px; padding-bottom: 8px; }
tr.groupe .groupe-n { font-weight: 500; color: var(--grey-700); margin-left: 8px; font-size: 13px; }
.radio-line { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0; cursor: pointer; }

/* Lignes alternées fiables quand un tableau a des lignes de détail ou des lignes-titres (voir zebrer()). */
tbody.zebre > tr, tbody.zebre > tr:nth-child(even) { background: transparent; }
tbody.zebre > tr.alt { background: #eef4f9; }
tbody.zebre > tr:not(.groupe):not(.detail-row):hover { background: #e2edf6; }

/* Stock actuel : code et emplacement en colonnes propres. */
.stock-table td.code-col { white-space: nowrap; color: var(--grey-700); font-variant-numeric: tabular-nums; font-size: 13px; }
.stock-table td.emplacement-col { color: var(--grey-700); font-size: 13px; min-width: 180px; }
.stock-table .no-col { width: 1%; white-space: nowrap; color: var(--grey-500); font-variant-numeric: tabular-nums; }

/* Produits : actions en icônes (modifier, supprimer). */
.actions-icones { white-space: nowrap; }
.btn-icon:disabled { opacity: .35; cursor: not-allowed; }

/* Suivi des cantines — Stock des ingrédients : texte un peu plus grand que les autres tableaux compacts. */
.suivi-table.compact.stock-ing { font-size: 14px; }
.suivi-table.compact.stock-ing td.ing { font-size: 13.5px; max-width: 230px; }
.suivi-table.compact.stock-ing .unite { font-size: 12px; }
.suivi-table.compact.stock-ing th.sous { font-size: 11.5px; }

/* Actions de ligne en icônes (utilisateurs, produits). */
.btn-icon.succes { color: var(--green-600, #1e8e5a); }
.btn-icon.succes:hover { background: var(--green-100, #e6f5ec); color: var(--green-600, #1e8e5a); }
.actions-icones { gap: 2px; }
.actions-note { font-size: 12px; padding: 0 8px; }

/* Feuille d'inventaire d'un rayon : tableau défilant avec en-tête fixe, cases de saisie bien visibles. */
.inv-feuille-table { max-height: 60vh; overflow-y: auto; }
.inv-feuille-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border); }
.inv-feuille-table td { vertical-align: middle; }
#inv-feuille .inv-feuille-table input.inv-physique {
  width: 8.5rem; padding: 9px 12px; font-size: 16px; font-weight: 700; text-align: right;
  border: 2px solid var(--brand-blue-600, #1279b8); background: #eef6fc;
}
#inv-feuille .inv-feuille-table input.inv-physique:not(:placeholder-shown) { background: var(--surface); border-color: var(--brand-green-600, #17864f); }
#inv-feuille .inv-feuille-table input.inv-physique::placeholder { font-weight: 400; font-size: 14px; }
#inv-feuille .inv-feuille-table input.inv-justif { width: 100%; min-width: 12rem; padding: 8px 10px; border: 1.5px solid #d9a441; background: #fffaf0; }
#inv-feuille .inv-conforme { font-size: 15px; font-weight: 700; padding: 10px 18px; align-self: flex-end; }
