/* ===== Base mobile first (référence 360 px, usage à une main, plein soleil) ===== */
:root {
  /* Couleurs foncées : contraste AA (≥ 4,5:1) même sur un écran peu lumineux */
  --vert: #17583a;
  --vert-fonce: #0f4029;
  --vert-clair: #e1f0e5;
  --orange: #8a4b00;
  --orange-clair: #fdefd9;
  --rouge: #a8201a;
  --rouge-clair: #fbe9e8;
  --texte: #111;
  --gris: #555;          /* gris le plus clair autorisé pour du texte */
  --bord: #cfcfcf;
  --fond: #f2f2ef;
  --blanc: #fff;
  --presse: #e6e6e2;     /* retour visuel au toucher */
  --rayon: 12px;
  --top-h: 52px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texte); background: var(--fond);
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
  overflow-wrap: break-word;
}
h1 { font-size: 1.35rem; margin: 4px 0 14px; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
a { color: var(--vert); }
[hidden] { display: none !important; }
.muted { color: var(--gris); }
.small { font-size: .875rem; }
.center { text-align: center; }
.b { font-weight: 700; }
.big { font-size: 1.15rem; }
.grow { flex: 1; min-width: 0; }
.neg { color: var(--rouge); }
.pos { color: var(--vert); }
.block { display: block; text-decoration: none; }

/* Icônes SVG (icon() en PHP, en ligne dans caisse.html) */
.ico { width: 24px; height: 24px; flex: none; vertical-align: middle; }
.btn .ico { width: 22px; height: 22px; }

/* ===== Formulaires ===== */
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #b5b5b5;
  border-radius: 10px; background: var(--blanc); color: var(--texte);
}
input::placeholder, textarea::placeholder { color: #666; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vert); outline-offset: 0; border-color: var(--vert); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .95rem; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
.form { max-width: 560px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > label { min-width: 0; }
.form-actions { display: grid; gap: 10px; margin: 14px 0; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form input { flex: 1; min-width: 0; }

/* Bouton Enregistrer collé en bas de l'écran, au-dessus de la barre de navigation */
.sticky-actions {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 10;
  display: flex; gap: 10px; margin: 16px 0 12px; padding: 10px 0;
  background: var(--fond); box-shadow: 0 -1px 0 var(--bord);
}

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 16px; border-radius: 10px; border: 1px solid #b5b5b5;
  background: var(--blanc); color: var(--texte); text-decoration: none; cursor: pointer; font-weight: 700;
  text-align: center; line-height: 1.2;
}
.btn:active:not(:disabled) { background: var(--presse); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn-primary:active:not(:disabled) { background: var(--vert-fonce); }
.btn-danger { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--gris); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 6px 12px; font-size: .9rem; }
.btn-lg { min-height: 56px; padding: 12px 20px; font-size: 1.05rem; border-radius: 12px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; background: none; border: 0;
  min-width: 48px; min-height: 48px; border-radius: 10px; color: var(--gris); cursor: pointer;
}
.icon-btn:active { background: var(--presse); }

/* ===== En-tête compact ===== */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 12px; background: var(--vert); color: #fff;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; height: 100%;
  color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none;
}
.topbar .brand img { width: 28px; height: 28px; border-radius: 6px; flex: none; background: #fff; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .who { display: none; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; }

.page { padding: 14px; max-width: 900px; margin: 0 auto; }
.card { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; margin-bottom: 14px; }
.cards { display: grid; gap: 10px; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; min-width: 0; }
.kpi-label { display: block; font-size: .8rem; color: var(--gris); font-weight: 600; }
.kpi-val { display: block; font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--bord); }
.list li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.list li:last-child { border-bottom: 0; }
.list li a { text-decoration: none; color: inherit; }
.list li.col { flex-direction: column; align-items: flex-start; }
.list li.struck { opacity: .65; }
.list li.clickable { cursor: pointer; }
.list li.clickable:active { background: var(--presse); }
ol.list { counter-reset: n; }

/* ===== Menus (page Plus, menu de la caisse) ===== */
.section-titre {
  margin: 20px 4px 8px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gris);
}
.menu-list { list-style: none; margin: 0 0 14px; padding: 0; overflow: hidden; }
.menu-list.card { padding: 0; }
.menu-list li { border-bottom: 1px solid var(--bord); }
.menu-list li:last-child { border-bottom: 0; }
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px;
  background: none; border: 0; color: var(--texte); text-align: left; text-decoration: none; cursor: pointer; font: inherit;
}
.menu-row:active { background: var(--presse); }
.menu-ico {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border-radius: 10px; background: var(--vert-clair); color: var(--vert);
}
.menu-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-titre { font-weight: 700; }
.menu-desc { font-size: .85rem; color: var(--gris); line-height: 1.3; }
.menu-fleche { color: var(--gris); }
.badge-count { min-width: 26px; text-align: center; }
.user-card { display: flex; align-items: center; gap: 12px; }
.logout-form { margin: 26px 0 14px; }
.menu-danger { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); color: var(--rouge); }
.menu-danger .menu-ico { background: var(--rouge-clair); color: var(--rouge); }

