/* =====================================================================
   SMART BUSINESS — Design system (mobile-first, aucune dépendance)
   Palette « Modern SaaS / Deep Tech » : Violet / Bleu technologique,
   Dark Navy, surfaces claires, statuts émeraude / ambre / corail.
   Thèmes : <html data-theme="light|dark">  (sans attribut = préférence système)
   ===================================================================== */
:root {
  color-scheme: light;
  /* Marque */
  --brand-violet: #7C3AED;
  --brand-indigo: #6366F1;
  --brand-blue: #4F46E5;
  --brand-grad: linear-gradient(135deg, #7C3AED 0%, #6366F1 55%, #4F46E5 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(124,58,237,.12), rgba(79,70,229,.08));
  --navy: #0F172A;
  --navy-2: #1E1B4B;
  --wordmark-sys: #0F172A;

  /* Surfaces & texte */
  --bg-primary: #F1F5F9;
  --bg-surface: #F8FAFC;
  --bg-surface-2: #F1F5F9;
  --bg-accent: #EEF2FF;
  --bg-accent-strong: #C7D2FE;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;
  --border-color: #E2E8F0;
  --link: #4F46E5;
  --link-strong: #4338CA;

  /* Statuts (texte = nuance foncée pour un contraste ≥ 4,5:1) */
  --ok-base: #10B981;   --ok: #047857;   --ok-strong: #059669; --ok-bg: #D1FAE5;
  --warn-base: #F59E0B; --warn: #B45309; --warn-bg: #FEF3C7;
  --bad-base: #EF4444;  --bad: #DC2626;  --bad-bg: #FEE2E2;  --bad-line: #FECACA;

  /* Composants */
  --sidebar-bg: #0F172A;
  --sidebar-bg-2: #1E1B4B;
  --sidebar-txt: #CBD5E1;
  --topbar-bg: rgba(255,255,255,.86);
  --toast-bg: #0F172A;
  --overlay: rgba(15,23,42,.55);
  --shadow-c: rgba(15,23,42,.08);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow-md: 0 8px 24px -8px rgba(15,23,42,.18);
  --shadow-brand: rgba(79,70,229,.35);
  --shadow-ok: rgba(5,150,105,.35);
  --ring: rgba(99,102,241,.28);
  --ring-ok: rgba(16,185,129,.25);

  /* Alias courts (rétro-compatibilité interne) */
  --bg: var(--bg-primary); --card: var(--card-bg); --txt: var(--text-main); --muted: var(--text-muted); --line: var(--border-color);
  --pri: var(--brand-blue); --pri2: var(--brand-indigo); --egg: var(--warn-base);

  --r: 16px; --tab: 70px; --sb: 248px; --sb-mini: 76px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Mode sombre : contrastes vérifiés (texte ≥ 12:1, montants ≥ 7:1) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0B1120;
  --bg-surface: #111A2E;
  --bg-surface-2: #172238;
  --bg-accent: rgba(99,102,241,.16);
  --bg-accent-strong: rgba(99,102,241,.32);
  --card-bg: #131C31;
  --text-main: #E8EDF5;
  --text-muted: #9AA8BF;
  --text-soft: #6B7A93;
  --border-color: #25314B;
  --link: #A5B4FC;
  --link-strong: #C7D2FE;
  --wordmark-sys: #E8EDF5;
  --ok: #34D399;   --ok-strong: #059669; --ok-bg: rgba(16,185,129,.16);
  --warn: #FBBF24; --warn-bg: rgba(245,158,11,.16);
  --bad: #F87171;  --bad-bg: rgba(239,68,68,.16); --bad-line: rgba(239,68,68,.4);
  --sidebar-bg: #0A0F1D;
  --sidebar-bg-2: #141033;
  --topbar-bg: rgba(19,28,49,.86);
  --toast-bg: #E8EDF5;
  --overlay: rgba(2,6,23,.7);
  --shadow-c: rgba(0,0,0,.35);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03);
  --shadow-md: 0 10px 30px -10px rgba(0,0,0,.6);
  --shadow-brand: rgba(99,102,241,.35);
  --ring: rgba(129,140,248,.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-primary: #0B1120; --bg-surface: #111A2E; --bg-surface-2: #172238;
    --bg-accent: rgba(99,102,241,.16); --bg-accent-strong: rgba(99,102,241,.32);
    --card-bg: #131C31; --text-main: #E8EDF5; --text-muted: #9AA8BF; --text-soft: #6B7A93;
    --border-color: #25314B; --link: #A5B4FC; --link-strong: #C7D2FE; --wordmark-sys: #E8EDF5;
    --ok: #34D399; --ok-bg: rgba(16,185,129,.16); --warn: #FBBF24; --warn-bg: rgba(245,158,11,.16);
    --bad: #F87171; --bad-bg: rgba(239,68,68,.16); --bad-line: rgba(239,68,68,.4);
    --sidebar-bg: #0A0F1D; --sidebar-bg-2: #141033; --topbar-bg: rgba(19,28,49,.86);
    --toast-bg: #E8EDF5; --overlay: rgba(2,6,23,.7); --shadow-c: rgba(0,0,0,.35);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03);
    --shadow-md: 0 10px 30px -10px rgba(0,0,0,.6); --ring: rgba(129,140,248,.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--bg); color: var(--txt); line-height: 1.35;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(var(--tab) + 16px + env(safe-area-inset-bottom));
}
body.sans-nav { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.strong { font-weight: 800; } .mt { margin-top: 14px; }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  height: 60px; padding: 0 8px; background: var(--pri); color: #fff;
}
.topbar h1 { flex: 1; margin: 0; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-btn { width: 48px; height: 48px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 14px; color: #fff; flex: none; }
.topbar-btn:active { background: rgba(255,255,255,.15); }
#btn-printer.connected { background: var(--ok); }

.page { max-width: 560px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px var(--shadow-c); }
.label { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 8px; }

/* Statistiques */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--card-bg); border-radius: 16px; padding: 12px; box-shadow: 0 1px 3px var(--shadow-c); }
.stat small { color: var(--muted); font-size: .8rem; }
.stat b { display: block; font-size: 1.2rem; margin-top: 2px; }

/* Recherche & filtres */
.search {
  width: 100%; height: 58px; border: 2px solid var(--line); border-radius: 16px;
  padding: 0 16px; font-size: 1.1rem; background: var(--card-bg); -webkit-appearance: none; appearance: none;
}
.search:focus { outline: none; border-color: var(--link); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; height: 46px; padding: 0 16px; border-radius: 23px; background: var(--card-bg);
  border: 2px solid var(--line); font-weight: 700; font-size: .95rem; white-space: nowrap;
}
.chip.on { background: var(--pri); border-color: var(--link-strong); color: #fff; }

/* Ligne client (style fil d'actualité) */
.client-row {
  display: flex; align-items: center; gap: 12px; background: var(--card-bg); border-radius: var(--r);
  padding: 12px; margin-bottom: 10px; min-height: 78px; border-left: 6px solid var(--line);
  box-shadow: 0 1px 3px var(--shadow-c);
}
.client-row:active { background: var(--bg-surface); }
.client-row.b-vert { border-left-color: var(--ok); }
.client-row.b-orange { border-left-color: var(--egg); }
.client-row.b-rouge { border-left-color: var(--bad); }
.avatar {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; background: var(--warn-bg); color: var(--warn);
}
.avatar-xl { width: 76px; height: 76px; font-size: 1.6rem; margin: 0 auto 8px; }
.client-info { flex: 1; min-width: 0; }
.client-info strong { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-info small { color: var(--muted); }
.client-solde { text-align: right; }
.client-solde b { display: block; font-size: 1.15rem; margin-bottom: 4px; }

/* Badges & couleurs de dette */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.badge-vert { background: var(--ok-bg); color: var(--ok); }
.badge-orange { background: var(--warn-bg); color: var(--warn); }
.badge-rouge { background: var(--bad-bg); color: var(--bad); }
.t-vert { color: var(--ok); } .t-orange { color: var(--warn); } .t-rouge { color: var(--bad); }

/* Fiche client */
.hero { text-align: center; padding: 20px 14px; }
.hero h2 { margin: 0; font-size: 1.4rem; }
.hero p { margin: 6px 0 0; }
.solde-xl { font-size: 2.6rem; font-weight: 900; margin: 10px 0 6px; letter-spacing: -.02em; }

/* Boutons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 56px; padding: 0 18px; border-radius: 16px; font-weight: 800; font-size: 1.05rem; text-align: center;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn-xl { min-height: 68px; font-size: 1.2rem; }
.btn-primary { background: var(--pri2); color: #fff; }
.btn-success { background: var(--ok); color: #fff; }
.btn-egg { background: var(--egg); color: #1f2937; }
.btn-ghost { background: var(--card-bg); border: 2px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.grid2 > :only-child { grid-column: 1 / -1; }
.action-big { flex-direction: column; min-height: 112px; font-size: 1.2rem; gap: 2px; }
.action-big span { font-size: 2.3rem; }

/* Compteur de plateaux */
.counter { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn-round {
  width: 84px; height: 84px; border-radius: 50%; background: var(--pri2); color: #fff;
  font-size: 2.6rem; font-weight: 700; line-height: 1; flex: none;
}
.btn-round.minus { background: var(--border-color); color: var(--txt); }
.btn-round:active { transform: scale(.94); }
.counter-value { font-size: 3.4rem; font-weight: 900; min-width: 2ch; text-align: center; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-top: 12px; }
.quick button { min-height: 48px; padding: 0 6px; border-radius: 12px; background: var(--bg-accent); color: var(--link-strong); font-weight: 800; }
.quick button:active { background: var(--bg-accent-strong); }
.hint { margin: 10px 0 0; color: var(--muted); font-size: .9rem; text-align: center; }
.hint.warn { color: var(--bad); font-weight: 800; }

/* Champs montants (pilotés par le pavé) */
.field-display {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg-surface); text-align: left;
}
.field-display + .field-display, .field-display + .row-total { margin-top: 10px; }
.field-display small { display: block; color: var(--muted); font-size: .75rem; }
.field-display strong { font-size: 1.4rem; white-space: nowrap; }
.field-display.big strong { font-size: 2.3rem; }
.field-display.active { border-color: var(--link); background: var(--bg-accent); box-shadow: 0 0 0 3px var(--ring); }
.row-total { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px; }
.row-total strong { font-size: 1.4rem; }

/* Pavé numérique géant */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.keypad button { height: 64px; border-radius: 14px; background: var(--bg-surface-2); font-size: 1.8rem; font-weight: 700; }
.keypad button:active { background: var(--bg-accent-strong); }

.result { text-align: center; }
.result strong { display: block; font-size: 2.2rem; font-weight: 900; margin: 4px 0 6px; }
.client-chip { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; }
.client-chip strong { display: block; font-size: 1.1rem; }
.client-chip small { color: var(--muted); }

/* Bouton de validation collé en bas (pouce) */
.sticky-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 35%);
}
.sticky-bottom .btn { max-width: 536px; margin: 0 auto; box-shadow: 0 6px 18px var(--shadow-ok); }

/* Barre d'onglets */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card-bg); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--muted); }
.tabbar a span { font-size: 1.5rem; }
.tabbar a.on { color: var(--link); }

