/* Boucherie Junod – fiches de production (tablette) */
:root {
  --fond: #F3F4F6;
  --surface: #FFFFFF;
  --encre: #16191D;
  --discret: #5B6470;
  --bord: #DDE1E6;
  --bord-fort: #C9CFD6;
  --ligne: #EEF0F2;
  --nav: #1E2328;
  --nav-texte: #C9CFD6;
  --rouge: #A3241B;
  --rouge-clair: #FBEAE8;
  --orange-fond: #FEF3E2;
  --orange-texte: #8A3C04;
  --gris-tag: #EEF0F2;
  --gris-tag-texte: #4A525C;
  --vert-fond: #E7F4EC;
  --vert-texte: #1F5F3A;
  --titre: Archivo, system-ui, sans-serif;
  --texte: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 16px; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2B5FD9; outline-offset: 2px; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.nav { width: 108px; flex-shrink: 0; background: var(--nav); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 0; position: sticky; top: 0; height: 100vh; }
.nav-logo { width: 60px; height: 60px; border-radius: 16px; background: var(--rouge); color: #fff; display: flex; align-items: center; justify-content: center; font: 800 22px var(--titre); margin-bottom: 18px; }
.nav-logo.grand { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 8px; }
.nav-lien { width: 88px; padding: 12px 0; border-radius: 14px; color: var(--nav-texte); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.nav-lien:hover { background: rgba(255,255,255,0.06); }
.nav-lien.actif { background: var(--rouge); color: #fff; }
.nav-verrou { margin-top: auto; opacity: 0.8; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.entete { min-height: 88px; padding: 12px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--bord); }
.entete h1 { margin: 0; font: 800 28px var(--titre); }
.sous-titre { font-size: 15px; color: var(--discret); }
.entete-actions { display: flex; gap: 10px; }
.lot { display: flex; align-items: center; gap: 12px; }
.lot span { font-size: 15px; color: var(--discret); }
.lot strong { padding: 10px 18px; border-radius: 12px; background: var(--encre); color: #fff; font: 700 20px var(--titre); letter-spacing: 0.02em; }

.contenu { flex: 1; padding: 24px 32px; }
.deux-colonnes { display: flex; gap: 24px; align-items: flex-start; }

/* ---------- Éléments ---------- */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 20px; padding: 24px; }
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--bord); background: var(--surface); font-weight: 600; font-size: 16px; }
.btn-principal { background: var(--rouge); border-color: var(--rouge); color: #fff; font-weight: 700; }
.btn-principal:disabled { background: #E4E7EB; border-color: #E4E7EB; color: #4A525C; cursor: not-allowed; }
.btn.grand { min-height: 60px; font-size: 18px; width: 100%; }
.discret { color: var(--discret); font-size: 14px; margin: 0; }
.titre-section { margin: 0; font: 700 18px var(--titre); }

/* ---------- Choix du produit ---------- */
.colonne-produits { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.recherche { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--bord); color: var(--discret); }
.recherche svg { width: 22px; height: 22px; }
.recherche input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--encre); }
.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.puce { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--bord); background: var(--surface); font-weight: 600; font-size: 15px; }
.puce.active { background: var(--encre); border-color: var(--encre); color: #fff; }
.grille-produits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tuile { min-height: 72px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--bord); display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 8px; text-align: left; }
.tuile.choisie { background: var(--rouge-clair); border: 2px solid var(--rouge); padding: 11px 13px; }
.tuile-nom { font: 700 17px var(--titre); }
.etiquette { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--gris-tag); color: var(--gris-tag-texte); }
.etiquette.charge { background: var(--orange-fond); color: var(--orange-texte); }
.aucun { color: var(--discret); grid-column: 1 / -1; }

