:root {
  --bg: #EEF1F0;
  --surface: #FFFFFF;
  --surface-2: #F6F8F7;
  --ink: #1C2233;
  --ink-2: #5A6272;
  --line: #D9DEDC;
  --dispo: #1F8A4C;
  --dispo-bg: #E2F3E8;
  --cours: #D9730D;
  --cours-bg: #FCEBD8;
  --vendu: #2F5FD0;
  --vendu-bg: #E3EAFB;
  --danger: #B8342A;
  --danger-bg: #F8E2E0;
  --focus: #2F5FD0;
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --shadow-sheet: 0 -8px 30px rgba(28, 34, 51, .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161F; --surface: #1B2130; --surface-2: #222939; --ink: #ECEFF4; --ink-2: #A3ABBA;
    --line: #2F3748; --dispo: #4CC27E; --dispo-bg: #183A28; --cours: #F29A45; --cours-bg: #42301C;
    --vendu: #7C9EF0; --vendu-bg: #1E2B4F; --danger: #EE7B71; --danger-bg: #45201D; --focus: #7C9EF0;
    --shadow-sheet: 0 -8px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.hidden { display: none !important; }

/* ---------- structure ---------- */
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: 88px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding: 14px 16px 10px;
  display: flex; align-items: center; gap: 12px;
}
.topbar h1 {
  margin: 0; flex: 1; min-width: 0;
  font-size: 1.5rem; font-weight: 800; font-stretch: 85%; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.back {
  border: 0; background: var(--surface); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.back svg { width: 20px; height: 20px; }
main { padding: 0 16px; }
section + section { margin-top: 28px; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px; }

/* ---------- navigation basse ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { display: flex; width: 100%; max-width: 720px; }
.tabbar a {
  flex: 1; text-decoration: none; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 2px 10px; font-size: .74rem; font-weight: 600; position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--ink); }
.tabbar a.active::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  background: var(--ink); border-radius: 0 0 3px 3px;
}
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px);
  background: var(--cours); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: grid; place-items: center;
}

/* ---------- formulaires ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--radius-s); padding: 11px 12px; font-size: 1rem;
}
.input:focus { border-color: var(--focus); outline: none; }
textarea.input { min-height: 70px; resize: vertical; }
.search {
  position: relative; margin-bottom: 14px;
}
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; color: var(--ink-2); }
.search .input { padding-left: 42px; border-radius: 999px; }

.btn {
  border: 0; cursor: pointer; border-radius: var(--radius-s);
  padding: 13px 18px; font-weight: 700; font-size: 1rem;
  background: var(--surface-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-take { background: var(--cours); color: #fff; }
.btn-sold { background: var(--vendu); color: #fff; }
.btn-cancel { background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-small { padding: 8px 12px; font-size: .9rem; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: .9rem; white-space: nowrap; cursor: pointer;
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- liste produits ---------- */
.plist { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; }
.plist li + li { border-top: 1px solid var(--line); }
.plist a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; color: inherit; }
.thumb {
  width: 56px; height: 56px; border-radius: var(--radius-s); flex: none;
  background: var(--surface-2) center/cover no-repeat;
  display: grid; place-items: center; color: var(--ink-2); font-weight: 800; font-size: 1.3rem;
}
.plist .name { font-weight: 700; font-size: 1.05rem; }
.plist .meta { font-size: .88rem; color: var(--ink-2); }
.plist .count { margin-left: auto; text-align: right; flex: none; }
.plist .count b { display: block; font-size: 1.35rem; font-stretch: 80%; color: var(--dispo); line-height: 1.1; }
.plist .count small { color: var(--ink-2); font-size: .78rem; }
.plist .count .zero { color: var(--ink-2); }

/* ---------- variante + boîtes de pointures (élément signature) ---------- */
.variant { background: var(--surface); border-radius: var(--radius-m); padding: 14px; }
.variant + .variant { margin-top: 14px; }
.vhead { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.vhead .thumb { width: 64px; height: 64px; cursor: zoom-in; }
.vhead h3 { margin: 0; font-size: 1.1rem; }
.vhead .price { color: var(--ink-2); font-size: .92rem; }
.vhead .vactions { margin-left: auto; }

.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.box {
  border: 0; cursor: pointer; text-align: left;
  background: var(--surface-2); border-radius: var(--radius-s);
  padding: 8px 9px 0; display: flex; flex-direction: column; overflow: hidden;
  border-left: 5px solid var(--dispo);
}
.box.low { border-left-color: var(--cours); }
.box.out { border-left-color: var(--line); }
.box .sz { font-size: 2rem; font-weight: 800; font-stretch: 70%; line-height: 1; letter-spacing: -.02em; }
.box.out .sz { color: var(--ink-2); }
.box .dispo { font-size: .8rem; font-weight: 600; color: var(--dispo); margin: 3px 0 7px; }
.box.out .dispo { color: var(--ink-2); }
.box .dispo b { font-size: 1rem; }
.bar { display: flex; height: 6px; margin: 0 -9px; gap: 1px; background: var(--line); }
.bar i { display: block; height: 100%; }
.bar .g { background: var(--dispo); }
.bar .o { background: var(--cours); }
.bar .b { background: var(--vendu); }
.box .tags { display: flex; gap: 6px; font-size: .74rem; font-weight: 700; margin: -3px 0 6px; min-height: 1em; }
.tag-o { color: var(--cours); }
.tag-b { color: var(--vendu); }

.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--ink-2); margin: 0 0 12px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .l-g::before { background: var(--dispo); }
.legend .l-o::before { background: var(--cours); }
.legend .l-b::before { background: var(--vendu); }

/* ---------- commandes en cours ---------- */
.order {
  background: var(--surface); border-radius: var(--radius-m); padding: 14px;
  border-left: 5px solid var(--cours);
}
.order + .order { margin-top: 10px; }
.order.vendu { border-left-color: var(--vendu); }
.order.annule { border-left-color: var(--line); }
.order .top { display: flex; gap: 12px; align-items: flex-start; }
.order .what { flex: 1; min-width: 0; }
.order .what b { display: block; font-size: 1.02rem; }
.order .sizebig { font-size: 2.2rem; font-weight: 800; font-stretch: 70%; line-height: 1; flex: none; }
.order .info { font-size: .86rem; color: var(--ink-2); margin-top: 2px; }
.order .note { font-size: .9rem; margin-top: 8px; background: var(--surface-2); padding: 7px 10px; border-radius: var(--radius-s); }
.order .actions { display: flex; gap: 10px; margin-top: 12px; }
.order .actions .btn { flex: 1; }
.status { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.st-en_cours, .st-EN_COURS { background: var(--cours-bg); color: var(--cours); }
.st-vendu, .st-VENDU { background: var(--vendu-bg); color: var(--vendu); }
.st-annule, .st-ANNULE { background: var(--surface-2); color: var(--ink-2); }
.st-ARRIVAGE { background: var(--dispo-bg); color: var(--dispo); }
.st-CORRECTION { background: var(--danger-bg); color: var(--danger); }

/* ---------- historique ---------- */
.hist { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; }
.hist li { padding: 12px 14px; display: grid; grid-template-columns: 58px 1fr; gap: 0 12px; }
.hist li + li { border-top: 1px solid var(--line); }
.hist .time { font-size: .82rem; color: var(--ink-2); line-height: 1.3; }
.hist .time b { display: block; color: var(--ink); font-size: .95rem; }
.hist .lbl { font-weight: 600; }
.hist .who { font-size: .86rem; color: var(--ink-2); }
.daysep { padding: 8px 14px !important; background: var(--surface-2); font-weight: 700; font-size: .88rem; display: block !important; }

/* ---------- tableau de bord ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border-radius: var(--radius-m); padding: 14px; }
.stat b { display: block; font-size: 2.1rem; font-weight: 800; font-stretch: 75%; line-height: 1.05; }
.stat span { font-size: .88rem; color: var(--ink-2); }
.stat.g b { color: var(--dispo); }
.stat.o b { color: var(--cours); }
.stat.b b { color: var(--vendu); }
.table { background: var(--surface); border-radius: var(--radius-m); overflow: hidden; }
.table .tr { display: flex; align-items: center; padding: 11px 14px; gap: 10px; text-decoration: none; color: inherit; }
.table .tr + .tr { border-top: 1px solid var(--line); }
.table .tr .grow { flex: 1; min-width: 0; }
.table .tr .grow small { display: block; color: var(--ink-2); font-size: .84rem; }
.pill-n { font-weight: 800; font-size: 1.1rem; min-width: 34px; text-align: right; }

/* ---------- feuille du bas & dialogues ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 18, 28, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
.sheet {
  background: var(--surface); width: 100%; max-width: 720px;
  border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: var(--shadow-sheet);
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto;
  animation: up .2s ease-out;
}
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 1.25rem; margin-bottom: 4px; }
.sheet .sub { color: var(--ink-2); margin: 0 0 16px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scrim, .sheet { animation: none; } }

.counts3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.counts3 div { border-radius: var(--radius-s); padding: 10px; text-align: center; }
.counts3 b { display: block; font-size: 1.8rem; font-weight: 800; font-stretch: 75%; line-height: 1.1; }
.counts3 span { font-size: .82rem; font-weight: 600; }
.c-g { background: var(--dispo-bg); color: var(--dispo); }
.c-o { background: var(--cours-bg); color: var(--cours); }
.c-b { background: var(--vendu-bg); color: var(--vendu); }

.stepper { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: var(--radius-s); overflow: hidden; width: max-content; }
.stepper button { border: 0; background: var(--surface-2); width: 48px; height: 48px; font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.stepper output { min-width: 56px; text-align: center; font-size: 1.3rem; font-weight: 800; }

.sizes-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 14px; }
.sizes-edit label { background: var(--surface-2); border-radius: var(--radius-s); padding: 8px; display: block; }
.sizes-edit label span { display: block; font-weight: 800; font-size: 1.3rem; font-stretch: 75%; }
.sizes-edit input { width: 100%; border: 1.5px solid var(--line); border-radius: 4px; padding: 6px; background: var(--surface); }

.photo-pick { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.photo-pick .thumb { width: 72px; height: 72px; }

/* ---------- divers ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-weight: 600; max-width: calc(100vw - 32px); text-align: center;
  animation: up .2s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
.empty { background: var(--surface); border-radius: var(--radius-m); padding: 28px 18px; text-align: center; }
.empty p { margin: 0 0 14px; color: var(--ink-2); }
.empty p:last-child { margin-bottom: 0; }
.loading { padding: 40px 0; text-align: center; color: var(--ink-2); }
.fab {
  position: fixed; right: max(16px, calc(50vw - 344px)); bottom: 84px; z-index: 15;
  border-radius: 999px; box-shadow: 0 6px 18px rgba(28,34,51,.25);
}
.linkbtn { border: 0; background: none; color: var(--vendu); font-weight: 600; cursor: pointer; padding: 6px 0; }
.iconbtn { border: 0; background: var(--surface-2); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.iconbtn svg { width: 18px; height: 18px; }

/* ---------- connexion ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.auth .mark { display: flex; gap: 4px; margin-bottom: 22px; }
.auth .mark i { width: 34px; height: 10px; border-radius: 2px; }
.auth h1 { font-size: 2.1rem; font-weight: 800; font-stretch: 80%; line-height: 1.05; margin: 0 0 8px; }
.auth p { color: var(--ink-2); margin: 0 0 24px; }
.install-hint { margin-top: 16px; font-size: .9rem; }
.imgview { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: var(--radius-s); }

/* ---------- modèles : filtres, pastilles, fiche ---------- */
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(128,128,128,.35); }
.thumb.nophoto { background: var(--surface-2); position: relative; overflow: hidden; }
.thumb.nophoto::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: var(--sw, transparent); }
.filters { margin-bottom: 8px; }
.filters .input { padding: 9px 10px; font-size: .95rem; }
.check { display: flex; align-items: center; gap: 9px; font-size: .92rem; margin: 0 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.plist .group { padding: 9px 14px; background: var(--surface-2); font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.plist .pinfo { min-width: 0; }
.plist .name { line-height: 1.25; }
.plist .meta { margin-top: 3px; }

.mhero { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.mphoto { border: 0; padding: 0; cursor: zoom-in; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-m); background: var(--surface) center/cover no-repeat; }
.mname { font-size: 1.45rem; font-weight: 800; font-stretch: 85%; line-height: 1.15; margin: 0 0 4px; letter-spacing: -.01em; }
.mprice { font-size: 1.1rem; font-weight: 600; color: var(--ink-2); }
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); background: var(--surface); border-radius: var(--radius-m); overflow: hidden; margin: 0; }
.traits div { padding: 9px 12px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.traits dt { font-size: .78rem; color: var(--ink-2); }
.traits dd { margin: 0; font-weight: 700; }

.namepreview { background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 16px; position: sticky; top: -10px; z-index: 2; }
.namepreview small { display: block; color: var(--ink-2); font-size: .78rem; }
.namepreview b { font-size: 1.05rem; line-height: 1.25; display: block; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.formgrid .field:first-child { grid-column: 1 / -1; }
.addval { display: flex; gap: 6px; margin-top: 6px; }
.addval .input { padding: 8px 10px; }

.listblock { background: var(--surface); border-radius: var(--radius-m); padding: 12px 14px; }
.listblock + .listblock { margin-top: 10px; }
.listblock h3 { margin: 0 0 8px; font-size: 1rem; }
.vals { display: flex; flex-wrap: wrap; gap: 6px; }
.val { border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.val small { color: var(--ink-2); font-weight: 500; }
.val.off { opacity: .5; text-decoration: line-through; }
.val.add { background: none; border-style: dashed; color: var(--vendu); }

.order .thumb { width: 52px; height: 52px; }
.oname { color: inherit; text-decoration: none; font-weight: 700; font-size: 1.02rem; line-height: 1.25; display: block; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 360px) { .formgrid { grid-template-columns: 1fr; } }

.mystats { margin-bottom: 16px; }
.mystats .stat b { font-size: 1.9rem; }
.mystats .wide { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mystats .wide b { font-size: 1.5rem; }
/* photos plus grandes dans la liste : les vendeurs reconnaissent d'abord le modèle à l'image */
.plist .thumb { width: 72px; height: 72px; }

/* ---------- v4 : commandes, arrivage, import, réglages ---------- */
.small { font-size: .86rem; }
.code { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--ink); }
.mcode { margin-bottom: 4px; font-size: .86rem; color: var(--ink-2); }
.h3 { font-size: 1rem; margin: 18px 0 6px; }

.actions-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 14px; }
.act { border: 0; background: var(--surface); border-radius: var(--radius-m); padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .82rem; cursor: pointer; }
.act svg { width: 24px; height: 24px; }

.sticky-cta { position: sticky; bottom: 76px; z-index: 5; margin: 18px -16px 0; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--line); }
.cta-sum { margin: 0 0 8px; font-weight: 600; font-size: .95rem; }

.cartmodel { background: var(--surface); border-radius: var(--radius-m); padding: 12px 14px; }
.cartmodel + .cartmodel { margin-top: 10px; }
.cmhead { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.cmhead .thumb { width: 52px; height: 52px; }
.cmhead .pinfo { flex: 1; min-width: 0; }
.cmhead .name { font-weight: 700; line-height: 1.25; }
.cmhead .meta { font-size: .86rem; color: var(--ink-2); margin-top: 2px; }
.sizechips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.schip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: .9rem; }
.schip b { font-stretch: 80%; font-size: 1.05rem; }
.schip button { border: 0; background: none; font-size: 1.1rem; line-height: 1; padding: 2px 6px; cursor: pointer; color: var(--ink-2); }
.schip:not(:has(button)) { padding-right: 11px; }

.pick { margin-bottom: 14px; }
.pickrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pickrow .sz { font-size: 1.6rem; font-weight: 800; font-stretch: 70%; width: 44px; }
.pickrow .muted { flex: 1; font-size: .9rem; }
.pickrow.off { opacity: .45; }
.stepper.small button { width: 38px; height: 38px; font-size: 1.15rem; }
.stepper.small output { min-width: 34px; font-size: 1.1rem; }
.stepper button:disabled { opacity: .35; }
.sres { max-height: 60vh; overflow-y: auto; }
.sres .plist a { cursor: pointer; }

.order.cmd { display: block; text-decoration: none; color: inherit; }
.order.cmd.closed { border-left-color: var(--vendu); }
.cmdcounts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.thumbs { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.thumb.mini { width: 36px; height: 36px; border-radius: 6px; font-size: .9rem; }
.thumbs .muted { margin-left: 4px; font-size: .86rem; }

.cmdhead { background: var(--surface); border-radius: var(--radius-m); padding: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.kv span { color: var(--ink-2); }
.kv b { text-align: right; }
.sline { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.sline + .sline { margin-top: 0; }
.sline .sz { font-size: 1.5rem; font-weight: 800; font-stretch: 70%; width: 40px; flex: none; }
.sline .grow { flex: 1; min-width: 0; }
.sline.settle { flex-wrap: wrap; }
.setcol { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.setcol small { font-size: .74rem; color: var(--ink-2); font-weight: 600; }
.settlebar { background: var(--vendu-bg); border-radius: var(--radius-m); padding: 12px 14px; }
.settlebar .row .btn { padding: 8px 6px; font-size: .86rem; }

.whorow { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.shead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.table .tr .thumb.mini { flex: none; }
button.tr { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.table .tr + button.tr, .table button.tr + .tr { border-top: 1px solid var(--line); }

.stat.err b { color: var(--danger); }
.howto .row { flex-wrap: wrap; }
.howto .row .btn { flex: 1 1 auto; }
.implist { list-style: none; padding: 0; margin: 14px 0 0; }
.implist li { background: var(--surface); border-radius: var(--radius-m); padding: 10px 14px; border-left: 5px solid var(--line); }
.implist li + li { margin-top: 8px; }
.implist .t-nouveau { border-left-color: var(--dispo); }
.implist .t-arrivage { border-left-color: var(--vendu); }
.implist .t-erreur { border-left-color: var(--danger); }
.implist .ihead { display: flex; justify-content: space-between; align-items: center; font-size: .84rem; }
.implist .name { font-weight: 700; margin-top: 4px; }
.ierr { color: var(--danger); font-size: .9rem; margin-top: 4px; font-weight: 600; }
.iwarn { color: var(--ink-2); font-size: .88rem; margin-top: 4px; }

.seg { display: flex; border: 1.5px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 11px; font-weight: 600; background: var(--surface); }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.perms { border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px 12px; margin: 0 0 14px; }
.perms legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.perms .check { margin: 8px 0; align-items: flex-start; }
.perms .check input { margin-top: 1px; flex: none; }
.fab.btn-take { color: #fff; text-decoration: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-block svg { width: 22px; height: 22px; }

/* ---------- photos : import et ajout rapide ---------- */
.checks { display: flex; flex-wrap: wrap; gap: 0 18px; }
.mphoto.addphoto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 2px dashed var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; aspect-ratio: 16 / 7; }
.mphoto.addphoto svg { width: 30px; height: 30px; }
.irow { display: flex; gap: 12px; align-items: flex-start; margin-top: 4px; }
.irow .thumb { width: 64px; height: 64px; flex: none; }
.thumb.nophoto.small { font-size: .7rem; font-weight: 600; text-align: center; line-height: 1.1; padding: 4px; }
.irow .grow { flex: 1; min-width: 0; }
.photohelp { margin-top: 12px; background: var(--surface); border-radius: var(--radius-m); padding: 10px 14px; }
.photohelp summary { font-weight: 700; cursor: pointer; }
.photohelp p, .photohelp li { font-size: .92rem; }
.photohelp ul { padding-left: 18px; margin: 6px 0; }
.photohelp li + li { margin-top: 6px; }

/* ---------- v6 : comptes, partage, filtres ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2) center/cover no-repeat; font-weight: 800; font-size: .9rem; color: var(--ink-2); }
.avatar.ini { background: var(--vendu-bg); color: var(--vendu); }
.avatar.sm { width: 30px; height: 30px; font-size: .74rem; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.6rem; }
.mebtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; text-decoration: none; }
.mebtn .avatar.sm { width: 38px; height: 38px; }
.profile { display: flex; align-items: center; gap: 16px; }
.bigavatar { position: relative; cursor: pointer; }
.bigavatar .edit { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.bigavatar .edit svg { width: 15px; height: 15px; }
.bigcode { font-size: 2.2rem; font-weight: 800; letter-spacing: .08em; text-align: center; background: var(--surface-2); border-radius: var(--radius-m); padding: 18px 10px; margin: 0 0 14px; }
.btn-wa { background: #1FA855; color: #fff; text-decoration: none; }
.card-link { background: var(--surface); border-radius: var(--radius-m); }
.chev { color: var(--ink-2); font-size: 1.4rem; line-height: 1; }
.table .tr small + small { margin-top: 1px; }
.kv b.who { display: inline-flex; align-items: center; gap: 8px; }
.filters.dates label { flex: 1; display: block; }
.filters.dates small { display: block; margin-bottom: 3px; font-size: .78rem; }
.filtertag { font-size: .9rem; margin: -4px 0 12px; }
.order.cmd .top > .avatar { margin-top: 2px; }
.szline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.szline span { font-size: .78rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--dispo-bg); color: var(--dispo); }
.szline span.hit { background: var(--dispo); color: #fff; }
.sharelist { list-style: none; padding: 0; margin: 0 0 8px; max-height: 46vh; overflow-y: auto; }
.sharelist label { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sharelist input { width: 20px; height: 20px; flex: none; accent-color: var(--ink); }
.sharelist .grow { flex: 1; min-width: 0; }
.sharelist small { display: block; color: var(--ink-2); }
.codeform { display: flex; gap: 8px; }
.codeform .input { font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; }
.fixbar { background: var(--cours-bg); }
.sline.changed { background: var(--cours-bg); margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
.fixinfo { flex-basis: 100%; padding-left: 50px; }
.sline.fix { display: grid; grid-template-columns: 40px repeat(3, 1fr); gap: 4px 6px; align-items: end; }
.sline.fix .stepper.small { width: 100%; }
.sline.fix .stepper.small button { width: 30px; height: 36px; font-size: 1rem; flex: none; }
.sline.fix .stepper.small output { flex: 1; min-width: 0; font-size: 1rem; }
.sline.fix .fixinfo { grid-column: 2 / -1; padding-left: 0; }
.sline.fix .sz { align-self: center; }
.table .tr { text-decoration: none; color: inherit; }

/* ---------- v7 : sélecteur, pointures, historique, inactifs ---------- */
.input.picker { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; min-width: 0; }
.picker .pk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .avatar.sm { width: 24px; height: 24px; font-size: .62rem; }
.filters.pickers > * { flex: 1 1 0; min-width: 0; }
.prow { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 9px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: inherit; }
.prow .grow { flex: 1; min-width: 0; }
.prow small { display: block; color: var(--ink-2); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sizechipsbar { display: flex; gap: 6px; overflow-x: auto; align-items: center; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.sizechipsbar .muted { flex: none; margin-right: 2px; }
.szchip { flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 8px; min-width: 44px; padding: 6px 8px; font-weight: 800; font-size: 1rem; cursor: pointer; }
.szchip.on { background: var(--dispo); border-color: var(--dispo); color: #fff; }
.plist li.inactive a { opacity: .6; }
.inactivebar { background: var(--surface-2); border-left: 4px solid var(--ink-2); padding: 8px 10px; border-radius: 6px; font-size: .9rem; margin-bottom: 8px; }
.morefilters { margin: 0 0 12px; }
.morefilters summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink-2); padding: 4px 0; }
.morefilters .chips { margin: 8px 0 0; }
.hist.events li { padding: 0; display: block; }
.hist.events li.daysep { padding: 8px 14px; }
.evrow { display: grid; grid-template-columns: 50px 1fr auto auto; gap: 0 10px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; }
.evrow .time { align-self: start; }
.evrow .grow { min-width: 0; }
.thumbs-stack { display: flex; }
.thumbs-stack .thumb.mini { width: 30px; height: 30px; margin-left: -8px; border: 2px solid var(--surface); }
.st-EN_COURS, .st-COMMANDE { background: var(--cours-bg); color: var(--cours); }
.sline.fix.open { grid-template-columns: 40px 1fr 2fr; }
.sline.fix.removed { opacity: .55; }
.sline.added { background: var(--dispo-bg); margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
.errbox { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: 8px; font-size: .92rem; font-weight: 600; }

/* ---------- liste déroulante des pointures (choix multiple) ---------- */
.msel { position: relative; margin-bottom: 10px; }
.msel-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.msel-btn.on { border-color: var(--dispo); color: var(--dispo); font-weight: 700; }
.msel-btn .caret { color: var(--ink-2); font-size: .9rem; }
.msel-panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 10px 28px rgba(28,34,51,.18); padding: 12px; }
.msel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; }
.msel-opt { cursor: pointer; }
.msel-opt input { position: absolute; opacity: 0; pointer-events: none; }
.msel-opt span { display: block; text-align: center; padding: 9px 4px; border-radius: 8px; border: 1.5px solid var(--line); font-weight: 800; font-size: 1.05rem; }
.msel-opt input:checked + span { background: var(--dispo); border-color: var(--dispo); color: #fff; }
.msel-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.msel-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.msel-foot .btn { flex: 1; }
.demobar { margin: -4px 16px 12px; padding: 6px 10px; border-radius: 8px; background: var(--cours-bg); color: var(--cours); font-size: .82rem; font-weight: 600; }
.demologin { margin-top: 22px; padding: 14px; border-radius: var(--radius-m); background: var(--cours-bg); }
.demologin p { margin: 4px 0 10px; font-size: .9rem; color: var(--ink); }

/* ---------- abonnement (SaaS) ---------- */
.abobar { display: block; margin: -4px 16px 12px; padding: 8px 12px; border-radius: 8px; background: var(--vendu-bg); color: var(--vendu); font-size: .85rem; text-decoration: none; }
.abobar.warn { background: var(--danger-bg); color: var(--danger); }
.abobar b { text-decoration: underline; }
.abobox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 14px; margin-bottom: 14px; }
.abobox p { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.abobox.warn { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.abobox.warn p { color: inherit; }
.abobox.info { background: var(--cours-bg); border-color: transparent; color: var(--cours); }
.abobox.info p { color: inherit; }
.abobox.total { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; }
.abobox.total b { font-size: 1.3rem; }
.abobox .pre { white-space: pre-line; color: var(--ink); }
.abo-essai { background: var(--vendu-bg); color: var(--vendu); }
.abo-actif, .abo-gratuit { background: var(--dispo-bg); color: var(--dispo); }
.abo-retard { background: var(--cours-bg); color: var(--cours); }
.abo-expire, .abo-suspendu { background: var(--danger-bg); color: var(--danger); }
.usebar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; max-width: 200px; }
.usebar i { display: block; height: 100%; background: var(--dispo); }
.usebar i.full { background: var(--danger); }
.plans { display: grid; gap: 10px; margin-bottom: 12px; }
.plan { display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; cursor: pointer; }
.plan.on { border-color: var(--vendu); background: var(--vendu-bg); }
.plan .price { font-size: 1.25rem; font-weight: 700; }
.plan .price small { font-size: .8rem; font-weight: 400; color: var(--ink-2); }
.slugfield { display: flex; align-items: center; gap: 6px; }
.slugfield .input { flex: 1; min-width: 0; }
.slugfield span { color: var(--ink-2); white-space: nowrap; font-size: .9rem; }