/* Notifications */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab) + 28px); z-index: 50;
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: #fff; padding: 14px 18px; border-radius: 14px;
  font-weight: 700; max-width: 92vw; width: max-content; text-align: center; transition: .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.ok { background: var(--ok); } .toast.err { background: var(--bad); }

/* Écran de succès */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.6); display: flex; align-items: flex-end; justify-content: center; }
.overlay-box {
  background: var(--card-bg); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0;
  padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); text-align: center; display: grid; gap: 10px;
  animation: monte .25s ease-out;
}
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
.succes-icon { font-size: 3.5rem; }
.overlay-box h2 { margin: 0; }
.overlay-box p { margin: 0 0 6px; font-size: 1.05rem; }

/* Historique */
.histo { list-style: none; margin: 0; padding: 0; }
.histo li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.histo li:last-child { border-bottom: 0; }
.histo .ic { font-size: 1.5rem; flex: none; }
.histo .txt { flex: 1; min-width: 0; }
.histo .txt strong { display: block; }
.histo .txt small { display: block; color: var(--muted); font-size: .8rem; }
.histo li.annule .txt { opacity: .5; text-decoration: line-through; }
.icon-btn { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-surface-2); font-size: 1.25rem; flex: none; }
.icon-danger { color: var(--bad); font-weight: 800; }