/* ---------- Panneau quantité / composition ---------- */
.panneau { width: 430px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: 20px; padding: 22px 24px; position: sticky; top: 24px; }
.panneau-vide { min-height: 300px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--discret); font-size: 17px; }
.panneau-plein { display: flex; flex-direction: column; gap: 18px; }
.panneau-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panneau-titre h2 { margin: 0; font: 800 26px var(--titre); }
.bloc { display: flex; flex-direction: column; gap: 10px; }
.libelle-bloc { font-size: 14px; font-weight: 600; color: var(--discret); text-transform: uppercase; letter-spacing: 0.06em; }
.stepper { display: flex; align-items: center; gap: 12px; }
.btn-carre { width: 64px; height: 64px; flex-shrink: 0; border-radius: 16px; border: 1px solid var(--bord); background: var(--fond); font-size: 30px; font-weight: 700; }
.quantite { flex: 1; height: 64px; min-width: 0; border-radius: 16px; border: 2px solid var(--encre); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; }
.quantite input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; text-align: right; font: 800 34px var(--titre); }
.quantite span { font-size: 18px; color: var(--discret); font-weight: 600; flex-shrink: 0; min-width: 40%; }
.raccourcis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.raccourcis button { min-height: 44px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); font-weight: 600; font-size: 15px; }
.composition .groupe { font-size: 13px; font-weight: 700; color: var(--rouge); padding: 8px 0 2px; }
.composition .ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--ligne); font-size: 16px; }
.composition .ligne strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.composition .total { display: flex; justify-content: space-between; padding: 10px 0 0; font-weight: 700; }

