/* app.mypassionelle.com — design system Passion'elle (cockpit-contrat.md § 5).
   Tokens ivoire / encre / doré, Instrument Sans + JetBrains Mono (nombres), thème clair + sombre (prefers-color-scheme).
   Mobile-first pour Réception / Proposer (cibles ≥ 44 px), desktop-first pour Réassort / Commandes (iPad de caisse OK).
   Icônes = SVG inline (icones.js). Aucun emoji dans l'UI. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --ivoire: #f4f1ea; --encre: #1c1a17; --dore: #b08a3e; --dore-fonce: #8a6a24; --dore-clair: #f0e6cf;
  --fond: #f4f1ea; --surface: #ffffff; --surface-2: #faf8f3; --surface-3: #f4f1ea;
  --bord: #e6dfd0; --bord-2: #d8d1c2; --ligne: #efe9dc;
  --texte: #1c1a17; --texte-2: #7d7563; --texte-3: #9c937f; --texte-inverse: #ffffff;
  --vert: #1f7a45; --vert-fond: #e7f4ec; --rouge: #b3261e; --rouge-fond: #fdecea; --rouge-bord: #f3c9c4;
  --ambre: #a8641a; --ambre-fond: #fff4e0; --bleu: #1e56a0; --bleu-fond: #e8f0fb; --neutre-fond: #ece7db;
  --nav-fond: #1c1a17; --nav-texte: #b8b0a0; --nav-actif: #2e2a24; --nav-blanc: #ffffff; --nav-muet: #8f8778; --nav-badge: #2e2a24;
  --primaire: #1c1a17; --primaire-texte: #ffffff; --primaire-hover: #2e2a24;
  --focus: #b08a3e;
  --ombre-1: 0 1px 2px rgba(28, 26, 23, .06); --ombre-2: 0 8px 28px rgba(28, 26, 23, .14); --ombre-3: -8px 0 32px rgba(28, 26, 23, .22);
  --r-s: 8px; --r-m: 10px; --r-l: 14px;
  --sans: "Instrument Sans", -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --nav-l: 216px; --barre-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fond: #141311; --surface: #1e1c19; --surface-2: #242220; --surface-3: #2a2723;
    --bord: #35322c; --bord-2: #45413a; --ligne: #2e2b26;
    --texte: #ece7dc; --texte-2: #a59d8c; --texte-3: #7d7563; --texte-inverse: #1c1a17;
    --vert: #4fb877; --vert-fond: #1c3326; --rouge: #ef7a70; --rouge-fond: #3d211e; --rouge-bord: #5a2f2a;
    --ambre: #e4a45a; --ambre-fond: #3b2a16; --bleu: #7aa6e6; --bleu-fond: #1b2a42; --neutre-fond: #35322c;
    --dore-clair: #3a3020; --dore-fonce: #d3ad5c;
    --nav-fond: #0f0e0c; --nav-actif: #262320; --nav-badge: #2e2a24;
    --primaire: #ece7dc; --primaire-texte: #1c1a17; --primaire-hover: #ffffff;
    --ombre-1: 0 1px 2px rgba(0, 0, 0, .4); --ombre-2: 0 8px 28px rgba(0, 0, 0, .5); --ombre-3: -8px 0 32px rgba(0, 0, 0, .6);
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--fond); color: var(--texte); font: 15px/1.45 var(--sans); overflow-x: hidden; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--dore-fonce); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
img { max-width: 100%; }
svg { flex: none; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muet { color: var(--texte-2); font-size: 13px; }
.petit { font-size: 12px; }
.centre { text-align: center; }
.droite { text-align: right; }
.gras { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.tronque { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ------------------------------------------------------------------ coquille */
#app { min-height: 100vh; min-height: 100dvh; }
.coquille { display: flex; min-height: 100vh; min-height: 100dvh; }
.nav { width: var(--nav-l); flex: none; background: var(--nav-fond); color: var(--nav-texte); display: flex; flex-direction: column; padding: 20px 14px; gap: 2px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.nav-marque { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; text-decoration: none; color: inherit; }
.nav-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--dore); display: flex; align-items: center; justify-content: center; flex: none; }
.nav-marque .nom { font-weight: 700; color: var(--nav-blanc); font-size: 15px; letter-spacing: .01em; line-height: 1.2; }
.nav-marque .dom { font-size: 11px; color: var(--nav-muet); }
.nav-lien { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; font-size: 14px; color: var(--nav-texte); text-decoration: none; min-height: 40px; }
.nav-lien:hover { background: rgba(255, 255, 255, .05); color: var(--nav-blanc); }
.nav-lien.actif { background: var(--nav-actif); color: var(--nav-blanc); font-weight: 600; }
.nav-lien .cpt { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--nav-badge); color: #d9d2c3; padding: 2px 7px; border-radius: 999px; min-width: 22px; text-align: center; }
.nav-lien .cpt.dore { background: var(--dore); color: #1c1a17; }
.nav-lien .cpt.rouge { background: #7a2e22; color: #ffd9d2; }
.nav-profil { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid #2e2a24; display: flex; align-items: center; gap: 10px; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: inherit; border-radius: 0; }
.nav-profil:hover .nav-avatar { background: var(--dore); color: #1c1a17; }
.nav-avatar { width: 30px; height: 30px; border-radius: 999px; background: #3b362e; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.nav-profil .qui { font-size: 13px; color: var(--nav-blanc); font-weight: 600; line-height: 1.2; }
.nav-profil .role { font-size: 11px; color: var(--nav-muet); }
.nav-hors-ligne { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: #3b2a16; color: #e4a45a; font-size: 12px; display: flex; gap: 8px; align-items: center; }

.page { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 26px 32px 18px; flex-wrap: wrap; }
.page-tete .sur { font-size: 12px; color: var(--texte-2); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.page-tete h1 { margin: 4px 0 0; font-size: 28px; }
.page-tete .sous { color: var(--texte-2); font-size: 13px; margin-top: 4px; }
.page-tete .actions-tete { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-corps { padding: 0 32px 32px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.btn-retour { display: inline-flex; align-items: center; gap: 4px; color: var(--texte-2); text-decoration: none; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; background: none; border: 0; padding: 0; }
.btn-retour:hover { color: var(--texte); }

.barre-basse { display: none; }
.nav-bascule { display: none; }

/* ------------------------------------------------------------------ cartes & KPI */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: 16px 18px; }
.carte.serre { padding: 12px 14px; }
.carte-titre { font-size: 12px; color: var(--texte-2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.carte-titre .cpt { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--texte); }
.grille-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border-radius: var(--r-l); padding: 16px 18px; border: 1px solid var(--bord); min-width: 0; }
.kpi.cliquable { cursor: pointer; transition: border-color .15s; }
.kpi.cliquable:hover { border-color: var(--dore); }
.kpi .lib { font-size: 12px; color: var(--texte-2); font-weight: 600; }
.kpi .val { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.kpi .val .num { font-size: 30px; font-weight: 500; line-height: 1.1; }
.kpi .val .unite { font-size: 12px; color: var(--texte-2); }
.kpi .note { font-size: 12px; color: var(--texte-2); margin-top: 4px; }
.kpi .rouge, .texte-rouge { color: var(--rouge); } .kpi .vert, .texte-vert { color: var(--vert); } .kpi .ambre, .texte-ambre { color: var(--ambre); } .kpi .bleu, .texte-bleu { color: var(--bleu); }
.grille-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pipe { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; cursor: pointer; min-width: 0; }
.pipe.actif { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.pipe .lib { font-size: 11px; color: var(--texte-2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pipe .num { font-size: 24px; font-weight: 500; margin-top: 4px; }
.pipe .note { font-size: 12px; color: var(--texte-2); }
.mini-kpi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-kpi > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.mini-kpi .lib { font-size: 11px; color: var(--texte-2); font-weight: 600; }
.mini-kpi .num { font-size: 20px; font-weight: 500; }

/* ------------------------------------------------------------------ boutons */
.btn { min-height: 40px; padding: 0 14px; border-radius: var(--r-m); border: 1px solid var(--bord-2); background: var(--surface); color: var(--texte); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--texte-3); }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn-primaire { background: var(--primaire); color: var(--primaire-texte); border-color: var(--primaire); font-weight: 600; }
.btn-primaire:hover { background: var(--primaire-hover); border-color: var(--primaire-hover); }
.btn-secondaire { background: var(--surface); }
.btn-danger { background: var(--rouge); color: #fff; border-color: var(--rouge); font-weight: 600; }
.btn-danger:hover { background: #8f1e17; border-color: #8f1e17; }
.btn-vert { background: var(--vert); color: #fff; border-color: var(--vert); font-weight: 600; }
.btn-vert:hover { background: #17603a; border-color: #17603a; }
.btn-dore { background: var(--dore); color: #1c1a17; border-color: var(--dore); font-weight: 600; }
.btn-fantome { background: transparent; border-color: transparent; }
.btn-fantome:hover { background: var(--surface-2); border-color: transparent; }
.btn-bloc { width: 100%; }
.btn-grand { min-height: 52px; font-size: 15px; border-radius: 12px; }
.btn-petit { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: var(--r-s); }
.btn-icone { min-width: 40px; padding: 0; }
.btn-icone.btn-petit { min-width: 32px; }
.btn-lien { background: none; border: 0; padding: 0; color: var(--dore-fonce); font-weight: 500; text-decoration: underline; min-height: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.actions.serre { margin-top: 0; }
@media (max-width: 720px) { .btn { min-height: 44px; } .btn-petit { min-height: 36px; } .actions .btn { flex: 1 1 auto; } }

/* ------------------------------------------------------------------ formulaires */
.champ { display: block; margin: 12px 0 0; }
.champ > span, label.lib, .lib-champ { display: block; font-size: 12px; font-weight: 600; color: var(--texte-2); margin-bottom: 5px; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--bord-2); border-radius: var(--r-m); background: var(--surface); font-size: 15px; color: var(--texte); }
.input:focus { border-color: var(--dore); outline: 2px solid var(--dore-clair); outline-offset: 0; }
.input::placeholder { color: var(--texte-3); }
.input-nombre { font-family: var(--mono); font-size: 28px; text-align: center; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d7563' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.recherche { position: relative; display: flex; align-items: center; }
.recherche svg { position: absolute; left: 11px; color: var(--texte-2); pointer-events: none; }
.recherche .input { padding-left: 34px; }
.interrupteur { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; }
.interrupteur input { position: absolute; opacity: 0; width: 0; height: 0; }
.interrupteur .piste { width: 40px; height: 22px; border-radius: 999px; background: var(--bord-2); position: relative; transition: background .15s; flex: none; }
.interrupteur .piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.interrupteur input:checked + .piste { background: var(--vert); }
.interrupteur input:checked + .piste::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .piste { outline: 2px solid var(--focus); outline-offset: 2px; }
.case { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--bord-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; color: transparent; }
.case[aria-checked="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.case.partiel { background: var(--texte-3); border-color: var(--texte-3); color: #fff; }
@media (prefers-color-scheme: dark) { .case[aria-checked="true"] { background: var(--primaire); border-color: var(--primaire); color: var(--primaire-texte); } }
.choix { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.choix label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--bord); border-radius: 10px; margin: 0; color: var(--texte); font-size: 15px; background: var(--surface); cursor: pointer; }
.choix input[type=radio] { width: 20px; height: 20px; accent-color: var(--encre); }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }

/* ------------------------------------------------------------------ chips, badges, points */
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--bord-2); font-size: 13px; font-weight: 500; color: var(--texte); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--texte-3); }
.chip.actif { background: var(--primaire); color: var(--primaire-texte); border-color: var(--primaire); font-weight: 600; }
.chip.rouge { background: var(--rouge-fond); color: var(--rouge); border-color: var(--rouge-bord); font-weight: 600; }
.chip .n { font-family: var(--mono); font-size: 11px; opacity: .8; }
.chip select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0 16px 0 0; font-size: 13px; font-weight: 500; color: inherit; cursor: pointer; max-width: 200px; text-overflow: ellipsis; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d7563' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; }
.chip select:focus { outline: none; }
.chip.avec-select { padding-right: 8px; }
.chip.avec-select.rempli { border-color: var(--encre); }
.chips .espace { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--neutre-fond); color: var(--texte-2); white-space: nowrap; line-height: 1.4; }
.badge.vert { background: var(--vert-fond); color: var(--vert); }
.badge.rouge { background: var(--rouge-fond); color: var(--rouge); }
.badge.ambre, .badge.orange { background: var(--ambre-fond); color: var(--ambre); }
.badge.bleu { background: var(--bleu-fond); color: var(--bleu); }
.badge.dore { background: var(--dore-clair); color: var(--dore-fonce); }
.badge.encre { background: var(--encre); color: #fff; }
.point { width: 8px; height: 8px; border-radius: 999px; background: var(--texte-3); display: inline-block; flex: none; }
.point.vert { background: var(--vert); } .point.rouge { background: var(--rouge); } .point.ambre { background: var(--ambre); } .point.bleu { background: var(--bleu); }
.dispo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.dispo.ambre { color: var(--ambre); } .dispo.rouge { color: var(--rouge); } .dispo.muet { color: var(--texte-2); }
.classe { display: inline-flex; width: 18px; height: 18px; border-radius: 5px; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 700; background: var(--neutre-fond); color: var(--texte-2); }
.classe.A { background: var(--encre); color: #fff; } .classe.B { background: var(--dore-clair); color: var(--dore-fonce); }
@media (prefers-color-scheme: dark) { .classe.A { background: var(--primaire); color: var(--primaire-texte); } }

/* ------------------------------------------------------------------ tableau dense */
.tableau-cadre { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); overflow: hidden; display: flex; flex-direction: column; }
.tableau-defil { overflow: visible; }
@media (max-width: 1100px) { .tableau-defil { overflow-x: auto; } }
table.tableau { width: 100%; border-collapse: collapse; min-width: 640px; }
.tableau td.col-ref { min-width: 200px; max-width: 300px; width: 30%; }
.tableau td { white-space: nowrap; }
.tableau td.boutique { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tableau td.col-ref, .tableau td.texte { white-space: normal; }
.tableau th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: 10px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); font-weight: 700; text-align: left; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.tableau th.tri { cursor: pointer; user-select: none; }
.tableau th.tri:hover { color: var(--texte); }
.tableau th .fleche { display: inline-block; margin-left: 3px; opacity: .5; }
.tableau th.actif { color: var(--texte); }
.tableau td { padding: 8px 10px; border-bottom: 1px solid var(--ligne); font-size: 14px; vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau tbody tr.cliquable { cursor: pointer; }
.tableau tbody tr.selectionne { background: var(--dore-clair); }
.tableau tbody tr.rupture { box-shadow: inset 3px 0 0 var(--rouge); }
.tableau td.droite, .tableau th.droite { text-align: right; }
.tableau td.centre, .tableau th.centre { text-align: center; }
.tableau td.num { font-size: 14px; }
.tableau .cell-ref { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tableau .cell-ref .titre { display: block; max-width: 100%; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tableau .cell-ref .sous { font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.tableau .cell-ref > div:not(.vignette) { min-width: 0; overflow: hidden; flex: 1; }
.vignette { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; color: var(--texte-3); }
.vignette img { width: 100%; height: 100%; object-fit: contain; }
.vignette.grande { width: 56px; height: 56px; border-radius: 10px; }
.vignette.petite { width: 32px; height: 32px; border-radius: 6px; }
.tableau-pied { margin-top: auto; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--bord); background: var(--surface-2); font-size: 12px; color: var(--texte-2); flex-wrap: wrap; }
.legende { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.motif { color: var(--texte-2); font-size: 12px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.motif-ligne { white-space: normal; padding: 0 16px 10px 84px; font-size: 12px; color: var(--texte-2); line-height: 1.45; }
.motif-ligne b { color: var(--dore-fonce); font-weight: 700; font-size: 11px; letter-spacing: .04em; }

/* barre de progression segmentée (commandes) */
.progression { height: 8px; border-radius: 4px; background: var(--ligne); overflow: hidden; display: flex; }
.progression > i { height: 100%; display: block; }
.progression .recu { background: var(--vert); } .progression .exp { background: var(--dore); } .progression .bo { background: var(--rouge); } .progression .cours { background: var(--bleu); } .progression .attente { background: var(--texte-3); }
.progression.fine { height: 6px; }
.avancement { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.avancement .progression { flex: 1; }
.avancement .lib { font-family: var(--mono); font-size: 11px; color: var(--texte-2); white-space: nowrap; }

/* ------------------------------------------------------------------ stepper « − n + » */
.stepper { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--bord-2); background: var(--surface); font-size: 16px; line-height: 1; color: var(--texte); display: flex; align-items: center; justify-content: center; padding: 0; }
.stepper button:hover { background: var(--surface-2); border-color: var(--texte-3); }
.stepper button:disabled { opacity: .35; }
.stepper input { width: 44px; height: 30px; text-align: center; font-family: var(--mono); font-size: 15px; font-weight: 500; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 0; -moz-appearance: textfield; color: var(--texte); }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { border-color: var(--dore); outline: none; background: var(--surface); }
.stepper.zero input { color: var(--texte-3); }
.stepper.ok input { color: var(--vert); } .stepper.trop input { color: var(--rouge); }
.stepper .sur { font-family: var(--mono); font-size: 13px; color: var(--texte-2); margin-left: 2px; }
.stepper.grand button { width: 44px; height: 44px; border-radius: 10px; font-size: 20px; }
.stepper.grand input { width: 52px; height: 44px; font-size: 20px; }
@media (max-width: 720px), (pointer: coarse) { .stepper button { width: 44px; height: 44px; border-radius: 10px; font-size: 20px; } .stepper input { height: 44px; width: 48px; font-size: 18px; } }

/* ------------------------------------------------------------------ listes (mobile) */
.liste { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: 12px 14px; min-height: 64px; text-decoration: none; color: inherit; }
.item.cliquable { cursor: pointer; }
.item.cliquable:hover { border-color: var(--dore); }
.item .corps { flex: 1; min-width: 0; }
.item .titre { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .detail { font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .fin { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.compteur { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.compteur.ok { color: var(--vert); }
.groupe-titre { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); margin: 12px 2px 6px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.groupe-titre:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ états vides, squelettes, bandeaux */
.vide { text-align: center; color: var(--texte-2); padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; }
.vide svg { color: var(--texte-3); }
.vide .titre { font-weight: 600; color: var(--texte); font-size: 15px; }
.vide.carte { background: var(--surface); }
.squelette { display: flex; flex-direction: column; gap: 10px; }
.squelette i, .sq { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--ligne) 25%, var(--surface-2) 50%, var(--ligne) 75%); background-size: 200% 100%; animation: sq 1.2s infinite linear; }
.sq.grand { height: 44px; border-radius: 10px; } .sq.kpi { height: 92px; border-radius: 14px; } .sq.court { width: 40%; } .sq.moyen { width: 70%; }
@keyframes sq { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sq, .squelette i { animation: none; } }
.bandeau { padding: 10px 14px; font-size: 14px; border-radius: var(--r-m); display: flex; gap: 10px; align-items: center; }
.bandeau.info { background: var(--bleu-fond); color: var(--bleu); }
.bandeau.attention, .bandeau.hors-ligne { background: var(--ambre-fond); color: var(--ambre); }
.bandeau.erreur { background: var(--rouge-fond); color: var(--rouge); }
.bandeau.ok { background: var(--vert-fond); color: var(--vert); }
.bandeau .btn { margin-left: auto; }
.note-manque { font-size: 12px; color: var(--texte-3); display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ tiroir, modale, toast */
.tiroir-overlay { position: fixed; inset: 0; background: rgba(28, 26, 23, .45); z-index: 40; display: flex; justify-content: flex-end; }
.tiroir { background: var(--surface); width: min(420px, 100vw); height: 100%; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--ombre-3); border-left: 1px solid var(--bord); }
.tiroir.large { width: min(760px, 100vw); }
.tiroir.ouvert { transform: translateX(0); }
.tiroir-tete { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--bord); }
.tiroir-tete .titre { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.tiroir-corps { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.tiroir-corps.document { padding: 0; background: var(--surface-3); }
.tiroir-corps iframe { flex: 1; width: 100%; border: 0; min-height: 100%; }
.tiroir-pied { padding: 12px 18px; border-top: 1px solid var(--bord); display: flex; gap: 8px; background: var(--surface); }
.tiroir-chargement { margin: auto; padding: 24px; text-align: center; color: var(--texte-2); }
.tiroir-fermer { background: none; border: 0; line-height: 1; cursor: pointer; padding: 6px; color: var(--texte-2); border-radius: 8px; display: flex; }
.tiroir-fermer:hover { background: var(--surface-2); color: var(--texte); }
@media (prefers-reduced-motion: reduce) { .tiroir { transition: none; } }
.overlay { position: fixed; inset: 0; background: rgba(28, 26, 23, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.modale { background: var(--surface); border-radius: 16px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: var(--ombre-2); border: 1px solid var(--bord); }
.modale.large { max-width: 720px; }
.modale h2 { margin: 0 0 10px; font-size: 18px; }
.modale-texte { white-space: pre-line; color: var(--texte-2); font-size: 14px; }
.modale-actions { display: flex; gap: 8px; margin-top: 18px; }
.modale-actions .btn { flex: 1; }
@media (max-width: 720px) { .overlay { align-items: flex-end; } .modale { border-radius: 16px 16px 0 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px); background: var(--encre); color: #fff; padding: 12px 16px; border-radius: 10px; text-align: center; opacity: 0; transition: .2s; z-index: 60; pointer-events: none; font-size: 14px; max-width: min(92vw, 520px); box-shadow: var(--ombre-2); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--vert); } .toast.erreur { background: var(--rouge); } .toast.attention { background: var(--ambre); }
@media (max-width: 720px) { .toast { bottom: calc(var(--barre-h) + 16px); } }

/* ------------------------------------------------------------------ fiche 360° */
.fiche-tete { display: flex; align-items: flex-start; gap: 12px; }
.fiche-tete .titre { font-weight: 700; font-size: 15px; line-height: 1.3; }
.fiche-tete .sous { font-size: 12px; color: var(--texte-2); margin-top: 2px; }
.stock-boutiques { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stock-boutiques > div { text-align: center; background: var(--surface-2); border-radius: 8px; padding: 8px 4px; }
.stock-boutiques > div.rupture { background: var(--rouge-fond); }
.stock-boutiques > div.rupture .num { color: var(--rouge); }
.stock-boutiques > div.ici { outline: 1.5px solid var(--dore); }
.stock-boutiques .lib { font-size: 10px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-boutiques .num { font-size: 15px; font-weight: 600; }
.courbe { width: 100%; height: auto; display: block; }
.pourquoi { background: var(--surface-3); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.45; }
.pourquoi .lib { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--dore-fonce); margin-bottom: 4px; letter-spacing: .04em; }
.histo { display: flex; flex-direction: column; gap: 6px; }
.histo > a, .histo > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); text-decoration: none; color: inherit; }
.histo > a:hover { background: var(--dore-clair); }
.fiche-page { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .fiche-page { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ barre d'action collante (sélection) */
.barre-selection { position: sticky; bottom: 0; z-index: 10; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--ombre-2); flex-wrap: wrap; }
.barre-selection .resume { font-size: 13px; color: var(--texte-2); flex: 1; min-width: 200px; }
.barre-selection .resume b { color: var(--texte); font-family: var(--mono); font-weight: 600; }
.barre-selection .btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .barre-selection { bottom: var(--barre-h); border-radius: var(--r-l) var(--r-l) 0 0; } }

/* ------------------------------------------------------------------ connexion */
.connexion-fond { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: #1c1a17; overflow: hidden; }
.connexion-fond .vitrine { position: absolute; inset: 0; width: 100%; height: 100%; }
.connexion-panneau { position: relative; width: 100%; max-width: 420px; background: var(--ivoire); color: #1c1a17; border-radius: 18px; padding: 32px 28px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); border: 1px solid rgba(176, 138, 62, .35); }
.connexion-panneau .marque { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.connexion-panneau .marque .nom { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.connexion-panneau .marque .sous { font-size: 12px; color: #7d7563; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.connexion-panneau .input { background: #fff; color: #1c1a17; border-color: #d8d1c2; min-height: 46px; }
.connexion-panneau .champ > span { color: #7d7563; }
.connexion-panneau .btn-primaire { background: #1c1a17; color: #fff; border-color: #1c1a17; min-height: 48px; margin-top: 18px; }
.connexion-panneau .btn-primaire:hover { background: #2e2a24; }
.connexion-panneau .aide { font-size: 12px; color: #7d7563; margin-top: 16px; line-height: 1.5; }
.connexion-panneau .erreur { margin-top: 12px; background: #fdecea; color: #b3261e; border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.connexion-panneau .filet { height: 3px; width: 48px; background: #b08a3e; border-radius: 2px; margin: 0 0 18px; }
.turnstile { margin-top: 14px; min-height: 0; }
.turnstile:empty { display: none; }

/* ------------------------------------------------------------------ réception (existant, restylé) */
.ligne { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: 10px 12px; margin-bottom: 8px; border-left: 4px solid var(--bord-2); }
.ligne-info { display: flex; align-items: center; gap: 8px; }
.ligne-entete { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 3; background: var(--surface-2); padding: 8px 12px; margin-bottom: 6px; border-radius: var(--r-m); border: 1px solid var(--bord); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); font-weight: 700; }
.ligne-entete .e-img, .ligne .vignette { flex: none; width: 40px; }
.ligne .vignette { height: 40px; }
.ligne .c-ean, .ligne-entete .c-ean { flex: none; width: 108px; font-size: 12px; color: var(--texte-2); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .c-ref, .ligne-entete .c-ref { flex: none; width: 96px; font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .c-titre, .ligne-entete .c-titre { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .c-achat, .ligne-entete .c-achat { flex: none; width: 72px; text-align: right; font-size: 12px; font-family: var(--mono); color: var(--texte-2); }
.ligne .c-public, .ligne-entete .c-public { flex: none; width: 88px; text-align: right; font-size: 12px; font-weight: 600; font-family: var(--mono); }
.ligne .c-recu, .ligne-entete .c-recu { flex: none; width: 180px; text-align: center; }
.ligne .c-recu.fige { font-family: var(--mono); font-size: 18px; font-weight: 600; line-height: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }
.ligne .c-recu.fige .sur { font-size: 13px; color: var(--texte-2); }
.ligne .c-recu.fige.ok { color: var(--vert); } .ligne .c-recu.fige.trop { color: var(--rouge); }
.c-annot, .ligne-entete .c-annot { flex: none; width: 118px; display: flex; gap: 4px; padding-left: 6px; justify-content: flex-end; }
.c-annot .btn-petit { white-space: nowrap; }
.btn-suppr { color: var(--rouge); }
.ligne-meta { display: contents; }
.ligne .vignette { order: 1; } .ligne .c-ean { order: 2; } .ligne .c-ref { order: 3; } .ligne .c-titre { order: 4; }
.ligne .c-achat { order: 5; } .ligne .c-public { order: 6; } .ligne .c-recu { order: 8; } .ligne .c-annot { order: 9; }
@media (max-width: 720px) {
  .ligne-entete { display: none; }
  .ligne-info { flex-wrap: wrap; gap: 6px 10px; }
  .ligne .vignette { order: 1 !important; }
  .ligne .c-titre { order: 2 !important; flex: 1 1 auto; min-width: 0; font-size: 15px; }
  .ligne .c-recu { order: 3 !important; width: auto; }
  .ligne .c-annot { order: 4 !important; width: auto; }
  .ligne-meta { order: 5 !important; display: flex; flex-basis: 100%; width: 100%; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
  .ligne-meta > * { width: auto !important; text-align: left !important; flex: none; }
  .c-annot .lbl { display: none; }
  .c-annot .btn-petit { min-width: 44px; min-height: 44px; padding: 0 10px; }
}
.ligne.ok { border-left-color: var(--vert); }
.ligne.trop { border-left-color: var(--rouge); }
.ligne.inconnue { border-left-color: var(--ambre); background: var(--ambre-fond); }
.ligne.flash { animation: flash .6s; }
@keyframes flash { 0% { background: var(--dore-clair); } 100% { background: inherit; } }
.ligne .meta { font-size: 12px; color: var(--texte-2); }
.ecart { font-size: 13px; color: var(--ambre); }
.note-item { font-size: 14px; padding: 8px 0; border-top: 1px solid var(--ligne); }
.note-item .auteur { color: var(--texte-2); font-size: 12px; }
.note-item img { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.barre-scan { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-l); padding: 10px 14px; }
.barre-scan .muet { flex: 1; }
.cam-conteneur { position: fixed; inset: 0; background: #000; z-index: 45; display: flex; flex-direction: column; }
.cam-video { flex: 1; width: 100%; object-fit: cover; }
.cam-viseur { position: absolute; left: 10%; right: 10%; top: 35%; height: 26%; border: 3px solid #fff; border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.cam-fermer { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 46; }
.sous-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--texte-2); }
.tableau-edit td { padding: 6px 4px; }
.tableau-edit input { width: 100%; min-height: 40px; padding: 6px 8px; border: 1px solid var(--bord-2); border-radius: 8px; background: var(--surface); }
.tableau-edit .qte-col { width: 72px; } .tableau-edit .ean-col { width: 150px; }
.resume-bl { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.resume-bl .compteur { font-size: 16px; }

/* ------------------------------------------------------------------ zone de scan (Proposer) */
.zone-scan { height: 120px; border-radius: 12px; background: var(--encre); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; color: var(--ivoire); }
.zone-scan .ligne-rouge { position: absolute; left: 16px; right: 16px; top: 58px; height: 2px; background: var(--rouge); opacity: .9; }
.zone-scan.actif .ligne-rouge { animation: balayage 1.6s ease-in-out infinite alternate; }
@keyframes balayage { from { top: 30px; } to { top: 90px; } }
@media (prefers-reduced-motion: reduce) { .zone-scan.actif .ligne-rouge { animation: none; } }
.proposition-carte { display: flex; align-items: center; gap: 12px; }
.proposition-carte .corps { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ responsive : mobile (barre basse) */
@media (max-width: 900px) {
  .nav { display: none; }
  .coquille { flex-direction: column; }
  .page { padding-bottom: calc(var(--barre-h) + env(safe-area-inset-bottom)); }
  .page-tete { padding: 16px 16px 10px; align-items: center; }
  .page-tete h1 { font-size: 20px; }
  .page-corps { padding: 0 16px 16px; gap: 12px; }
  .barre-basse { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--barre-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--nav-fond); z-index: 30; justify-content: space-around; align-items: stretch; }
  .barre-basse a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--nav-texte); text-decoration: none; font-size: 11px; font-weight: 500; position: relative; min-width: 44px; }
  .barre-basse a.actif { color: var(--nav-blanc); }
  .barre-basse a.actif::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--dore); }
  .barre-basse .cpt { position: absolute; top: 8px; left: calc(50% + 6px); font-family: var(--mono); font-size: 10px; background: var(--dore); color: #1c1a17; padding: 1px 5px; border-radius: 999px; font-weight: 700; }
  .barre-basse .cpt.rouge { background: #b3261e; color: #fff; }
  .grille-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; } .kpi .val .num { font-size: 24px; }
  .stock-boutiques { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tableau td, .tableau th { padding: 8px 10px; }
  .motif-ligne { padding-left: 16px; }
  .tiroir { width: 100vw; }
  .barre-selection { position: fixed; left: 0; right: 0; border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 480px) { .grille-kpi { grid-template-columns: 1fr 1fr; } .stock-boutiques .lib { font-size: 9px; } }
@media print { .nav, .barre-basse, .barre-selection, .toast { display: none !important; } .page { padding: 0; } }
/* 6 cartes (total + 5 boutiques) sur une ligne dès 1200 px */
@media (min-width: 1200px) { .grille-kpi.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* tableaux dans une colonne de fiche : défilement horizontal interne */
.fiche-page .tableau-defil { overflow-x: auto; }

.grille-kpi.une { grid-template-columns: minmax(0, 420px); }
