/* Katonne Suite — écrans visuels animés (plan de salle, vue de l'hôtel, tournées, rayonnage).
   Tout est dessiné en CSS et SVG, sans ressource externe ; les couleurs suivent les jetons de
   style.css (thème clair ou sombre). --teinte est la couleur du module, posée sur le conteneur.
   Les animations se coupent d'elles-mêmes si le système demande « moins de mouvement ». */

.visuel { --teinte: var(--marque); --att: #c27a0e;
  --teinte-douce: #f3e9e6; --ok-douce: var(--ok-fond); --att-douce: #fdf2e2; }
@supports (color: color-mix(in srgb, red, blue)) {
  .visuel { --teinte-douce: color-mix(in srgb, var(--teinte) 14%, var(--surface));
    --att-douce: color-mix(in srgb, var(--att) 14%, var(--surface)); }
}
:root[data-theme="sombre"] .visuel { --att: #d9a441; }

/* ---------- Apparition et compteurs ---------- */
@keyframes v-monte { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes v-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes v-pouls { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 0; transform: scale(1.18); } }
@keyframes v-clignote { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes v-tirets { to { background-position: 28px 0; } }
@keyframes v-cahot { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes v-glisse { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.v-app { animation: v-monte .45s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

/* ---------- Indicateurs ---------- */
.v-indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.v-ind { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--bordure); border-radius: 10px; min-width: 0; }
a.v-ind { color: inherit; text-decoration: none; }
a.v-ind:hover { border-color: var(--bordure-forte); text-decoration: none; }
.v-ind > div { display: grid; gap: 1px; min-width: 0; }
.v-ind > div > span { color: var(--texte-2); font-size: 12.5px; }
.v-ind strong { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.v-ind strong small { font-size: 12.5px; font-weight: 500; color: var(--texte-2); }
.v-ind-icone { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--teinte-douce); color: var(--teinte); }
.v-ind-icone .icone { width: 20px; height: 20px; }
.v-ind.alerte .v-ind-icone { background: var(--erreur-fond); color: var(--erreur); }
.v-ind.attention .v-ind-icone { background: var(--att-douce); color: var(--att); }
.v-ind.bien .v-ind-icone { background: var(--ok-fond); color: var(--ok); }

/* Anneau de taux : le trait se remplit à l'ouverture de la page (--taux de 0 à 100) */
.v-anneau { flex: none; width: 46px; height: 46px; transform: rotate(-90deg); }
.v-anneau circle { fill: none; stroke-width: 5; }
.v-anneau .fond { stroke: var(--bordure-douce); }
.v-anneau .trait { stroke: var(--teinte); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2, .7, .2, 1); }
.v-pret .v-anneau .trait { stroke-dashoffset: calc(100 - var(--taux, 0)); }

/* Bascule entre deux présentations d'un même écran */
.v-bascule { display: inline-flex; padding: 2px; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 8px; }
.v-bascule a, .v-bascule button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 6px;
  background: none; color: var(--texte-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.v-bascule a:hover, .v-bascule button:hover { color: var(--texte); text-decoration: none; }
.v-bascule [aria-pressed="true"], .v-bascule [aria-current="true"] { background: var(--surface); color: var(--texte); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.v-bascule .icone { width: 15px; height: 15px; }

.v-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; color: var(--texte-2); font-size: 12.5px; }
.v-legende span { display: inline-flex; align-items: center; gap: 6px; }
.v-legende i { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--c, var(--bordure-forte)); background: var(--f, transparent); }

/* =====================================================================
   Restaurant : plan de salle
   ===================================================================== */
.salle-visuel { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 14px; align-items: start; }
.plan-salle { position: relative; aspect-ratio: 16 / 10; min-height: 400px; overflow: hidden; touch-action: pan-y;
  border: 1px solid var(--bordure); border-radius: 12px; background-color: var(--surface);
  background-image: linear-gradient(var(--bordure-douce) 1px, transparent 1px), linear-gradient(90deg, var(--bordure-douce) 1px, transparent 1px);
  background-size: 36px 36px; background-position: -1px -1px; }
.plan-salle::after { content: "Entrée"; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); padding: 2px 18px;
  border: 1px solid var(--bordure); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--surface-2);
  color: var(--texte-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.pt { position: absolute; display: grid; justify-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--texte);
  font: inherit; cursor: pointer; transform: translate(-50%, -50%) scale(var(--echelle, 1)); transition: left .35s, top .35s; -webkit-tap-highlight-color: transparent; }
.pt svg { display: block; overflow: visible; }
.pt .plateau { fill: var(--ok-douce); stroke: var(--ok); stroke-width: 2; transition: fill .3s, stroke .3s; }
.pt .chaise { fill: var(--surface); stroke: var(--bordure-forte); stroke-width: 1.5; transform-box: fill-box; transform-origin: center;
  animation: v-pop .35s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 45ms); transition: fill .25s, stroke .25s; }
.pt .chaise.prise { fill: var(--teinte); stroke: var(--teinte); }
.plan-salle.calme .chaise { animation: none; }   /* simple rafraîchissement : les chaises ne rejouent pas leur entrée */
.pt text { fill: var(--texte); font-size: 12px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.pt text.sous { font-size: 10.5px; font-weight: 500; fill: var(--texte-2); }
.pt.occupee .plateau { fill: var(--teinte-douce); stroke: var(--teinte); }
/* Table occupée : une onde part du plateau, comme un voyant */
.pt .onde { fill: none; stroke: var(--teinte); stroke-width: 2; transform-box: fill-box; transform-origin: center;
  animation: pt-onde 2.6s ease-out infinite; }
@keyframes pt-onde { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.32); } }
.pt:hover .plateau, .pt:focus-visible .plateau { stroke-width: 3; }
.pt:focus-visible { outline: none; }
.pt.choisie .plateau { stroke-width: 3.5; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .22)); }
.pt-info { padding: 1px 8px; border-radius: 10px; background: var(--teinte); color: #fff; font-size: 11.5px; font-weight: 500;
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt.libre .pt-info { background: var(--ok-fond); color: var(--ok); }
.amenagement .plan-salle { background-color: var(--surface-2); touch-action: none; }
.amenagement .pt { cursor: grab; transition: none; }
.amenagement .pt.deplace { cursor: grabbing; z-index: 5; }
.amenagement .pt.deplace .plateau { filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .28)); }
.amenagement .pt .onde, .sp-apercu .pt .onde { display: none; }