/* ===== Cartes d'articles (administration) ===== */
.item-card { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px; min-width: 0; }
.item-card.inactive { background: #ebebe8; }
.item-card.inactive .item-nom::after { content: " (désactivé)"; font-weight: 400; color: var(--gris); }
.item-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 4px; }
.item-nom { font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.item-card .prix { color: var(--texte); }
.item-actions { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }

/* Menu « … » natif (<details>) : fonctionne sans script */
.more { position: relative; flex: none; }
.more > summary { list-style: none; width: 52px; padding: 0; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { background: var(--presse); }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; padding: 6px 0;
  background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.more-menu form { margin: 0; }
.more-menu a, .more-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 16px;
  background: none; border: 0; color: var(--texte); text-decoration: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.more-menu .ico { color: var(--gris); }
.more-menu .neg, .more-menu .neg .ico { color: var(--rouge); }
.more-menu a:active, .more-menu button:active { background: var(--presse); }

/* Badges : la couleur est doublée d'un mot (« bas », « rupture ») */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 800;
  background: #e4e4e0; color: var(--texte); white-space: nowrap; border: 1px solid transparent;
}
.badge-green { background: var(--vert-clair); color: var(--vert); }
.badge-orange { background: var(--orange-clair); color: var(--orange); border-color: #e2b679; }
.badge-red { background: var(--rouge-clair); color: var(--rouge); border-color: #e8a6a2; }
.badge-bl { background: #e3ecf8; color: #1d4f91; border-color: #a9c1e4; }  /* « Bon de livraison » */

.flash { padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: .95rem; font-weight: 600; }
.flash-ok { background: var(--vert-clair); color: var(--vert); }
.flash-warn { background: var(--orange-clair); color: var(--orange); }
.flash-err { background: var(--rouge-clair); color: var(--rouge); }
.flash-link { display: flex; align-items: center; gap: 10px; min-height: 52px; }

/* ===== Filtres et recherche ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: flex-end; }
.filters select { flex: 1 1 140px; min-width: 0; }
.filters label { margin: 0; flex: 1 1 140px; min-width: 0; }
.filters-sticky {
  position: sticky; top: var(--top-h); z-index: 15; margin: 0 -14px 10px; padding: 10px 14px;
  background: var(--fond); box-shadow: 0 1px 0 var(--bord);
}
.search-field { position: relative; flex: 1 1 100%; min-width: 0; }
.search-field input { padding-left: 44px; padding-right: 50px; }
.search-field .search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gris); pointer-events: none; }
.search-clear {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: var(--gris); cursor: pointer;
}
.search-clear:active { background: var(--presse); }

.table-wrap { overflow-x: auto; background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); margin-bottom: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
.table tfoot th, .table tfoot td { font-weight: 700; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); width: 60px; height: 60px;
  border-radius: 50%; background: var(--vert); color: #fff; display: flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.28); z-index: 25;
}
.fab .ico { width: 30px; height: 30px; }
.fab:active { background: var(--vert-fonce); }

/* ===== Navigation du bas ===== */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--blanc);
  border-top: 1px solid var(--bord); padding-bottom: var(--safe-b); box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.bottomnav-in { display: flex; gap: 4px; height: var(--nav-h); max-width: 600px; margin: 0 auto; padding: 6px; }
.bottomnav a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 12px; text-decoration: none; color: var(--gris); font-size: .75rem; font-weight: 600;
}
.bottomnav a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottomnav a:active { background: var(--presse); }
/* Onglet actif : fond teinté + gras, pas seulement la couleur */
.bottomnav a.active { background: var(--vert-clair); color: var(--vert); font-weight: 800; }

/* ===== Connexion ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
body.login-page { padding-bottom: 16px; }
.login-box { width: 100%; max-width: 380px; background: var(--blanc); border: 1px solid var(--bord); border-radius: 16px; padding: 22px; text-align: center; }
.login-box label { text-align: left; }
.login-box h1 { margin: 8px 0 0; overflow-wrap: anywhere; }
.login-box .btn + .btn { margin-top: 8px; }

/* ===== Caisse ===== */
.status {
  display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 52%;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 800; font-size: .875rem; white-space: nowrap; overflow: hidden;
}
.status #status-text { overflow: hidden; text-overflow: ellipsis; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.status-ok { background: var(--vert-clair); color: var(--vert); }
.status-warn { background: var(--orange-clair); color: var(--orange); }
.status-err { background: var(--rouge-clair); color: var(--rouge); }

.search-bar { position: sticky; top: var(--top-h); z-index: 15; padding: 10px 12px 6px; background: var(--fond); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 1px solid #b5b5b5;
  background: var(--blanc); color: var(--texte); font-weight: 700; cursor: pointer;
}
.chip.active { background: var(--vert); color: #fff; border-color: var(--vert); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 12px 96px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 120px; padding: 12px;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--blanc); color: var(--texte);
  text-align: left; cursor: pointer; min-width: 0;
}
.tile:active:not(:disabled) { transform: scale(.97); background: var(--presse); }
.tile.in-cart { border-color: var(--vert); box-shadow: inset 0 0 0 2px var(--vert); }
.tile-name {
  font-size: 16px; font-weight: 700; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile.in-cart .tile-name { padding-right: 34px; }
.tile-price { font-size: 1.25rem; font-weight: 800; color: var(--vert); line-height: 1.2; overflow-wrap: anywhere; }
.tile-stock { margin-top: auto; font-size: .82rem; color: var(--gris); font-weight: 600; }
.tile.low .tile-stock { color: var(--orange); font-weight: 800; }
.tile.out { background: #ebebe8; }
.tile.out .tile-name, .tile.out .tile-price { color: var(--gris); }
.tile.out .tile-stock { color: var(--rouge); font-weight: 800; }
.tile-qty {
  position: absolute; top: 8px; right: 8px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; background: var(--vert); color: #fff; font-weight: 800; font-size: .95rem;
}

.cartbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 8px + var(--safe-b)); z-index: 28;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; padding: 0 18px;
  border: 0; border-radius: 14px; background: var(--vert); color: #fff; font-size: 1.05rem; font-weight: 800;
  box-shadow: 0 6px 16px rgba(0,0,0,.28); cursor: pointer; max-width: 600px; margin: 0 auto;
}
.cartbar:active { background: var(--vert-fonce); }
.cartbar-l { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cart-total { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--blanc); border-radius: 18px 18px 0 0; padding: 12px 14px calc(12px + var(--safe-b));
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; }
.cart-lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 60px; }
.cart-line { padding: 10px 0; border-bottom: 1px solid var(--bord); }
.cl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cl-head b { min-width: 0; overflow-wrap: anywhere; }
/* Nom de l'article : touchable, rouvre le pavé sur la ligne */
.cl-nom {
  flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; text-align: left;
  font: inherit; font-weight: 700; color: var(--texte); overflow-wrap: anywhere; cursor: pointer;
}
/* Ligne « pour 3 000 FC » : le montant, le poids servi, « Modifier » */
.cl-montant {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--vert); border-radius: 10px; background: var(--vert-clair); color: var(--texte);
  font: inherit; text-align: left; cursor: pointer;
}
.cl-montant .small { margin-left: auto; text-decoration: underline; }
.cl-body { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid #b5b5b5; border-radius: 10px; overflow: hidden; }
.qty button { width: 48px; height: 48px; border: 0; background: #ececea; color: var(--texte); font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.qty button:active { background: #d8d8d4; }
.qty input { width: 64px; border: 0; border-radius: 0; text-align: center; min-height: 48px; padding: 4px; font-weight: 700; }
.cart-sum { padding: 10px 0; }
.cart-sum .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-weight: 600; }
.cart-sum .row input { width: 55%; margin: 0; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn-ghost { flex: none; }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal-body {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--blanc);
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--safe-b));
}
.modal-body .row { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; }
.modal-body .sheet-actions { margin-top: 14px; }

