/* Espace boutique — shared stylesheet. Shop colours and logo sizes: assets/theme.css (stores/<id>/theme.css), loaded after this file. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
h1 { font-size: 26px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.015em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; color: var(--ink); }
.right { text-align: right; }

/* ---------- layout ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; z-index: 30; }
.brand { display: flex; flex-direction: column; gap: 8px; padding: 16px 14px 14px; margin: 0 0 22px; border-radius: 14px; text-decoration: none !important; }
.brand img { width: var(--logo-w); height: auto; display: block; }
.brand span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side nav .soon, .side-foot a, .side-foot button, .side-foot .who { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font: inherit; font-weight: 500; background: none; border: 0; width: 100%; text-decoration: none; }
.side nav a, .side-foot a, .side-foot button { cursor: pointer; }
.side nav a:hover, .side-foot a:hover, .side-foot button:hover { background: var(--line-2); color: var(--ink); }
.side nav a.on { background: var(--brand-l); color: var(--brand-d); }
.side nav a.on .ic { color: var(--brand); }
.side nav .soon { color: var(--faint); cursor: default; }
.side nav .soon em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--muted); padding: 2px 7px; border-radius: 6px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.side-foot .who { color: var(--muted); font-size: 14px; }
.side-foot form { margin: 0; }
.main { margin-left: var(--side); padding: 32px 40px 80px; max-width: 1480px; }
.burger { display: none; }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .nav-open .side { transform: none; }
  .burger { display: grid; place-items: center; position: fixed; top: 12px; left: 12px; z-index: 31; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
  .main { margin-left: 0; padding: 70px 16px 60px; }
}

/* ---------- head / toolbar ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.filters-r { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-r select { width: auto; margin: 0; padding: 9px 12px; max-width: 260px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--brand-dd); border-color: var(--brand-dd); color: #fff; } .chip.on b { color: #fff; opacity: .75; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-width: 260px; flex: 1 1 260px; max-width: 420px; margin: 0; }
.search .ic { width: 17px; color: var(--muted); }
.toolbar .search input[type=search]:not([type=checkbox]) { border: 0; outline: 0; padding: 9px 0; font: inherit; width: 100%; background: transparent; margin: 0; box-shadow: none; border-radius: 0; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.count { margin: 0 0 8px; }

/* ---------- table ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.table-card { padding: 0; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--th-bg); white-space: nowrap; }
.table th.right { text-align: right; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--row-hover); }
.products .th { width: 72px; padding-right: 0; }
.products .th img, .noimg { width: 56px; height: 56px; object-fit: cover; border-radius: 9px; display: block; background: var(--line-2); }
.noimg { display: grid; place-items: center; color: var(--noimg); border: 1px dashed var(--dash); }
.products .name { min-width: 220px; }
.products .var { color: var(--brand-d); }
.price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-sale { color: var(--promo); font-weight: 600; }
.promo-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--promo); background: var(--promo-l); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.promo-tag .ic { width: 13px; height: 13px; }
.until { color: var(--promo); }
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.st-publish { background: #e3f4ea; color: var(--ok); }
.st-draft { background: var(--soft); color: var(--draft-ink); }
.st-in { background: var(--brand-l); color: var(--brand-d); }
.st-low { background: #fff1d6; color: var(--warn); }
.st-out { background: #fde7e5; color: var(--err); }
.st-back { background: #ece8fb; color: #5b45b0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); }
.icon-btn:hover { background: var(--brand-l); color: var(--brand-d); }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }
.empty .ic { width: 38px; height: 38px; color: var(--noimg); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

/* phones: each product becomes a card */
@media (max-width: 760px) {
  .table thead { display: none; }
  /* each product becomes a card: [✓][photo] name / prices / dates / stock + statut / actions */
  .products tbody tr { display: grid; grid-template-columns: 26px 46px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; padding: 12px 12px; border-bottom: 1px solid var(--line-2); }
  .products td { padding: 0 !important; border: 0; }
  .products .c-pick { grid-column: 1; grid-row: 1; padding-top: 4px !important; }
  .products .th { grid-column: 2; grid-row: 1 / 3; width: auto; }
  .products .name { grid-column: 3 / 5; grid-row: 1; min-width: 0; max-width: none; }
  .products .c-reg { grid-column: 3; } .products .c-promo { grid-column: 4; }
  .products .c-dates { grid-column: 3 / 5; }
  .products .c-stock { grid-column: 3; } .products .c-status { grid-column: 4; }
  .products .actions { grid-column: 3 / 5; text-align: left; }
  .products td.num, td.num .ed, td.num .cell-input { text-align: left; }
  .var-row .th { padding-left: 0 !important; }
  .search { min-width: 0; max-width: none; }
  .filters-r select { flex: 1 1 140px; max-width: none; }
}