/* ---------- Fiche ---------- */
.bandeau-ok { background: var(--vert-fond); color: var(--vert-texte); font-weight: 700; padding: 14px 18px; border-radius: 14px; margin-bottom: 16px; }
.fiche { max-width: 820px; }
.fiche-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.fiche-entete h2 { margin: 0 0 4px; font: 800 30px var(--titre); }
.fiche-infos { display: flex; gap: 24px; margin: 0; }
.fiche-infos dt, .fiche-suivi dt { font-size: 13px; color: var(--discret); font-weight: 600; }
.fiche-infos dd { margin: 2px 0 0; font: 700 20px var(--titre); }
.tableau { width: 100%; border-collapse: collapse; font-size: 16px; }
.tableau th, .tableau td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--ligne); }
.tableau thead th { font-size: 13px; color: var(--discret); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--bord); }
.tableau .groupe th { color: var(--rouge); font-size: 13px; padding-top: 16px; }
.droite { text-align: right !important; }
.fort { font-weight: 700; font-variant-numeric: tabular-nums; }
.fiche-suivi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0 0; }
.fiche-suivi dd { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.fiche-suivi .large { grid-column: 1 / -1; }

.vide { max-width: 560px; }
.vide h2 { margin-top: 0; font: 800 24px var(--titre); }

/* ---------- Accès ---------- */
.page-acces { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.acces { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.acces h1 { margin: 0; font: 800 26px var(--titre); }
.champ { display: flex; flex-direction: column; gap: 8px; text-align: left; font-weight: 600; }
.champ input { height: 60px; border-radius: 14px; border: 2px solid var(--encre); padding: 0 16px; font: 800 28px var(--titre); letter-spacing: 0.2em; text-align: center; }
.erreur { color: var(--rouge); font-weight: 700; margin: 0; }

/* ---------- Tablette en portrait / petits écrans ---------- */
@media (max-width: 1000px) {
  .deux-colonnes { flex-direction: column; align-items: stretch; }
  .panneau { width: auto; position: static; }
  .grille-produits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav { width: 76px; }
  .nav-lien { width: 64px; font-size: 11px; }
  .contenu, .entete { padding-left: 16px; padding-right: 16px; }
  .fiche-suivi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; }
  .nav, .entete-actions, .bandeau-ok { display: none !important; }
  .entete { border: 0; padding: 0 0 8px; min-height: 0; }
  .contenu { padding: 0; }
  .carte { border: 0; padding: 0; }
  .fiche { max-width: none; }
}

/* ---------- Suivi ---------- */
.onglets { display: flex; gap: 6px; padding: 6px; background: var(--fond); border-radius: 14px; }
.onglet { min-height: 44px; padding: 0 18px; border-radius: 10px; display: flex; align-items: center; font-weight: 600; font-size: 15px; color: var(--gris-tag-texte); }
.onglet.actif { background: var(--surface); color: var(--encre); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.suivi { align-items: flex-start; }
.liste-fiches { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 136px); overflow-y: auto; padding: 2px; }
.recherche.petite { height: 48px; flex-shrink: 0; }
.carte-fiche { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--bord); }
.carte-fiche.choisie { border: 2px solid var(--rouge); padding: 13px 15px; }
.carte-fiche .ligne-haut, .carte-fiche .ligne-bas { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.carte-fiche .ligne-haut strong:first-child { font: 700 18px var(--titre); }
.pastille { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.pastille.alerte { background: var(--orange-fond); color: var(--orange-texte); }
.pastille.info { background: #E8EEF9; color: #1E3A8A; }
.pastille.ok { background: var(--vert-fond); color: var(--vert-texte); }
.vide-liste { padding: 24px 4px; }
.detail-fiche { flex: 1; width: auto; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.detail-titre { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.detail-titre h2 { margin: 0 0 4px; font: 800 26px var(--titre); }
.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.etapes li { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: var(--discret); }
.etapes .barre { height: 8px; border-radius: 4px; background: #E4E7EB; }
.etapes li.faite { color: var(--encre); }
.etapes li.faite .barre { background: var(--rouge); }
.etapes li.courante { color: var(--encre); font-weight: 700; }
.etapes li.courante .barre { background: #E6A29B; }
.etapes small { font-weight: 500; color: var(--discret); }
.grille-suivi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.champ-suivi { display: flex; flex-direction: column; gap: 8px; }
.champ-suivi.large { grid-column: 1 / -1; }
.champ-suivi > label { font-size: 15px; font-weight: 600; }
.ligne-champ { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ligne-champ input[type=date] { flex: 1; min-width: 0; height: 56px; border-radius: 14px; border: 1px solid var(--bord-fort); padding: 0 12px; font-size: 18px; font-weight: 600; background: var(--surface); }
.temperature { width: 220px; height: 64px; border-radius: 16px; border: 2px solid var(--encre); display: flex; align-items: center; gap: 6px; padding: 0 18px; }
.temperature input { width: 100%; border: 0; outline: none; background: transparent; font: 800 30px var(--titre); }
.temperature span { font-size: 20px; font-weight: 600; color: var(--discret); }
.champ-suivi textarea { min-height: 56px; border-radius: 14px; border: 1px solid var(--bord-fort); padding: 14px; font: 500 16px var(--texte); resize: vertical; }
.btn-sombre { background: var(--encre); border-color: var(--encre); color: #fff; min-height: 56px; }
.btn-lien { border: 0; background: transparent; color: var(--discret); text-decoration: underline; font-weight: 600; }
.grand-l { min-height: 60px; padding: 0 36px; font-size: 18px; }
.actions-suivi { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.bandeau-erreur { background: var(--rouge-clair); color: var(--rouge); font-weight: 700; padding: 14px 18px; border-radius: 14px; }
.detail-fiche .bandeau-ok { margin: 0; }
@media (max-width: 1000px) {
  .liste-fiches { width: auto; max-height: 360px; }
  .detail-fiche { flex: none; }
  .etapes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grille-suivi { grid-template-columns: 1fr; }
  .etapes span:not(.barre) { font-size: 11px; }
}

/* ---------- Historique ---------- */
.historique { display: flex; flex-direction: column; gap: 16px; }
.barre-periode { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.barre-periode > .onglets { background: #E4E7EB; }
.navigation-periode { display: flex; align-items: center; gap: 10px; }
.btn-carre.petit { width: 48px; height: 48px; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.btn-carre.inactif { opacity: 0.35; }
.libelle-periode { min-width: 190px; text-align: center; display: flex; flex-direction: column; }
.libelle-periode strong { font: 700 20px var(--titre); }
.libelle-periode span { font-size: 13px; color: var(--discret); }
.comparer { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--discret); }
.comparer select { height: 48px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--encre); }
.note-comparaison { margin-top: -8px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-titre { font-size: 14px; color: var(--discret); font-weight: 600; }
.kpi strong { font: 800 28px var(--titre); }
.kpi .kpi-texte { font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.delta { font-size: 14px; font-weight: 700; }
.delta span { font-weight: 500; color: var(--discret); }
.delta.hausse { color: #1E3A8A; }
.delta.baisse { color: var(--orange-texte); }
.delta.neutre { color: var(--discret); font-weight: 600; }
.historique-bas { display: flex; gap: 18px; align-items: flex-start; }
.graphique { flex: 1; min-width: 0; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.graphique-entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.onglets.petits .onglet { min-height: 44px; font-size: 14px; padding: 0 14px; }
.legende { display: flex; gap: 16px; font-size: 13px; font-weight: 600; color: var(--gris-tag-texte); flex-wrap: wrap; }
.legende span { display: flex; align-items: center; gap: 6px; }
.pastille-couleur { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.actuelle { background: var(--rouge); }
.comparee { background: #9AA3AD; }
.groupe-barres { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--rouge); text-transform: uppercase; letter-spacing: 0.05em; }
.barres { display: flex; flex-direction: column; gap: 10px; }
.barre-ligne { display: grid; grid-template-columns: 200px minmax(0, 1fr) 150px; align-items: center; gap: 12px; }
.barre-nom { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-pistes { display: flex; flex-direction: column; gap: 3px; }
.barre-pistes .barre { display: block; height: 13px; border-radius: 4px; min-width: 2px; }
.barre-valeurs { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre-valeurs span { color: var(--discret); }
.fiches-periode { width: 300px; flex-shrink: 0; padding: 18px 20px; }
.fiches-periode h2 { margin: 0 0 8px; font: 700 18px var(--titre); }
.fiches-defilement { max-height: 520px; overflow-y: auto; }
.ligne-fiche { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.ligne-fiche > span { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.ligne-fiche .discret { font-size: 13px; }
.menu-export { position: relative; }
.menu-export summary { list-style: none; cursor: pointer; }
.menu-export summary::-webkit-details-marker { display: none; }
.menu-export-liste { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 300px; display: flex; flex-direction: column; }
.menu-export-liste a { padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.menu-export-liste a:hover { background: var(--fond); }
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .historique-bas { flex-direction: column; align-items: stretch; }
  .fiches-periode { width: auto; }
  .barre-ligne { grid-template-columns: 130px minmax(0, 1fr) 130px; }
}
@media print {
  .barre-periode .onglets, .btn-carre, .comparer select, .menu-export, .graphique-entete .onglets { display: none !important; }
  .comparer::after { content: none; }
  .historique-bas { display: block; }
  .fiches-periode { width: auto; margin-top: 16px; }
  .fiches-defilement { max-height: none; overflow: visible; }
  .barre-pistes .barre { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Recettes & ingrédients ---------- */
.acces-responsable { margin: 40px auto; }
.acces-responsable h2 { margin: 0; font: 800 24px var(--titre); }
.recettes { align-items: flex-start; }
.liste-produits { width: 290px; flex-shrink: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.btn.plein { width: 100%; }
.liste-defilement { max-height: calc(100vh - 300px); min-height: 200px; overflow-y: auto; display: flex; flex-direction: column; }
.ligne-produit { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 10px; font-size: 16px; font-weight: 500; }
.ligne-produit:hover { background: var(--fond); }
.ligne-produit.choisi { background: var(--rouge-clair); font-weight: 700; }
.ligne-produit.inactif > span:first-child { color: var(--discret); text-decoration: line-through; }
.ligne-produit .discret { font-size: 12px; font-weight: 600; }
.groupe-liste { font-size: 12px; font-weight: 700; color: var(--rouge); text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 12px 4px; }
.point-alerte { width: 10px; height: 10px; border-radius: 50%; background: #D97706; flex-shrink: 0; }
.filtre-ing { background: #E4E7EB; }
.edition-recette { flex: 1; width: auto; min-width: 0; display: flex; flex-direction: column; gap: 18px; position: static; }
.titre-edition { margin: 0; font: 800 26px var(--titre); }
.grille-produit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.champ-form { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.champ-form input[type=text], .champ-form select, .champ-form textarea { height: 52px; border-radius: 12px; border: 1px solid var(--bord-fort); padding: 0 14px; font: 600 17px var(--texte); background: var(--surface); }
.champ-form textarea { height: auto; padding: 12px 14px; font-weight: 500; font-size: 15px; resize: vertical; }
.champ-form input[hidden] { display: none; }
.choix-mode { background: #E4E7EB; }
.choix-mode .onglet { flex: 1; justify-content: center; cursor: pointer; }
.choix-mode input { position: absolute; opacity: 0; pointer-events: none; }
.choix-mode .onglet:focus-within { outline: 3px solid #2B5FD9; outline-offset: 1px; }
.info-mode { background: var(--orange-fond); color: var(--orange-texte); padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.info-mode.alerte { background: var(--rouge-clair); color: var(--rouge); }
.table-recette { display: flex; flex-direction: column; }
.entete-lignes, .ligne-recette { display: grid; grid-template-columns: minmax(0, 1fr) 130px 100px 48px; gap: 10px; align-items: center; }
.entete-lignes { font-size: 12px; font-weight: 700; color: var(--discret); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 8px; border-bottom: 1px solid var(--bord); }
.ligne-recette { padding: 6px 0; border-bottom: 1px solid var(--ligne); }
.ligne-recette select { height: 46px; border-radius: 10px; border: 1px solid var(--bord-fort); padding: 0 10px; font-size: 16px; background: var(--surface); min-width: 0; }
.ligne-recette input { height: 46px; border-radius: 10px; border: 1px solid var(--bord-fort); padding: 0 10px; text-align: right; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; }
.unite-ligne { font-size: 14px; color: var(--gris-tag-texte); }
.btn-supprimer { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--bord); background: var(--surface); color: var(--discret); display: flex; align-items: center; justify-content: center; }
.sous-table { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn-pointille { border-style: dashed; border-color: #9AA3AD; }
.total-base { font-weight: 700; font-size: 15px; }
.total-base.ok { color: var(--vert-texte); }
.total-base.alerte { color: var(--orange-texte); }
.allergenes-produit { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.allergenes-produit a { color: #1E3A8A; text-decoration: underline; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.pied-edition { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--bord); }
.pied-edition .note { flex: 1; min-width: 220px; }
.case { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; min-height: 44px; }
.case input, .case-allergene input { width: 22px; height: 22px; accent-color: var(--rouge); }
.case.haut { align-self: end; }
.versions summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.versions .tableau { margin-top: 6px; font-size: 15px; }
.allergenes { border: 1px solid var(--bord); border-radius: 14px; padding: 14px 16px; margin: 0; }
.allergenes legend { font-weight: 700; padding: 0 6px; }
.grille-allergenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 12px; }
.case-allergene { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }
.confirmation { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ligne); color: var(--vert-texte); }
@media (max-width: 1000px) {
  .liste-produits { width: auto; }
  .liste-defilement { max-height: 280px; }
  .grille-allergenes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grille-produit { grid-template-columns: 1fr; }
  .entete-lignes, .ligne-recette { grid-template-columns: minmax(0, 1fr) 90px 70px 46px; }
  .grille-allergenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Améliorations design (v8) ---------- */
.titre-etape { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 18px var(--titre); color: var(--encre); }
.titre-etape span { width: 28px; height: 28px; border-radius: 50%; background: var(--rouge); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.sous-titre-liste { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--discret); text-transform: uppercase; letter-spacing: 0.06em; }
.bloc-frequents { display: flex; flex-direction: column; gap: 12px; }
.tuile { justify-content: center; }
.tuile .etiquette { margin-top: 2px; }
.btn-petit { min-height: 44px; padding: 0 14px; font-size: 14px; }
.bascule-composition { display: none; }
.titre-composition { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }

/* Composition lisible à distance */
.composition .groupe { font-size: 14px; padding: 10px 0 2px; }
.composition .ligne { font-size: 18px; padding: 9px 0; }
.composition .ligne strong { font: 700 22px var(--titre); }
.composition .total { font-size: 17px; padding-top: 12px; }
.fiche .tableau td { font-size: 18px; padding: 10px 4px; }
.fiche .tableau td.fort { font: 700 21px var(--titre); }

/* Panneau toujours entier à l'écran : la composition défile, le bouton reste visible */
.panneau-fiche { display: flex; flex-direction: column; max-height: calc(100vh - 112px); }
.panneau-fiche .panneau-plein { flex: 1; min-height: 0; }
.panneau-fiche .composition { flex: 1; min-height: 0; overflow-y: auto; }
.panneau-fiche .actions { flex-shrink: 0; }

/* Tablette en portrait : barre fixe en bas */
@media (max-width: 1000px) {
  .page-nouvelle { padding-bottom: 320px; }
  .panneau-fiche { position: fixed; left: 108px; right: 0; bottom: 0; top: auto; width: auto; max-height: 88vh;
    border-radius: 20px 20px 0 0; border-bottom: 0; box-shadow: 0 -8px 28px rgba(0,0,0,0.14); z-index: 20; padding: 16px 24px 20px; }
  .panneau-fiche:not(.actif) { display: none; }
  .panneau-fiche .panneau-plein { gap: 12px; }
  .panneau-fiche .composition { flex: none; overflow: visible; }
  .panneau-fiche #composition { display: none; }
  .panneau-fiche.ouvert #composition { display: block; max-height: 42vh; overflow-y: auto; }
  .bascule-composition { display: inline-flex; }
}
@media (max-width: 640px) {
  .panneau-fiche { left: 76px; padding: 14px 16px 16px; }
}
@media print { .panneau-fiche { max-height: none; } }
