/* ============================================================
   mobile.css — RFPyrogest' interface mobile (Thread 15)
   Charte : navy #1A3A8F · gold #C9A84C · bg #EEF2FB
============================================================ */

:root {
  --navy:        #1A3A8F;
  --navy-dark:   #122A6A;
  --navy-hover:  #254AAE;
  --gold:        #C9A84C;
  --gold-light:  #E5C97A;
  --bg:          #EEF2FB;
  --white:       #FFFFFF;
  --text:        #0F172A;
  --text-muted:  #475569;
  --text-hint:   #94A3B8;
  --border:      #D6DCE9;
  --border-light:#E6EBF4;
  --red:         #B91C1C;
  --red-bg:      #FEE2E2;
  --green:       #0D7A3A;
  --green-bg:    #DEF7E3;
  --orange:      #E65100;
  --orange-bg:   #FEEAD6;
  --purple:      #6A1B9A;
  --purple-bg:   #F3E8FF;
  --blue:        #1E40AF;
  --blue-bg:     #DBEAFE;

  --topbar-h:    56px;
  --bottomnav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100dvh;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
body { overflow: hidden; }

button, input, select, textarea {
  font-family: inherit; font-size: inherit; color: inherit;
}
button {
  border: none; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
input, textarea, select {
  -webkit-appearance: none; appearance: none;
}
/* Checkbox / radio : restaurer le rendu natif (sinon invisibles sur mobile) */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--navy);
  width: 18px;
  height: 18px;
  cursor: pointer;
}
input[type="checkbox"].m-check-large,
input[type="radio"].m-check-large {
  width: 24px;
  height: 24px;
  accent-color: var(--navy);
}
input:focus, select:focus, textarea:focus {
  outline: none;
}

/* ── LOGIN ────────────────────────────────────────────────── */
.m-login-screen {
  position: fixed; inset: 0;
  background: #1A3A8F;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 10000;
}
.m-login-card {
  position: relative;
  z-index: 1;            /* au-dessus du watermark (z-index: 0) */
  width: 100%;
  max-width: 360px;
  border-radius: 14px;
  border: 2px solid #C9A84C;
  box-shadow: 0 0 0 1px rgba(201,168,76,0.1), 0 12px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  background: #1A3A8F;
}
/* Watermark QR gold décoratif — positionné en bas-droite de l'écran (fond navy),
   en arrière-plan derrière la card. .m-login-screen est position:fixed (containing
   block pour absolute children). pointer-events: none n'intercepte aucun clic. */
.m-login-watermark {
  position: absolute;
  right: -20px;
  bottom: 20px;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}

/* Header navy + filet gold */
.m-login-head {
  position: relative;
  z-index: 1;
  background: #1A3A8F;
  border-bottom: 3px solid #C9A84C;
  padding: 30px 24px 24px;
  text-align: center;
}
.m-login-head-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.m-login-logo-icon { flex-shrink: 0; }
.m-login-sep {
  display: inline-block;
  width: 1.5px;
  height: 22px;
  background: rgba(201,168,76,0.45);
  flex-shrink: 0;
}
.m-login-name {
  font-family: 'Exo 2', sans-serif;
  font-weight: 500;
  font-size: 26px;
  color: #C9A84C;
  letter-spacing: 0.4px;
  line-height: 1;
}
.m-login-tool-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.m-login-tool {
  font-family: 'DM Sans', sans-serif;
  font-style: italic;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.2px;
}

/* Form bleu pâle */
.m-login-form {
  position: relative;
  z-index: 1;
  background: #EEF2FB;
  padding: 28px 22px 26px;
}
.m-login-field { margin-bottom: 14px; }
.m-login-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #1A3A8F;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.m-login-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(26,58,143,0.2);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  color: #1A3A8F;
  transition: border-color .15s;
}
.m-login-input:focus {
  border-color: #1A3A8F;
  outline: none;
}
.m-login-submit {
  width: 100%;
  height: 52px;
  background: #1A3A8F;
  color: #C9A84C;
  border: 1.5px solid #C9A84C;
  border-radius: 10px;
  font-family: 'Exo 2', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 6px;
  transition: background .12s ease;
}
.m-login-submit:hover  { background: #15306E; }
.m-login-submit:active { transform: scale(0.99); }

/* ── SESSION OVERLAY ─────────────────────────────────────── */
.m-session-overlay {
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 9999;
}
.m-session-card {
  background: var(--white);
  border-radius: 16px; padding: 26px 20px;
  width: 100%; max-width: 360px;
  border-top: 4px solid var(--gold);
}
.m-session-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 20px;
  color: var(--navy); text-align: center;
}
.m-session-sub {
  font-size: 13px; color: var(--text-muted);
  text-align: center; margin: 6px 0 18px;
}

/* ── BOUTONS ──────────────────────────────────────────────── */
.m-btn-primary, .m-btn-secondary, .m-btn-ghost, .m-btn-danger, .m-btn-success, .m-btn-warn {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  font-family: 'Exo 2', sans-serif;
  font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: background .12s, transform .05s;
  user-select: none;
}
.m-btn-primary  { background: var(--navy);   color: var(--white); }
.m-btn-primary:active { background: var(--navy-hover); transform: scale(0.98); }
.m-btn-secondary{ background: var(--bg);     color: var(--navy); border: 1.5px solid var(--border); }
.m-btn-secondary:active { background: var(--border-light); }
.m-btn-ghost    { background: transparent;   color: var(--text-muted); }
.m-btn-ghost:active { background: var(--border-light); }
.m-btn-danger   { background: var(--red);    color: var(--white); }
.m-btn-danger:active { background: #991818; }
.m-btn-success  { background: var(--green);  color: var(--white); }
.m-btn-success:active { background: #0a5a2a; }
.m-btn-warn     { background: var(--orange); color: var(--white); }
.m-btn-block    { width: 100%; margin-top: 8px; }
.m-btn-sm       { min-height: 40px; padding: 8px 14px; font-size: 13px; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%; top: calc(var(--topbar-h) + 12px + var(--safe-top));
  transform: translateX(-50%) translateY(-20px);
  background: var(--navy); color: var(--white);
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20000;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok   { background: var(--green); }
.toast.err  { background: var(--red); }
.toast.warn { background: var(--orange); }

/* ── OFFLINE ──────────────────────────────────────────────── */
.m-offline-banner {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-top));
  left: 0; right: 0;
  background: var(--orange-bg);
  border-bottom: 1px solid var(--orange);
  color: var(--orange);
  font-size: 12px; padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  z-index: 500;
}

/* ── APP ──────────────────────────────────────────────────── */
.m-app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}