.salle-panneau { display: grid; gap: 12px; align-content: start; padding: 14px 16px 16px; background: var(--surface);
  border: 1px solid var(--bordure); border-radius: 12px; }
.salle-panneau h2 { margin: 0; font-size: 16px; }
.salle-panneau p { margin: 0; }
.salle-panneau form { gap: 10px; }
.sp-apercu { display: grid; place-items: center; min-height: 190px; border-radius: 10px; background: var(--surface-2); }
.sp-apercu .pt { position: static; transform: scale(1.25); cursor: default; }
.sp-faits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-faits div { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.sp-faits span { display: block; color: var(--texte-2); font-size: 12px; }
.sp-faits strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.pas-a-pas { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 6px; }
.pas-a-pas button { width: 100%; height: 38px; padding: 0; justify-self: stretch; font-size: 18px; }
.pas-a-pas output { text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pas-a-pas output small { display: block; font-size: 11.5px; font-weight: 400; color: var(--texte-2); }
.formes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.formes button { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--bordure); border-radius: 8px;
  background: var(--surface); color: var(--texte-2); font: inherit; font-size: 12px; cursor: pointer; }
.formes button svg { width: 34px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.formes button[aria-pressed="true"] { border-color: var(--teinte); color: var(--teinte); background: var(--teinte-douce); }
.sp-etat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.sp-etat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.sp-etat.occupee::before { background: var(--teinte); animation: v-clignote 1.6s ease-in-out infinite; }
@media (max-width: 900px) { .salle-visuel { grid-template-columns: 1fr; } .plan-salle { min-height: 340px; } }

/* =====================================================================
   Hôtel : façade par étage
   ===================================================================== */
.hotel-facade { overflow: hidden; background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; }
.hf-toit { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--teinte); color: #fff; }
.hf-toit strong { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.hf-toit .v-bascule { background: rgba(255, 255, 255, .16); border-color: transparent; }
.hf-toit .v-bascule button { color: rgba(255, 255, 255, .85); padding: 4px 10px; font-size: 12.5px; }
.hf-toit .v-bascule button[aria-pressed="true"] { background: #fff; color: var(--texte-fixe, #1b1e22); }
.hf-etage { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-top: 1px solid var(--bordure); }
.hf-etage:first-of-type { border-top: 0; }
.hf-etage-nom { display: grid; align-content: center; justify-items: center; gap: 2px; padding: 10px 6px; background: var(--surface-2);
  border-right: 1px solid var(--bordure); text-align: center; font-weight: 600; font-size: 13px; }
.hf-etage-nom small { font-weight: 400; font-size: 12px; color: var(--texte-2); }
.hf-chambres { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; padding: 12px; }
.hf-chambre { position: relative; display: grid; gap: 4px; align-content: start; min-height: 112px; padding: 10px 12px 12px;
  border: 1px solid var(--bordure); border-radius: 10px; border-top: 3px solid var(--ok); background: var(--surface);
  color: var(--texte); text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.hf-chambre:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .12); }
.hf-num { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hf-num strong { font-size: 19px; font-weight: 600; line-height: 1.1; }
.hf-num strong.long { font-size: 15px; line-height: 1.3; white-space: nowrap; }
.hf-num small { color: var(--texte-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-client { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-detail { color: var(--texte-2); font-size: 12.5px; }
.hf-personnes { display: flex; gap: 1px; color: var(--texte-3); }
.hf-personnes .icone { width: 15px; height: 15px; }
.hf-personnes .present { color: var(--teinte); }
.hf-etat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--ok); }
.hf-etat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
/* Chambre occupée : la « fenêtre » est allumée */
.hf-chambre.occupee, .hf-chambre.depart { border-top-color: var(--teinte);
  background: linear-gradient(180deg, var(--teinte-douce), var(--surface) 78%); }
.hf-chambre.occupee .hf-etat { color: var(--teinte); }
.hf-chambre.depart { border-top-color: var(--att); }
.hf-chambre.depart .hf-etat { color: var(--att); }
.hf-chambre.arrivee { border-top-color: var(--lien); border-style: dashed; border-top-style: solid; }
.hf-chambre.arrivee .hf-etat { color: var(--lien); }
.hf-chambre.depart .hf-etat::before, .hf-chambre.arrivee .hf-etat::before { animation: v-clignote 1.5s ease-in-out infinite; }
.hf-nuits { height: 5px; margin-top: 4px; border-radius: 3px; background: var(--bordure-douce); overflow: hidden; }
.hf-nuits i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--teinte); transition: width 1s cubic-bezier(.2, .7, .2, 1) .2s; }
.v-pret .hf-nuits i { width: var(--part, 0%); }
.hf-chambre.masquee { display: none; }
.hf-etage.vide-filtre { display: none; }
.hf-sol { height: 8px; background: repeating-linear-gradient(90deg, var(--bordure) 0 18px, var(--bordure-douce) 18px 36px); }

.hotel-bas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.hotel-bas section { padding: 12px 16px 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; }
.hotel-bas h2 { margin: 0 0 10px; font-size: 14px; }
.hotel-bas .ligne-jour { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 6px 0; border-top: 1px solid var(--bordure-douce); }
.hotel-bas .ligne-jour:first-of-type { border-top: 0; }
/* Occupation des sept prochains jours : une barre par jour, hauteur = part des chambres prises */
.hf-semaine { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 132px; }
.hf-jour { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; height: 100%; font-size: 12px; color: var(--texte-2); }
.hf-jour b { font-weight: 600; color: var(--texte); font-variant-numeric: tabular-nums; }
.hf-jour .barre-v { display: flex; align-items: flex-end; width: 100%; max-width: 30px; height: 100%; border-radius: 5px 5px 2px 2px; background: var(--bordure-douce); overflow: hidden; }
.hf-jour .barre-v i { display: block; width: 100%; height: 0; border-radius: 5px 5px 0 0; background: var(--teinte);
  transition: height .9s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i) * 70ms); }
.v-pret .hf-jour .barre-v i { height: var(--part, 0%); }
.hf-jour.auj { color: var(--texte); font-weight: 600; }
@media (max-width: 640px) { .hf-etage { grid-template-columns: 1fr; } .hf-etage-nom { grid-auto-flow: column; justify-content: start; gap: 8px; border-right: 0; border-bottom: 1px solid var(--bordure); padding: 6px 12px; } }

/* =====================================================================
   Logistique : flux des livraisons et parcours de la tournée
   ===================================================================== */
.lg-flux { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 10px; }
.lg-etape { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 26px; background: var(--surface); border: 1px solid var(--bordure);
  border-left-width: 0; color: var(--texte); text-decoration: none; }
.lg-etape:first-child { border-left-width: 1px; border-radius: 12px 0 0 12px; padding-left: 16px; }
.lg-etape:last-child { border-radius: 0 12px 12px 0; }
.lg-etape:hover { text-decoration: none; background: var(--survol); }
.lg-etape.actif { background: var(--teinte-douce); box-shadow: inset 0 -3px 0 var(--teinte); }
.lg-etape span { display: inline-flex; align-items: center; gap: 6px; color: var(--texte-2); font-size: 12.5px; }
.lg-etape span .icone { width: 15px; height: 15px; color: var(--teinte); }
.lg-etape strong { font-size: 24px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
/* Chevron entre deux étapes, avec un point qui le traverse */
.lg-etape + .lg-etape::before { content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; z-index: 1;
  transform: translateY(-50%) rotate(45deg); background: var(--surface); border-top: 1px solid var(--bordure); border-right: 1px solid var(--bordure); }
.lg-etape + .lg-etape::after { content: ""; position: absolute; left: -4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; z-index: 2;
  border-radius: 50%; background: var(--teinte); animation: lg-point 2.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .35s); }
@keyframes lg-point { 0% { opacity: 0; transform: translateX(-12px); } 40%, 60% { opacity: 1; } 100% { opacity: 0; transform: translateX(12px); } }
.lg-marge { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

.lg-direct { display: grid; gap: 10px; margin: 0 0 16px; }
.lg-direct-ligne { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; color: var(--texte); text-decoration: none; }
.lg-direct-ligne:hover { text-decoration: none; border-color: var(--teinte); }
.lg-direct-ligne > div:first-child { display: grid; min-width: 0; }
.lg-direct-ligne small { color: var(--texte-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-direct-ligne .num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Piste : trait pointillé qui défile quand la tournée roule, partie parcourue pleine, camion posé dessus */
.lg-piste { position: relative; height: 34px; }
.lg-piste::before { content: ""; position: absolute; left: 0; right: 0; top: 24px; height: 3px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--bordure-forte) 0 8px, transparent 8px 14px); background-size: 28px 3px; }
.en-route .lg-piste::before, .lg-piste.en-route::before { animation: v-tirets 1s linear infinite; }
.lg-piste .fait { position: absolute; left: 0; top: 24px; height: 3px; width: 0; border-radius: 2px; background: var(--teinte);
  transition: width 1.4s cubic-bezier(.3, .6, .2, 1); }
.lg-camion { position: absolute; top: 0; left: 0; width: 34px; height: 24px; margin-left: -17px; color: var(--teinte);
  transition: left 1.4s cubic-bezier(.3, .6, .2, 1); }
.lg-camion svg { display: block; width: 34px; height: 24px; }
.en-route .lg-camion svg, .lg-piste.en-route .lg-camion svg { animation: v-cahot .45s ease-in-out infinite; }
.v-pret .lg-piste .fait { width: var(--part, 0%); }
.v-pret .lg-camion { left: var(--part, 0%); }

.lg-parcours { margin: 0 0 16px; padding: 16px 16px 12px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; overflow-x: auto; }
.lg-parcours-int { position: relative; min-width: calc(var(--n) * 104px); }
.lg-parcours .lg-piste { margin: 0 calc(50% / var(--n)); }
.lg-arrets { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin: -13px 0 0; padding: 0; list-style: none; }
.lg-arret { display: grid; justify-items: center; gap: 3px; padding: 0 4px; text-align: center; font-size: 12.5px; min-width: 0; }
.lg-arret .pastille { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--bordure-forte); color: var(--texte-2); font-size: 11.5px; font-weight: 600; }
.lg-arret .pastille .icone { width: 13px; height: 13px; stroke-width: 2.5; }
.lg-arret b { max-width: 100%; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-arret small { max-width: 100%; color: var(--texte-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-arret a { color: inherit; }
.lg-arret.livree .pastille { background: var(--ok); border-color: var(--ok); color: #fff; }
.lg-arret.echec .pastille { background: var(--erreur); border-color: var(--erreur); color: #fff; }
.lg-arret.en_route .pastille { border-color: var(--teinte); color: var(--teinte); }
.lg-arret.prochain .pastille { box-shadow: 0 0 0 4px var(--teinte-douce); animation: v-clignote 1.4s ease-in-out infinite; }
.lg-arret.depot .pastille { background: var(--teinte); border-color: var(--teinte); color: #fff; }

.lg-jauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 0 0 16px; }
.lg-jauge { padding: 12px 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; }
.lg-jauge header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.lg-jauge header span { display: inline-flex; align-items: center; gap: 6px; color: var(--texte-2); font-size: 12.5px; }
.lg-jauge header span .icone { width: 15px; height: 15px; color: var(--teinte); }
.lg-jauge header strong { font-variant-numeric: tabular-nums; }
.v-barre { height: 8px; border-radius: 4px; background: var(--bordure-douce); overflow: hidden; }
.v-barre i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--teinte); transition: width 1.1s cubic-bezier(.2, .7, .2, 1) .15s; }
.v-barre i.plein { background: var(--erreur); }
.v-barre i.ok { background: var(--ok); }
.v-pret .v-barre i { width: var(--part, 0%); }
td .v-barre { min-width: 90px; }
@media (max-width: 760px) {
  .lg-flux { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lg-etape, .lg-etape:first-child, .lg-etape:last-child { border-left-width: 1px; border-radius: 12px; padding-left: 16px; }
  .lg-etape + .lg-etape::before, .lg-etape + .lg-etape::after { display: none; }
  .lg-direct-ligne { grid-template-columns: 1fr; gap: 6px; }
}

/* =====================================================================
   Inventaire : rayonnage
   ===================================================================== */
.inv-visuel { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.inv-rayon { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; overflow: hidden; }
.inv-rayon > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--bordure); }
.inv-rayon > header h2 { margin: 0; font-size: 13.5px; }
.inv-rayon > header span { color: var(--texte-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.inv-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding: 12px;
  background: linear-gradient(var(--bordure) 0 0) left bottom / 100% 4px no-repeat; }
.inv-case { display: grid; grid-template-rows: 92px auto; align-content: start; gap: 6px; color: var(--texte); text-decoration: none; min-width: 0; }
.inv-case:hover { text-decoration: none; }
/* Le bac : le niveau monte à l'ouverture, le trait pointillé marque le seuil d'alerte */
.inv-bac { position: relative; height: 92px; border: 2px solid var(--bordure-forte); border-top: 0; border-radius: 0 0 8px 8px; overflow: hidden;
  background: var(--surface-2); transition: border-color .15s, transform .15s; }
.inv-case:hover .inv-bac { border-color: var(--c); transform: translateY(-2px); }
.inv-niveau { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--c);
  background-image: linear-gradient(rgba(255, 255, 255, .22) 2px, transparent 2px); background-size: 100% 14px; background-position: 0 100%;
  transition: height 1.1s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 25ms); }
.v-pret .inv-niveau { height: var(--part, 0%); }
.inv-seuil { position: absolute; left: 0; right: 0; bottom: var(--seuil, 0%); border-top: 2px dashed var(--texte); opacity: .55; }
.inv-qte { position: absolute; left: 50%; top: 7px; transform: translateX(-50%); padding: 0 9px; border-radius: 11px; white-space: nowrap;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-qte small { margin-left: 4px; font-size: 11px; font-weight: 400; color: var(--texte-2); }
.inv-case { --c: var(--teinte); }
.inv-case.seuil { --c: var(--att); }
.inv-case.rupture { --c: var(--erreur); }
.inv-case.rupture .inv-bac { border-color: var(--erreur); border-style: dashed; border-top: 0;
  background: repeating-linear-gradient(135deg, var(--erreur-fond) 0 8px, var(--surface-2) 8px 16px); }
.inv-case.seuil .inv-bac { animation: inv-alerte 2s ease-in-out infinite; }
@keyframes inv-alerte { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px var(--att-douce); } }
.inv-nom { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inv-nom small { color: var(--texte-2); font-variant-numeric: tabular-nums; }
.inv-fil { padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; }
.inv-fil h2 { margin: 0 0 8px; font-size: 14px; }
.inv-fil ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.inv-fil li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--bordure-douce);
  animation: v-glisse .4s ease-out both; animation-delay: calc(var(--i) * 70ms + .2s); }
.inv-fil li:first-child { border-top: 0; }
.inv-fil li > div { display: grid; min-width: 0; }
.inv-fil b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-fil small { color: var(--texte-2); font-size: 11.5px; }
.inv-fil .sens { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ok-fond); color: var(--ok); }
.inv-fil .sens .icone { width: 14px; height: 14px; stroke-width: 2.5; }
.inv-fil .sortie .sens { background: var(--att-douce); color: var(--att); }
.inv-fil .q { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) { .inv-visuel { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .visuel *, .visuel *::before, .visuel *::after { animation: none !important; transition: none !important; }
}
@media print { .v-bascule, .salle-panneau { display: none; } }