.recu-preview { background: var(--blanc); border: 1px dashed #b5b5b5; border-radius: var(--rayon); padding: 12px; margin-bottom: 12px; overflow-x: auto; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 76px + var(--safe-b));
  z-index: 70; background: #1b1b1b; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: .95rem; font-weight: 600;
  width: max-content; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

#print-zone { display: none; }

/* ===== Écrans plus larges (secondaires : ils doivent seulement rester propres) ===== */
@media (min-width: 576px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .topbar .who { display: block; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet-body { left: auto; width: 440px; top: 0; max-height: none; border-radius: 0; }
  .modal { align-items: center; }
  .modal-body { border-radius: 18px; }
  .filters-sticky { margin-left: 0; margin-right: 0; border-radius: 0 0 var(--rayon) var(--rayon); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 1200px; margin: 0 auto; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-bar, .chips { max-width: 1200px; margin-left: auto; margin-right: auto; }
}

/* ===== Impression depuis la caisse : seul le reçu sort ===== */
@media print {
  body.app { padding: 0; background: #fff; }
  body.app > *:not(#print-zone) { display: none !important; }
  body.app #print-zone { display: block !important; }
}

/* ===== Ajustements après contrôle à 360 px ===== */
/* .list est déclaré après .card : on rend aux listes-cartes leur marge intérieure */
.list.card { padding: 2px 14px; }
.d-block { display: block; }
.nowrap { white-space: nowrap; flex: none; }
.list li .badge { margin-top: 4px; }
/* Espace sous la dernière carte : le bouton + flottant ne cache rien */
.fab-space { padding-bottom: 84px; }

/* Panier : [ − ] 2 [ + ] cartons, prix unitaire sous le nom */
.cl-prix { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: -2px 0 8px; }
.qty-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.qty-unite { font-weight: 700; overflow-wrap: anywhere; }

/* ===== Pavé numérique « Quantité » (caisse) ===== */
.pave .sheet-body { overflow-y: auto; }
/* Le panneau défile si l'écran est trop court : aucun bloc ne doit être écrasé (onglets, « À peser ») */
.pave .sheet-body > * { flex-shrink: 0; }
.pave-stock { margin: 2px 0 8px; }
.pave-unites { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pave-unites .chip { flex: 1 1 auto; min-height: 48px; }
.pave-affichage {
  display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 8px; padding: 6px 12px;
  border-radius: 12px; background: var(--fond); border: 2px solid var(--vert);
}
#pave-qte {
  width: 50%; max-width: 190px; min-height: 60px; padding: 0; border: 0; background: transparent;
  font-size: 2.3rem; font-weight: 800; text-align: right; color: var(--texte);
}
#pave-qte:focus { outline: none; }
.pave-unite { flex: 1; min-width: 0; font-size: 1.35rem; font-weight: 800; overflow-wrap: anywhere; }
.pave-raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); gap: 6px; margin-bottom: 8px; }
.pave-rac {
  min-height: 46px; border: 1px solid var(--vert); border-radius: 10px; background: var(--vert-clair);
  color: var(--vert); font-weight: 800; font-size: 1.1rem; cursor: pointer;
}
.pave-touches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.pave-touches button {
  display: flex; align-items: center; justify-content: center; min-height: 52px; border: 1px solid #b5b5b5; border-radius: 10px;
  background: var(--blanc); color: var(--texte); font-size: 1.5rem; font-weight: 700; cursor: pointer;
}
.pave-rac:active, .pave-touches button:active:not(:disabled) { background: var(--presse); }
.pave-touches button:disabled { opacity: .35; cursor: default; }
.pave-total { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 10px; font-size: 1.1rem; }
/* Onglets Quantité / Montant (unité au détail) */
.pave-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 8px; border: 2px solid var(--vert); border-radius: 12px; overflow: hidden; }
.pave-modes button {
  min-height: 46px; border: 0; background: var(--blanc); color: var(--vert); font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer;
}
.pave-modes button.active { background: var(--vert); color: #fff; }
/* « À peser : 0,600 kg (600 g) » : le poids à servir, lisible de loin */
.pave-peser {
  margin: -2px 0 8px; padding: 8px 12px; border-radius: 12px; background: var(--vert-clair); text-align: center; font-size: 1.05rem;
}
.pave-peser b { display: block; font-size: 1.9rem; line-height: 1.2; color: var(--texte); overflow-wrap: anywhere; }
/* Lien « Vendre au détail (kg) » sous le pavé */
.pave-detail {
  display: block; width: 100%; min-height: 44px; margin: -2px 0 4px; border: 0; background: none;
  color: var(--vert); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer;
}
.pave-detail[hidden], .pave-peser[hidden], .pave-modes[hidden] { display: none; }
.tile-price small { font-size: .8rem; font-weight: 700; color: var(--gris); }

/* ===== Unités de vente (fiche article, conversion) ===== */
.unite-vente { padding: 12px 0; border-top: 1px solid var(--bord); }
.unite-vente.inactive { opacity: .7; }
.unite-titre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 4px; font-weight: 600; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; }
.unite-actions { display: flex; gap: 8px; margin-top: 6px; }
.ajout-unite { margin-top: 12px; }
.ajout-unite > summary { list-style: none; }
.ajout-unite > summary::-webkit-details-marker { display: none; }
.table.recap th { width: 38%; }

/* ===== Bon de livraison (caisse) ===== */
/* Bouton « Bon de livraison » à droite de la recherche, sur deux lignes à 360 px */
.search-row { display: flex; align-items: center; gap: 8px; }
.search-row .search-field { flex: 1 1 auto; }
.bon-top {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 48px; max-width: 120px; padding: 4px 10px;
  border-color: var(--vert); color: var(--vert); font-size: .8rem; line-height: 1.1; text-align: left;
}
.bon-top[hidden] { display: none; }
/* Onglet « Bon de livraison » : libellé sur deux lignes */
.bottomnav a.nav-2l span { white-space: normal; text-align: center; line-height: 1.05; }
.bottomnav a[hidden] { display: none; }
.bon-page { padding-bottom: 8px; }
.bon-recherche { position: relative; margin-bottom: 12px; }
/* Suggestions sous le champ : nom, prix de l'unité, stock */
.bon-sugg {
  list-style: none; margin: 4px 0 0; padding: 0; background: var(--blanc); border: 1px solid var(--bord);
  border-radius: var(--rayon); box-shadow: 0 8px 20px rgba(0,0,0,.14); overflow: hidden;
}
.bon-sugg li { border-bottom: 1px solid var(--bord); }
.bon-sugg li:last-child { border-bottom: 0; }
.bon-sugg button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 8px 12px;
  border: 0; background: none; color: var(--texte); font: inherit; text-align: left; cursor: pointer;
}
.bon-sugg button:active:not(:disabled) { background: var(--presse); }
.bon-sugg button:disabled { color: var(--gris); cursor: default; }
.bon-sugg .s-nom { font-weight: 700; overflow-wrap: anywhere; }
.bon-sugg .s-nom mark { background: var(--vert-clair); color: inherit; font-weight: 800; }
.bon-sugg .s-info { font-size: .85rem; color: var(--gris); font-weight: 600; }
.bon-sugg .s-info b { color: var(--vert); }
.bon-sugg .s-vide { padding: 12px; color: var(--gris); }
.bon-art { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.1rem; }
.bon-art b { min-width: 0; overflow-wrap: anywhere; }
.bon-art-stock { margin: 0 0 8px; }
.bon-montant-l { display: block; margin: 0 0 4px; font-weight: 700; }
.bon-montant input {
  width: 60%; min-height: 56px; padding: 0; border: 0; background: transparent;
  font-size: 2rem; font-weight: 800; text-align: right; color: var(--texte);
}
.bon-montant input:focus { outline: none; }
.bon-montant:focus-within { box-shadow: 0 0 0 2px var(--vert); }
.bon-saisie .pave-peser { margin-top: 0; }
#bon-lignes .bl-l-qte { font-weight: 800; font-size: 1.05rem; }
/* Raccourcis 500 … 10 000 : sur une ligne à 360 px */
.bon-saisie .pave-rac { padding: 0 2px; font-size: .95rem; white-space: nowrap; }
.bon-lignes-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bon-lignes-tete h2 { margin: 0; }
.bon-lignes-tete .btn[hidden] { display: none; }
/* Barre du bas : total et « Valider le bon » sur une seule rangée */
.bon-actions { align-items: center; margin-top: 4px; padding: 8px 0; }
.bon-total { display: flex; flex-direction: column; flex: none; min-width: 0; line-height: 1.15; }
.bon-total b { font-size: 1.3rem; white-space: nowrap; }
.bon-actions .grow { flex: 1; min-width: 0; }
/* Mes ventes : totaux du jour par type et filtre */
.mv-par-type { margin: -4px 0 6px; }
.mv-filtre { padding: 0 0 10px; }