/* ---------- forms / buttons ---------- */
label { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 16px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d3dfdc; border-radius: var(--r-s); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--line-2); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-d); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--ink); background: var(--line-2); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.block { width: 100%; margin-top: 6px; padding: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.err { background: #fdecea; color: #8f1d17; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--brand-dd); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.35); font-size: 14px; max-width: 400px; animation: tin .25s ease; transition: opacity .4s, transform .4s; }
.toast.ok::before { content: "✓  "; color: var(--toast-ok); font-weight: 700; }
.toast.err { background: var(--err); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- login ---------- */
.login-page .main { margin: 0; max-width: none; min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1100px 560px at 15% -10%, var(--login-glow) 0, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 36px 32px; box-shadow: 0 30px 60px -30px rgba(var(--shade-rgb), .3); border: 1px solid var(--line); }
.login-card { overflow: hidden; }
.login-brand { margin: -12px 0 22px; display: grid; place-items: center; }
.login-brand img { width: 170px; height: auto; display: block; }
.login-card h1 { font-size: 22px; } .login-card > p { margin: 0 0 22px; font-size: 14px; }
.login-card .forgot { margin: 16px 0 0; text-align: center; }

/* ---------- inline editing ---------- */
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.keys { margin: 0 0 8px; }
kbd { font: 600 11px/1 "Inter", sans-serif; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; color: var(--ink-2); }
.faint { color: var(--faint); }
/* fixed widths so opening an editor never re-flows the table */
@media (min-width: 761px) {
  .products th.c-pick { width: 40px; }
  .products th.c-img { width: 62px; }
  .products th.c-reg { width: 118px; }
  .products th.c-promo { width: 158px; }
  .products th.c-dates { width: 160px; }
  .products th.c-stock { width: 140px; }
  .products th.c-status { width: 112px; }
  .products th.c-act { width: 86px; }
}
.c-pick { padding-right: 0 !important; }
.c-pick input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.products tr.picked td { background: var(--picked) !important; }
.products .actions { white-space: nowrap; }
.products .th { padding-left: 6px; }
.products .name { min-width: 240px; }
.products .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.products .meta i { font-style: normal; color: var(--meta-dot); }
.brand-name { font-weight: 600; color: var(--ink-2); }
.products td.num { text-align: right; }
.products td.dates { min-width: 150px; font-size: 13.5px; }

.ed { position: relative; display: block; min-height: 34px; padding: 6px 9px; margin: -6px -9px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s; font-variant-numeric: tabular-nums; outline: 0; }
td.num .ed { text-align: right; }
.ed:hover { background: var(--ed-hover); border-color: var(--ed-hover-line); }
.ed:focus-visible, .ed:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); background: #fff; }
.ed.ed-text { font-weight: 600; color: var(--ink); }
.ed .add { font-size: 13px; }
.ed:hover .add { color: var(--brand-d); }
.ed-promo { white-space: nowrap; }
.ed-promo.is-on { color: var(--promo); font-weight: 600; }
.ed-promo.is-later { color: var(--warn); }
.ed .pct { font-style: normal; font-size: 11.5px; font-weight: 600; background: var(--promo-l); color: var(--promo); padding: 1px 5px; border-radius: 5px; margin-left: 2px; }
.later-tag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--warn); background: #fff1d6; padding: 1px 6px; border-radius: 5px; }
.ed-dates.is-off { cursor: default; }
.ed-dates.is-off:hover { background: transparent; border-color: transparent; }
.ed.editing { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.ed.saving { opacity: .55; pointer-events: none; }
.ed.saving::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border: 2px solid var(--brand); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
td.num .ed.saving::after { right: auto; left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ed.saved { background: #e3f4ea !important; border-color: #9fd6b3 !important; }
.ed.failed { background: #fdecea !important; border-color: #f1b3ad !important; }
.cell-input { display: block; width: 100%; min-width: 0; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; font: inherit !important; color: var(--ink) !important; outline: 0; }
td.num .cell-input { text-align: right; }
.ro { padding: 6px 0; font-variant-numeric: tabular-nums; }

/* variants */
.var-toggle { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 2px 8px 2px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--brand-d); font: 600 12px/1.4 inherit; font-family: inherit; cursor: pointer; }
.var-toggle .ic { width: 14px; height: 14px; transition: transform .15s; }
.var-toggle[aria-expanded="true"] { background: var(--brand-l); border-color: var(--brand-line); }
.var-toggle[aria-expanded="true"] .ic { transform: rotate(90deg); }
.var-row td { background: var(--var-bg); }
.var-row .th { padding-left: 34px; }
.var-row .th img, .var-row .noimg { width: 36px; height: 36px; }
.var-name { display: inline-block; padding-left: 12px; border-left: 2px solid var(--brand-line); font-weight: 500; color: var(--ink-2); }

/* popovers */
.pop { position: absolute; z-index: 60; width: 300px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 20px 50px -18px rgba(var(--shade-rgb), .35); display: grid; gap: 12px; animation: tin .15s ease; }
.pop label { margin: 0; font-size: 13px; }
.pop input[type=date], .pop input[type=number] { margin-top: 4px; }
.pop-title { font-weight: 600; font-size: 14px; }
.pop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pop .hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { border: 1px solid var(--line); background: var(--line-2); color: var(--ink-2); font: 500 12.5px/1 inherit; font-family: inherit; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.quick button:hover { background: var(--brand-l); border-color: var(--brand-line); color: var(--brand-d); }
.seg { display: flex; background: var(--line-2); border-radius: 11px; padding: 4px; gap: 4px; }
.seg label { flex: 1; margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.seg input:checked + span { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--brand-d); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.opt { display: flex !important; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px !important; color: var(--ink) !important; }
.opt + .opt { margin-top: 6px !important; }
.opt input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-l); }
.choice { display: grid; gap: 2px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.choice span { font-size: 12.5px; color: var(--muted); }
.choice:hover { border-color: var(--brand-line); background: var(--choice-hover); }
.choice.on { border-color: var(--brand); background: var(--brand-l); }
[hidden] { display: none !important; }

/* undo toasts (bottom left) */
#undo-area { position: fixed; left: calc(var(--side) + 24px); bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(560px, calc(100vw - 32px)); }
.undo-toast { display: flex; align-items: center; gap: 14px; background: var(--brand-dd); color: #fff; padding: 11px 12px 11px 16px; border-radius: 12px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); font-size: 13.5px; animation: tin .2s ease; transition: opacity .35s; }
.undo-toast span { flex: 1; min-width: 0; }
.undo-toast button { flex: none; border: 0; background: rgba(255,255,255,.14); color: var(--on-dark); font: 600 13px/1 inherit; font-family: inherit; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.undo-toast button:hover { background: rgba(255,255,255,.24); color: #fff; }
.undo-toast.busy { opacity: .6; pointer-events: none; }
.undo-toast.out { opacity: 0; }
@media (max-width: 900px) { #undo-area { left: 16px; right: 16px; } }

/* promo calculator under the input */
.calc { position: absolute; z-index: 5; top: calc(100% + 4px); right: 0; white-space: nowrap; font: 600 12px/1 "Inter", sans-serif; color: var(--ok); background: #fff; border: 1px solid #bfe0cc; padding: 6px 8px; border-radius: 7px; box-shadow: 0 6px 16px -8px rgba(0,0,0,.25); }
.calc.bad { color: var(--err); border-color: #f1b3ad; }

/* bulk bar */
.bulk-bar { position: fixed; z-index: 70; left: calc(var(--side) + 24px); right: 24px; bottom: 18px; max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px 12px 18px; background: var(--brand-dd); color: #fff; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.45); animation: tin .2s ease; }
.bulk-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 14px; }
.bulk-count b { font-size: 16px; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-bar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #fff; }
.bulk-bar .btn:hover { background: rgba(255,255,255,.22); }
.link { border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; color: var(--on-dark); text-decoration: underline; cursor: pointer; }
.link.muted { color: rgba(255,255,255,.65); }
body.has-bulk .main { padding-bottom: 120px; }
body.has-bulk #undo-area { bottom: 92px; }
@media (max-width: 900px) { .bulk-bar { left: 12px; right: 12px; bottom: 12px; } }

/* modal */
body.modal-open { overflow: hidden; }
.modal-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(var(--shade-rgb), .45); display: grid; place-items: center; padding: 16px; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.45); display: grid; gap: 16px; animation: tin .2s ease; }
.modal.wide { max-width: 620px; }
.modal h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal label { margin: 0; }
.modal .seg { margin: 0; }
.bulk-form { display: grid; gap: 14px; }
.bulk-form > div:not(.seg):not(.modal-actions):not([hidden]) { display: grid; gap: 12px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.field-group { display: grid; gap: 8px; }
.modal .hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.modal.busy .modal-actions { opacity: .6; pointer-events: none; }
.progress { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.sum { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.sum li::before { content: "•"; margin-right: 8px; color: var(--muted); }
.sum li.ok::before { content: "✓"; color: var(--ok); font-weight: 700; }
.sum li.warn::before { content: "!"; color: var(--warn); font-weight: 700; }
.skipped { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; font-size: 13px; }
.skipped div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.skipped div:last-of-type { border-bottom: 0; }
.skipped span { color: var(--warn); text-align: right; }

/* product sheet drawer */
.drawer-wrap { position: fixed; inset: 0; z-index: 110; background: rgba(var(--shade-rgb), .35); animation: fadein .15s ease; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); display: grid; grid-template-rows: auto 1fr auto; box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); animation: slidein .22s ease; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 2px 0 0; font-size: 19px; font-weight: 600; }
.drawer-head p { margin: 0; }
.drawer-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.drawer-body { overflow: auto; padding: 20px 24px; display: grid; gap: 22px; align-content: start; }
.drawer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: #fff; border-top: 1px solid var(--line); }
.drawer-foot [data-state] { margin-right: auto; }
.rte-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rte-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px 0; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.rte-bar button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 9px; font: 500 13px/1 "Inter", sans-serif; color: var(--ink-2); cursor: pointer; }
.rte-bar button:hover { background: var(--brand-l); border-color: var(--brand-line); color: var(--brand-d); }
.rte-bar [data-cmd=bold] { font-weight: 700; } .rte-bar [data-cmd=italic] { font-style: italic; }
.rte { min-height: 120px; max-height: 46vh; overflow: auto; padding: 14px 16px; outline: 0; line-height: 1.6; color: var(--ink); }
.rte[data-name=long] { min-height: 220px; }
.rte:focus { box-shadow: inset 0 0 0 2px var(--brand-l); }
.rte p { margin: 0 0 10px; } .rte h2, .rte h3, .rte h4 { margin: 14px 0 8px; font-size: 16px; } .rte ul, .rte ol { margin: 0 0 10px; padding-left: 22px; }
.rte:empty::before { content: "Écrivez ici…"; color: var(--faint); }

.lot-tag { color: var(--brand-d); font-weight: 600; }

/* order: whatsapp menu, editing, edit log */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(var(--shade-rgb), .35); padding: 6px; display: grid; }
.menu-list a { padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none !important; font-size: 14px; }
.menu-list a:hover { background: var(--brand-l); color: var(--brand-d); }
.items-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 0; }
.items-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.qty-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.qty-step button { border: 0; background: var(--line-2); width: 30px; height: 32px; font-size: 16px; cursor: pointer; color: var(--ink); }
.qty-step button:hover { background: var(--brand-l); }
.qty-step input { width: 52px !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 6px 2px !important; box-shadow: none !important; }
.link-rm { display: block; margin: 4px 0 0 auto; border: 0; background: none; color: var(--err); font: 500 12.5px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: underline; }
.order-items tr.removed td { opacity: .45; }
.order-items tr.removed td .strong { text-decoration: line-through; }
.order-edit-box { border-top: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; background: var(--th-bg); }
.add-line { position: relative; }
.add-line .search { max-width: none; }
.results { margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(var(--shade-rgb), .35); padding: 6px; max-height: 320px; overflow: auto; }
.results button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.results button:hover { background: var(--brand-l); }
.results img, .results .noimg { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none; }
.results small { display: block; color: var(--muted); font-size: 12px; }
.added-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.added-line input { width: 64px !important; display: inline-block !important; margin: 0 !important; padding: 5px 8px !important; }
.added-line .link-rm { margin: 0; }
.edit-total { margin: 4px 0 0; font-size: 15px; }
.edit-log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.edit-log li { border-left: 3px solid var(--warn); padding-left: 12px; font-size: 14px; }

/* alerte PC */
.code-card { margin-bottom: 20px; border-color: var(--brand); background: var(--brand-l); }
.code-card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.code-row code { font: 600 20px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; user-select: all; }
.how { margin-bottom: 20px; }
.how h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.how ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.add-device { display: flex; align-items: flex-end; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.add-device label { margin: 0; flex: 1 1 240px; }
.add-device input { margin-top: 4px; }

/* import */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.preview-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.table.preview th { position: sticky; top: 0; }
.table.preview td { font-size: 13px; padding: 7px 10px; }

/* product sheet sections */
.sheet-sec { display: grid; gap: 10px; }
.sheet-sec > label { margin: 0; }
.sheet-sec.grid-2 { grid-template-columns: 1fr 1fr; gap: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.sheet-sec.grid-2 label { margin: 0; }
.sheet-sec.grid-2 input, .sheet-sec.grid-2 select { margin-top: 4px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.calc-inline { display: block; min-height: 16px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ok); }
.calc-inline.bad { color: var(--err); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ph-grid:empty { display: none; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); cursor: grab; }
.ph:first-child { grid-column: span 2; grid-row: span 2; }
.ph img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; background: #fff; }
.ph.dragging { opacity: .35; } .ph.over { box-shadow: 0 0 0 3px var(--brand); }
.ph.up img, .ph-wait { opacity: .5; } .ph-wait { width: 100%; height: 100%; background: var(--line-2); }
.ph.failed { border-color: var(--err); }
.ph .ph-badge { position: absolute; left: 6px; top: 6px; background: var(--brand-dd); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.ph .ph-tools { position: absolute; right: 5px; top: 5px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.ph:hover .ph-tools, .ph:focus-within .ph-tools { opacity: 1; }
@media (hover: none) { .ph .ph-tools { opacity: 1; } }
.ph .ph-tools button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: rgba(255,255,255,.95); box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; font-size: 13px; color: var(--ink); }
.ph .ph-tools button:hover { color: var(--brand-d); }
.ph .ph-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 5px; background: rgba(255,255,255,.8); border-radius: 4px; overflow: hidden; }
.ph .ph-bar i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.ph .ph-err { position: absolute; inset: auto 0 0 0; background: var(--err); color: #fff; font-size: 11px; padding: 4px 6px; }
.ph-add { display: grid; justify-items: center; gap: 2px; padding: 18px; border: 2px dashed var(--dash); border-radius: 12px; background: #fff; cursor: pointer; text-align: center; color: var(--brand-d); font-weight: 600; margin: 0; }
.ph-add small { font-weight: 400; color: var(--muted); }
.ph-add:hover, .ph-add.drop { border-color: var(--brand); background: var(--brand-l); }
.small-search { min-width: 0 !important; max-width: none !important; }
.cat-list { max-height: 260px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; columns: 2 220px; column-gap: 20px; }
.cat-list .cat { display: flex !important; align-items: center; gap: 8px; margin: 0; padding: 4px 0; font-weight: 400; color: var(--ink); cursor: pointer; break-inside: avoid; font-size: 14px; }
.cat-list .cat input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; flex: none; }
.cat-list .cat.d0 { font-weight: 600; } .cat-list .cat.d1 { padding-left: 18px; } .cat-list .cat.d2 { padding-left: 36px; } .cat-list .cat.d3 { padding-left: 54px; }
.cat-list .cat:has(input:checked) span { color: var(--brand-d); font-weight: 600; }
@media (max-width: 640px) { .sheet-sec.grid-2 { grid-template-columns: 1fr; } }

/* ---------- orders ---------- */
.badge { margin-left: auto; background: var(--promo); color: #fff; font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(var(--promo-rgb), .18); } }
.new-count { color: var(--promo); }
.orders tr[data-href] { cursor: pointer; }
.orders tr.is-new td { background: var(--new-row); }
.orders tr.is-new td:first-child { box-shadow: inset 3px 0 var(--promo); }
.new-tag { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--promo); padding: 2px 7px; border-radius: 6px; vertical-align: 1px; }
.tel { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-d); }
.tel .ic { width: 15px; height: 15px; }
.clip-1 { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-new { background: var(--promo-l); color: var(--promo); }
.os-confirmed { background: #e6efff; color: #2f5bb7; }
.os-shipped { background: #efe9fd; color: #6a3fc1; }
.os-done { background: #e3f4ea; color: var(--ok); }
.os-cancel { background: var(--soft); color: var(--cancel-ink); }
.os-wait { background: #fff1d6; color: var(--warn); }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.back .ic { width: 16px; height: 16px; }
.order-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-head h1 .pill { font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 20px; }
.status-bar .hint-r { margin-left: auto; }
.inline-form { margin: 0; }
.btn.danger-ghost { color: var(--err); border-color: #f1cfcc; background: #fff; } .btn.danger-ghost:hover { background: #fdecea; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.order-main, .order-side { display: grid; gap: 20px; min-width: 0; }
.order-side .card h2, .order-main .card h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.order-side h3 { font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.order-side p { margin: 0 0 8px; }
.big { font-size: 17px; }
.addr { display: flex; gap: 8px; color: var(--ink-2); line-height: 1.5; }
.addr .ic { color: var(--muted); margin-top: 2px; }
.note-client { background: #fffbea; border-color: #f3e2a1; }
.order-items .th { width: 64px; }
.order-items .th img, .order-items .noimg { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.order-items tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.order-items tfoot tr.grand td { font-size: 17px; font-weight: 700; padding-top: 12px; border-top: 1px solid var(--line); }
.note-form { display: flex; gap: 8px; margin-bottom: 14px; }
.note-form input { margin: 0 !important; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline li.to-client::before { border-color: var(--promo); }
.timeline li div { color: var(--ink); }
@media (max-width: 1000px) { .order-grid { grid-template-columns: 1fr; } .status-bar .hint-r { margin-left: 0; width: 100%; } }
@media (max-width: 760px) {
  .orders tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .orders td { padding: 0 !important; border: 0; }
  .orders td:nth-child(4) { display: none; }
  .orders td:nth-child(5) { text-align: right; }
}

/* ---------- delivery slip (print) ---------- */
.slip-page { background: var(--slip-bg); padding: 24px; }
.slip { max-width: 800px; margin: 0 auto; background: #fff; padding: 36px 40px; border-radius: 8px; color: #111; font-size: 14px; }
.slip header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 16px; margin-bottom: 20px; }
.slip-logo { padding: 4px 0; }
.slip-logo img { width: var(--slip-logo-w); display: block; }
.slip h1 { font-size: 22px; margin: 0 0 6px; }
.slip header p { margin: 0; line-height: 1.5; }
.slip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.slip-grid h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #666; margin: 0 0 6px; }
.slip-grid p { margin: 0; line-height: 1.5; }
.slip-items { width: 100%; border-collapse: collapse; }
.slip-items th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #666; border-bottom: 1px solid #111; padding: 8px 6px; }
.slip-items td { padding: 9px 6px; border-bottom: 1px solid #ddd; }
.slip-items .right { text-align: right; }
.slip-items tfoot td { border: 0; padding: 5px 6px; }
.slip-items tfoot .grand td { font-size: 18px; font-weight: 700; border-top: 2px solid #111; padding-top: 10px; }
.slip-note { margin: 18px 0 0; padding: 10px 12px; background: #f6f6f6; border-radius: 6px; }
.slip footer { display: flex; justify-content: space-between; margin-top: 48px; color: #666; font-size: 12px; }
.slip footer div:first-child { border-top: 1px solid #999; padding-top: 6px; width: 220px; }
.no-print { text-align: center; margin-top: 18px; }
@media print {
  .slip-page { background: #fff; padding: 0; }
  .slip { padding: 0; max-width: none; border-radius: 0; }
  .slip-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none; }
  @page { margin: 14mm; }
}

/* history */
.history td { vertical-align: top; }
.history .arrow { color: var(--muted); font-weight: 400; }
.history tr.reverted td { color: var(--muted); }
.history tr.reverted b { font-weight: 500; }
.nowrap { white-space: nowrap; }

@media (max-width: 760px) {
  .ed { margin: 0; }
  .keys { display: none; }
  .calc { right: auto; left: 0; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- delete / trash ---------- */
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; } .btn.danger:hover { filter: brightness(.93); }
.icon-btn.trash-btn:hover { color: var(--err); }
.st-trash { background: #fdecea; color: var(--err); }
.chip.chip-trash { border-style: dashed; } .chip.chip-trash.on { background: var(--err); border-color: var(--err); border-style: solid; }
.trash-row td { background: #fcfcfd; } .trash-row .th img { filter: grayscale(.6); opacity: .8; }
.restore-btn { white-space: nowrap; }
tr.row-out { opacity: 0; transition: opacity .3s; }

/* ---------- product sheet: variants ---------- */
.v-box { display: grid; gap: 14px; transition: opacity .2s; } .v-box.busy { opacity: .55; pointer-events: none; }
.v-attr { display: grid; gap: 6px; }
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--line-2); border: 1px dashed var(--dash); font-size: 13px; }
.v-chip.used { background: var(--brand-l); border: 1px solid var(--brand-line); color: var(--brand-d); padding-right: 10px; font-weight: 500; }
.v-chip button { border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; cursor: pointer; border-radius: 50%; } .v-chip button:hover { color: var(--err); }
.v-addval { display: inline-flex; gap: 6px; margin: 0; } .v-addval input { width: 150px; margin: 0; padding: 6px 10px; }
.v-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.v-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--line); background: #fff; }
.v-row:first-child { border-top: 0; } .v-row.off { background: var(--var-bg); } .v-row.off .v-name b { color: var(--muted); }
.v-photo { position: relative; flex: none; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.v-photo img { width: 100%; height: 100%; object-fit: cover; display: block; } .v-photo:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.v-photo em { position: absolute; inset: auto 0 0 0; font-style: normal; font-size: 9px; text-align: center; background: rgba(255, 255, 255, .85); color: var(--muted); }
.v-photo .noimg, .v-pick .noimg { display: block; width: 100%; height: 100%; }
.v-name { flex: 1; min-width: 0; display: grid; } .v-name b { font-weight: 600; }
.warn-txt { color: var(--warn); font-weight: 500; }
.v-add { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-s); background: var(--line-2); }
.v-all { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin: 0; }
.v-missing { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
.v-missing label { display: inline-flex; gap: 6px; align-items: center; margin: 0; padding: 5px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.v-make { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-s); background: var(--line-2); }
.v-suggest { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; } .v-suggest .link { color: var(--brand-d); font-size: 13px; }
.v-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 12px 0; }
.v-pick button { position: relative; aspect-ratio: 1; padding: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; }
.v-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); } .v-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-pick small { position: absolute; inset: auto 0 6px 0; font-size: 11px; color: var(--muted); }

/* ---------- outlined action buttons (edit / view / delete / close) ---------- */
.products .actions .icon-btn, .icon-btn.outline, .v-row .icon-btn.trash-btn {
  width: 32px; height: 32px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 8px; margin-left: 4px;
  transition: border-color .15s, color .15s, background .15s; }
.products .actions .icon-btn .ic, .icon-btn.outline .ic, .v-row .icon-btn.trash-btn .ic { width: 16px; height: 16px; stroke-width: 1.75; }
.products .actions .icon-btn:hover, .icon-btn.outline:hover { border-color: var(--brand-line); background: var(--brand-l); color: var(--brand-d); }
.products .actions .icon-btn.trash-btn:hover, .v-row .icon-btn.trash-btn:hover { border-color: #f1c4c0; background: #fdecea; color: var(--err); }
.icon-btn.close-btn { width: 36px; height: 36px; }
.icon-btn.close-btn .ic { width: 18px; height: 18px; }
.products th.c-act { width: 116px; }