/* Formulaires */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.input {
  width: 100%; height: 56px; border: 2px solid var(--line); border-radius: 14px;
  padding: 0 14px; font-size: 1.1rem; background: var(--card-bg); font-family: inherit;
}
.input:focus { outline: none; border-color: var(--link); }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chips input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chips label { height: 46px; padding: 0 16px; border-radius: 23px; border: 2px solid var(--line); display: flex; align-items: center; font-weight: 700; }
.radio-chips input:checked + label { background: var(--pri); border-color: var(--link-strong); color: #fff; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 700; min-height: 48px; }
.switch input { width: 26px; height: 26px; accent-color: var(--ok); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Connexion */
.login { min-height: 100vh; max-width: 380px; margin: 0 auto; padding: 24px 20px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.login-logo { font-size: 3.5rem; }
.login h1 { margin: 4px 0; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 20px 0; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--pri); }
.pin-dots i.on { background: var(--pri); }
.login-err { color: var(--bad); font-weight: 800; }
.login .keypad button { height: 72px; background: var(--card-bg); box-shadow: 0 1px 3px var(--shadow-c); }

/* =====================================================================
   v2 — Catalogue, panier, stock, articles, fournisseurs
   ===================================================================== */
body.noscroll { overflow: hidden; }
.t-muted { color: var(--muted); }
.hint.left { text-align: left; }
.small { font-size: .85rem; }
.tabbar a { position: relative; }
.tab-badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font-style: normal; font-size: .7rem; line-height: 20px; text-align: center; }
a.stat { display: block; }
.warn-card { background: var(--warn-bg); color: var(--warn); }
.card.soft { background: var(--bg-surface); box-shadow: none; border: 1px dashed var(--line); }

/* Vignettes produit */
.thumb { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: var(--card-bg); display: block; }
.thumb-ph { display: grid; place-items: center; background: var(--c, #4F46E5); color: #fff; font-weight: 900; font-size: 1.6rem; letter-spacing: .05em; }
.thumb-sm { width: 52px; height: 52px; flex: none; font-size: 1rem; border-radius: 10px; }
.thumb-xl { width: 140px; height: 140px; font-size: 2.6rem; margin: 0 auto; }

/* Client sélectionné */
.client-bar { display: flex; align-items: center; gap: 12px; background: var(--card-bg); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px;
  box-shadow: 0 1px 3px var(--shadow-c); border-left: 6px solid var(--egg); }
.client-bar-change { font-weight: 800; color: var(--link); font-size: .9rem; }
.pick-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 10px; }
.pick-list a, .pick-list button { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--bg-surface); text-align: left; width: 100%; }
.pick-list strong { display: block; } .pick-list small { color: var(--muted); }
.pick-list a:active, .pick-list button:active { background: var(--border-color); }

/* Grille catalogue (2 colonnes, style appli) */
.cat-chips .chip { height: 44px; }
.grid-articles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 90px; }
.pcard { background: var(--card-bg); border-radius: 20px; box-shadow: 0 2px 8px var(--shadow-c); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.pcard.in-cart { outline: 3px solid var(--ok); }
.pcard-img { position: relative; }
.pcard-flag { position: absolute; top: 6px; left: 6px; font-size: .65rem; font-weight: 800; padding: 3px 7px; border-radius: 999px; }
.flag-warn { background: var(--bad); color: #fff; }
.flag-special { background: var(--egg); color: #1f2937; top: auto; bottom: 6px; }
.pcard-body { flex: 1; }
.pcard-code { color: var(--muted); font-weight: 700; font-size: .75rem; }
.pcard h3 { margin: 2px 0 4px; font-size: .9rem; line-height: 1.25; text-transform: uppercase;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-prix { margin: 0; font-weight: 900; font-size: 1.05rem; }
.pcard-prix small { font-weight: 600; color: var(--muted); font-size: .7rem; }
.pcard-stock { margin: 2px 0 0; font-size: .72rem; color: var(--muted); }
.btn-add { min-height: 48px; border-radius: 999px; background: var(--ok); color: #fff; font-size: .9rem; gap: 6px; padding: 0 10px; }
.btn-add-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%; font-size: 1rem; line-height: 1; }
.pcard.in-cart .btn-add { background: var(--ok); }

/* Bouton panier flottant */
.cart-fab { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab) + 10px + env(safe-area-inset-bottom)); z-index: 16;
  max-width: 536px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px;
  background: var(--pri); color: #fff; box-shadow: 0 8px 22px var(--shadow-brand); }
.cart-ic { position: relative; font-size: 1.6rem; }
.cart-ic i { position: absolute; top: -6px; right: -10px; background: var(--bad); color: #fff; font-style: normal; font-size: .75rem;
  min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 10px; font-weight: 800; }
.cart-txt { flex: 1; font-weight: 800; }

/* Fenêtre glissante (saisie rapide) */
.sheet { background: var(--card-bg); width: 100%; max-width: 560px; max-height: 94vh; overflow: auto; border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: monte .2s ease-out; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--line); margin-bottom: 12px; }
.sheet-img { width: 64px; flex: none; }
.sheet-img .thumb { width: 64px; height: 64px; font-size: 1.2rem; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { margin: 0; font-size: 1.1rem; text-transform: uppercase; }
.sheet-title small { display: block; }
.sheet-close { width: 48px; height: 48px; font-size: 1.6rem; color: var(--bad); font-weight: 800; flex: none; }
.counter-input { flex: 1; min-width: 0; width: 100%; text-align: center; font-size: 2.6rem; font-weight: 900; border: 0; border-bottom: 3px solid var(--line);
  background: transparent; padding: 4px 0; font-family: inherit; color: var(--txt); }
.counter-input:focus { outline: none; border-color: var(--link); }
.btn-round.minus { background: var(--egg); color: #fff; }
.btn-round.plus { background: var(--ok); }
.input-big { font-size: 1.4rem; font-weight: 800; text-align: center; height: 60px; }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.sheet-total { display: flex; justify-content: space-between; gap: 10px; background: var(--bg-surface); border-radius: 14px; padding: 12px 14px; margin: 6px 0 12px; }
.sheet-total small { display: block; color: var(--muted); font-size: .8rem; }
.sheet-total strong { font-size: 1.3rem; }
.sheet-total .right { text-align: right; }
.sheet-total .right strong { font-size: 1rem; }
.btn-ghost-danger { background: none; color: var(--bad); margin-top: 8px; min-height: 48px; }
.btn-outline-danger { background: var(--card-bg); color: var(--bad); border: 2px solid var(--bad); }

/* Panier */
.cart-line { display: flex; gap: 12px; background: var(--card-bg); border-radius: var(--r); padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 3px var(--shadow-c); }
.cart-img { width: 72px; flex: none; }
.cart-img .thumb { width: 72px; height: 72px; font-size: 1.2rem; }
.cart-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cart-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cart-top strong { font-size: .92rem; text-transform: uppercase; line-height: 1.25; }
.cart-top .icon-btn { width: 40px; height: 40px; }
.cart-price { font-weight: 900; font-size: 1.05rem; }
.cart-price small { color: var(--muted); font-weight: 600; font-size: .75rem; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.qbtn { width: 46px; height: 46px; border-radius: 50%; color: #fff; font-size: 1.6rem; font-weight: 800; flex: none; }
.qbtn.minus { background: var(--egg); } .qbtn.plus { background: var(--ok); }
.qval { min-width: 64px; text-align: center; font-size: 1.25rem; font-weight: 900; }
.qval small { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; }
.cart-qty .icon-btn { margin-left: auto; font-size: 1.4rem; }
.cart-sub { text-align: right; font-weight: 800; color: var(--link-strong); }
.cart-main > small { display: block; font-size: .78rem; }
.totaux .row-total { padding: 3px 2px; }
.row-total.big { border-top: 2px solid var(--txt); margin-top: 6px; padding-top: 8px; }
.row-total.big strong { font-size: 1.6rem; }
.row-total.small strong, .row-total.small b { font-size: .95rem; }
.sticky-bottom.two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.sticky-bottom.two .btn { max-width: none; margin: 0; box-shadow: none; }
.sticky-bottom.two .btn-xl { box-shadow: 0 6px 18px var(--shadow-ok); }

/* Listes stock / articles */
.stock-row { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card-bg); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: 0 1px 3px var(--shadow-c); text-align: left; border-left: 6px solid transparent; }
.stock-row.alerte { border-left-color: var(--bad); }
.stock-row.inactif, .client-row.inactif { opacity: .55; }
.stock-row .client-solde small { display: block; color: var(--muted); font-size: .72rem; }
.stock-row .client-info strong { white-space: normal; font-size: .95rem; text-transform: uppercase; }

/* Menu */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-tile { background: var(--card-bg); border-radius: 20px; padding: 18px 14px; min-height: 130px; box-shadow: 0 1px 3px var(--shadow-c);
  display: flex; flex-direction: column; gap: 4px; }
.menu-tile span { font-size: 2.2rem; }
.menu-tile b { font-size: 1.05rem; }
.menu-tile small { color: var(--muted); font-size: .8rem; }
.menu-tile:active { background: var(--bg-surface-2); }

/* Tableaux de rapport */
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: left; color: var(--muted); font-size: .72rem; text-transform: uppercase; padding: 6px 4px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; white-space: nowrap; }

/* Fiche article : photo */
.photo-pick { text-align: center; margin-bottom: 14px; }
.photo-zone { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.photo-btn { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--bg-accent); color: var(--link-strong); font-weight: 800; }
select.input { -webkit-appearance: none; appearance: none; background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23475569' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }

/* Achat */
.grid3 { display: grid; grid-template-columns: 1fr 1.2fr .8fr; gap: 8px; }
.grid3 .field { margin-bottom: 4px; }
.grid3 .field > span { font-size: .75rem; }
.grid3 .input { height: 50px; font-size: 1.05rem; padding: 0 10px; }
.achat-line { border: 2px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.achat-line .cart-top strong { font-size: .85rem; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.alerte-stock { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 800; font-size: .9rem; }

/* ===================================================== Carte « Stock & prix d'achat » (accueil + détail) */
.kpi-card {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 16px;
  border-radius: var(--r); color: #fff; min-height: 96px;
  background: linear-gradient(135deg, var(--pri) 0%, var(--pri2) 100%);
  box-shadow: 0 6px 16px var(--shadow-brand);
}
a.kpi-card:active { transform: scale(.99); filter: brightness(.95); }
.kpi-ic { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.9rem; background: rgba(255,255,255,.16); }
.kpi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kpi-body small { font-size: .82rem; opacity: .9; }
.kpi-body small:first-child { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; }
.kpi-val { font-size: 1.65rem; font-weight: 900; letter-spacing: -.01em; line-height: 1.15; }
.kpi-qte { font-weight: 700; opacity: 1 !important; }
.kpi-body .t-orange { color: #FDE68A; font-weight: 800; }
.kpi-go { flex: none; font-size: 2.2rem; font-weight: 300; opacity: .85; }
a.warn-card { display: block; font-weight: 700; }

/* Barre de tri */
.sort-bar { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 0 0 8px; scrollbar-width: none; }
.sort-bar::-webkit-scrollbar { display: none; }
.sort-bar > span { color: var(--muted); font-size: .85rem; font-weight: 700; flex: none; }
.sort { flex: none; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card-bg); font-weight: 700; font-size: .9rem; white-space: nowrap; color: var(--txt); }
.sort.on { background: var(--bg-accent); border-color: var(--link); color: var(--link-strong); }
.sd-total { margin: 2px 2px 10px; color: var(--muted); font-size: .92rem; }
.sd-total b { color: var(--txt); }

/* Lignes article */
.sd-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; column-gap: 12px; row-gap: 10px;
  background: var(--card-bg); border-radius: var(--r); padding: 12px; margin-bottom: 10px; color: inherit; text-decoration: none;
  border-left: 6px solid var(--line); box-shadow: 0 1px 3px var(--shadow-c);
}
.sd-row.alerte { border-left-color: var(--bad); }
.sd-row:active { background: var(--bg-surface); }
.sd-row[hidden] { display: none; }
.thumb-md { width: 56px; height: 56px; flex: none; font-size: 1.1rem; border-radius: 12px; }
.sd-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sd-main strong { font-size: 1rem; line-height: 1.2; }
.sd-main > small { color: var(--muted); font-size: .82rem; }
.sd-cat { font-weight: 700; color: var(--link-strong); white-space: nowrap; }
.sd-val { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.sd-val b { font-size: 1.15rem; font-weight: 900; color: var(--link-strong); white-space: nowrap; }
.sd-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.sd-grid > span:not(.sd-go) { display: flex; flex-direction: column; background: var(--bg-surface); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.sd-grid em, .sd-val em { font-style: normal; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sd-grid b { font-size: 1rem; }
.sd-grid i, .sd-val i { font-style: normal; font-size: .78rem; color: var(--muted); }
.sd-go { font-size: 1.7rem; color: var(--muted); line-height: 1; padding: 0 2px; }
a.warn-card { font-size: .9rem; padding: 10px 14px; }
@media (max-width: 360px) {
  .thumb-md { width: 46px; height: 46px; }
  .sd-grid { grid-template-columns: 1fr 1fr; }
  .sd-go { display: none; }
}

/* Carte « Œufs en stock » : pièces en principal, plateaux en indicatif */
.stat-oeufs b { white-space: nowrap; }
.stat-unite { font-size: .85rem; font-weight: 700; color: var(--muted); }
.stat-equiv { display: block; margin-top: 2px; font-size: .75rem !important; }
.stat small.t-rouge { display: block; margin-top: 2px; }

/* =====================================================================
   RESPONSIVE ORDINATEUR (mobile-first : rien ne change sous 1024 px)
   ===================================================================== */

/* --- Éléments communs (toutes tailles) --- */
.sidebar, .caisse-panier { display: none; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px;
  background: var(--card-bg); font: 700 .75rem ui-monospace, Menlo, Consolas, monospace; color: var(--txt); text-align: center; }
.kbd-hint { margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar .btn, .page-actions .btn { width: auto; min-height: 46px; padding: 0 16px; font-size: .95rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.page-actions .toolbar { margin: 0; }
.doc-links { display: flex; gap: 12px; margin-top: 4px; }
.doc-links a { font-size: .8rem; font-weight: 700; color: var(--link); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head .label { margin: 4px 0 8px; }
.lien { font-size: .85rem; font-weight: 700; color: var(--link); }
.mini { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--bg-accent); color: var(--link-strong); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.mini:hover { background: var(--bg-accent); }
.thumb-xs { width: 40px; height: 40px; font-size: .8rem; border-radius: 8px; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--card-bg); border-radius: 16px; padding: 14px; box-shadow: 0 1px 3px var(--shadow-c); }
.kpi small { color: var(--muted); font-size: .8rem; font-weight: 700; }
.kpi b { font-size: 1.15rem; font-weight: 900; white-space: nowrap; }
.dash-cols .dt { min-width: 640px; }   /* téléphone : le tableau défile au lieu d'être écrasé */
.dash-cols .dt td:nth-child(3) { white-space: nowrap; }
.kpi i { font-style: normal; font-size: .78rem; color: var(--muted); }
.kpi-pri { background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; }
.kpi-pri small, .kpi-pri i { color: rgba(255,255,255,.85); }
.kpi-pri .kpi-qte { color: #fff; font-weight: 700; }
.dash-actions { display: grid; gap: 10px; margin-bottom: 12px; }
.dash-actions .btn { min-height: 52px; }

/* Tableaux de données */
.dt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dt { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card-bg); }
.dt th { position: sticky; top: 0; background: var(--bg-surface); color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.dt td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dt td small { color: var(--muted); }
.dt .num { text-align: right; white-space: nowrap; }
.dt td:first-child b, .dt td:nth-child(2) { white-space: nowrap; }
.dt .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; white-space: nowrap; }
.dt .act { text-align: right; white-space: nowrap; }
.dt .img { width: 52px; }
.dt tbody tr:hover td { background: var(--bg-surface); }
.dt tr.inactif td, .dt tr.annule td { opacity: .55; }
.dt th.sortable { cursor: pointer; user-select: none; }
.dt th.sortable::after { content: ' ⇅'; opacity: .35; }
.dt th[aria-sort="ascending"]::after { content: ' ▲'; opacity: 1; color: var(--link); }
.dt th[aria-sort="descending"]::after { content: ' ▼'; opacity: 1; color: var(--link); }
#dt-articles { border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 3px var(--shadow-c); }

@media (max-width: 1023.98px) {
  .only-desktop { display: none !important; }
}

/* --- Ordinateur / portable --- */
@media (min-width: 1024px) {
  html { font-size: 16px; }
  body, body.sans-nav { padding-left: 240px; padding-bottom: 28px; }
  .only-mobile { display: none !important; }
  .tabbar { display: none; }

  /* Menu latéral */
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 30;
    background: var(--sidebar-bg); color: var(--border-color); padding: 16px 12px; overflow-y: auto; }
  .sb-logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-size: 1.35rem; color: #fff; }
  .sb-logo span { font-size: 1.8rem; }
  .sb-cta { display: block; margin: 0 4px 14px; padding: 12px; border-radius: 12px; background: var(--ok-strong); color: #fff; font-weight: 800; text-align: center; }
  .sb-cta:hover { background: var(--ok-strong); }
  .sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .sidebar li a { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; font-weight: 600; color: var(--bg-accent-strong); }
  .sidebar li a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sidebar li a.on { background: var(--card-bg); color: var(--link-strong); font-weight: 800; }
  .sb-ic { width: 24px; text-align: center; font-size: 1.15rem; }
  .sb-badge { margin-left: auto; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--bad); color: #fff; font-style: normal; font-size: .75rem; font-weight: 800; text-align: center; }
  .sb-sub a { padding: 7px 12px 7px 46px !important; font-size: .9rem; }
  .sb-bas { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
  .sb-bas a { padding: 9px 12px; border-radius: 10px; color: #94a3b8; font-size: .9rem; }
  .sb-bas a:hover { background: rgba(255,255,255,.08); color: #fff; }

  /* Barre du haut et contenu */
  .topbar { height: 56px; padding: 0 20px; }
  .topbar h1 { font-size: 1.25rem; }
  .page { max-width: 1240px; padding: 20px 28px 32px; }
  body.large .page { max-width: none; }
  .search { height: 50px; font-size: 1rem; }
  .btn { min-height: 52px; }

  /* Accueil : 3 indicateurs sur une ligne */
  .dash-kpis { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 14px; margin-bottom: 16px; }
  .dash-kpis .stats { display: contents; }
  .dash-kpis .stat { display: flex; flex-direction: column; justify-content: center; padding: 16px; }
  .dash-kpis .stat b { font-size: 1.5rem; }
  .dash-kpis .kpi-card { margin: 0; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

  /* Listes en grille */
  [data-page="clients"] #liste, [data-page="stock"] #liste, [data-page="articles"] #liste.only-mobile,
  #sd-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
  [data-page="clients"] #liste .client-row, [data-page="stock"] #liste .stock-row, #sd-liste .sd-row { margin: 0; }
  .grid-articles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); padding-bottom: 0; }
  .menu-grid { grid-template-columns: repeat(4, 1fr); }
  .menu-tile { min-height: 140px; }
  .stats-3 { grid-template-columns: repeat(3, 1fr); }

  /* Tableau de bord */
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
  .kpi { padding: 18px; }
  .kpi b { font-size: 1.55rem; }
  .dash-cols .dt { min-width: 0; }
  .dash-actions { display: flex; }
  .dash-actions .btn { width: auto; padding: 0 22px; }
  .dash-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }

  /* Caisse : catalogue 60 % + panier 40 % */
  .caisse.avec-panier { display: grid; grid-template-columns: minmax(0, 3fr) minmax(380px, 2fr); gap: 20px; align-items: start; }
  .caisse.avec-panier .cart-fab { display: none !important; }
  .caisse.avec-panier .grid-articles { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .caisse-panier { display: block; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto;
    background: var(--card-bg); border-radius: var(--r); padding: 14px 14px 0; box-shadow: 0 4px 18px var(--shadow-c); }
  .caisse-titre { margin-left: auto; font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
  .caisse-panier .card { box-shadow: none; border: 1px solid var(--line); padding: 12px; }
  .caisse-panier .cart-line { box-shadow: none; border: 1px solid var(--line); padding: 8px; gap: 10px; margin-bottom: 8px; }
  .caisse-panier .cart-img { width: 48px; }
  .caisse-panier .cart-img .thumb { width: 48px; height: 48px; font-size: .9rem; }
  .caisse-panier .keypad { display: none; }            /* ordinateur : le montant se tape au clavier */
  .caisse-panier .client-chip { margin-bottom: 8px; }
  .caisse-panier .cart-line { display: grid; grid-template-columns: 48px 1fr; }
  .caisse-panier .cart-top strong { font-size: .82rem; }
  .caisse-panier .cart-top .icon-btn { width: 30px; height: 30px; font-size: .9rem; }
  .caisse-panier .cart-price { font-size: .9rem; }
  .caisse-panier .cart-qty { gap: 6px; }
  .caisse-panier .qbtn { width: 32px; height: 32px; font-size: 1.15rem; }
  .caisse-panier .qval { min-width: 48px; font-size: 1rem; }
  .caisse-panier .qval small { display: inline; margin-left: 3px; }
  .caisse-panier .cart-sub { font-size: .9rem; }
  .caisse-panier .card { margin-bottom: 10px; }
  .caisse-panier .totaux .row-total { padding: 1px 2px; font-size: .9rem; }
  .caisse-panier .row-total strong { font-size: 1rem; }
  .caisse-panier .row-total.big strong { font-size: 1.35rem; }
  .caisse-panier .field-display.big { padding: 8px 12px; }
  .caisse-panier .field-display.big strong { font-size: 1.6rem; }
  .caisse-panier .quick button { min-height: 38px; font-size: .85rem; }
  .caisse-panier .result { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; text-align: left; }
  .caisse-panier .result strong { font-size: 1.3rem; margin: 0; }
  .caisse-panier .sticky-bottom .btn { min-height: 52px; font-size: .95rem; }
  .caisse-panier .kbd-paye { margin: 8px 0 0; font-size: .8rem; }
  .caisse-panier .field-display:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--ring); }
  .caisse-panier .sticky-bottom { position: sticky; bottom: 0; left: auto; right: auto; margin: 0 -14px; padding: 12px 14px;
    background: var(--card-bg); border-top: 1px solid var(--line); }
  .sticky-bottom { left: 240px; }
  .cart-fab { left: 252px; right: 12px; max-width: 640px; margin: 0 auto; }

  /* Fenêtres : centrées au lieu de remonter du bas */
  .overlay { align-items: center; }
  .sheet { border-radius: 24px; max-width: 600px; }
  .overlay-box { border-radius: 24px; max-width: 520px; }
  .toast { margin-left: 120px; }
}

@media (min-width: 1440px) {
  .caisse.avec-panier { grid-template-columns: minmax(0, 3fr) minmax(420px, 2fr); }
}

/* --- Impression des listes depuis l'ordinateur (A4) --- */
@media print {
  @page { size: A4; margin: 10mm; }
  html { font-size: 11pt; }
  body, body.sans-nav { padding: 0 !important; background: var(--card-bg); }
  .sidebar, .tabbar, .toolbar, .page-actions, .chips, .search, .sort-bar, .cart-fab, .kbd-hint, .no-print,
  .topbar-btn, .toast, .overlay, a.warn-card, .empty { display: none !important; }
  .topbar { position: static; height: auto; padding: 0 0 8px; background: none; color: #000; border-bottom: 2px solid #000; margin-bottom: 10px; }
  .page { max-width: none; padding: 0; }
  .only-desktop { display: block !important; }
  .only-mobile { display: none !important; }
  .card, .stat, .kpi, .client-row, .sd-row, .stock-row { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
  #dt-articles { box-shadow: none !important; border-radius: 0; overflow: visible; }
  .warn-card { display: none !important; }
  .dt { font-size: 9pt; }
  .dt td, .dt th { padding: 4px 5px; }
  .kpi-card, .kpi-pri { background: var(--card-bg) !important; color: #000 !important; border: 1px solid #000; }
  .dt th { position: static; }
  .dt tr { break-inside: avoid; }
  .dt thead { display: table-header-group; }
  /* priorité sur .only-desktop ci-dessus */
  .toolbar, .toolbar.only-desktop, .dash-actions, .kbd-hint, .dt .act, .lien, .kpi-go { display: none !important; }
  .kpi-card *, .kpi-pri * { color: #000 !important; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  #sd-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  #sd-liste .sd-row { margin: 0; padding: 6px; }
}

/* Fiche client : coordonnées + 2 colonnes sur ordinateur */
.coord { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.coord dt { color: var(--muted); font-weight: 700; font-size: .9rem; }
.coord dd { margin: 0; font-weight: 600; }
.coord a { color: var(--link); }
@media (min-width: 1024px) {
  .fiche-client { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
}

/* Fiche article : 2 boutons photo (appareil / galerie) */
.photo-pick #photo-preview { display: inline-block; margin-bottom: 10px; }
.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-btns .photo-btn { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 10px; border-radius: 14px; cursor: pointer; text-align: center; font-size: .92rem; }
.photo-btn-gal { background: var(--ok-bg); color: var(--ok); }

/* Catégories */
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.emoji { width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--card-bg); font-size: 1.4rem; }
.emoji.on { border-color: var(--link); background: var(--bg-accent); box-shadow: 0 0 0 3px var(--ring); }
.emoji-libre { width: 90px; height: 46px; text-align: center; }
.input-color { height: 56px; padding: 4px; cursor: pointer; }
.cat-liste { display: grid; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 12px; background: var(--card-bg); border-radius: var(--r); padding: 12px; min-height: 70px; box-shadow: 0 1px 3px var(--shadow-c); border: 2px solid transparent; }
.cat-row.on { border-color: var(--link); }
.cat-row.inactif { opacity: .55; }
.cat-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--c, var(--pri)); color: #fff; font-size: 1.5rem; font-weight: 900; }
.cat-go { margin-left: auto; font-size: 1.1rem; }
@media (min-width: 1024px) {
  [data-page="categories"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
  [data-page="categories"] #cat-form { grid-row: span 3; }
}

/* Réglages : choix 58 / 80 mm */
.choix-largeur { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--card-bg); cursor: pointer; min-height: 84px; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix b { font-size: 1.15rem; }
.choix small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.choix.on { border-color: var(--link); background: var(--bg-accent); box-shadow: 0 0 0 3px var(--ring); }
[data-page="reglages"] { padding-bottom: 20px; }
.choix-largeur.choix-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 380px) { .choix-largeur.choix-3 { grid-template-columns: 1fr; } }

/* Réglages : police, taille et aperçu du ticket */
.choix-police { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix-police .choix { min-height: 72px; }
@media (max-width: 380px) { .choix-police { grid-template-columns: 1fr; } }
.pas-taille { display: flex; align-items: center; gap: 12px; }
.pas-taille .btn { min-width: 72px; font-size: 1.3rem; font-weight: 800; }
.pas-taille output { flex: 1; text-align: center; font-size: 1.6rem; font-weight: 800; }
.apercu-ticket { display: flex; justify-content: center; padding: 14px; background: var(--bg-surface-2); border-radius: 14px; overflow: hidden; }
.apercu-ticket img { max-width: 100%; background: var(--card-bg); box-shadow: 0 4px 14px rgba(0,0,0,.18); image-rendering: auto; }
.choix-largeur, .choix-police { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choix { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .choix-largeur.choix-3 { grid-template-columns: 1fr; } .choix-largeur.choix-3 .choix { min-height: 0; } }
.pas-taille .btn { flex: 0 0 88px; min-width: 0; }
.pas-taille output { white-space: nowrap; }

/* Connexion e-mail + mot de passe, Mon compte (1.9) */
.login-mdp { justify-content: center; }
.login-form { display: grid; gap: 12px; margin-top: 14px; text-align: left; }
.login-form .field { margin: 0; }
.login-ok { color: var(--ok); font-weight: 800; }
.login-err { background: var(--bad-bg); border: 2px solid var(--bad-line); border-radius: 12px; padding: 10px 12px; }
.login-lien { display: inline-block; margin-top: 18px; color: var(--link); font-weight: 700; text-decoration: none; padding: 8px; }
.mdp-zone { position: relative; display: block; }
.mdp-zone .input { padding-right: 56px; }
.mdp-oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 48px; height: 44px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; opacity: .6; }
.mdp-oeil.on { opacity: 1; }
.case { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.case input { width: 22px; height: 22px; accent-color: var(--link); flex: none; }
.force { display: block; height: 6px; margin-top: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.force i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.alerte-bandeau { background: var(--warn-bg); border: 2px solid #f59e0b; border-radius: 14px; padding: 12px 14px; font-weight: 700; margin-bottom: 12px; }
.etat-ok { color: var(--ok); font-weight: 800; margin: 4px 0 10px; }
.cpt-form { display: grid; gap: 10px; }
.cpt-form .field { margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl.journal tr.echec td { color: var(--bad); }
.tbl tr.inactif td { opacity: .55; }
.btn-sm { min-height: 36px; padding: 6px 10px; font-size: .8rem; }
.actions-u { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Rapports 2.0 : période, cascade de rentabilité, historiques, charges */
.rap-periode { padding: 10px 14px; }
.rap-periode .chips { padding: 0 0 8px; }
.rap-dates { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.rap-dates label span { display: block; font-size: .75rem; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.rap-dates .input { min-height: 46px; padding: 8px 10px; }
.rap-dates .btn { width: auto; min-height: 46px; padding: 0 18px; }
.rap-libelle { margin: 8px 0 0; font-weight: 700; font-size: .9rem; color: var(--link-strong); }
.rap-grille { display: grid; gap: 12px; margin-bottom: 4px; }
.rap-stats { grid-template-columns: 1fr 1fr; margin: 0 0 10px; }
.cascade { margin-bottom: 0; }
.cas-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cas-ligne span { font-weight: 700; }
.cas-ligne small { color: var(--muted); font-weight: 600; font-size: .78rem; margin-left: 4px; }
.cas-ligne b { white-space: nowrap; font-size: 1.05rem; }
.cas-ligne.sous span, .cas-ligne.sous b { color: var(--muted); font-size: .92rem; }
.cas-ligne.moins b { color: var(--bad); }
.cas-ligne.egal { border-bottom: 2px solid var(--txt); }
.cas-ligne.egal b { font-size: 1.2rem; }
.cas-net { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; }
.cas-net span { font-weight: 900; letter-spacing: .03em; }
.cas-net b { font-size: 1.6rem; font-weight: 900; white-space: nowrap; }
.cas-net .badge-net { grid-column: 1 / -1; justify-self: start; font-style: normal; font-weight: 800; font-size: .8rem; padding: 3px 10px; border-radius: 99px; color: #fff; }
.cas-net.pos { background: var(--ok-bg); color: var(--ok); } .cas-net.pos .badge-net { background: var(--ok-strong); }
.cas-net.neg { background: var(--bad-bg); color: var(--bad); } .cas-net.neg .badge-net { background: #dc2626; }
.rap-nav { position: sticky; top: 56px; z-index: 5; background: var(--bg); margin: 4px 0 8px; }
.rap-filtre { display: flex; gap: 8px; margin-bottom: 10px; }
.rap-filtre .input { flex: 1; min-width: 0; min-height: 46px; }
.rap-filtre .btn { width: auto; min-height: 46px; padding: 0 16px; }
.rap-tbl td.g, .rap-tbl th:nth-child(3) { text-align: left; white-space: normal; }
.rap-tbl td.articles { min-width: 220px; font-size: .8rem; color: var(--muted); }
.rap-tbl tr.report td { background: var(--bg-surface); font-weight: 700; }
.rap-tbl a { color: var(--link); font-weight: 700; text-decoration: none; }
.actions-v { display: flex; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.partiel { background: var(--warn-bg); color: var(--warn); } .pill.du { background: var(--bad-bg); color: var(--bad); }
.cat-charges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cat-ch { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 12px; background: var(--warn-bg); font-size: .85rem; }
.cat-ch span { font-weight: 700; } .cat-ch b { white-space: nowrap; }
.cat-ch.vide { background: var(--bg-surface); color: var(--muted); }
.cat-ch.total { grid-column: 1 / -1; background: var(--pri); color: #fff; font-size: 1rem; }
.cat-choix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cat-choix .choix { min-height: 0; padding: 8px; align-items: center; text-align: center; }
.cat-choix .choix b { font-size: 1.4rem; }
.montant-charge { font-size: 1.4rem; font-weight: 800; }
.rap-grille2 { display: grid; gap: 12px; }
@media (max-width: 420px) { .rap-dates { grid-template-columns: 1fr 1fr; } .rap-dates .btn { grid-column: 1 / -1; } }
@media (min-width: 1024px) {
  .rap-grille { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .rap-stats { grid-template-columns: 1fr 1fr; }
  .rap-grille2 { grid-template-columns: 1fr 1fr; }
  .cat-charges { grid-template-columns: repeat(3, 1fr); }
  .rap-nav { top: 0; }
}
@media print { .rap-nav, #sheet-charge, .rap-dates, .rap-filtre { display: none !important; } .cas-net { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.rap-dates > * { min-width: 0; }
.rap-dates .input { width: 100%; min-width: 0; }
.rap-tbl { min-width: 660px; }
.rap-tbl td:first-child, .rap-tbl td:nth-child(2) { white-space: nowrap; }
.rap-tbl td.g { min-width: 120px; }
.table-wrap { margin: 0 -4px; padding: 0 4px; }
@media (max-width: 1023px) { .cat-charges { grid-template-columns: 1fr; gap: 6px; } }
.card-head .btn-sm { width: auto; flex: none; }

/* Stock par emplacement (Entrepôt / Camion 3971TU233) et transferts */
.lieux-onglets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--border-color); padding: 5px; border-radius: 16px; margin-bottom: 10px; }
.lieu-onglet { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; color: var(--txt); text-decoration: none; text-align: center; }
.lieu-onglet span { font-size: 1.4rem; line-height: 1; }
.lieu-onglet b { font-size: .78rem; line-height: 1.2; }
.lieu-onglet.on { background: var(--card-bg); box-shadow: 0 2px 6px var(--shadow-c); color: var(--link-strong); }
.lieu-resume { margin: 0 0 10px; font-size: .9rem; }
.lien-transferts { display: block; margin: 4px 0 10px; font-weight: 700; color: var(--link); text-decoration: none; }
.par-lieu { display: block; color: var(--muted); font-size: .75rem; margin-top: 1px; white-space: pre; }
.lieu-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lieu-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--card-bg); font-weight: 800; font-size: .9rem; cursor: pointer; text-align: center; font-family: inherit; color: var(--txt); }
.lieu-btn span { font-size: 1.4rem; }
.lieu-btn input { position: absolute; opacity: 0; pointer-events: none; }
.lieu-btn.on { border-color: var(--link); background: var(--bg-accent); color: var(--link-strong); box-shadow: 0 0 0 3px var(--ring); }

.tr-sens { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.tr-sens-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--card-bg); font-family: inherit; color: var(--txt); cursor: pointer; text-align: center; }
.tr-sens-btn .tr-fleche { font-size: 1.5rem; }
.tr-sens-btn b { font-size: .95rem; }
.tr-sens-btn small { color: var(--muted); font-size: .75rem; }
.tr-sens-btn.on { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 0 0 3px var(--ring-ok); }
.tr-trajet { margin: 0 0 8px; font-size: .88rem; text-align: center; }
.tr-liste { padding-bottom: 96px; }
.tr-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "img info ctrl" "img sous sous"; gap: 4px 10px; align-items: center;
  background: var(--card-bg); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px var(--shadow-c); border: 2px solid transparent; }
.tr-row > .thumb, .tr-row > img { grid-area: img; }
.tr-row.choisi { border-color: var(--ok); background: var(--ok-bg); }
.tr-row.trop { border-color: var(--warn); background: var(--warn-bg); }
.tr-info { grid-area: info; min-width: 0; }
.tr-info strong { display: block; font-size: .92rem; line-height: 1.2; }
.tr-dispo { color: var(--txt); font-size: .8rem; font-weight: 700; }
.tr-ctrl { grid-area: ctrl; display: flex; align-items: center; gap: 4px; }
.tr-b { width: 44px; height: 44px; border-radius: 12px; border: 0; font-size: 1.5rem; font-weight: 900; cursor: pointer; font-family: inherit; }
.tr-b.moins { background: var(--bad-bg); color: var(--bad); } .tr-b.plus { background: var(--ok); color: #fff; }
.tr-q { width: 64px; height: 44px; text-align: center; font-size: 1.15rem; font-weight: 900; border: 2px solid var(--line); border-radius: 12px; font-family: inherit; padding: 0 4px; }
.tr-q:focus { outline: none; border-color: var(--link); }
.tr-sous { grid-area: sous; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.tr-unite { color: var(--muted); font-size: .78rem; }
.tr-tout { border: 0; background: var(--bg-accent); color: var(--link-strong); font-weight: 800; font-size: .75rem; padding: 4px 10px; border-radius: 99px; cursor: pointer; font-family: inherit; }
.tr-barre { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab) + 10px + env(safe-area-inset-bottom)); z-index: 16; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--pri); color: #fff; box-shadow: 0 8px 22px var(--shadow-brand); }
.tr-barre-txt { flex: 1; min-width: 0; }
.tr-barre-txt b { display: block; font-size: 1.05rem; }
.tr-barre-txt small { display: block; font-size: .78rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-barre .btn { width: auto; min-height: 48px; padding: 0 16px; }
.tr-barre .btn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: transparent; font-size: 1.2rem; }
.tr-barre .btn-success:disabled { opacity: .5; }
.tr-recap { list-style: none; margin: 0 0 10px; padding: 0; max-height: 45vh; overflow: auto; }
.tr-recap li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tr-recap b { text-align: right; white-space: nowrap; } .tr-recap small { display: block; color: var(--muted); font-weight: 600; }
.tr-alerte { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: .85rem; }
@media (min-width: 1024px) {
  .tr-barre { bottom: 16px; left: calc(240px + 24px); right: 24px; }
  .tr-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
  .lieux-onglets { max-width: 640px; }
}

/* =====================================================================
   SMART BUSINESS — Couche « Modern SaaS » (surcharge les styles hérités)
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-main); transition: background-color .2s ease, color .2s ease; }
::selection { background: var(--bg-accent-strong); }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }
.ic-lg { width: 1.6em; height: 1.6em; }
b, strong, .kpi b, .stat b, .solde-xl, .cart-price, .row-total strong, .dt .num, .sd-val b, .client-solde b, .kpi-val, .cas-ligne b, .cas-net b {
  font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 10px; }
.input, .search, select.input, textarea.input { color: var(--text-main); border-color: var(--border-color); transition: border-color .15s, box-shadow .15s; }
.input:focus, .search:focus { border-color: var(--brand-indigo); box-shadow: 0 0 0 4px var(--ring); }
.input::placeholder, .search::placeholder { color: var(--text-soft); }
select.input { background-color: var(--card-bg); }
.counter-input { color: var(--text-main); }
hr { border: 0; border-top: 1px solid var(--border-color); }

/* ---------- Marque ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.logo-mark { width: 40px; height: 32px; flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.wordmark b { font-family: "ARP Montserrat", var(--font); font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; white-space: nowrap; }
.wordmark b span:first-child { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark b span + span { color: var(--wordmark-sys); }
.wordmark small { font-size: .56rem; font-weight: 700; letter-spacing: .16em; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }

/* ---------- Barre du haut ---------- */
.topbar {
  height: 62px; padding: 0 10px; gap: 8px; background: var(--topbar-bg); color: var(--text-main);
  border-bottom: 1px solid var(--border-color); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
}
.topbar h1 { font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; }
.topbar-btn { color: var(--text-main); width: 44px; height: 44px; font-size: 1.2rem; border-radius: 12px; }
.topbar-btn:hover { background: var(--bg-accent); }
.topbar-btn:active { background: var(--bg-accent-strong); }
.topbar .brand .wordmark { display: none; }
#btn-printer.connected { background: var(--ok-bg); color: var(--ok); }
.topbar-user { display: none; }

/* Sélecteur de thème (3 positions : clair / système / sombre) */
.theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-surface-2); border: 1px solid var(--border-color); }
.theme-switch button { width: 34px; height: 30px; display: grid; place-items: center; border-radius: 999px; color: var(--text-muted); }
.theme-switch button:hover { color: var(--text-main); }
.theme-switch button[aria-pressed="true"] { background: var(--card-bg); color: var(--brand-violet); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .theme-switch button[aria-pressed="true"] { color: #C4B5FD; }
.theme-toggle-btn .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle-btn .ic-moon { display: inline; }

/* ---------- Cartes & contenus ---------- */
.card, .stat, .kpi, .client-row, .stock-row, .sd-row, .menu-tile, .cart-line, .pcard, .cat-row, .tr-row, .client-bar {
  background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.client-row, .sd-row, .stock-row { border-left-width: 5px; }
.client-row:hover, .stock-row:hover, .sd-row:hover, .menu-tile:hover, .pcard:hover { border-color: var(--bg-accent-strong); box-shadow: var(--shadow-md); }
.client-row, .stock-row, .sd-row, .menu-tile, .pcard, .btn, .chip, .kpi { transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease; }
.label { color: var(--text-muted); letter-spacing: .07em; font-size: .72rem; }
.avatar { background: var(--bg-accent); color: var(--link-strong); }
.card.soft { background: var(--bg-surface); }
.page { padding: 14px 12px; }

/* KPI */
.kpi { border-radius: 18px; gap: 4px; }
.kpi small { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.kpi-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--bg-accent); color: var(--brand-blue); }
:root[data-theme="dark"] .kpi-ic { color: #A5B4FC; }
.kpi-pri, .kpi-card { background: var(--brand-grad); border: 0; color: #fff; box-shadow: 0 12px 28px -12px var(--shadow-brand); }
.kpi-pri .kpi-ic { background: rgba(255,255,255,.18); color: #fff; }
.kpi-pri small, .kpi-pri i { color: rgba(255,255,255,.88); }

/* Boutons */
.btn { border-radius: 14px; font-weight: 750; letter-spacing: .01em; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px -10px var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-success { background: var(--ok-strong); color: #fff; }
.btn-success:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--card-bg); border: 1.5px solid var(--border-color); color: var(--text-main); }
.btn-ghost:hover { border-color: var(--bg-accent-strong); background: var(--bg-accent); }
.btn-danger { background: var(--bad-base); color: #fff; }
.btn-outline-danger { background: var(--card-bg); }
.btn:disabled { filter: grayscale(.3); }
.chip { background: var(--card-bg); border: 1.5px solid var(--border-color); color: var(--text-main); }
.chip.on, .radio-chips input:checked + label { background: var(--brand-grad); border-color: transparent; color: #fff; }
.quick button { background: var(--bg-accent); color: var(--link-strong); }
.keypad button { background: var(--bg-surface-2); color: var(--text-main); }

/* Badges de statut ultra-nets */
.badge, .pill { display: inline-flex; align-items: center; gap: 5px; font-weight: 750; letter-spacing: .01em; }
.badge::before, .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-vert, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.badge-orange, .pill.partiel { background: var(--warn-bg); color: var(--warn); }
.badge-rouge, .pill.du { background: var(--bad-bg); color: var(--bad); }
.t-vert { color: var(--ok); } .t-orange { color: var(--warn); } .t-rouge { color: var(--bad); }
.client-row.b-vert { border-left-color: var(--ok-base); }
.client-row.b-orange { border-left-color: var(--warn-base); }
.client-row.b-rouge, .stock-row.alerte, .sd-row.alerte { border-left-color: var(--bad-base); }
.alerte-bandeau { background: var(--warn-bg); border-color: var(--warn-base); color: var(--text-main); }

/* Tableaux de données : en-têtes collants */
.dt, .tbl { background: transparent; color: var(--text-main); }
.dt th { background: var(--bg-surface); color: var(--text-muted); top: 0; z-index: 2; }
.dt-scroll, .table-wrap { max-height: 70vh; overflow: auto; border-radius: 12px; }
.tbl th { position: sticky; top: 0; background: var(--card-bg); z-index: 2; }
.dt tbody tr:hover td { background: var(--bg-accent); }
.mini { background: var(--bg-accent); color: var(--link-strong); }

/* Fenêtres */
.overlay { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.overlay-box, .sheet { background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); }
.toast { background: var(--toast-bg); color: var(--toast-txt, #fff); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .toast { --toast-txt: #0B1120; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { --toast-txt: #0B1120; } }
.toast.ok, .toast.err { color: #fff; }
.toast.ok { background: var(--ok-strong); } .toast.err { background: var(--bad); }

/* État vide / accès refusé */
.empty-state { text-align: center; padding: 34px 18px; display: grid; justify-items: center; gap: 8px; }
.empty-state h2 { margin: 4px 0 0; }
.empty-state .btn { width: auto; padding: 0 22px; margin-top: 6px; }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-grad-soft); color: var(--brand-violet); font-size: 1.8rem; }

/* ---------- Barre d'onglets mobile (5 onglets + vente rapide centrale) ---------- */
.tabbar {
  background: var(--topbar-bg); border-top: 1px solid var(--border-color);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 -6px 20px -12px var(--shadow-c);
}
.tabbar a { gap: 3px; color: var(--text-muted); font-size: .7rem; font-weight: 700; }
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a.on { color: var(--brand-blue); }
:root[data-theme="dark"] .tabbar a.on { color: #A5B4FC; }
.tabbar a.on .ic { stroke-width: 2.4; }
.tabbar a.tab-fab { color: var(--text-main); }
.tabbar a.tab-fab .fab-ic {
  width: 56px; height: 56px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: var(--brand-grad); box-shadow: 0 10px 22px -8px var(--shadow-brand), 0 0 0 5px var(--bg-primary);
}
.tabbar a.tab-fab .fab-ic .ic { width: 28px; height: 28px; }
.tabbar a.tab-fab:active .fab-ic { transform: scale(.94); }
.tab-badge { background: var(--bad-base); box-shadow: 0 0 0 2px var(--card-bg); }

/* Grosses touches tactiles (tournée) */
.btn-round { background: var(--ok-strong); box-shadow: 0 8px 18px -8px var(--shadow-ok); }
.btn-round.minus { background: var(--warn-base); color: #1f2937; }
.qbtn.plus, .tr-b.plus { background: var(--ok-strong); }
.qbtn.minus { background: var(--warn-base); color: #1f2937; }
.btn-add { background: var(--ok-strong); }
.cart-fab, .tr-barre { background: var(--brand-grad); }
.pcard.in-cart { outline-color: var(--ok-base); }
.unit-switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-surface-2); margin-bottom: 10px; }
.unit-switch button { min-height: 44px; border-radius: 10px; font-weight: 800; font-size: .9rem; color: var(--text-muted); }
.unit-switch button[aria-pressed="true"] { background: var(--card-bg); color: var(--brand-blue); box-shadow: var(--shadow-sm); }

/* Menu : tuiles avec icône */
.menu-tile .tile-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-grad-soft); color: var(--brand-violet); margin-bottom: 6px; }
:root[data-theme="dark"] .menu-tile .tile-ic { color: #C4B5FD; }
.menu-tile .tile-ic .ic { width: 24px; height: 24px; }
.menu-section { grid-column: 1 / -1; margin: 10px 2px 0; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- Connexion ---------- */
.login { gap: 4px; }
.login-brand { display: grid; justify-items: center; gap: 6px; margin-bottom: 8px; }
.login-brand .logo-mark { width: 120px; height: 96px; }
.login-brand .wordmark { align-items: center; }
.login-brand .wordmark b { font-size: 2rem; }
.login-brand .wordmark small { font-size: .7rem; }
.login-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 22px; padding: 22px 18px; box-shadow: var(--shadow-md); }
.login-theme { position: fixed; top: 12px; right: 12px; }
.login-err { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }

/* ---------- Administration des utilisateurs ---------- */
.users-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.users-toolbar .search { flex: 1 1 240px; height: 50px; }
.users-toolbar .btn { width: auto; padding: 0 18px; min-height: 50px; }
.u-list { display: grid; gap: 10px; }
.u-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px;
  background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.u-card.inactif { opacity: .62; }
.u-card .avatar { width: 46px; height: 46px; }
.u-main { min-width: 0; display: grid; gap: 3px; }
.u-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-main small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800;
  color: var(--rc, var(--brand-indigo)); background: color-mix(in srgb, var(--rc, #6366F1) 14%, transparent); }
.role-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.u-act { display: flex; gap: 6px; }
.u-act .btn { width: auto; min-height: 40px; padding: 0 12px; font-size: .85rem; }
.perm-groups { display: grid; gap: 14px; }
.perm-group h4 { margin: 0 0 6px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.perm-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 6px; background: var(--bg-surface); }
.perm-row b { display: block; font-size: .92rem; }
.perm-row small { color: var(--text-muted); font-size: .78rem; }
.perm-row .src { font-size: .7rem; font-weight: 800; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; }
.perm-row.override .src { color: var(--brand-violet); }
.perm-row.sensible b::after { content: " • sensible"; color: var(--warn); font-size: .72rem; font-weight: 800; }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-accent-strong); transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.toggle input:checked + span { background: var(--ok-strong); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.role-card { position: relative; display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--border-color); background: var(--card-bg); cursor: pointer; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card b { color: var(--rc); font-size: .92rem; }
.role-card small { color: var(--text-muted); font-size: .74rem; line-height: 1.3; }
.role-card:has(input:checked) { border-color: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 22%, transparent); }
.pwd-box { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--brand-grad-soft); border: 1px dashed var(--brand-indigo); text-align: center; }
.pwd-box code { font: 800 1.5rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--text-main); user-select: all; }
.sheet-lg { max-width: 760px; }
.form-grid { display: grid; gap: 12px; }
.seg-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-weight: 800; }
.seg-title .ic { color: var(--brand-violet); }

/* Ticket de reçu et document A4 : toujours sur fond blanc */
.apercu-ticket { background: var(--bg-surface-2); }

@media (min-width: 640px) {
  .page { max-width: 640px; }
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   ORDINATEUR (≥ 1024 px) : sidebar rétractable
   ===================================================================== */
@media (min-width: 1024px) {
  body, body.sans-nav { padding-left: var(--sb); transition: padding-left .2s ease; }
  body.sb-mini { padding-left: var(--sb-mini); }
  .sidebar {
    width: var(--sb); padding: 14px 12px; gap: 6px; color: var(--sidebar-txt);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    border-right: 1px solid rgba(255,255,255,.06); transition: width .2s ease;
  }
  .sb-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 12px; }
  .sb-head .brand { color: #fff; }
  .sb-head .wordmark b span + span { color: #fff; }
  .sb-head .brand { min-width: 0; gap: 10px; }
  .sb-head .wordmark b { display: flex; flex-direction: column; font-size: 1.02rem; line-height: 1.02; letter-spacing: .03em; }
  .sb-head .logo-mark { width: 44px; height: 35px; }
  .sb-head .wordmark small { color: #94A3B8; }
  .sb-toggle { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #94A3B8; flex: none; }
  .sb-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sb-cta { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 2px 12px; padding: 12px; border-radius: 12px;
    background: var(--brand-grad); color: #fff; font-weight: 800; box-shadow: 0 10px 22px -10px rgba(124,58,237,.7); }
  .sb-cta:hover { background: var(--brand-grad); filter: brightness(1.08); }
  .sb-section { margin: 12px 12px 4px; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #64748B; }
  .sidebar li a { gap: 12px; padding: 10px 12px; color: var(--sidebar-txt); font-weight: 600; font-size: .93rem; }
  .sidebar li a .ic { width: 20px; height: 20px; opacity: .9; }
  .sidebar li a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
  .sidebar li a.on { background: rgba(99,102,241,.22); color: #fff; font-weight: 750; box-shadow: inset 3px 0 0 #A78BFA; }
  .sidebar li a.on .ic { color: #C4B5FD; opacity: 1; }
  .sb-sub a { padding: 7px 12px 7px 44px !important; font-size: .86rem !important; }
  .sb-bas { gap: 2px; border-top: 1px solid rgba(255,255,255,.08); }
  .sb-bas a, .sb-bas button { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #94A3B8; font-size: .88rem; width: 100%; text-align: left; }
  .sb-bas a:hover, .sb-bas button:hover { background: rgba(255,255,255,.07); color: #fff; }
  .sb-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 4px; }
  .sb-user .avatar { width: 36px; height: 36px; font-size: .8rem; background: rgba(255,255,255,.1); color: #fff; }
  .sb-user span { min-width: 0; display: grid; }
  .sb-user b { color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-user small { color: #94A3B8; font-size: .72rem; }
  .sb-label { white-space: nowrap; overflow: hidden; }
  .sb-badge { background: var(--bad-base); }

  /* Repliée : icônes seules + info-bulle */
  body.sb-mini .sidebar { width: var(--sb-mini); }
  body.sb-mini .sidebar .sb-label, body.sb-mini .sidebar .wordmark, body.sb-mini .sb-section, body.sb-mini .sb-sub,
  body.sb-mini .sb-user span, body.sb-mini .sb-badge { display: none; }
  body.sb-mini .sb-head { flex-direction: column; }
  body.sb-mini .sb-toggle .ic { transform: rotate(180deg); }
  body.sb-mini .sidebar li a, body.sb-mini .sb-bas a, body.sb-mini .sb-bas button, body.sb-mini .sb-cta { justify-content: center; padding-left: 0; padding-right: 0; }
  body.sb-mini .sidebar [data-tip] { position: relative; }
  body.sb-mini .sidebar [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    padding: 6px 10px; border-radius: 8px; background: var(--navy); color: #fff; font-size: .8rem; white-space: nowrap; z-index: 40; box-shadow: var(--shadow-md);
  }
  body.sb-mini .sb-user { justify-content: center; }

  .topbar { height: 64px; padding: 0 24px; }
  .topbar .brand { display: none; }
  .topbar-user { display: flex; align-items: center; gap: 10px; }
  .page { max-width: 1280px; padding: 22px 28px 36px; }
  .sticky-bottom { left: var(--sb); }
  body.sb-mini .sticky-bottom { left: var(--sb-mini); }
  .cart-fab { left: calc(var(--sb) + 12px); }
  body.sb-mini .cart-fab { left: calc(var(--sb-mini) + 12px); }
  .tr-barre { left: calc(var(--sb) + 24px); }
  body.sb-mini .tr-barre { left: calc(var(--sb-mini) + 24px); }
  .toast { margin-left: calc(var(--sb) / 2); }
  .menu-grid { grid-template-columns: repeat(4, 1fr); }
  .u-list { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
  .caisse-panier { background: var(--card-bg); border: 1px solid var(--border-color); }
  .caisse-panier .sticky-bottom { background: var(--card-bg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Impression : toujours en clair */
@media print {
  :root, :root[data-theme="dark"] { --bg-primary: #fff; --card-bg: #fff; --text-main: #000; --text-muted: #333; --border-color: #ccc; }
  body { padding-left: 0 !important; }
}

/* Accessibilité */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-focus:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--card-bg); color: var(--text-main); box-shadow: var(--shadow-md); }
.theme-switch-lg button { width: 56px; height: 44px; }
/* Ajustements 3.0.1 */
.kpi .kpi-ic, .kpi-card .kpi-ic { width: 30px; height: 30px; font-size: 1rem; border-radius: 10px; }
.kpi-ic .ic { width: 17px; height: 17px; }
.kpi-card .kpi-ic { width: 52px; height: 52px; border-radius: 16px; }
.kpi-card .kpi-ic .ic { width: 26px; height: 26px; }
@media (min-width: 1024px) {
  .sb-head .wordmark small { font-size: .5rem; letter-spacing: .1em; }
  body.sb-mini .sb-bas .theme-switch { flex-direction: column; border-radius: 16px; margin: 0 auto 8px !important; }
}
.tbl.tbl-left td, .tbl.tbl-left th { text-align: left; white-space: normal; }

/* ---------- 3.1 : lots / DLC, double unité ---------- */
.dlc-alerte { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: .9rem; }
.dlc-alerte.perime, .dlc-alerte.urgent { background: var(--bad-bg); color: var(--bad); }
.dlc-alerte.proche { background: var(--warn-bg); color: var(--warn); }
.lots-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lot-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--border-color); border-left-width: 4px; }
.lot-row.lot-perime, .lot-row.lot-urgent { border-left-color: var(--bad-base); }
.lot-row.lot-proche { border-left-color: var(--warn-base); }
.lot-main { display: grid; min-width: 0; }
.lot-main small { color: var(--text-muted); }
.lot-qte { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.achat-line .unit-switch { margin: 8px 0; }

/* ===================================================== 3.2 Flotte & camions */
.badge-gris { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-muted); }
.cam-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 12px; }
.cam-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--card-bg);
  border: 1px solid var(--border-color); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.cam-card.etat-maintenance { border-color: color-mix(in srgb, var(--warn) 45%, var(--border-color)); }
.cam-card.etat-inactif { opacity: .62; }
.cam-head { display: flex; align-items: center; gap: 12px; }
.cam-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: color-mix(in srgb, var(--ok-base) 14%, transparent); color: var(--ok-strong); }
.etat-maintenance .cam-ic { background: var(--warn-bg); color: var(--warn); }
.etat-inactif .cam-ic { background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }
.cam-ic svg { width: 24px; height: 24px; }
.cam-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cam-mat { font-size: 1.15rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.cam-titre small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.cam-infos dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.cam-infos dd { margin: 2px 0 0; font-weight: 600; }
.cam-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-color); }
.cam-act .btn { width: 100%; min-height: 40px; font-size: .86rem; padding: 0 10px; }
.cam-sheet-ic { width: 48px; height: 48px; font-size: 1.3rem; }
.cam-mat-input { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
/* Sélecteur de camion réutilisable (stock, transfert) */
.camion-select { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card-bg);
  border: 1px solid var(--border-color); margin-bottom: 12px; }
.camion-select > span { font-weight: 700; white-space: nowrap; }
.camion-select select { flex: 1; min-width: 0; }
.camion-select small { color: var(--text-muted); }
.lieu-onglet .badge { font-size: .65rem; padding: 1px 6px; }
.lieu-select { position: relative; cursor: pointer; }
.lieu-select select { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; font-size: .78rem; font-weight: 700;
  text-align: center; text-align-last: center; padding: 0 14px 0 2px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 7px) 55%, calc(100% - 3px) 55%; background-size: 4px 4px; background-repeat: no-repeat; }
.lieu-select select:focus-visible { outline: 2px solid var(--link-strong); border-radius: 6px; }
@media (max-width: 560px) {
  .camion-select { flex-wrap: wrap; }
  .camion-select select { flex-basis: 100%; }
}
/* Lots DLC sur téléphone : la quantité passe sous le nom (évite le chevauchement) */
.lot-main b, .lot-main small { line-height: 1.3; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .lot-row { grid-template-columns: auto minmax(0, 1fr); }
  .lot-qte { grid-column: 2; white-space: normal; color: var(--text-main); }
}

/* ===================================================== 3.3 Prix TTC / HT */
.prix-card .tva-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 6px 0 4px; }
.prix-card .tva-lib { font-weight: 700; }
.tva-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tva-chip { min-height: 40px; min-width: 62px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--border-color);
  background: var(--card-bg); color: var(--text-main); font: inherit; font-weight: 700; cursor: pointer; }
.tva-chip.on { background: var(--link-strong); border-color: var(--link-strong); color: #fff; }
.tva-autre { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-muted); }
.tva-autre .input { width: 84px; min-height: 40px; text-align: center; }
.prix-grid { display: grid; grid-template-columns: minmax(150px, 1.15fr) 1fr 1fr; gap: 8px 12px; align-items: center; margin: 10px 0; }
.prix-grid .prix-col { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.prix-grid .prix-lib { font-weight: 700; line-height: 1.25; }
.prix-grid .prix-lib small { display: block; font-weight: 500; color: var(--text-muted); }
.prix-grid input[data-ht] { background: var(--bg-primary); }
.marges-apercu p { margin: 6px 0 0; color: var(--text-muted); font-size: .92rem; }
.marges-liste { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.marges-liste li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--card-bg);
  border: 1px solid var(--border-color); font-size: .92rem; }
@media (max-width: 560px) {
  .prix-grid { grid-template-columns: 1fr 1fr; }
  .prix-grid > span:first-child { display: none; }
  .prix-grid .prix-lib { grid-column: 1 / -1; margin-top: 6px; }
}
.bs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 12px 0 4px; }
.bs-bar .btn small { font-weight: 600; opacity: .85; }
.bs-bar p { margin: 0; flex: 1 1 260px; }

/* Page de connexion : aucune barre latérale ni barre du bas → carte centrée sur toutes les largeurs */
body.page-login, body.page-login.sb-mini { padding: 0 !important; }
body.page-login .login { min-height: 100vh; min-height: 100dvh; margin-inline: auto; justify-content: center; }
