/* Plateforme de commandes PGD — design épuré aux couleurs de Paris Gastronomy Distribution :
   fond gris clair, cartes blanches très arrondies, grands titres, recherche en pilule, boutons bleu nuit.
   Sur téléphone : barre d'onglets flottante en bas, listes en cartes, fenêtres qui montent du bas. */

/* ---------- police : Inter variable (graisses 100 à 900, optique adaptée aux grands titres) ---------- */
@font-face { font-family: "Inter"; src: url("../fonts/inter-variable-latin.4b73e2ff3024.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-variable-latin-ext.084b211fc382.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #1D1D1F; --ink2: #3A3A3C; --muted: #636366; --faint: #6E6E73; --line: #E0E0E6; --hair: #EDEDF0; --bg: #F5F5F7; --champ: #EFEFF3;
  --blue: #2C3784; --blue-deep: #1E2560; --blue-2: #4A54A3; --blue-soft: #E3E6F4; --blue-softer: #F5F6FB;
  --ok: #17663F; --ok-soft: #E3F3EA; --warn: #8A5300; --warn-soft: #FFF1D6; --err: #B3261E; --err-soft: #FCE8E6;
  --shadow: 0 1px 2px rgba(20,27,65,.04);
  --shadow-carte: 0 1px 2px rgba(20,27,65,.05), 0 10px 30px rgba(30,37,96,.08);
  --shadow-flottant: 0 2px 6px rgba(20,27,65,.06), 0 14px 36px rgba(30,37,96,.16);
  --anneau: 0 0 0 2px var(--blue), 0 0 0 6px rgba(44,55,132,.12);
  --haut: 68px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-width: 320px; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(74,84,163,.4); outline-offset: 2px; }
b, strong { font-weight: 700; }
h1, h2, h3 { font-family: "Inter", sans-serif; font-weight: 800; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.04em; }
h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .r { text-align: right; } .nw, .nowrap { white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lecteur { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m-seul { display: none; }

/* ---------- barre du haut ---------- */
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 12px; background: var(--blue-deep); color: #fff; font-weight: 600; transition: top .18s ease; }
.skip-link:focus { top: 12px; color: #fff; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1320px; height: var(--haut); margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; flex: none; text-decoration: none !important; border-radius: 12px; }
.brand img { height: 41px; width: auto; display: block; }
.onglets { display: flex; align-items: center; gap: 4px; min-width: 0; }
.onglets a { padding: 10px 16px; border-radius: 999px; color: var(--ink2); font-weight: 600; white-space: nowrap; text-decoration: none; transition: background .15s ease, color .15s ease; }
.onglets a:hover { background: var(--hair); color: var(--ink); }
.onglets a.on { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }
.droite { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.avatar.grand { width: 56px; height: 56px; font-size: 19px; }

/* menu du compte, ouvert depuis l'avatar */
.menu-compte { position: relative; }
.menu-compte summary { list-style: none; cursor: pointer; transition: box-shadow .15s ease; }
.menu-compte summary::-webkit-details-marker { display: none; }
.menu-compte summary:hover, .menu-compte[open] summary { box-shadow: 0 0 0 2px var(--blue-2); }
.menu-compte .menu { position: absolute; right: 0; top: 54px; z-index: 40; min-width: 290px; padding: 8px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-flottant); }
.menu-compte .menu-tete { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.menu-compte .menu a, .menu-compte .menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 0; background: none; color: var(--ink); font-size: 14.5px; font-weight: 500; cursor: pointer; text-decoration: none; }
.menu-compte .menu a:hover, .menu-compte .menu button:hover { background: var(--blue-soft); color: var(--blue-deep); }
.menu-compte form { margin: 0; }
.menu-compte .menu-pied { padding: 8px 12px 4px; margin-top: 4px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--faint); }
.menu-section-label { padding: 10px 12px 4px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fraicheur { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.fraicheur::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.fraicheur.vide::before { background: var(--warn); }

/* barre d'onglets flottante : seulement sur téléphone */
.barre-onglets { display: none; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease; }
.btn:hover { border-color: #C9CCD8; background: #FAFAFC; }
.btn:active { transform: scale(.98); }
.btn.primaire { border-color: transparent; background: var(--blue-deep); color: #fff; } .btn.primaire:hover { background: var(--blue); }
.btn.clair { border-color: transparent; background: var(--blue-soft); color: var(--blue-deep); } .btn.clair:hover { background: #D8DCF0; }
.btn.blanc { background: #fff; }
.btn.discret { border-color: transparent; background: transparent; color: var(--blue); padding: 0 12px; } .btn.discret:hover { background: var(--blue-soft); }
.btn.danger { border-color: transparent; background: transparent; color: var(--err); } .btn.danger:hover { background: var(--err-soft); }
.btn.rouge { border-color: transparent; background: var(--err); color: #fff; } .btn.rouge:hover { background: #8C1D17; }
.btn.petit { min-height: 36px; height: 36px; padding: 0 14px; font-size: 14px; }
.btn.large { width: 100%; height: 54px; border-radius: 16px; font-size: 16px; font-weight: 700; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: default; transform: none; }
.lien-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---------- champs : pleins et arrondis, comme sur la page de connexion ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin: 0 0 6px; }
input[type=text], input[type=search], input[type=date], input[type=number], input[type=password], input[type=email], input[type=tel], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; font: inherit; font-size: 15px; color: var(--ink); background: var(--champ); border: 0; border-radius: 12px; padding: 0 14px; outline: none; transition: background .15s, box-shadow .15s; }
select { padding-right: 36px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--champ) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%2348484A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
textarea { min-height: 76px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #86868B; opacity: 1; }
input:hover, select:hover, textarea:hover { background-color: #E8E8ED; }
input:focus, select:focus, textarea:focus { background-color: #fff; box-shadow: var(--anneau); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); cursor: default; }
.champ + .champ { margin-top: 14px; }
.champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Mot de passe : le petit œil affiche ou masque ce qui est tapé (static/js/mot-de-passe.js) */
.mdp { position: relative; }
.mdp input { padding-right: 52px; }
.mdp-oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.mdp-oeil:hover, .mdp-oeil[aria-pressed="true"] { color: var(--blue); background: var(--blue-soft); }
.mdp-oeil svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mdp-oeil[aria-pressed="false"] .oeil-ferme, .mdp-oeil[aria-pressed="true"] .oeil-ouvert { display: none; }
/* segments : des choix exclusifs, en rail gris (formulaires) ou en pastilles (filtres des listes) */
.segment { display: inline-flex; background: var(--champ); border-radius: 14px; padding: 4px; gap: 4px; }
/* le bouton radio caché reste dans sa pastille : sinon il échappe au défilement de la rangée et élargit la page */
.segment label { position: relative; margin: 0; flex: 1; }
.segment input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.segment span, .segment.boutons button { display: flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: none; font-size: 14.5px; font-weight: 600; color: var(--ink2); cursor: pointer; white-space: nowrap; }
.segment span:hover, .segment.boutons button:hover { color: var(--ink); }
.segment input:checked + span, .segment.boutons button.on { background: #fff; color: var(--blue-deep); box-shadow: 0 1px 3px rgba(20,27,65,.12); }
.segment input:focus-visible + span { box-shadow: var(--anneau); }
.outils .segment, .rg-portee .segment { background: none; padding: 0; gap: 8px; flex-wrap: wrap; }
.outils .segment span, .rg-portee .segment button { height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 500; }
.rg-portee .segment button { height: 34px; padding: 0 14px; font-size: 13.5px; }
.outils .segment input:checked + span, .rg-portee .segment.boutons button.on { border-color: transparent; background: var(--blue-deep); color: #fff; font-weight: 600; box-shadow: none; }
/* pastilles */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; background: var(--blue-soft); color: var(--blue-deep); white-space: nowrap; letter-spacing: 0; }
.pill.gris { background: #EDEDF0; color: #48484A; } .pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.err { background: var(--err-soft); color: #9B211A; }
.pill.frais { background: #E3EEFB; color: #1F4E8C; } .pill.sec { background: #FBF0DC; color: #7A4A00; } .pill.congele { background: #E2F4F7; color: #155E6B; } .pill.ambiant { background: #EAF4E3; color: #3F6322; } .pill.materiel { background: #EDEDF0; color: #48484A; }
mark { background: #FFEFA8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- pages ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 40px 32px 80px; }
.entete, .entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.entete .sub, .entete-page .sub { max-width: 780px; color: var(--muted); margin-top: 8px; font-size: 16px; line-height: 1.5; }
.entete > div:first-child, .entete-page > div:first-child { min-width: 0; }
.entete > .actions, .entete-page > .actions { flex: none; }
.carte, .card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); }
.card { padding: 24px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grille-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.retour { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.retour svg.i { width: 18px; height: 18px; }
.messages { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; transition: opacity .3s ease, transform .3s ease, max-height .3s ease; }
.messages li { padding: 14px 18px; border-radius: 16px; background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }
.messages li.error { background: var(--err-soft); color: var(--err); }
.messages li.success { background: var(--ok-soft); color: var(--ok); }
.messages li.warning { background: var(--warn-soft); color: var(--warn); }
.messages.message-expire { opacity: 0; transform: translateY(-6px); max-height: 0; margin: 0; overflow: hidden; }
.erreur-page p { max-width: 520px; margin: 4px auto 18px; line-height: 1.55; }

/* ---------- accueil ---------- */
.accueil { display: flex; flex-direction: column; gap: 32px; }
.accueil-date { margin: 0 0 6px; font-size: 17px; color: var(--muted); }
.accueil-tete h1 { font-size: 48px; }
.recherche-pilule { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 68px; padding: 10px 26px; border: 0; border-radius: 999px; background: #fff; box-shadow: var(--shadow-carte); color: var(--ink); text-align: left; cursor: pointer; transition: box-shadow .15s ease; }
.recherche-pilule:hover { box-shadow: 0 0 0 2px var(--blue-soft), var(--shadow-carte); }
.recherche-pilule svg.i { width: 24px; height: 24px; }
.rp-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-texte b { font-size: 17px; font-weight: 600; }
.rp-texte span { font-size: 14px; color: var(--muted); }
.recherche-pilule kbd, .champ-recherche kbd, .cf-aide kbd { font: 600 12.5px "Inter", sans-serif; color: var(--muted); padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.accueil-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.carte-action, .carte-info { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-height: 210px; padding: 28px; border: 0; border-radius: 28px; text-align: left; text-decoration: none !important; }
.carte-action { background: var(--blue-deep); color: #fff; cursor: pointer; transition: background .15s ease; }
.carte-action:hover { background: #252E72; }
.ca-texte { display: flex; flex-direction: column; gap: 8px; }
.ca-texte b { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.ca-texte span { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.8); }
.ca-bouton { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 999px; background: #fff; color: var(--blue-deep); font-weight: 700; }
.carte-info { background: #fff; color: var(--ink); box-shadow: var(--shadow); transition: box-shadow .15s ease; }
.carte-info:hover { box-shadow: var(--shadow-carte); }
.ci-titre { font-size: 16px; font-weight: 600; color: #48484A; }
.ci-valeur { display: flex; align-items: baseline; gap: 10px; font-size: 16px; color: var(--muted); }
.ci-valeur b { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--blue-deep); }
.ci-valeur b.ci-mot { font-size: 24px; letter-spacing: -.02em; color: var(--ink); }
.ci-detail { font-size: 14.5px; line-height: 1.45; color: var(--muted); margin-top: -12px; }
.ci-lien { font-size: 15px; font-weight: 700; color: var(--blue); }
.accueil-section { display: flex; flex-direction: column; gap: 14px; }
.accueil-section h2 { font-size: 24px; }
.section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-tete a { font-weight: 700; white-space: nowrap; }
.liste-cartes { border-radius: 24px; background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.ligne-carte { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 18px 24px; color: var(--ink); text-decoration: none !important; transition: background .15s ease; }
.ligne-carte + .ligne-carte { border-top: 1px solid var(--hair); }
.ligne-carte:hover { background: var(--blue-softer); }
.lc-titre { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lc-titre b { font-size: 16.5px; }
.lc-titre span { font-size: 14px; color: var(--muted); }
.lc-meta { flex: 0 1 260px; font-size: 14.5px; color: var(--muted); }
.lc-montant { flex: 0 0 110px; text-align: right; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lc-montant.barre { color: var(--faint); text-decoration: line-through; }
.ligne-carte > svg.i { color: var(--faint); width: 20px; height: 20px; }
.raccourcis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.raccourci { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: #fff; color: var(--ink); font-weight: 600; text-decoration: none !important; box-shadow: var(--shadow); transition: box-shadow .15s ease; }
.raccourci:hover { box-shadow: var(--shadow-carte); }
.r-ico { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-deep); }

/* ---------- mon compte ---------- */
.compte-hub { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.hub-bandeau { padding: 36px 32px 88px; border-radius: 28px; background: var(--blue-deep); }
.hub-bandeau h1 { color: #fff; }
.hub-profil { display: flex; align-items: center; gap: 14px; margin: -88px 16px 0; padding: 18px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-carte); }
.hub-qui { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-qui b { font-size: 18px; }
.hub-qui span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.hub-groupe { display: flex; flex-direction: column; gap: 8px; }
.hub-groupe h2 { margin: 0 0 2px 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #48484A; }
.hub-liste { border-radius: 22px; background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.hub-ligne { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none !important; transition: background .15s ease; }
.hub-ligne + .hub-ligne { border-top: 1px solid var(--hair); }
a.hub-ligne:hover { background: var(--blue-softer); }
.hub-ligne > svg.i { width: 22px; height: 22px; }
.hub-ligne > svg.i:last-child { width: 18px; height: 18px; color: var(--faint); }
.hub-libelle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 16px; font-weight: 600; }
.hub-libelle small { font-size: 13px; font-weight: 400; color: var(--muted); }
.hub-sortie { margin: 0; }
.hub-sortie button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; border: 0; border-radius: 18px; background: #fff; color: var(--err); font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.hub-sortie button:hover { background: var(--err-soft); }
.hub-version { margin: 0; text-align: center; font-size: 13px; color: var(--faint); }

/* ---------- listes : recherche en pilule, filtres, tableau ---------- */
.outils { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.champ-recherche { position: relative; flex: 1 1 100%; min-width: 260px; }
.champ-recherche input { height: 58px; padding: 0 56px 0 54px; font-size: 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-carte); }
.champ-recherche input:hover { background: #fff; }
.champ-recherche input:focus { box-shadow: var(--anneau), var(--shadow-carte); }
.champ-recherche > svg { position: absolute; left: 21px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.champ-recherche kbd { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.champ-recherche input:focus ~ kbd, .champ-recherche input:not(:placeholder-shown) ~ kbd { display: none; }
select.filtre { height: 42px; min-height: 42px; width: auto; max-width: 260px; padding: 0 38px 0 16px; border: 1px solid var(--line); border-radius: 999px; background-color: #fff; font-size: 15px; }
select.filtre:hover { border-color: #C9CCD8; background-color: #fff; }
select.filtre.actif { border-color: transparent; background-color: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }
.reinit { font-size: 15px; font-weight: 600; white-space: nowrap; margin-left: 4px; }
.reinit[hidden] { display: none; }
.barre-res { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; margin: 0 4px 10px; font-size: 14px; color: var(--muted); }
.barre-res.bas { margin: 12px 4px 0; }
.barre-res b { color: var(--ink); font-weight: 700; }
.indice { color: var(--faint); margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.pager { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pager .pos { margin-right: 6px; white-space: nowrap; }
.pager .pg { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink2); text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.pager a.pg:hover { border-color: transparent; background: var(--blue-soft); color: var(--blue-deep); }
.pager .pg.off { opacity: .35; }
#resultats.charge, #cat-resultats.charge { opacity: .55; transition: opacity .15s; }
.vide-etat { text-align: center; padding: 56px 20px; color: var(--muted); border: 1.5px dashed var(--line); background: rgba(255,255,255,.7); }
.vide-etat b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* « clip » et non « auto » : l'en-tête du tableau reste collé sous la barre du haut pendant le défilement.
   Si le tableau ne tient pas dans la carte (écran étroit, texte très long), app.js ajoute « defile » :
   il défile alors horizontalement au lieu d'être coupé (l'en-tête ne reste plus collé). */
.carte-table { background: #fff; border-radius: 24px; box-shadow: var(--shadow); overflow: clip; }
@media (min-width: 761px) { .carte-table.defile { overflow-x: auto; } }
table.liste { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
table.liste th { position: sticky; top: var(--haut); z-index: 2; background: #fff; text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 16px 14px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
table.liste th:first-child, table.liste td:first-child { padding-left: 24px; }
table.liste th:last-child, table.liste td:last-child { padding-right: 22px; }
table.liste th.r { text-align: right; }
table.liste th a.tri { color: inherit; text-decoration: none; }
table.liste th a.tri:hover { color: var(--ink2); }
table.liste th.trie, table.liste th.trie a.tri { color: var(--blue-deep); }
table.liste th .fl { display: inline-block; width: 10px; margin-left: 3px; font-size: 11px; }
table.liste td { padding: 15px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.liste tbody tr[data-fiche-url], table.liste tbody tr[data-lien] { cursor: pointer; }
table.liste tbody tr:hover td { background: var(--blue-softer); }
table.liste tbody tr.sel td { background: var(--blue-soft); }
table.liste tbody tr:last-child td { border-bottom: 0; }
.c-code { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.c-fort { color: var(--ink); }
.c-titre { font-weight: 700; }
.c-sous { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.c-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-mute { color: var(--muted); }
/* Codes, noms, e-mails, références saisies : un mot très long (« TRANSPORTS/LOGISTIQUE », un e-mail) passe à la ligne
   au lieu d'élargir le tableau au-delà de sa carte. La largeur minimale garde les mots courts entiers. */
.c-libre { overflow-wrap: anywhere; white-space: normal; }
@media (min-width: 761px) { .c-libre { min-width: 120px; } }
.lien { color: var(--blue); }
.lien-ligne { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; color: var(--faint); text-decoration: none !important; }
.lien-ligne:hover, tr:hover .lien-ligne { background: var(--blue-soft); color: var(--blue-deep); }
.defile-x { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 12px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.cliquable { cursor: pointer; }
table.data tr.cliquable:hover td { background: var(--blue-softer); }
table.data .num { font-variant-numeric: tabular-nums; }
table.data th.r { text-align: right; }
/* Colonnes secondaires : masquées quand la place manque (.opt sur petit ordinateur, .opt2 sur tablette) */
@media (max-width: 1240px) { .opt { display: none; } }
@media (max-width: 1000px) { .opt2 { display: none; } }
/* Liste des commandes : beaucoup de colonnes, les titres en deux mots (« Votre commande ») passent sur deux lignes */
table.liste.commandes th { white-space: normal; }

/* ---------- fiche (panneau latéral) ---------- */
#tiroir { position: fixed; top: var(--haut); right: 0; bottom: 0; width: 520px; max-width: 100%; z-index: 40; background: #fff; border-radius: 24px 0 0 0; box-shadow: -14px 0 44px rgba(30,37,96,.13); transform: translateX(105%); transition: transform .22s ease; overflow: auto; overscroll-behavior: contain; }
#tiroir.ouvert { transform: none; }
/* Seule la ligne du haut (référence, fermer) reste visible quand la fiche défile : l'en-tête entier prenait
   le tiers de l'écran */
.t-nav { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 14px 26px 8px; background: #fff; }
#tiroir.defile .t-nav { box-shadow: 0 1px 0 var(--hair); }
.fiche-page .t-nav { position: static; border-radius: 24px 24px 0 0; }
.t-tete { padding: 0 26px 18px; border-bottom: 1px solid var(--hair); }
.t-sur { font-size: 13px; color: var(--muted); }
.t-nav .boutons { display: flex; gap: 6px; margin-left: auto; }
.fiche-page .t-nav .boutons, .fiche-page [data-action=fiche-retour] { display: none; }
.rond { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #F2F2F5; color: var(--ink2); cursor: pointer; font-size: 18px; line-height: 1; text-decoration: none !important; }
.rond:hover { background: var(--blue-soft); color: var(--blue-deep); }
.rond[hidden] { display: none; }

/* Écran de chargement : import en cours */
.chargement { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(20, 27, 65, .35); }
.chargement[hidden] { display: none; }
.chargement-carte { background: var(--bg); color: var(--ink); border-radius: 14px; padding: 22px 28px; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-flottant); }
.chargement-carte p { margin: 0; font-size: 15px; }
.chargement-roue { width: 22px; height: 22px; flex: none; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%;
  animation: chargement-tourne .9s linear infinite; }
@keyframes chargement-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chargement-roue { animation-duration: 3s; } }

/* Formulaire non envoyé (jeton CSRF) : page explicative */
.csrf { max-width: 560px; margin: 24px auto; text-align: left; padding: 32px 28px; }
.csrf-icone { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-soft); display: grid; place-items: center; margin-bottom: 16px; }
.csrf-icone svg { width: 30px; height: 30px; fill: none; stroke: var(--blue); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.csrf-titre { font-size: 22px; margin-bottom: 10px; }
.csrf p { color: var(--ink2); line-height: 1.55; margin: 0 0 14px; }
.csrf-etapes { margin: 0 0 22px; padding-left: 22px; color: var(--ink2); line-height: 1.6; }
.csrf-etapes li + li { margin-top: 4px; }
.csrf-actions { gap: 10px; flex-wrap: wrap; }
.csrf-detail { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); word-break: break-word; }
.t-tete h2 { font-size: 22px; }
.t-sous { color: var(--muted); margin-top: 3px; }
.t-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.t-prix { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.t-prix .prix { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--blue-deep); }
.t-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.t-actions form { margin: 0; }
.t-corps { padding: 4px 26px 36px; }
.t-sec { margin-top: 22px; }
.t-sec h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: 10px; }
.t-sec dl { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14.5px; }
.t-sec dt { color: var(--muted); }
.t-sec dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.t-cmds { list-style: none; margin: 0; padding: 0; }
.t-cmds li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14.5px; }
.t-note { margin: 12px 0 0; font-size: 13px; color: var(--faint); }
.t-ajout { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.t-ajout input { width: 84px; text-align: right; border-radius: 999px; }

/* ---------- fenêtres (nouvelle commande, recherche, livraison) ---------- */
dialog.dlg { width: min(640px, calc(100vw - 32px)); max-height: min(700px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0; border: 0; border-radius: 26px; box-shadow: 0 30px 90px rgba(30,37,96,.3); color: var(--ink); overflow: auto; }
/* Livraison : en-tête et pied fixes, seul le formulaire défile. La fenêtre elle-même ne défile jamais (clip),
   même quand le téléphone ramène un champ à l'écran ; display:flex seulement ouverte, sinon elle resterait visible. */
#dlg-infos[open] { display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
#dlg-infos .dlg-tete, #dlg-infos .dlg-pied { flex-shrink: 0; }
#dlg-infos .dlg-tete { padding-bottom: 16px; border-bottom: 1px solid var(--hair); }
#dlg-infos .dlg-defile { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
dialog.dlg::backdrop { background: rgba(17,19,40,.42); backdrop-filter: blur(2px); }
/* Confirmation des actions importantes (supprimer, émettre, annuler, remplacer), à la place de la fenêtre du
   navigateur : au centre, titre, explication, récapitulatif du panier, boutons qui nomment l'action */
dialog.dlg-confirmer { width: min(460px, calc(100vw - 32px)); margin: auto; overflow: visible; }
dialog.dlg-confirmer[open] { animation: confirmer-ouvre .2s cubic-bezier(.2,.9,.3,1.1); }
@keyframes confirmer-ouvre { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.cf-corps { display: grid; gap: 18px; padding: 28px 28px 24px; }
.cf-tete { display: flex; gap: 16px; align-items: flex-start; }
.cf-icone { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--blue-soft); color: var(--blue-deep); }
.cf-icone svg.i { width: 24px; height: 24px; }
.dlg-confirmer.danger .cf-icone { background: var(--err-soft); color: var(--err); }
.cf-tete h2 { margin-top: 4px; font-size: 22px; }
.cf-tete p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.cf-recap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--blue-softer); font-size: 14px; }
.cf-recap[hidden] { display: none; }
.cf-recap dt { color: var(--muted); }
.cf-recap dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cf-boutons { display: flex; justify-content: flex-end; gap: 10px; }
.cf-boutons .btn { height: 48px; min-height: 48px; padding: 0 22px; border-radius: 14px; }
.cf-aide { margin: -6px 0 0; font-size: 12.5px; color: var(--faint); text-align: right; }
.dlg-tete { padding: 26px 26px 6px; }
.dlg-tete h2 { font-size: 24px; }
.dlg-tete p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.dlg .champ-recherche { margin: 16px 26px 0; width: auto; }
.dlg .champ-recherche input { height: 52px; background: var(--champ); box-shadow: none; }
.dlg .champ-recherche input:focus { background: #fff; box-shadow: var(--anneau); }
.dlg-liste { list-style: none; margin: 12px 0 0; padding: 0 14px; max-height: 370px; overflow: auto; }
.dlg-liste .titre-l { padding: 8px 12px 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.dlg-liste li.choix { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 14px; cursor: pointer; }
.dlg-liste li.choix.on, .dlg-liste li.choix:hover { background: var(--blue-soft); }
.dlg-liste .code { font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.dlg-liste .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-liste .nom small { display: block; color: var(--muted); font-size: 13px; }
.dlg-liste .vide { padding: 28px 12px; text-align: center; color: var(--muted); }
.dlg-pied { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 26px 18px; margin-top: 8px; border-top: 1px solid var(--hair); background: #fff; font-size: 13px; color: var(--faint); }
.dlg-pied .btn.primaire { min-width: 120px; }
#etat-save { color: var(--ok); font-weight: 600; }
.dlg-form { display: grid; gap: 14px; padding: 12px 26px 8px; }
.dlg-form .champ + .champ { margin-top: 0; }
.dlg-form .segment { display: flex; }
fieldset.dlg-form { border: 0; margin: 0; min-width: 0; }
fieldset.dlg-form:disabled input, fieldset.dlg-form:disabled select, fieldset.dlg-form:disabled textarea { color: var(--muted); }
.plus-infos summary { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--ink); font-size: 15px; font-weight: 600; list-style-position: inside; }
.plus-infos[open] summary { margin-bottom: 14px; }
dialog.dlg-rg { width: min(760px, calc(100vw - 32px)); margin-top: 9vh; }
.rg-champ { margin: 20px 22px 0 !important; }
.rg-portee { display: flex; align-items: center; gap: 12px; margin: 14px 24px 4px; font-size: 14px; color: var(--muted); }
.rg-res { max-height: min(460px, calc(100vh - 330px)); overflow: auto; padding: 4px 14px; }
.rg-groupe { padding-top: 8px; }
.rg-titre { display: flex; justify-content: space-between; padding: 6px 12px 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-deep); font-weight: 700; }
.rg-titre span { color: var(--faint); letter-spacing: 0; text-transform: none; font-weight: 500; font-size: 13px; }
.rg-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; cursor: pointer; }
.rg-item.on, .rg-item:hover { background: var(--blue-soft); }
.rg-item .code { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-item .nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-item .nom small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.rg-item.rg-tous { display: block; color: var(--blue); font-weight: 600; font-size: 14px; }
.rg-aucun { padding: 6px 12px 10px; color: var(--faint); font-size: 14px; }
.rg-vide { padding: 36px 20px; text-align: center; color: var(--muted); }
.rg-vide span { font-size: 13px; color: var(--faint); }

/* ---------- page Ajouter ---------- */
.choix-type { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.choix-type .choix { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; border-radius: 24px; border: 2px solid transparent; background: #fff; box-shadow: var(--shadow); color: inherit; text-decoration: none !important; transition: border-color .15s, background .15s; }
.choix-type .choix:hover { border-color: var(--blue-soft); }
.choix-type .choix.on { border-color: var(--blue-deep); background: var(--blue-softer); }
.choix-type .ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-deep); flex: none; }
.choix-type .choix.on .ico { background: var(--blue-deep); color: #fff; }
.choix-type .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choix-type b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.choix-type .d { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.choix-type .coche { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--blue-deep); color: #fff; font-size: 12px; display: none; place-items: center; }
.choix-type .choix.on .coche { display: grid; }
.invite { padding: 48px 20px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 24px; }
.form-carte { background: #fff; border-radius: 24px; box-shadow: var(--shadow); }
.form-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 24px 28px 4px; }
.form-tete h2 { font-size: 22px; }
.form-tete .muted { font-size: 14px; }
.f-section { padding: 18px 28px 4px; }
.f-section + .f-section { border-top: 1px solid var(--hair); margin-top: 14px; padding-top: 22px; }
.f-section h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: 14px; }
.f-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; }
.f-champ.l2 { grid-column: span 2; } .f-champ.l3 { grid-column: span 3; } .f-champ.l4 { grid-column: 1 / -1; }
.f-champ label { font-size: 13px; color: var(--ink2); font-weight: 600; }
.req { color: var(--err); font-weight: 700; }
.maj { text-transform: uppercase; } .maj::placeholder { text-transform: none; }
.f-input .segment { display: flex; width: 100%; }
.f-input .segment span { padding: 0 6px; }
.f-aide { font-size: 13px; color: var(--muted); margin-top: 6px; }
.f-err { font-size: 13px; color: var(--err); margin-top: 6px; }
.f-champ.erreur input, .f-champ.erreur select, .f-champ.erreur textarea { background-color: #fff; box-shadow: 0 0 0 2px var(--err); }
.f-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink); font-weight: 500; margin: 0; cursor: pointer; }
.f-check input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--blue-deep); }
.form-pied { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 28px; margin-top: 22px; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--hair); border-radius: 0 0 24px 24px; box-shadow: 0 -8px 20px rgba(30,37,96,.04); }
.form-pied .muted { font-size: 13px; }
.succes { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 14px 16px 14px 20px; border-radius: 16px; background: var(--ok-soft); color: var(--ok); font-size: 15px; }
.succes .actions { margin-left: auto; }
.erreurs-resume { margin: 14px 28px 0; padding: 12px 16px; border-radius: 14px; background: var(--err-soft); color: var(--err); font-size: 14px; font-weight: 600; }
.ajouts { margin-top: 28px; }

/* ---------- commande ouverte : en-tête, étapes, catalogue, panier ---------- */
.cmd-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.cmd-tete h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cmd-tete h1 .pill { font-size: 13px; letter-spacing: 0; }
.cmd-tete > div:first-child { min-width: 0; } .cmd-tete > .actions { flex: none; }
.cmd-client { color: var(--muted); margin-top: 8px; font-size: 16px; }
.cmd-client a { font-weight: 600; }
.bandeau-info { margin: 16px 0 0; padding: 13px 18px; border-radius: 16px; background: var(--blue-soft); color: var(--blue-deep); font-size: 14.5px; line-height: 1.5; }
.bandeau-info.ok { background: var(--ok-soft); color: var(--ok); }
.bandeau-info.err { background: var(--err-soft); color: var(--err); }
.bandeau-info a { font-weight: 700; }
.etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 24px; }
.etape { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; padding: 32px 20px 18px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.etape::before { content: ""; position: absolute; left: 20px; right: 20px; top: 16px; height: 5px; border-radius: 999px; background: #DADCE6; }
.etape.faite::before { background: var(--blue-deep); }
.etape .num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--blue-deep); color: var(--blue-deep); font-weight: 800; font-size: 14px; }
.etape.faite .num { background: var(--blue-deep); color: #fff; }
.et-corps { flex: 1 1 150px; min-width: 0; }
.et-corps b { display: block; font-size: 15.5px; }
.et-corps span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 13.5px; line-height: 1.4; color: var(--muted); overflow: hidden; }
.etape .btn, .etape form, .etape .lien-mini { flex: none; margin: 0 0 0 auto; }
.etape .lien-mini + form { margin-left: 0; }
.cmd-grille { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
/* container-type : le tableau du catalogue s'adapte à la largeur du catalogue, pas à celle de l'écran */
.cmd-catalogue { padding: 24px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); min-width: 0; container-type: inline-size; }
.cat-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cat-tete h2 { font-size: 24px; }
.cat-aide { font-size: 14px; color: var(--muted); }
.cmd-catalogue .champ-recherche input { background: var(--champ); box-shadow: none; height: 54px; }
.cmd-catalogue .champ-recherche input:focus { background: #fff; box-shadow: var(--anneau); }
.cmd-catalogue select.filtre { flex: 1 1 140px; min-width: 0; max-width: 220px; }
.cmd-catalogue .carte-table { box-shadow: none; border-radius: 0; }
.cmd-catalogue table.liste th:first-child, .cmd-catalogue table.liste td:first-child { padding-left: 4px; }
.cmd-catalogue table.liste th:last-child, .cmd-catalogue table.liste td:last-child { padding-right: 4px; }
table.catalogue tbody tr.au-panier td { background: var(--blue-softer); }
/* Catalogue étroit (panier à côté, sur un petit ordinateur) : la référence passe sous la désignation */
.ref-sous { display: none; }
@container (max-width: 680px) {
  table.liste.catalogue th:first-child, table.liste.catalogue td.c-code { display: none; }
  table.liste.catalogue .ref-sous { display: inline; }
}
@media (min-width: 761px) { @container (max-width: 680px) {
  table.liste.catalogue th:nth-child(2), table.liste.catalogue td.m-titre { padding-left: 4px; }
} }
.c-ajout { width: 1%; white-space: nowrap; text-align: right; }
.c-ajout .q-ajout { width: 64px; min-height: 42px; height: 42px; text-align: right; padding: 0 10px; margin: 0 6px 0 0; }
/* Unité de commande : colis, pièce ou poids */
select.u-ajout, select.u-fiche, select.pl-u { width: auto; }
.c-ajout .u-ajout { min-height: 42px; height: 42px; padding: 0 30px 0 12px; margin-right: 6px; font-size: 14px; background-position: right 11px center; }
.c-ajout .btn { height: 42px; min-height: 42px; border-radius: 12px; }
.t-ajout .u-fiche { padding: 0 32px 0 14px; border-radius: 999px; }
select.pl-u { min-height: 36px; height: 36px; min-width: 0; padding: 0 28px 0 12px; border-radius: 999px; font-size: 14px; color: var(--ink2); background-color: #fff; background-position: right 10px center; }
/* « ✓ 2 pièces » au-dessus de la saisie : la colonne « Ajouter » reste étroite */
.dans-panier { display: block; margin: 0 2px 6px; font-size: 13px; font-weight: 700; color: var(--ok); }
.lien-fiche { color: var(--ink); cursor: pointer; }
.lien-fiche:hover { color: var(--blue); }
.panier { position: sticky; top: calc(var(--haut) + 20px); display: flex; flex-direction: column; max-height: calc(100vh - var(--haut) - 40px); padding: 0; overflow: hidden; border-radius: 26px; box-shadow: var(--shadow-carte); }
.pan-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 22px 22px 12px; }
.pan-tete h2 { font-size: 24px; }
.pan-tete .muted { font-size: 14px; }
.pan-corps { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 0 8px; }
.pan-vide { padding: 48px 26px; text-align: center; color: var(--muted); }
.pan-vide svg { width: 36px; height: 36px; fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; margin: 0 auto 10px; }
.pan-vide b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.pan-groupe { padding-top: 6px; }
.pan-four { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 22px 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #48484A; font-weight: 700; }
.lien-mini { border: 0; background: none; color: var(--blue); font: 600 13.5px "Inter", sans-serif; cursor: pointer; padding: 4px 8px; border-radius: 8px; text-transform: none; letter-spacing: 0; white-space: nowrap; text-decoration: none !important; }
.lien-mini:hover { background: var(--blue-soft); }
.pan-ligne { margin: 0 14px 8px; padding: 14px; border-radius: 18px; background: var(--blue-softer); }
.pan-ligne.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--blue-soft); } to { background: var(--blue-softer); } }
.pl-haut { display: flex; gap: 8px; align-items: flex-start; }
.pl-des { flex: 1; min-width: 0; }
.pl-des b { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.pl-des span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.x { flex: none; display: grid; place-items: center; border: 0; background: #fff; color: #48484A; font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.x:hover { background: var(--err-soft); color: var(--err); }
.pl-sans-prix { font-style: normal; color: var(--warn); font-weight: 600; }
/* « Prix, colis… » suit le prix sur la ligne du dessous de la désignation ; quantité, unité et total tiennent
   ainsi sur une ligne, et passent à la ligne plutôt que d'écraser la quantité (panier étroit, gros montant) */
.pl-des .lien-mini { margin-left: 2px; padding: 1px 6px; font-size: 13px; }
.pl-bas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pl-bas > .stepper, .pl-bas > .pl-u { flex: none; }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; overflow: hidden; height: 40px; background: #fff; }
.stepper button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 18px; font-weight: 600; line-height: 1; cursor: pointer; color: var(--ink); }
.stepper button:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue-deep); }
.stepper button:disabled { color: #C7C7CC; cursor: default; }
.stepper input { width: 52px; min-height: 40px; height: 40px; border-radius: 0; text-align: center; padding: 0 4px; background: #fff; font-variant-numeric: tabular-nums; font-weight: 700; }
.stepper input:hover { background: #fff; }
.stepper input:focus { box-shadow: none; background: var(--blue-softer); }
.pl-u { color: var(--muted); font-size: 13.5px; min-width: 34px; }
.pl-total { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 16px; white-space: nowrap; }
.pl-q { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.pl-meta-court { font-size: 13px; color: var(--faint); }
.pl-detail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding: 12px; border-radius: 14px; background: #fff; }
.pl-detail[hidden] { display: none; }
.pl-detail label { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; margin: 0; }
.pl-detail input { min-height: 38px; height: 38px; padding: 0 10px; text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pl-detail input.manquant { background: var(--warn-soft); box-shadow: 0 0 0 2px #E3A33B; }
.pl-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--faint); }
.pan-pied { border-top: 1px solid var(--hair); padding: 16px 22px 22px; background: #fff; }
.pan-pied form { margin: 0; }
.pan-kv { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); padding: 3px 0; }
.pan-kv b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pan-kv.alerte, .pan-kv.alerte b { color: var(--warn); }
.pan-total { display: flex; justify-content: space-between; align-items: flex-end; margin: 10px 0 16px; padding-top: 14px; border-top: 1px solid var(--hair); }
.pan-total span { font-size: 16px; color: var(--ink); font-weight: 700; }
.pan-total small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.pan-total b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
.pan-pied .btn + .btn, .pan-pied form + .btn { margin-top: 10px; }
.pan-barre { display: none; }
.cmd-documents { padding: 24px; }
.cmd-documents h2 { font-size: 24px; margin-bottom: 4px; }
.cmd-documents .muted { margin: 0 0 14px; }
.cmd-documents .small { margin: 14px 0 0; }
.doc-liens { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.doc-lien { display: block; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.doc-lien:hover { border-color: transparent; background: var(--blue-soft); }
.doc-lien b { display: block; color: var(--blue-deep); }
.doc-lien span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 16px; font-weight: 600; font-size: 14.5px; transition: all .25s; pointer-events: none; z-index: 80; max-width: min(640px, calc(100vw - 32px)); }
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- choix du client (page de secours) ---------- */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 18px; }
.client-carte { display: block; width: 100%; text-align: left; border: 2px solid transparent; font: inherit; color: inherit; cursor: pointer; }
.client-carte:hover { border-color: var(--blue-soft); }
.client-carte .haut { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.client-carte .code { font-weight: 700; font-size: 16px; }
.client-carte .nom { color: var(--ink2); margin-top: 3px; }
.client-carte .details { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.recherche-barre { position: relative; }
.recherche-barre input { padding-left: 46px; height: 52px; font-size: 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-carte); }
.recherche-barre svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2; }

/* ---------- données / import ---------- */
.compteur { padding: 22px 24px; }
.compteur .v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--blue-deep); line-height: 1.1; }
.compteur .l { color: var(--muted); font-size: 14px; margin-top: 4px; }
.depot { display: block; border: 2px dashed var(--line); border-radius: 24px; padding: 34px; text-align: center; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.depot:hover, .depot.survol { border-color: var(--blue-2); background: var(--blue-softer); }
.depot input { display: none; }
.depot b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.onglet { margin-top: 20px; }
.onglet-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.onglet-tete select { width: 260px; }
.corr { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 16px; }
.corr label .oblig { color: var(--err); }
.apercu { overflow-x: auto; margin-top: 14px; border: 1px solid var(--hair); border-radius: 14px; }
.apercu table { border-collapse: collapse; font-size: 13px; }
.apercu th, .apercu td { padding: 7px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; text-align: left; }
.apercu th { background: var(--bg); font-weight: 700; color: var(--ink2); }
.prix-grilles { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--blue-softer); }
.prix-grilles .liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; margin-top: 10px; }
.prix-grilles .liste label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink2); font-size: 14px; }
.prix-grilles .liste input { width: 80px; min-height: 38px; }

/* ---------- comptes : mot de passe, double authentification (dans la plateforme) ---------- */
.compte-carte { width: min(420px, 100%); padding: 32px 32px 28px; }
.compte-carte h1 { font-size: 30px; text-align: center; margin-bottom: 10px; }
.compte-carte h2 { font-size: 18px; margin: 4px 0 6px; }
.compte-carte .texte { margin: 0 0 14px; color: var(--ink2); line-height: 1.55; }
.compte-carte .texte.centre, .compte-carte .centre { text-align: center; }
.compte-carte .texte.petit { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.compte-carte .messages { margin-bottom: 14px; }
.compte-form .champ { margin-top: 14px; }
.compte-form .champ:first-of-type { margin-top: 0; }
.compte-form .f-aide ul { margin: 4px 0 0; padding-left: 18px; }
.compte-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.compte-actions .btn { width: 100%; height: 52px; border-radius: 16px; }
.compte-carte img.qr { display: block; width: 190px; height: 190px; margin: 6px auto 16px; padding: 8px; border-radius: 16px; background: #fff; border: 1px solid var(--hair); }
.compte-carte textarea.codes { font: 500 14px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.compte-carte > .btn, .compte-carte > a.btn { margin-top: 8px; }
.compte-panneau { padding: 16px 0; border-top: 1px solid var(--hair); }
.compte-panneau:first-of-type { border-top: 0; }
.compte-panneau .texte { margin-bottom: 10px; }
.compte { display: grid; grid-template-columns: 220px minmax(0, 560px); gap: 28px; align-items: start; justify-content: center; padding-top: 10px; }
.compte .compte-carte { width: auto; border-radius: 24px; }
.compte .compte-carte h1 { text-align: left; }
.compte-nav { display: grid; gap: 4px; }
.compte-nav b { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 0 14px 8px; }
.compte-nav a { padding: 11px 14px; border-radius: 14px; color: var(--ink2); font-weight: 600; text-decoration: none; }
.compte-nav a:hover { background: #fff; color: var(--blue-deep); }
.compte-nav a.on { background: #fff; color: var(--blue-deep); box-shadow: var(--shadow); }
.sales-profils { display: grid; gap: 10px; margin-top: 18px; }
.sales-profil { display: grid; gap: 3px; text-align: left; }
.sales-profil span { color: var(--muted); font-size: 14px; }

/* ---------- suppression définitive d'une commande ---------- */
.suppression { max-width: 720px; display: grid; gap: 14px; line-height: 1.55; }
.suppression p { margin: 0; }
.suppression .confirmation { display: grid; gap: 8px; margin-top: 4px; }
.suppression .confirmation input { max-width: 280px; font-weight: 700; letter-spacing: .02em; }
.suppression .actions { margin-top: 8px; }
.alerte-err { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--err-soft); color: var(--err); }

/* ---------- environnement (recette, développement) ---------- */
.bandeau-env { position: fixed; left: 12px; bottom: 12px; z-index: 90; max-width: calc(100vw - 24px); padding: 6px 14px; border-radius: 999px; font-size: 12px; color: #fff; background: var(--err); box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: .92; pointer-events: none; }
.bandeau-env.developpement { background: var(--ink2); }
.bandeau-env b { letter-spacing: .06em; }

/* ---------- écrans moyens ---------- */
@media (max-width: 1200px) { .f-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .f-champ.l3, .f-champ.l2 { grid-column: 1 / -1; } }
@media (max-width: 1100px) {
  .topbar-in { gap: 16px; padding: 0 20px; } .onglets a { padding: 9px 12px; } .page { padding: 28px 20px 64px; }
  .cmd-grille { grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
  .etapes { grid-template-columns: 1fr; }
  .grille-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) { .btn-nouvelle { width: 44px; padding: 0; font-size: 0; gap: 0; } .btn-nouvelle svg.i { width: 20px; height: 20px; } }
@media (max-width: 860px) { .cmd-grille { grid-template-columns: minmax(0, 1fr); } .panier { position: static; max-height: none; } }

/* ---------- téléphone ---------- */
@media (max-width: 760px) {
  :root { --haut: 64px; }
  html, body { overflow-x: hidden; }
  h1 { font-size: 32px; }
  .page { min-width: 0; padding: 18px 16px calc(120px + env(safe-area-inset-bottom)); }
  /* barre du haut réduite au logo et à l'avatar ; la navigation passe en bas */
  .topbar { position: relative; background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar-in { padding: max(10px, env(safe-area-inset-top)) 16px 0; height: auto; min-height: var(--haut); }
  .brand img { height: 36px; }
  .onglets, .btn-nouvelle { display: none; }
  .menu-compte .menu { position: fixed; top: 70px; right: 12px; left: 12px; min-width: 0; }
  .barre-onglets { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 35; height: 66px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); box-shadow: var(--shadow-flottant); }
  .barre-onglets a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; border-radius: 999px; color: #48484A; font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .barre-onglets a svg.i { width: 22px; height: 22px; }
  .barre-onglets a.on { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

  .entete, .entete-page, .cmd-tete { flex-direction: column; align-items: stretch; gap: 14px; width: 100%; margin-bottom: 18px; }
  .entete .sub, .entete-page .sub { font-size: 14.5px; }
  .entete .actions, .entete-page .actions, .cmd-tete .actions { width: 100%; }
  .entete .actions .btn, .entete-page .actions .btn { flex: 1 1 auto; gap: 6px; height: 42px; min-height: 42px; padding: 0 12px; font-size: 14px; }
  .choix-type, .f-grille, .grille-2, .grille-4 { grid-template-columns: 1fr; }
  .f-section, .form-tete { padding-left: 20px; padding-right: 20px; }
  .form-pied { padding: 12px 16px; } .form-pied .muted { display: none; }

  /* accueil et compte */
  .accueil { gap: 24px; }
  .accueil-tete h1 { font-size: 36px; }
  .accueil-section h2 { font-size: 22px; }
  .recherche-pilule { min-height: 64px; padding: 8px 22px; }
  .recherche-pilule kbd { display: none; }
  .accueil-cartes { grid-template-columns: 1fr; gap: 12px; }
  .carte-action, .carte-info { min-height: 0; padding: 22px; border-radius: 26px; }
  .carte-action { flex-direction: row; align-items: center; }
  .carte-action .ca-texte b { font-size: 22px; }
  .ca-bouton { flex: none; width: 48px; height: 48px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .ca-bouton svg.i { width: 22px; height: 22px; }
  .ci-valeur b { font-size: 44px; }
  .ligne-carte { padding: 16px 18px; gap: 6px 12px; }
  .lc-titre { flex: 1 1 60%; }
  .lc-meta { flex: 1 1 auto; font-size: 13.5px; }
  .lc-montant { flex: none; }
  .ligne-carte > svg.i { display: none; }
  .raccourcis { grid-template-columns: 1fr 1fr; }
  .hub-bandeau { margin: -18px -16px 0; padding: 30px 20px 84px; border-radius: 0; }
  .hub-profil { margin-top: -84px; }

  /* listes : une carte par ligne (nom en gras, prix à droite, détails en gris, pastilles dessous) */
  .outils { gap: 10px; }
  .outils .champ-recherche { min-width: 0; }
  .champ-recherche input { height: 56px; }
  .champ-recherche kbd { display: none; }
  .outils .segment { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .outils .segment label { flex: none; }
  .outils select.filtre, .cmd-catalogue select.filtre { flex: 1 1 100%; min-width: 0; max-width: none; }
  .barre-res { flex-wrap: wrap; align-items: center; gap: 10px; } .indice { display: none; }
  .barre-res.bas { display: none; }
  .carte-table, .cmd-catalogue .carte-table { min-width: 0; max-width: 100%; overflow: visible; background: transparent; border-radius: 0; box-shadow: none; }
  table.liste, table.liste tbody { display: block; }
  table.liste thead { display: none; }
  table.liste tbody { display: grid; gap: 10px; }
  table.liste tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; padding: 16px 18px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); min-width: 0; }
  /* retours à la ligne forcés : après le nom et le prix (::after), puis avant les pastilles (::before) */
  table.liste tbody tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  table.liste tbody tr::before { content: ""; order: 5; flex-basis: 100%; height: 0; }
  table.liste tbody tr:hover td, table.liste tbody tr.sel td { background: none; }
  table.liste tbody tr.sel { box-shadow: 0 0 0 2px var(--blue-2); }
  table.liste td, table.liste td:first-child, table.liste td:last-child { display: none; padding: 0; border: 0; }
  table.liste td.m-titre { display: block; order: 1; flex: 1 1 60%; min-width: 0; font-size: 16px; }
  table.liste td.m-titre .c-titre, table.liste td.m-titre .c-fort { font-size: 16px; font-weight: 700; }
  table.liste td.m-titre .c-sous { font-size: 13.5px; }
  table.liste td.m-prix { display: block; order: 2; flex: none; margin-left: 14px; text-align: right; font-size: 16px; font-weight: 800; }
  table.liste td.m-prix .c-sous { font-weight: 400; }
  table.liste td.m-meta { display: inline; order: 4; margin-top: 4px; font-size: 13.5px; color: var(--muted); white-space: normal; }
  table.liste td.m-meta::before { content: "·"; margin: 0 7px; }
  table.liste td.m-meta.m-premier::before, table.liste td.m-meta:empty { content: none; }
  table.liste td.m-meta:empty { display: none; }
  table.liste td.m-meta .c-fort { color: var(--muted); font-weight: 600; }
  table.liste td.m-badge { display: inline-block; vertical-align: middle; order: 6; margin: 12px 8px 0 0; font-size: 13.5px; color: var(--muted); text-align: left; }
  table.liste td.m-badge:empty { display: none; }
  table.liste td.m-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; order: 8; flex-basis: 100%; margin-top: 14px; text-align: left; white-space: normal; }
  table.liste td.m-action .q-ajout { flex: 0 0 76px; margin: 0; }
  table.liste td.m-action .u-ajout { flex: 1 1 auto; margin: 0; }
  table.liste td.m-action .btn { flex: 1 1 100%; height: 46px; }
  table.liste td.m-action .dans-panier { flex: 1 0 100%; margin: 0; }
  .m-seul { display: inline; }

  /* fiche en plein écran */
  #tiroir { top: 0; width: 100%; z-index: 60; border-radius: 0; }
  .t-nav { padding: max(14px, env(safe-area-inset-top)) 18px 8px; }
  .t-tete { padding: 0 18px 16px; }
  /* Fiche ouverte dans une commande : quantité et unité sur une ligne, « Ajouter au panier » en dessous */
  .t-ajout { flex-wrap: wrap; }
  .t-ajout .u-fiche { flex: 1 1 auto; }
  .t-ajout .btn { flex: 1 1 100%; height: 48px; }
  .t-corps { padding: 4px 18px 40px; }
  .t-sec dl { grid-template-columns: 130px minmax(0, 1fr); }

  /* fenêtres : panneau qui monte du bas, poignée en haut */
  dialog.dlg, dialog.dlg-rg { width: 100%; max-width: 100%; max-height: calc(100dvh - 40px); margin: auto 0 0; border-radius: 28px 28px 0 0; }
  #dlg-infos[open] { height: auto; }
  .dlg-tete { padding: 12px 20px 4px; }
  .dlg-tete::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto 14px; border-radius: 999px; background: #D4D4DA; }
  .dlg-tete h2 { font-size: 22px; }
  .dlg .champ-recherche, .rg-champ { margin: 14px 16px 0 !important; }
  .rg-champ::before { content: ""; display: block; width: 40px; height: 5px; margin: -6px auto 12px; border-radius: 999px; background: #D4D4DA; }
  .rg-portee { margin: 12px 16px 4px; overflow-x: auto; }
  .rg-item { grid-template-columns: 1fr; gap: 2px; }
  .dlg-liste { padding: 0 8px; }
  .dlg-liste li.choix { grid-template-columns: minmax(0, 1fr) auto; }
  .dlg-liste li.choix .code { grid-column: 1 / -1; }
  .dlg-form { padding: 10px 20px 8px; }
  .dlg-pied { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
  .dlg-pied > span:not(#etat-save) { display: none; }
  .dlg-pied .btn.primaire { flex: 1; height: 52px; border-radius: 16px; font-size: 16px; }
  .champs-2 { grid-template-columns: 1fr 1fr; }
  dialog.dlg-confirmer[open] { animation: confirmer-monte .24s cubic-bezier(.2,.9,.3,1); }
  @keyframes confirmer-monte { from { transform: translateY(100%); } to { transform: none; } }
  .cf-corps { padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); }
  .cf-corps::before { content: ""; justify-self: center; width: 40px; height: 5px; border-radius: 999px; background: #D4D4DA; }
  .cf-tete h2 { font-size: 21px; }
  .cf-boutons { flex-direction: column-reverse; }
  .cf-boutons .btn { width: 100%; height: 52px; border-radius: 16px; font-size: 16px; }
  .cf-aide { display: none; }

  /* commande : étapes compactes, catalogue puis panier, barre du bas avec le total */
  .cmd-tete h1 { font-size: 30px; gap: 8px; }
  .cmd-tete h1 .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .cmd-client { font-size: 14.5px; }
  .cmd-tete .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cmd-tete .actions form, .cmd-tete .actions .btn { width: 100%; }
  .cmd-tete .actions .btn { height: auto; min-height: 44px; padding: 8px 12px; white-space: normal; line-height: 1.25; background: #fff; border-color: var(--line); }
  .etapes { margin: 14px 0 16px; gap: 8px; }
  .etape { padding: 26px 16px 14px; border-radius: 20px; }
  .etape::before { left: 16px; right: 16px; top: 12px; }
  .cmd-grille { gap: 16px; }
  .cmd-catalogue { padding: 16px; margin: 0 -4px; border-radius: 24px; }
  .cat-tete { flex-direction: column; gap: 4px; }
  .cmd-catalogue table.liste tbody tr { padding: 14px; background: var(--blue-softer); box-shadow: none; }
  .panier { border-radius: 24px; }
  .pan-ligne { margin: 0 10px 8px; }
  .pl-detail { grid-template-columns: 1fr 1fr; }
  .pan-barre { display: flex; align-items: center; justify-content: space-between; gap: 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: #fff; box-shadow: 0 -8px 30px rgba(30,37,96,.12); }
  .pb-total { display: flex; flex-direction: column; min-width: 0; }
  .pb-total b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  .pb-total span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pan-barre .btn { flex: none; height: 54px; padding: 0 22px; border-radius: 16px; font-size: 16px; font-weight: 700; }

  .compte { grid-template-columns: 1fr; } .compte-nav { grid-auto-flow: column; justify-content: start; } .compte-carte { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- pages d'entrée : connexion, mot de passe oublié, double authentification, erreur ----------
   Une colonne sur fond uni, sans carte : logo, grand titre, champs pleins arrondis, grand bouton. */
body.entree { background: var(--bg); }
.connexion { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: max(40px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom)); }
.connexion .compte-carte { width: min(400px, 100%); margin: auto 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.connexion .logo { display: block; width: 240px; max-width: 70%; height: auto; margin: 0 auto 44px; }
.connexion h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.035em; text-align: center; margin: 0 0 28px; }
.connexion .compte-carte .texte { font-size: 15px; text-align: center; }
.connexion form + .texte { margin: 20px 0 0; font-size: 14px; color: var(--muted); }
.connexion .compte-carte .texte.centre { margin-top: -14px; margin-bottom: 24px; color: var(--muted); }
.connexion .compte-carte .texte.petit { margin-top: 28px; font-size: 13px; line-height: 1.5; color: var(--faint); }
.connexion .messages li { border-radius: 14px; font-size: 14px; line-height: 1.45; box-shadow: none; }
.connexion label { font-size: 13px; color: var(--ink2); margin-bottom: 7px; }
.connexion input[type=email], .connexion input[type=password], .connexion input[type=text], .connexion input[type=tel],
.connexion input[type=number], .connexion input:not([type]), .connexion select {
  height: 56px; padding: 0 18px; border: 0; border-radius: 14px; background-color: #E8E8ED; font-size: 17px; color: var(--ink); }
.connexion textarea { border: 0; border-radius: 14px; background: #E8E8ED; padding: 14px 18px; font-size: 16px; }
.connexion input:hover, .connexion select:hover, .connexion textarea:hover { background-color: #E1E1E7; }
.connexion input:focus, .connexion select:focus, .connexion textarea:focus { background-color: #fff; box-shadow: var(--anneau); }
.connexion .champ.erreur input { box-shadow: 0 0 0 2px var(--err); background: #fff; }
.connexion .compte-form .champ, .connexion form .champ + .champ { margin-top: 12px; }
.connexion .compte-form .champ:first-of-type { margin-top: 0; }
.connexion .f-err { margin: 7px 4px 0; font-size: 13px; }
.connexion .mdp input, .connexion .effacable input { padding-right: 58px; }
.connexion .mdp-oeil { right: 8px; width: 42px; height: 42px; border-radius: 999px; }
.connexion .compte-actions { margin-top: 20px; gap: 12px; }
.connexion .btn { width: 100%; height: 56px; border-radius: 14px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.connexion .btn.primaire { background: var(--blue-deep); box-shadow: 0 1px 2px rgba(20,27,65,.12); }
.connexion .btn.primaire:hover { background: var(--blue); }
.connexion .compte-carte > .btn, .connexion .compte-carte > a.btn, .connexion form > .btn { margin-top: 20px; }
.connexion .sales-profil { height: auto; min-height: 64px; padding: 12px 18px; white-space: normal; border: 0; background: #fff; box-shadow: var(--shadow); }
.connexion .compte-carte img.qr { margin-top: 0; }
.connexion-pied { margin: 28px 0 0; font-size: 12px; color: var(--faint); text-align: center; }
/* Recette, développement : le bandeau passe en haut pour ne pas couvrir le pied de page */
.entree .bandeau-env { top: max(10px, env(safe-area-inset-top)); bottom: auto; left: 50%; transform: translateX(-50%); white-space: nowrap; }
/* Connexion : bouton pour effacer l'adresse, options sous les champs */
.effacable { position: relative; }
.effacer { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 999px; background: #B4B4BA; color: #fff; cursor: pointer; }
.effacer[hidden] { display: none; }
.effacer:hover { background: var(--muted); }
.effacer svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.connexion-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 0 4px; }
.connexion-options .f-check { min-height: 32px; font-size: 14px; color: var(--ink2); margin: 0; }
.connexion-options a { font-size: 14px; font-weight: 500; white-space: nowrap; }
@media (max-width: 600px) {
  .connexion { padding-top: max(32px, env(safe-area-inset-top)); }
  .connexion .compte-carte { margin: 6vh 0 auto; }
  .connexion .logo { width: 210px; margin-bottom: 36px; }
  .connexion h1 { font-size: 28px; margin-bottom: 22px; }
}
/* Téléphone : le bandeau de recette ou de développement devient une bande en haut de l'écran, sans rien cacher */
@media (max-width: 760px) {
  .bandeau-env, .entree .bandeau-env { position: static; transform: none; display: block; max-width: none; border-radius: 0; padding: calc(6px + env(safe-area-inset-top)) 16px 6px;
    text-align: center; white-space: normal; font-size: 12px; opacity: 1; box-shadow: none; }
}