/* ── TOPBAR ───────────────────────────────────────────────── */
#m-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  display: flex; align-items: center;
  padding-left: 10px; padding-right: 8px;
  gap: 8px;
  z-index: 100;
  color: var(--white);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-sep { width: 1.5px; height: 32px; background: #C9A84C; opacity: 0.7; }
.topbar-brand-text { display: flex; flex-direction: column; gap: 2px; }
.topbar-brand-name { font-family: 'Exo 2', sans-serif; font-size: 13px; font-weight: 700; color: #C9A84C; line-height: 1; }
.topbar-brand-module { display: flex; align-items: center; gap: 5px; }
.topbar-brand-module span { font-size: 11px; color: #fff; font-style: italic; line-height: 1; }

/* Spacer flex entre marque et avatar */
.m-topbar-spacer { flex: 1; min-width: 0; }

/* Bouton "← Retour" texte (remplace l'ancienne flèche SVG seule) */
.m-btn-retour {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  min-height: 32px;
  line-height: 1;
}
.m-btn-retour:active { color: #fff; }
.m-btn-retour-arrow {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}
.m-btn-retour-lbl {
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Avatar utilisateur (droite) */
.m-topbar-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.m-topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #C9A84C;
  color: #1A3A8F;
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
}
.m-topbar-avatar:active { transform: scale(0.95); }

/* Indicateur connexion : dot 9px en bas-droite avec bordure navy */
.m-status-dot {
  display: inline-block;
  border-radius: 50%;
  transition: background .2s;
}
.m-avatar-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid #1A3A8F;
  box-shadow: none;
}
.m-avatar-dot.m-status-online  { background: #4caf50; }
.m-avatar-dot.m-status-offline { background: #E65100; }

/* Menu déroulant sous avatar */
.m-avatar-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  z-index: 200;
  overflow: hidden;
  animation: m-fade .12s ease-out;
}
.m-avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.m-avatar-menu-item:active { background: var(--bg); }

/* ── ÉCRANS ───────────────────────────────────────────────── */
.m-screen {
  position: absolute;
  top: calc(var(--topbar-h) + var(--safe-top));
  left: 0; right: 0;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 24px;
  display: none;
}
.m-screen.active { display: block; }
.m-screen-fiche.active ~ #m-bottomnav,
body.m-fiche-open #m-bottomnav { display: none; }
body.m-fiche-open .m-screen { bottom: 0; }

.m-screen-header { margin: 4px 2px 12px; }
.m-screen-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 20px; color: var(--navy);
}
.m-screen-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

.m-section-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600; font-size: 12px;
  color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin: 14px 2px 8px;
}
.m-section-title-gold { color: var(--gold); }

/* ── SCAN BAR + RECHERCHE ────────────────────────────────── */
.m-scanbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--navy);
  border-radius: 12px;
  padding: 6px 10px;
  margin: 4px 0 8px;
  box-shadow: 0 2px 8px rgba(26,58,143,0.08);
}
.m-scanbar-input {
  flex: 1; height: 44px;
  border: none; outline: none; background: transparent;
  font-size: 16px; font-weight: 500; color: var(--text);
}
.m-scanbar-input::placeholder { color: var(--text-hint); font-weight: 400; }
.m-scanbar-icon { color: var(--navy); display: flex; }
.m-scanbar-clear {
  min-width: 36px; min-height: 36px;
  border-radius: 8px; color: var(--text-hint); font-size: 16px;
}
.m-scanbar-clear:active { background: var(--bg); }

.m-suggestions {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: -4px; margin-bottom: 8px;
  max-height: 360px; overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.m-suggestion {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 2px;
}
.m-suggestion:last-child { border-bottom: none; }
.m-suggestion:active { background: var(--bg); }
.m-suggestion-ref {
  font-family: 'Exo 2', sans-serif; font-weight: 700;
  font-size: 13px; color: var(--navy);
}
.m-suggestion-lib {
  font-size: 12px; color: var(--text-muted);
}
.m-suggestion-foot {
  display: flex; gap: 6px; align-items: center; margin-top: 2px;
}

/* ── CHIPS FILTRES ────────────────────────────────────────── */
.m-chips {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m-chips::-webkit-scrollbar { display: none; }
.m-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--white);
  border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  user-select: none;
}
.m-chip:active { transform: scale(0.96); }
.m-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
}
.m-chip.m-chip-gold.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}
.m-chip-count {
  background: rgba(255,255,255,0.3);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
}
.m-chip-caret {
  display: inline-block;
  opacity: 0.5;
  margin-left: 2px;
  font-size: 10px;
}

