/* ==========================================================================
   Les Merveilles — Espace créatrice (admin)
   ========================================================================== */
:root {
  --cream: #fdf9f3;
  --sand: #f6ede1;
  --line: #e8d9c5;
  --line-2: #f0e6d8;
  --gold: #b0864a;
  --gold-2: #d6b47e;
  --gold-dark: #876430;
  --ink: #3e3027;
  --muted: #7f6c5d;
  --danger: #b4423b;
  --ok: #4e7b52;
  --radius: 16px;
  --shadow-sm: 0 4px 14px rgba(94, 66, 38, .07);
  --f-title: 'Bodoni Moda', Georgia, serif;
  --f-body: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side-w: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--cream); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; font-size: 16px; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 500; margin: 0; line-height: 1.2; }
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px;
  font-weight: 500; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: background .2s, box-shadow .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, #c39a5c, var(--gold-dark)); color: #fff; box-shadow: 0 4px 12px rgba(135, 100, 48, .25); }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--gold-2); }
.icon-btn.danger { color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-dark); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(700px 400px at 80% 0%, rgba(214, 180, 126, .25), transparent 60%), var(--sand); }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px; text-align: center; box-shadow: 0 20px 50px rgba(94, 66, 38, .12); }
.login-moon { width: 40px; height: 40px; color: var(--gold); }
.login-brand { font-family: 'Great Vibes', cursive; font-size: 30px; margin: 4px 0 0; }
.login-card h1 { font-size: 26px; margin-bottom: 22px; }
.login-card .fld { text-align: left; }
.login-error { color: var(--danger); font-weight: 500; margin: -6px 0 10px; }
.login-demo { font-size: 13px; color: var(--muted); margin: 16px 0 10px; }
.login-back { font-size: 13.5px; color: var(--gold-dark); }