/* ── RECAP BAR ────────────────────────────────────────────── */
.m-recap {
  background: var(--white);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
}
.m-recap-item {
  display: flex; flex-direction: column;
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.m-recap-val {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 14px;
  color: var(--navy);
  text-transform: none; letter-spacing: 0;
}

/* ── RECAP STYLE C (écran liste produits + fiche presta) ──── */
#m-prod-recap.m-recap,
#m-presta-recap.m-recap {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #C9A84C;
  padding: 14px;
  display: block;
  gap: 0;
  grid-template-columns: none;
}
.m-recap-row-1 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.m-recap-row-2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 0.5px solid rgba(26,58,143,0.08);
  padding-top: 10px;
  margin-top: 10px;
}
.m-recap-cell {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.m-recap-lbl {
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(26,58,143,0.4);
  letter-spacing: 0.5px;
  font-weight: 600;
}
.m-recap-num {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 16px;
  color: #1A3A8F;
  line-height: 1.1;
  white-space: nowrap;
}
.m-recap-num-gold { color: #C9A84C; }
.m-recap-unit {
  font-size: 10px;
  color: rgba(26,58,143,0.35);
  margin-left: 3px;
  font-weight: 500;
}

/* ── CARD PRODUIT (écran liste produits) ──────────────────── */
.m-prod-card {
  background: #fff;
  border-radius: 12px;
  border: 0.5px solid rgba(26,58,143,0.12);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .06s, box-shadow .12s;
}
.m-prod-card:active {
  transform: scale(0.995);
  box-shadow: 0 2px 10px rgba(26,58,143,0.12);
}
.m-prod-card-parent { border-left: 3px solid #C9A84C; }
.m-prod-card-variant {
  margin-left: 14px;
  border-left: 2px solid var(--border);
}
.m-prod-card-header {
  background: #1A3A8F;
  color: #fff;
  padding: 10px 14px;
  display: flex; flex-direction: column;
  gap: 3px;
}
.m-prod-h-l1 {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 20px;
}
.m-prod-h-chev {
  display: inline-flex; align-items: center;
  font-size: 12px; color: rgba(255,255,255,0.85);
  transition: transform .15s;
  width: 12px;
}
.m-prod-h-chev.expanded { transform: rotate(90deg); }
.m-prod-h-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 15px; color: #fff;
  letter-spacing: 0.3px;
}
.m-prod-h-nom {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600; font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.m-prod-h-l2 {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  line-height: 1.3;
}
.m-prod-h-l3 {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px;
}
.m-prod-h-sep { color: rgba(255,255,255,0.35); }
.m-prod-h-pill-cat {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px; font-weight: 700;
  background: rgba(201,168,76,0.18);
  color: #E8C975;
  border: 0.5px solid rgba(201,168,76,0.4);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-left: auto;
}
.m-prod-h-state {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.m-prod-h-state-supp  { background: rgba(239,68,68,0.18); color: #FCA5A5; border: 0.5px solid rgba(239,68,68,0.35); }
.m-prod-h-state-desac { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.7); border: 0.5px solid rgba(255,255,255,0.18); }
.m-prod-h-state-var   { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); border: 0.5px solid rgba(255,255,255,0.18); font-weight: 600; }
.m-prod-fiche-btn {
  display: inline-flex; align-items: center;
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 11px; font-weight: 600;
  border: 0.5px solid rgba(255,255,255,0.2);
  min-height: 26px;
}
.m-prod-fiche-btn:active { background: rgba(255,255,255,0.22); }
.m-prod-card-body {
  background: #fff;
  padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.m-prod-card-body:empty { display: none; }

/* ── CARDS LISTE UNIVERSELLES (Prestas / Recep / Retours) ─── */
.m-list-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid rgba(26,58,143,0.12);
  margin-bottom: 8px;
  display: flex; flex-direction: column;
  transition: transform .06s, box-shadow .12s;
}
.m-list-card:active {
  transform: scale(0.995);
  box-shadow: 0 2px 10px rgba(26,58,143,0.12);
}
.m-list-card-header {
  background: #1A3A8F;
  padding: 10px 12px;
}
.m-list-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.m-list-card-row + .m-list-card-row { margin-top: 4px; }
.m-list-card-row-left,
.m-list-card-row-right {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  flex-wrap: nowrap;
}
.m-list-card-row-left { flex: 1; min-width: 0; }
.m-list-card-row-right { flex-shrink: 0; }
.m-list-card-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 15px;
  color: #C9A84C;
  letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.m-list-card-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.m-list-card-info {
  font-size: 11px;
  color: rgba(255,255,255,0.40);
  white-space: nowrap;
  flex-shrink: 0;
}
.m-list-card-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-list-card-body {
  background: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.m-list-card-body:empty { display: none; }
.m-list-card-body-tags {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* Pills statut — Option 4 sémantique */
.m-pill-stat {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
  line-height: 1.3;
}
.m-pill-gold  { background: rgba(201,168,76,0.22); color: #C9A84C; border: 1px solid rgba(201,168,76,0.4); }
.m-pill-green { background: rgba(26,122,58,0.28);  color: #6fcf8a; border: 1px solid rgba(26,122,58,0.4); }
.m-pill-white { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.18); }
.m-pill-red   { background: rgba(198,40,40,0.22);  color: #f08080; border: 1px solid rgba(198,40,40,0.35); }
.m-pill-stat-sm {
  font-size: 9px;
  padding: 2px 6px;
}

/* Tags body */
.m-list-tag {
  font-size: 11px;
  color: rgba(26,58,143,0.6);
  background: #EEF2FB;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
}
.m-list-tag-sain   { background: rgba(26,122,58,0.10);  color: #1a7a3a; }
.m-list-tag-defaut { background: rgba(230,81,0,0.10);   color: #e65100; }
.m-list-tag-hs     { background: rgba(198,40,40,0.10);  color: #b91c1c; }

.m-list-card-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: 'Exo 2', sans-serif;
  font-weight: 600; font-size: 12px;
  white-space: nowrap;
  border: none;
  min-height: 32px;
}
.m-list-card-action-primary {
  background: #1A3A8F; color: #C9A84C;
  border: 1px solid #C9A84C;
}
.m-list-card-action-primary:active { background: #142E73; }
.m-list-card-action-outline {
  background: transparent; color: #C9A84C;
  border: 1px solid #C9A84C;
}
.m-list-card-action-outline:active { background: rgba(201,168,76,0.08); }

/* ── LISTES GÉNÉRIQUES ────────────────────────────────────── */
.m-list { display: flex; flex-direction: column; gap: 8px; }
.m-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-hint);
  font-size: 13px;
  background: var(--white);
  border-radius: 12px;
}

.m-card {
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .06s, box-shadow .12s;
  position: relative;
}
.m-card:active {
  transform: scale(0.995);
  box-shadow: 0 2px 10px rgba(26,58,143,0.12);
}
.m-card-row {
  display: flex; align-items: flex-start; gap: 10px; justify-content: space-between;
}
.m-card-main { flex: 1; min-width: 0; }
.m-card-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 16px;
  color: var(--navy); line-height: 1.2;
}
.m-card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.m-card-meta  { font-size: 11px; color: var(--text-hint); margin-top: 2px; }
.m-card-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 14px;
  color: var(--navy);
}
.m-card-ref-small {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Palette couleur dot (prestas) */
.m-palette-dot {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* Row avec chevron pour parent+variantes */
.m-card-parent {
  background: var(--white);
  border-left: 4px solid var(--gold);
}
.m-card-variant {
  background: #FAFBFF;
  margin-left: 14px;
  border-left: 2px solid var(--border);
}
.m-chevron {
  width: 14px; display: inline-flex; color: var(--navy);
  transition: transform .15s;
}
.m-chevron.expanded { transform: rotate(90deg); }

/* ── BADGES ───────────────────────────────────────────────── */
.m-badge {
  display: inline-block;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.m-badge-prep     { background: #FEF3C7; color: #92400E; }
.m-badge-appoint  { background: var(--orange-bg); color: var(--orange); }
.m-badge-prete    { background: var(--green-bg); color: var(--green); }
.m-badge-charg    { background: var(--blue-bg); color: var(--blue); }
.m-badge-chargee  { background: #C7D2FE; color: var(--navy); }
.m-badge-expediee { background: var(--purple-bg); color: var(--purple); }
.m-badge-attente  { background: var(--bg); color: var(--navy); }
.m-badge-brouillon{ background: var(--border-light); color: var(--text-muted); }
.m-badge-receptionnee{ background: var(--green-bg); color: var(--green); }
.m-badge-annulee  { background: var(--red-bg); color: var(--red); }
.m-badge-reliquat { background: #FEF3C7; color: #92400E; }
.m-badge-supprime { background: var(--red-bg); color: var(--red); }
.m-badge-desactive{ background: var(--border-light); color: var(--text-muted); }

/* Catégories F2/F4/T1/T2 */
.m-badge-cat { padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.m-badge-f2  { background: #E0E7FF; color: var(--navy); border: 1px solid var(--navy); }
.m-badge-f3  { background: #FEF3C7; color: #92400E; border: 1px solid #92400E; }
.m-badge-f4  { background: #FFF4D6; color: var(--gold); border: 1px solid var(--gold); }
.m-badge-t1  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.m-badge-t2  { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue); }
.m-badge-p1  { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple); }

/* Stock pills */
.m-stock-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 12px;
  white-space: nowrap;
}
.m-stock-ok    { background: var(--green-bg); color: var(--green); }
.m-stock-low   { background: var(--orange-bg); color: var(--orange); }
.m-stock-empty { background: var(--red-bg); color: var(--red); }

/* Banners */
.m-banner {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0;
}
.m-banner-warn   { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(230,81,0,0.25); }
.m-banner-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(185,28,28,0.25); }
.m-banner-info   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(30,64,175,0.25); }

/* ── BOTTOM NAV ───────────────────────────────────────────── */
#m-bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  z-index: 90;
}
.m-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  color: #fff;
  font-size: 11px; font-weight: 500;
  border-top: 2px solid transparent;
  user-select: none;
  transition: color .12s;
}
/* Pas d'override stroke/fill ici — chaque SVG inline porte son propre attribut
   stroke="currentColor" ou fill="currentColor" et hérite de .m-nav-item color. */
.m-nav-item.active {
  color: var(--gold);
  border-top-color: var(--gold);
}
.m-nav-item:active:not(.active) { color: rgba(255,255,255,0.75); }

/* ── BOTTOM SHEETS ────────────────────────────────────────── */
.m-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000;
  animation: m-fade .18s ease-out;
}
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }

.m-sheet {
  background: var(--white);
  width: 100%; max-width: 560px;
  border-radius: 16px 16px 0 0;
  padding: 12px 16px calc(18px + var(--safe-bottom));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: m-slide-up .22s ease-out;
}
.m-sheet-full {
  max-height: calc(100dvh - 10px);
  min-height: 70dvh;
}
@keyframes m-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.m-sheet-handle {
  width: 44px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 10px;
}
.m-sheet-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 18px;
  color: var(--navy);
  margin-bottom: 4px;
}
.m-sheet-sub {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 14px;
}
.m-sheet-section {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600; font-size: 11px;
  color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin: 14px 0 6px;
}
.m-sheet-close {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── CHAMPS ───────────────────────────────────────────────── */
.m-field { margin-bottom: 12px; }
.m-field-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--navy); margin-bottom: 6px;
}
.m-input, .m-select, .m-textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: var(--white); color: var(--text);
}
.m-input:focus, .m-select:focus, .m-textarea:focus { border-color: var(--navy); }
.m-textarea { min-height: 80px; resize: vertical; }
.m-input-numeric { text-align: center; font-weight: 600; }
.m-input-sm  { min-height: 40px; padding: 6px 10px; font-size: 14px; }

.m-field-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

/* Stepper */
.m-stepper {
  display: flex; align-items: center; gap: 8px;
}
.m-stepper-btn {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--bg); color: var(--navy);
  font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.m-stepper-btn:active { background: var(--border-light); transform: scale(0.96); }
.m-stepper-val {
  flex: 1; text-align: center;
  font-size: 20px; font-weight: 700; color: var(--navy);
}

/* Qty control lignes prestas (plus petit, inline) */
.m-qty-ctrl {
  display: inline-flex; align-items: center; gap: 6px;
}
.m-qty-btn {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--bg); color: var(--navy);
  font-size: 18px; font-weight: 700;
  border: 1px solid var(--border);
}
.m-qty-btn:active { background: var(--border-light); }
.m-qty-val {
  min-width: 40px; text-align: center;
  font-family: 'Exo 2', sans-serif;
  font-weight: 800; font-size: 18px;
  color: var(--navy);
  padding: 0 6px;
}
.m-qty-val.shake { color: var(--red); animation: m-shake .4s; }
@keyframes m-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* Radio group boutons */
.m-radio-group {
  display: flex; gap: 6px;
  background: var(--bg);
  border-radius: 10px; padding: 4px;
}
.m-radio-btn {
  flex: 1; min-height: 40px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: background .1s, color .1s;
}
.m-radio-btn.active {
  background: var(--white); color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.m-radio-btn.active.m-radio-sain    { color: var(--green); }
.m-radio-btn.active.m-radio-defaut  { color: var(--orange); }
.m-radio-btn.active.m-radio-hs      { color: var(--red); }

.m-sheet-actions {
  display: flex; gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.m-sheet-actions .m-btn-primary,
.m-sheet-actions .m-btn-secondary,
.m-sheet-actions .m-btn-danger,
.m-sheet-actions .m-btn-success,
.m-sheet-actions .m-btn-warn { flex: 1; }

/* Multi-select / radio-select (filtres avancés) */
.m-ms-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 60vh; overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 10px; padding: 6px;
}
.m-ms-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px; color: var(--text);
  min-height: 48px;
  cursor: pointer;
  transition: background .08s, color .08s;
  user-select: none;
}
.m-ms-item:active { background: var(--bg); }
.m-ms-item input[type=checkbox],
.m-ms-item input[type=radio] {
  width: 18px; height: 18px; flex-shrink: 0;
  accent-color: var(--navy);
}
.m-ms-lbl { flex: 1; }
.m-ms-check {
  margin-left: auto;
  color: var(--gold);
  font-weight: 800;
  font-size: 17px;
  display: none;
}
/* Variante sélectionnée — stylée via class JS + pseudo-classe :has pour redondance */
.m-ms-item.selected,
.m-ms-item:has(input:checked) {
  background: var(--navy);
  color: var(--gold);
}
.m-ms-item.selected .m-ms-lbl,
.m-ms-item:has(input:checked) .m-ms-lbl {
  color: var(--gold);
  font-weight: 600;
}
.m-ms-item.selected .m-ms-check,
.m-ms-item:has(input:checked) .m-ms-check {
  display: inline;
}
.m-ms-item.selected input[type=radio],
.m-ms-item:has(input:checked) input[type=radio] {
  accent-color: var(--gold);
}

/* Tags (dates) */
.m-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 4px 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--navy);
  margin: 2px 4px 2px 0;
}
.m-tag-del {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.08); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}

/* ── FICHES (plein écran) ─────────────────────────────────── */
.m-fiche-header {
  background: var(--navy); color: var(--white);
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
}
.m-fiche-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 800; font-size: 22px;
  color: var(--gold); letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 60px);
}
.m-fiche-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 17px; line-height: 1.2;
  max-width: calc(100% - 60px);
}
.m-fiche-sub {
  font-size: 12px; color: rgba(255,255,255,0.75);
  max-width: calc(100% - 60px);
}

.m-fiche-qr {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--white);
  padding: 3px;
  border-radius: 6px;
  width: 52px; height: 52px;
}
.m-fiche-qr img, .m-fiche-qr canvas { width: 100%; height: 100%; }

.m-fiche-nav {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.m-fiche-nav-btn {
  flex: 1; min-height: 40px;
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.m-fiche-nav-btn:disabled { opacity: 0.4; }

.m-fiche-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 10px;
}
.m-fiche-summary-cell {
  background: var(--white);
  border-radius: 8px; padding: 8px 10px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.m-fiche-summary-lbl {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px;
  font-weight: 600;
}
.m-fiche-summary-val {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 18px;
  color: var(--navy);
  margin-top: 2px;
}

.m-fiche-banner {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}
.m-fiche-banner-red    { background: var(--red-bg);    color: var(--red); }
.m-fiche-banner-orange { background: var(--orange-bg); color: var(--orange); }
.m-fiche-banner-grey   { background: var(--border-light); color: var(--text-muted); }

/* Tabs fiche */
.m-tabs {
  display: flex; gap: 0;
  background: var(--white);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border-light);
  margin-bottom: 10px;
}
.m-tab {
  flex: 1; min-height: 40px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.m-tab.active {
  background: var(--navy);
  color: var(--white);
}
.m-tab-content { display: none; }
.m-tab-content.active { display: block; }

/* Champ fiche produit (lecture) */
.m-field-block {
  background: var(--white);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border-light);
}
.m-field-block .m-field-k {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600;
}
.m-field-block .m-field-v {
  font-size: 14px; color: var(--text); font-weight: 500;
  margin-top: 1px;
}
.m-field-block .m-field-v.empty {
  color: var(--text-hint); font-style: italic;
}
.m-field-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.m-field-grid .m-field-block.full-col { grid-column: 1 / -1; }

/* Grille stock par cellule */
.m-cell-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.m-cell-box {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.m-cell-label {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 12px;
  color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.m-cell-vals {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center;
  margin-top: 4px;
}
.m-cv {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px; font-weight: 700;
}
.m-cv-sain   { background: var(--green-bg); color: var(--green); }
.m-cv-defaut { background: var(--orange-bg); color: var(--orange); }
.m-cv-hs     { background: var(--red-bg); color: var(--red); }

/* Lignes prestation/réception/retour */
.m-ligne {
  background: var(--white);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 6px;
}
.m-ligne-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.m-ligne-main { flex: 1; min-width: 0; }
.m-ligne-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 13px;
  color: var(--navy);
}
.m-ligne-lib { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.m-ligne-com { font-size: 11px; color: var(--text-hint); font-style: italic; margin-top: 1px; }
.m-ligne-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ===========================================================
   Cards lignes produits — fiche prestation (refonte visuelle)
   Header navy + body stepper centré + footer dispo/retirer
=========================================================== */
.m-pl-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}
.m-pl-card + .m-pl-card { margin-top: 8px; }

/* Header navy — 2 lignes (ref/nomCommercial puis libellé/cellule) */
.m-pl-head {
  background: #1A3A8F;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}
.m-pl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.m-pl-row-2 { margin-top: 4px; }
.m-pl-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #C9A84C;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.m-pl-com {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.m-pl-lib {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #fff;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-pl-cell {
  border: 1px solid rgba(201,168,76,0.6);
  color: #C9A84C;
  font-size: 10px;
  letter-spacing: 0.5px;
  border-radius: 4px;
  padding: 2px 8px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.m-pl-cell-empty { display: none; }

/* Body — stepper centré */
.m-pl-body {
  background: #fff;
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-pl-stp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.m-pl-stp-btn {
  width: min(34px, 8.5vw);
  height: min(34px, 8.5vw);
  border-radius: 50%;
  border: 1.5px solid #1A3A8F;
  background: #fff;
  color: #1A3A8F;
  font-size: min(17px, 4.5vw);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.12s ease, transform 0.08s ease;
}
.m-pl-stp-btn:hover  { background: rgba(26,58,143,0.06); }
.m-pl-stp-btn:active { transform: scale(0.92); }
.m-pl-stp-val {
  font-size: min(15px, 3.8vw);
  font-weight: 500;
  min-width: min(26px, 6vw);
  text-align: center;
  color: #1A3A8F;
}

/* Footer — dispo (gauche) + retirer (droite) */
.m-pl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
  border-top: 0.5px solid rgba(26,58,143,0.08);
  gap: 8px;
}
.m-pl-dispo {
  background: #eaf5ee;
  color: #1a7a3a;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.m-pl-dispo-empty {
  background: #fdecec;
  color: #c83232;
}
.m-pl-trash {
  background: transparent;
  border: none;
  color: rgba(26,58,143,0.4);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.m-pl-trash:active { color: rgba(26,58,143,0.7); }
.m-pl-trash svg { display: block; }

/* Le stepper sert de référent positionnel pour le badge +1 absolu. */
.m-pl-stp { position: relative; }

/* ---------- Feedback visuel scan / +1 ---------- */
@keyframes pl-header-flash {
  0%   { background: #1A3A8F; }
  30%  { background: #C9A84C; }
  100% { background: #1A3A8F; }
}
.m-pl-flash .m-pl-head {
  animation: pl-header-flash 0.9s ease;
}

@keyframes pl-val-pop {
  0%   { transform: scale(1);   color: #1A3A8F; }
  40%  { transform: scale(1.5); color: #1a7a3a; }
  100% { transform: scale(1);   color: #1A3A8F; }
}
.m-pl-stp-val.m-pl-val-pop {
  animation: pl-val-pop 0.7s ease;
  display: inline-block;        /* nécessaire pour que scale s'applique sur span */
  transform-origin: center center;
}

@keyframes pl-badge-fade {
  0%   { opacity: 1; transform: translateY(0); }
  60%  { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-10px); }
}
.m-pl-badge-plus {
  position: absolute;
  top: -2px;
  right: -22px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #1a7a3a;
  padding: 1px 6px;
  border-radius: 10px;
  pointer-events: none;
  animation: pl-badge-fade 1.4s ease forwards;
  white-space: nowrap;
}

/* ---- Variante rouge — décrément (bouton −) ---- */
@keyframes pl-header-flash-red {
  0%   { background: #1A3A8F; }
  30%  { background: #C62828; }
  100% { background: #1A3A8F; }
}
.m-pl-flash-red .m-pl-head {
  animation: pl-header-flash-red 0.9s ease;
}

@keyframes pl-val-pop-red {
  0%   { transform: scale(1);   color: #1A3A8F; }
  40%  { transform: scale(1.5); color: #C62828; }
  100% { transform: scale(1);   color: #1A3A8F; }
}
.m-pl-stp-val.m-pl-val-pop-red {
  animation: pl-val-pop-red 0.7s ease;
  display: inline-block;
  transform-origin: center center;
}

@keyframes pl-badge-fade-red {
  0%   { opacity: 1; transform: translateY(0); }
  60%  { opacity: 1; transform: translateY(6px); }
  100% { opacity: 0; transform: translateY(12px); }
}
.m-pl-badge-minus {
  position: absolute;
  bottom: -2px;
  right: -22px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #C62828;
  padding: 1px 6px;
  border-radius: 10px;
  pointer-events: none;
  animation: pl-badge-fade-red 1.4s ease forwards;
  white-space: nowrap;
}

/* ---------- Bottom sheet modale "Stock insuffisant" ----------
   Sheet bloquante (pas de tap-outside, pas de drag handle).
   Header navy + filet gold, body simple, footer plein-largeur. */
.m-sheet-modal {
  padding: 0 0 calc(0px + var(--safe-bottom)) 0;
  overflow: hidden;
  border-top: 3px solid #C9A84C;
}
.m-stock-alert {
  display: flex;
  flex-direction: column;
}
.m-stock-alert-head {
  background: #1A3A8F;
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #C9A84C;
}
.m-stock-alert-icon {
  font-size: 22px;
  color: #C9A84C;
  line-height: 1;
}
.m-stock-alert-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
}
.m-stock-alert-body {
  padding: 18px 20px;
  font-size: 14px;
  color: var(--navy);
  line-height: 1.45;
}
.m-stock-alert-body strong {
  font-weight: 600;
  color: var(--navy);
}
.m-stock-alert-foot {
  padding: 4px 14px 14px;
}


/* Actions sticky bas de fiche — barre fond blanc + ombre */
.m-fiche-actions {
  position: sticky;
  bottom: 0;
  margin: 14px -12px -24px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  z-index: 5;
}
/* Bouton Actions unique plein largeur (fiche produit) */
.m-actions-main {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--white);
  font-family: 'Exo 2', sans-serif;
  font-weight: 700; font-size: 15px;
  letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none;
}
.m-actions-main:active { background: var(--navy-hover); transform: scale(0.995); }
/* Grille multi-boutons (fiches presta/recep) */
.m-actions-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}

/* Items de la sheet d'actions (dot + label + chevron) */
.m-action-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--border-light);
  min-height: 56px;
  cursor: pointer;
  user-select: none;
}
.m-action-item:last-child { border-bottom: none; }
.m-action-item:active { background: var(--bg); }
.m-action-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; background: var(--navy);
}
.m-action-dot.neutral { background: var(--navy); }
.m-action-dot.warn    { background: var(--orange); }
.m-action-dot.success { background: var(--green); }
.m-action-dot.danger  { background: var(--red); }
.m-action-dot.gold    { background: var(--gold); }
.m-action-lbl { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.m-action-lbl.warn    { color: var(--orange); font-weight: 600; }
.m-action-lbl.success { color: var(--green);  font-weight: 600; }
.m-action-lbl.danger  { color: var(--red);    font-weight: 600; }
.m-action-chev {
  color: var(--text-hint);
  font-size: 20px; line-height: 1;
  flex-shrink: 0;
}
.m-action-divider {
  height: 8px;
  border-top: 1px solid var(--border-light);
  margin: 6px 0;
}
.m-actions-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.m-actions-grid .m-btn-primary,
.m-actions-grid .m-btn-secondary,
.m-actions-grid .m-btn-danger,
.m-actions-grid .m-btn-success,
.m-actions-grid .m-btn-warn {
  min-height: 44px;
  font-size: 12px; padding: 8px 10px;
}

/* Progress bar réception */
.m-progress {
  width: 100%; height: 6px;
  background: var(--border-light);
  border-radius: 3px; overflow: hidden;
}
.m-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
}

/* Combo picker (autocomplete produit) */
.m-combo { position: relative; }
.m-combo-panel {
  position: absolute; top: 100%; left: 0; right: 0;
  z-index: 50;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  max-height: 260px; overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.m-combo-panel .m-suggestion {
  border-bottom: 1px solid var(--border-light);
}

/* Wizard steps */
.m-wizard-steps {
  display: flex; gap: 6px;
  margin-bottom: 12px;
}
.m-wizard-dot {
  flex: 1; height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.m-wizard-dot.active { background: var(--navy); }
.m-wizard-dot.done   { background: var(--green); }

.m-option-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  text-align: left;
  margin-bottom: 8px;
}
.m-option-btn.selected {
  border-color: var(--navy);
  background: var(--bg);
}
.m-option-btn .sub {
  display: block;
  font-size: 11px; font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Tableau compact (onU wizard, retour stock) */
.m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.m-table th {
  text-align: left;
  padding: 6px 8px;
  background: var(--bg);
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 10px;
  border-bottom: 1px solid var(--border);
}
.m-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-light);
}
.m-table input, .m-table select {
  min-height: 36px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
}

/* Checkbox large */
.m-check-large {
  width: 24px; height: 24px;
}

/* Séparateur de groupe palette (vue regroupée prestations) */
.m-presta-group-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--navy);
  font-weight: 500;
  margin: 6px 0 2px;
  border-left: 3px solid var(--navy);
}
.m-presta-group-sep-none {
  background: var(--border-light);
  color: var(--text-muted);
  border-left-color: var(--text-hint);
}
.m-presta-group-sep .m-palette-dot {
  width: 16px; height: 16px;
}
.m-presta-group-cell {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.5);
  padding: 2px 8px;
  border-radius: 4px;
}
.m-presta-group-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.7);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Exo 2', sans-serif;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
}
.m-presta-group-sep-none .m-presta-group-badge {
  background: var(--white);
}

/* Palette info strip */
.m-palette-strip {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.m-palette-item {
  flex: 0 0 auto;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}

/* Card non conforme (réception) */
.m-nc-block {
  background: var(--orange-bg);
  border: 1px solid rgba(230,81,0,0.2);
  border-radius: 8px;
  padding: 8px;
  margin-top: 6px;
}

/* ──────────────────────────────────────────────────────────
   Sheet "Réception marchandises" — header sticky / body
   scrollable / footer sticky avec bouton Valider
────────────────────────────────────────────────────────── */
.m-sheet-flex {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.m-sheet-flex .m-sheet-handle { margin: 8px auto 4px; }

/* Header global — fond navy + filet bas gold */
.m-rec-march-header {
  padding: 4px 16px 12px;
  background: #1A3A8F;
  border-bottom: 3px solid #C9A84C;
  flex-shrink: 0;
  color: var(--white);
}
.m-sheet-flex .m-rec-march-header + * { /* placeholder */ }
.m-sheet-flex .m-sheet-handle {
  background: rgba(255,255,255,0.4);
}
.m-rec-march-header .m-sheet-title {
  color: var(--white);
  margin-bottom: 2px;
}
.m-rec-march-header .m-sheet-sub {
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
}

.m-rec-march-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
  background: var(--bg);
}
.m-rec-march-footer {
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

/* Barre de progression dans header — translucide blanche / fill gold */
.m-rmcard-progress {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
}
.m-rmcard-progress-fill {
  height: 100%;
  background: #C9A84C;
  border-radius: 4px;
  transition: width .15s ease;
}
.m-rmcard-counter {
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  color: #C9A84C;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Cartes lignes — non vérifiée par défaut */
.m-rmcard {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--white);
  overflow: hidden;
  transition: border-color .15s, background .15s, outline .15s;
}
.m-rmcard:last-child { margin-bottom: 0; }
.m-rmcard-header {
  background: #1A3A8F;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--white);
}
.m-rmcard-header-main { flex: 1; min-width: 0; }
.m-rmcard-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #C9A84C;
}
.m-rmcard-lib {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}
.m-rmcard-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}
.m-rmcard-btn-verifier {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'Exo 2', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  min-height: 36px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.m-rmcard-btn-verifier:active { background: rgba(255,255,255,0.25); }
.m-rmcard-body {
  padding: 12px;
  background: var(--white);
}
/* Inputs et selects dans le body : fond bg pâle pour contraste */
.m-rmcard-body .m-input,
.m-rmcard-body .m-select {
  background: #EEF2FB;
}

/* Cartes lignes — vérifiée */
.m-rmcard.checked {
  outline: 2px solid #C9A84C;
  outline-offset: -2px;
  border-color: transparent;
}
.m-rmcard.checked .m-rmcard-header {
  background: #152e72;
  border-bottom: 2px solid #C9A84C;
}
.m-rmcard.checked .m-rmcard-btn-verifier {
  background: rgba(201,168,76,0.2);
  border: 1.5px solid #C9A84C;
  color: #C9A84C;
}
.m-rmcard.checked .m-rmcard-body {
  opacity: 0.5;
  pointer-events: none;
}

/* Bandeau warning — quantité reçue > commandée */
.m-rmcard-warn {
  background: rgba(230,81,0,0.08);
  color: #E65100;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  margin-top: 6px;
  display: none;
}

/* Bouton Valider désactivé tant que toutes les lignes ne sont pas vérifiées */
.m-rmcard-validate-disabled {
  background: #dde3f0 !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
}
.m-rmcard-validate-disabled:active { transform: none; }

/* ============================================================
   Sheet "Retour matériel" — header navy + cards à steppers
============================================================ */

/* Header sticky */
.m-ret-header {
  background: #1A3A8F;
  border-bottom: 3px solid #C9A84C;
  padding: 6px 16px 12px;
  flex-shrink: 0;
  color: #fff;
}
.m-ret-header .m-sheet-handle {
  background: rgba(255,255,255,0.3);
  margin: 0 auto 10px;
}
.m-sheet-flex .m-ret-header + * { /* placeholder */ }
.m-ret-header-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.m-ret-header-titles { flex: 1; min-width: 0; }
.m-ret-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.m-ret-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}
.m-ret-close {
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
}
.m-ret-close:active { background: rgba(255,255,255,0.1); }

/* Body scrollable */
.m-ret-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
  background: #EEF2FB;
}

/* Bandeau progression */
.m-ret-progress {
  background: #fff;
  border: 0.5px solid rgba(26,58,143,0.12);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.m-ret-progress-info {
  font-size: 12px;
  color: #1A3A8F;
  margin-bottom: 6px;
}
.m-ret-progress-bar {
  background: #EEF2FB;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
}
.m-ret-progress-fill {
  height: 100%;
  background: #C9A84C;
  border-radius: 4px;
  transition: width .15s ease;
}

/* Bouton "↓ Retour complet" — raccourci pré-remplissage SAIN */
.m-ret-quickfill {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.5);
  color: #C9A84C;
  font-family: 'Exo 2', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.m-ret-quickfill:hover  { background: rgba(201,168,76,0.06); border-color: rgba(201,168,76,0.8); }
.m-ret-quickfill:active { transform: scale(0.99); }

/* Card retour */
.m-ret-card {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(26,58,143,0.08);
  transition: outline .15s ease;
}
.m-ret-card.complete {
  outline: 2px solid #C9A84C;
  outline-offset: -2px;
  border-color: transparent;
}
.m-ret-card.highlight { animation: m-ret-highlight 1s ease; }
@keyframes m-ret-highlight {
  0%   { box-shadow: 0 0 0 3px rgba(201,168,76,0.7); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,76,0);     }
}

/* Flash header retour — réutilise les keyframes pl-header-flash (gold) */
.m-ret-card-flash .m-ret-card-header {
  animation: pl-header-flash 0.9s ease;
}

/* Pulse ref produit — légère mise à l'échelle pour attirer l'œil */
@keyframes pl-ref-pulse {
  0%   { transform: scale(1);    }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1);    }
}
.m-ret-ref-pulse {
  display: inline-block;
  transform-origin: left center;
  animation: pl-ref-pulse 0.7s ease;
}

/* Alerte "Produit non trouvé" — overlay autonome au-dessus de la sheet retour
   (la sheet retour utilise z-index 1000, on monte à 1100 pour s'empiler dessus) */
.m-ret-alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,15,30,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1100;
  animation: m-fade .18s ease-out;
  padding-bottom: 0;
}
.m-ret-alert-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  border-top: 3px solid #C9A84C;
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
  animation: m-slide-up .22s ease-out;
}