/* ---------- Champs ---------- */
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.fld > span em { font-style: normal; color: var(--muted); font-weight: 400; }
.fld input:not([type=checkbox]):not([type=color]), .fld select, .fld textarea, .inp {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.fld input:focus, .fld select:focus, .fld textarea:focus, .inp:focus { border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(214, 180, 126, .2); }
.fld textarea { resize: vertical; min-height: 80px; }
.fld .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.fld.err input, .fld.err select { border-color: var(--danger); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* Interrupteur */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d8cdbf; border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  background: var(--ink); color: #f1e4cf; padding: 22px 16px;
}
.side-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px 6px; }
.side-logo svg { width: 32px; height: 32px; color: var(--gold-2); }
.side-logo > span { display: flex; flex-direction: column; line-height: 1.1; }
.side-name { font-family: 'Great Vibes', cursive; font-size: 26px; color: #fff; }
.side-sub { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: #e6d6bd; font-size: 14.5px; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.active { background: rgba(214, 180, 126, .18); color: #fff; }
.nav .count { margin-left: auto; background: var(--gold); color: #fff; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: #cdbb9f; font-size: 14px; background: none; border: 0; text-align: left; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 28px; background: rgba(253, 249, 243, .95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.demo-note { margin: 14px 28px 0; padding: 8px 14px; border-radius: 10px; background: #fff6e2; color: #7a5a1c; font-size: 12.5px; }
.view { padding: 20px 28px 60px; max-width: 1200px; }
.tabbar { display: none; }

/* ---------- Cartes / sections ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 20px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.2; color: var(--gold); display: block; margin: 0 auto 8px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi span { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi strong { display: block; font-family: var(--f-title); font-size: 28px; font-weight: 500; margin-top: 4px; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.kpi.accent { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.accent span, .kpi.accent small { color: var(--gold-2); }

/* Barres (top articles) */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 7px 0; font-size: 14px; }
.bars .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }

/* Statuts */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-nouvelle { background: #fff1d6; color: #8a5d0f; }
.st-encours { background: #e6eefb; color: #2f5590; }
.st-prete { background: #e5f2e6; color: #36693a; }
.st-livree { background: #eeeae5; color: #6b5e52; }
.st-annulee { background: #f8e3e1; color: #9b3a33; }

/* Filtres (puces) */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; color: var(--muted); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip b { font-weight: 600; opacity: .7; margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; position: relative; }
.toolbar .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { width: 100%; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px 9px 38px; background: #fff; outline: none; }
.toolbar select { border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; background: #fff; }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #fcf7ef; }
.table .num { font-weight: 600; white-space: nowrap; }
.table .right { text-align: right; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--sand); display: block; }
.thumb-ph { width: 48px; height: 48px; border-radius: 10px; background: var(--sand); display: grid; place-items: center; color: var(--gold); }
.prod-name { font-weight: 500; }
.prod-sub { font-size: 12.5px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.hidden-row td { opacity: .55; }

/* Liste mobile (cartes) */
.list-cards { display: none; }

/* Petites fiches (commandes, articles) */
.list-cards { flex-direction: column; gap: 8px; }
.lc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; transition: border-color .2s; }
a.lc:hover { border-color: var(--gold-2); }
.lc .lc-main { min-width: 0; display: flex; flex-direction: column; }
.lc .lc-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc .lc-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc .lc-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lc.hidden-row { opacity: .6; }

/* ---------- Détail commande ---------- */.order-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.order-head h2 { font-size: 26px; }
.status-select { border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; background: #fff; font-weight: 500; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.items { list-style: none; margin: 0; padding: 0; }
.items > li { padding: 14px 0; border-top: 1px dashed var(--line); }
.items > li:first-child { border-top: 0; padding-top: 0; }
.items .it-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; font-size: 15.5px; }
.perso { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 8px 0 0; padding: 10px 12px; background: #fcf7ef; border-radius: 10px; font-size: 14px; }
.perso dt { color: var(--muted); }
.perso dd { margin: 0; font-weight: 600; }
.totals { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { font-size: 18px; font-weight: 600; margin-top: 4px; }

/* ---------- Formulaire article ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.form-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.form-side .card + .card { margin-top: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--sand); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .main-tag { position: absolute; left: 6px; top: 6px; background: var(--ink); color: #fff; font-size: 10.5px; padding: 2px 7px; border-radius: 999px; }
.photo .ph-actions { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; }
.photo .ph-actions button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.photo .ph-actions .ic { width: 14px; height: 14px; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--gold-2); background: #fffaf2; display: grid; place-items: center; text-align: center; color: var(--gold-dark); font-size: 12.5px; cursor: pointer; padding: 6px; }
.photo-add .ic { width: 24px; height: 24px; display: block; margin: 0 auto 4px; }

.opt { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fffdf9; }
.opt + .opt { margin-top: 12px; }
.opt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.opt-head .opt-num { width: 26px; height: 26px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.opt-head .opt-title { font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-head .icon-btn { width: 32px; height: 32px; }
.opt-head .icon-btn .ic { width: 15px; height: 15px; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice { display: grid; grid-template-columns: 1fr 44px 110px 34px; gap: 6px; align-items: center; }
.choice.no-color { grid-template-columns: 1fr 110px 34px; }
.choice input[type=color] { width: 44px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; }
.choice .palette { width: 44px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); }
.price-inp { position: relative; }
.price-inp input { padding-right: 26px !important; }
.price-inp::after { content: '€'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.choice-head { display: grid; grid-template-columns: 1fr 44px 110px 34px; gap: 6px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.choice-head.no-color { grid-template-columns: 1fr 110px 34px; }
.opt-more { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.fonts-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.fonts-pick label { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; background: #fff; }
.add-opt { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.savebar {
  position: sticky; bottom: 0; z-index: 15; margin: 18px -28px -60px; padding: 12px 28px;
  display: flex; justify-content: flex-end; gap: 10px; background: rgba(253, 249, 243, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.savebar .dirty { margin-right: auto; align-self: center; font-size: 13px; color: var(--gold-dark); }

/* Catégories / réglages */
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.cat-row:last-child { border-bottom: 0; }
.cat-row input { flex: 1; }
.cat-row .cnt { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 70px; text-align: right; }
.liv-row { display: grid; grid-template-columns: 1.2fr 1.4fr 110px; gap: 8px; margin-bottom: 8px; }

/* ---------- Dialogue / toast ---------- */
.dialog-bg { position: fixed; inset: 0; z-index: 100; background: rgba(40, 28, 20, .45); display: grid; place-items: center; padding: 20px; }
.dialog { background: #fff; border-radius: 18px; padding: 22px; width: min(420px, 100%); box-shadow: 0 30px 70px rgba(0,0,0,.3); }
.dialog h2 { font-size: 22px; margin-bottom: 8px; }
.dialog p { color: var(--muted); margin: 0 0 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 20px; font-size: 14px; transition: transform .3s, visibility .3s;
  max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.err { background: var(--danger); }

/* ==========================================================================
   Tablette
   ========================================================================== */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-side { position: static; }
}

/* ==========================================================================
   Mobile : barre d'onglets en bas, cartes au lieu des tableaux
   ========================================================================== */
@media (max-width: 860px) {
  .app { display: block; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .topbar { padding: 10px 14px; min-height: 56px; }
  .topbar h1 { font-size: 21px; }
  .topbar-actions .btn { padding: 8px 12px; font-size: 13.5px; }
  .topbar-actions .btn .lbl { display: none; }
  .demo-note { margin: 10px 14px 0; font-size: 12px; }
  .view { padding: 14px 14px 40px; }
  .card { padding: 14px; border-radius: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpi { padding: 12px 14px; }
  .kpi strong { font-size: 22px; }
  .kv { grid-template-columns: 100px 1fr; font-size: 14px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 10.5px; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--gold-dark); }
  .tabbar .count { position: absolute; top: 0; left: 50%; margin-left: 6px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 600; padding: 0 5px; border-radius: 999px; min-width: 16px; text-align: center; }

  .table.desktop-only { display: none; }
  .list-cards { display: flex; flex-direction: column; gap: 8px; }


  .choice, .choice-head { grid-template-columns: 1fr 44px 92px 34px; }
  .choice.no-color, .choice-head.no-color { grid-template-columns: 1fr 92px 34px; }
  .liv-row { grid-template-columns: 1fr 100px; }
  .liv-row input:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .savebar { margin: 16px -14px -40px; padding: 10px 14px; bottom: calc(66px + env(safe-area-inset-bottom)); }
  .savebar .btn { flex: 1; }
  .savebar .dirty { display: none; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ---------- Impression : bon de commande ---------- */
@media print {
  .side, .topbar, .tabbar, .demo-note, .no-print, .toast { display: none !important; }
  .app { display: block; padding: 0; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; font-size: 12.5pt; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Tableaux : lisibles sur écrans moyens */
.table .nowrap { white-space: nowrap; }
.table .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1280px) { .table .col-liv { display: none; } }
/* Formulaire article : aucune colonne ne doit élargir la page sur petit écran */
.form-grid > *, .opt, .card { min-width: 0; }
.choice, .choice-head { grid-template-columns: minmax(0, 1fr) 44px 110px 34px; }
.choice.no-color, .choice-head.no-color { grid-template-columns: minmax(0, 1fr) 110px 34px; }
.choice input, .row input, .row select, .row textarea { min-width: 0; }
.row { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
@media (max-width: 1100px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .choice, .choice-head { grid-template-columns: minmax(0, 1fr) 40px 84px 34px; }
  .choice.no-color, .choice-head.no-color { grid-template-columns: minmax(0, 1fr) 84px 34px; }
  .opt { padding: 12px; }
  .opt-head .icon-btn { width: 30px; height: 30px; }
}
/* Aperçu photo : choix de la photo et éditeur de zone */
.pz-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pz-thumb { width: 52px; height: 52px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: var(--sand); display: grid; place-items: center; cursor: pointer; }
.pz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pz-thumb.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(176, 134, 74, .25); }
.pz-add { border-style: dashed; color: var(--gold-dark); background: #fffaf2; }
.pz-editor { position: relative; border-radius: 12px; overflow: hidden; container-type: inline-size; touch-action: none; cursor: crosshair; border: 1px solid var(--line); }
.pz-editor img { width: 100%; display: block; user-select: none; pointer-events: none; }
.pz-label {
  position: absolute; white-space: nowrap; line-height: 1.05; color: #fff; cursor: grab; touch-action: none; user-select: none;
  text-shadow: 0 0 2px rgba(0,0,0,.7), 0 1px 3px rgba(0,0,0,.5);
  outline: 1.5px dashed rgba(255,255,255,.95); outline-offset: 4px; padding: 0 2px;
}
.pz-label:active { cursor: grabbing; }
input[type=range] { width: 100%; accent-color: var(--gold); }

.noel-tag { display: inline-block; background: #9e2b2c; color: #fff; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }

/* Connexion en ligne */
.login-forgot { display: block; margin: 12px auto 0; font-size: 13.5px; }
/* Indicateur de publication sur la boutique */
.sync { flex-shrink: 0; border: 0; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: default; }
.sync::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.sync-ok { background: #e5f2e6; color: #36693a; }
.sync-pending { background: #fff1d6; color: #8a5d0f; }
.sync-pending::before { animation: syncBlink 1s ease-in-out infinite; }
.sync-err { background: #f8e3e1; color: #9b3a33; cursor: pointer; }
@keyframes syncBlink { 50% { opacity: .2; } }
@media (max-width: 860px) { .sync { font-size: 11px; padding: 3px 9px; } .topbar-left { flex-wrap: wrap; row-gap: 2px; } }

/* En ligne : pas de commandes de démo */
.en-ligne [data-act="demo-orders"], .en-ligne [data-act="clear-orders"] { display: none !important; }