/* Card header navy */
.m-ret-card-header {
  background: #1A3A8F;
  padding: 10px 12px;
  color: #fff;
}
.m-ret-card.complete .m-ret-card-header {
  background: #152e72;
  border-bottom: 2px solid #C9A84C;
}
.m-ret-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.m-ret-card-ref {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #C9A84C;
  letter-spacing: 0.5px;
}
.m-ret-pill-cell {
  border: 1px solid rgba(201,168,76,0.6);
  color: #C9A84C;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.m-ret-pill-deja {
  background: rgba(201,168,76,0.18);
  color: #C9A84C;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.m-ret-card-lib {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-ret-card-meta {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

/* Card body */
.m-ret-card-body {
  padding: 16px 12px 14px;
  background: #fff;
}

/* Steppers SAIN / DÉFAUT / HS */
.m-ret-steppers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}
.m-ret-stepper-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.m-ret-stepper-label {
  font-size: 11px;
  font-weight: 700;
  color: #1A3A8F;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.m-ret-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.m-ret-dot.sain   { background: #1a7a3a; }
.m-ret-dot.defaut { background: #C9A84C; }
.m-ret-dot.hs     { background: #C62828; }
.m-ret-stepper-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: min(6px, 1.5vw);
  width: 100%;
}
.m-ret-stepper-btn {
  width: min(34px, 8vw);
  height: min(34px, 8vw);
  border-radius: 50%;
  border: 1.5px solid #1A3A8F;
  background: #fff;
  color: #1A3A8F;
  font-family: 'Exo 2', sans-serif;
  font-size: min(18px, 4.5vw);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, transform .05s;
}
.m-ret-stepper-btn:active:not(.disabled):not(:disabled) {
  background: #EEF2FB;
  transform: scale(0.96);
}
.m-ret-stepper-btn.disabled,
.m-ret-stepper-btn:disabled {
  opacity: 0.4;
  border-color: #dde3f0;
  background: #EEF2FB;
  cursor: not-allowed;
}
.m-ret-stepper-val {
  font-size: min(17px, 4vw);
  font-weight: 500;
  color: var(--text-hint);
  min-width: min(26px, 6vw);
  text-align: center;
}
.m-ret-stepper-val.active-sain   { color: #1a7a3a; font-weight: 700; }
.m-ret-stepper-val.active-defaut { color: #C9A84C; font-weight: 700; }
.m-ret-stepper-val.active-hs     { color: #C62828; font-weight: 700; }

/* Bloc motif NC */
.m-ret-motif {
  background: #fdf3e0;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 10px 0 4px;
}
.m-ret-motif-label {
  font-size: 10px;
  color: #8a5a14;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  margin-bottom: 6px;
}
.m-ret-motif-input {
  width: 100%;
  border: 0.5px solid #C9A84C;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
}
.m-ret-motif-input:focus {
  outline: none;
  border-color: #C9A84C;
  box-shadow: 0 0 0 1px #C9A84C;
}

/* Footer card */
.m-ret-card-footer {
  border-top: 0.5px solid rgba(26,58,143,0.1);
  padding-top: 8px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(26,58,143,0.5);
}
.m-ret-complete-tag {
  color: #C9A84C;
  font-weight: 700;
}
.m-ret-progress-tag {
  color: #C9A84C;
  font-weight: 700;
}

/* Footer global avec boutons */
.m-ret-footer {
  background: #fff;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  border-top: 1px solid rgba(26,58,143,0.1);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-ret-validate {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  background: #1A3A8F;
  color: #C9A84C;
  border: 1px solid #C9A84C;
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  cursor: pointer;
  letter-spacing: 0.4px;
}
.m-ret-validate:active:not(.disabled):not(:disabled) {
  transform: scale(0.99);
}
.m-ret-validate.disabled,
.m-ret-validate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #dde3f0;
  color: var(--text-muted);
  border-color: #dde3f0;
}
.m-ret-cancel {
  background: transparent;
  color: rgba(26,58,143,0.6);
  border: 0.5px solid rgba(26,58,143,0.2);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}
.m-ret-cancel:active { background: rgba(26,58,143,0.05); }

/* Toggle switch (utilisé pour Non conforme) */
.m-switch {
  display: inline-block;
  position: relative;
  width: 44px; height: 24px;
  background: #dde3f0;
  border-radius: 12px;
  transition: background .15s ease;
  flex-shrink: 0;
  cursor: pointer;
  vertical-align: middle;
}
.m-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .18s ease;
}
.m-switch.checked { background: #E65100; }
.m-switch.checked::after { transform: translateX(20px); }

/* ── CHAMP SCAN INVISIBLE ─────────────────────────────────── */
#m-scan-input {
  position: fixed;
  top: -200px; left: 0;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
  border: none; background: transparent;
}

/* Divers */
.m-divider {
  height: 1px;
  background: var(--border-light);
  margin: 14px 0;
}
.m-sticky-rec {
  position: sticky; bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  margin: 8px -12px -24px; padding: 8px 12px;
}
.m-flex { display: flex; align-items: center; gap: 8px; }
.m-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-gap-6 { gap: 6px; }
.m-mt-8 { margin-top: 8px; }
.m-mt-12 { margin-top: 12px; }
.m-mb-8 { margin-bottom: 8px; }
.m-mb-12 { margin-bottom: 12px; }
.m-text-hint { color: var(--text-hint); font-style: italic; }
.m-text-right { text-align: right; }
.m-text-center { text-align: center; }
.m-nowrap { white-space: nowrap; }
.m-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
