/* =============================================================================
   Whatsale app — feuille de style (palette « bleu nuit + indigo »)
   Toutes les couleurs passent par les variables ci-dessous.
   ============================================================================= */

:root {
  --canvas: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #eef1f7;
  --surface-hover: #e2e7f1;
  --line: #e3e7ef;

  --ink: #0b1437;
  --ink-muted: #5b6785;
  --ink-subtle: #98a2bb;

  --sidebar: #0b1437;
  --sidebar-2: #111d4a;

  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --success: #047857;
  --success-soft: #ecfdf5;
  --info: #6d28d9;
  --info-soft: #f5f3ff;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-float: 0 10px 30px rgb(15 23 42 / 0.1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
[hidden] { display: none !important; }

/* ---------- Utilitaires ---------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon--xs { width: 14px; height: 14px; }
.icon--sm { width: 16px; height: 16px; }
.icon--md { width: 18px; height: 18px; }
.icon--lg { width: 24px; height: 24px; }
.icon--nav { width: 18px; height: 18px; }
.muted { color: var(--ink-muted); }
.hint { color: var(--ink-muted); font-size: 12px; }
.text-center { text-align: center; }
.text-brand { color: var(--brand); }
.text-warning { color: var(--warning); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 6px; }
.h3 { font-size: 15px; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-5 { margin-top: 20px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 0 16px; height: 44px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, transform .1s, opacity .15s, border-color .15s;
}
.btn:active { transform: scale(0.99); }
.btn:disabled, .btn.is-busy { opacity: .55; pointer-events: none; }
.btn--lg { height: 48px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 999px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--sidebar-2); }
.btn--brand { background: var(--brand); color: #fff; }
.btn--brand:hover { filter: brightness(.95); }
.btn--secondary { background: var(--surface-muted); color: var(--ink); }
.btn--secondary:hover { background: var(--surface-hover); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.95); }
.btn--outline { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn--outline:hover { border-color: var(--ink-subtle); }
.btn--pill { background: var(--ink); color: #fff; border-radius: 999px; height: 40px; font-size: 13px; }
.btn--pill:hover { background: var(--sidebar-2); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-muted); color: var(--ink); }
.icon-btn--warn:hover { color: var(--warning); }
.icon-btn--light { color: rgb(255 255 255 / .7); }
.icon-btn--light:hover { background: rgb(255 255 255 / .1); color: #fff; }
.icon-btn--danger:hover { background: rgb(239 68 68 / .15); color: #fca5a5; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input--lg { height: 48px; }
.input::placeholder { color: var(--ink-subtle); }
.input:hover { border-color: var(--ink-subtle); }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(79 70 229 / .12); }
.password { position: relative; }
.password .input { padding-right: 44px; }
.password__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-muted);
}
.password__toggle:hover { color: var(--ink); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-muted); }
.segmented__item { position: relative; }
.segmented__item input { position: absolute; opacity: 0; inset: 0; }
.segmented__item span {
  display: grid; place-items: center; height: 36px; border-radius: 9px;
  font-size: 12px; font-weight: 600; color: var(--ink-muted); cursor: pointer; transition: background .15s, color .15s;
}
.segmented__item input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.segmented__item input:focus-visible + span { outline: 2px solid var(--brand); }
.segmented__item input:disabled + span { cursor: not-allowed; opacity: .6; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--surface-muted); }
.switch-row__title { display: block; font-weight: 500; }
.switch {
  appearance: none; position: relative; width: 48px; height: 28px; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .15s;
}
.switch:checked { background: var(--brand); border-color: var(--brand); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Cartes, listes, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); }
.card--lg { border-radius: 24px; }
.card--row { display: flex; align-items: center; gap: 16px; padding: 16px; }
.card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.card__actions { display: flex; align-items: center; gap: 2px; }
.is-dimmed { opacity: .6; }
.meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.badges { display: flex; gap: 6px; margin-top: 6px; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge--brand { background: var(--brand-soft); color: var(--brand); }
.badge--brand-solid { background: var(--brand); color: #fff; }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }

.avatar { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 999px; font-weight: 700; font-size: 14px; }
.avatar--dark { background: var(--sidebar); color: #fff; }
.avatar--square { width: 36px; height: 36px; border-radius: 12px; background: var(--sidebar); color: #fff; font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.list-row--current { border-color: rgb(79 70 229 / .3); background: var(--brand-soft); }
.list-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row__title { font-weight: 600; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 56px 24px; }
.card.empty { padding: 48px 24px; }
.empty__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-muted);
}
.empty__title { font-weight: 500; }
.empty__text { max-width: 340px; font-size: 13px; color: var(--ink-muted); }
.empty .btn { margin-top: 14px; }

/* ---------- Filtres ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-muted); transition: color .15s, border-color .15s;
}
.pill:hover { color: var(--ink); }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill__count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-muted); font-size: 10px; }
.pill.is-active .pill__count { background: rgb(255 255 255 / .2); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.search:focus-within { border-color: var(--ink); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
.select-pill {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500;
}
.select-pill select { border: 0; outline: none; background: transparent; cursor: pointer; }

/* ---------- Mise en page connectée ---------- */
.shell { min-height: 100dvh; }
.shell__main { min-height: 100dvh; }
.page { width: 100%; max-width: 768px; margin: 0 auto; padding: 24px 20px 64px; }
.page__header { margin-bottom: 24px; }
.page__title { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.page__subtitle { margin-top: 4px; font-size: 13px; color: var(--ink-muted); }

.reminders { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.reminder {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px;
  border: 1px solid rgb(180 83 9 / .25); background: var(--warning-soft); transition: border-color .15s;
}
.reminder:hover { border-color: rgb(180 83 9 / .5); }
.reminder__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--surface); color: var(--warning); flex-shrink: 0; }
.reminder__text { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-muted); }
.reminder__text strong { display: block; font-size: 13px; color: var(--ink); }

/* Barre latérale (bleu nuit) */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: 256px;
  display: flex; flex-direction: column; color: #fff;
  background: linear-gradient(to bottom, var(--sidebar), var(--sidebar-2));
  transform: translateX(-100%); transition: transform .24s cubic-bezier(.2, .9, .3, 1);
}
.sidebar.is-open { transform: none; box-shadow: var(--shadow-float); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sidebar.is-open + .sidebar-backdrop { opacity: 1; pointer-events: auto; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 20px; }
.sidebar__name { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgb(79 70 229 / .8);
}
.brand-mark--sm { width: 28px; height: 28px; border-radius: 8px; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sidebar__section { margin: 20px 12px 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgb(255 255 255 / .35); }
.sidebar__section:first-child { margin-top: 4px; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 12px;
  font-weight: 500; color: rgb(255 255 255 / .65); transition: background .15s, color .15s;
}
.nav-link:hover { background: rgb(255 255 255 / .07); color: #fff; }
.nav-link.is-active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgb(79 70 229 / .7); }
.nav-link__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link__count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 600; background: rgb(255 255 255 / .1); color: rgb(255 255 255 / .8); }
.nav-link.is-active .nav-link__count { background: rgb(255 255 255 / .25); color: #fff; }
.sidebar__tour { display: flex; align-items: center; gap: 8px; margin: 12px 12px 0; padding: 10px 12px; border: 1px dashed rgb(255 255 255 / .22); border-radius: 12px; background: transparent; color: rgb(255 255 255 / .8); font-size: 13px; font-weight: 500; text-align: left; }
.sidebar__tour:hover { border-color: rgb(255 255 255 / .45); color: #fff; }

/* Visite guidée : élément mis en lumière + bulle d'explication */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour--center { display: grid; place-items: center; padding: 16px; background: rgb(11 20 55 / .55); }
.tour__spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgb(11 20 55 / .55), 0 0 0 3px var(--brand); pointer-events: none; transition: top .25s, left .25s, width .25s, height .25s; }
.tour__card { position: fixed; width: min(360px, calc(100vw - 24px)); padding: 18px 18px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-float); animation: pop-in .18s ease-out; }
.tour--center .tour__card { position: static; }
.tour__progress { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.tour__title { margin-top: 6px; font-size: 17px; font-weight: 700; color: var(--ink); }
.tour__text { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.tour__dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.tour__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--line); }
.tour__dot.is-active { width: 18px; background: var(--brand); }
.tour__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.tour__skip { border: 0; background: transparent; color: var(--ink-subtle); font-size: 12px; }
.tour__skip:hover { color: var(--ink); text-decoration: underline; }
.tour__nav { display: flex; gap: 6px; margin-left: auto; }
body.is-touring { overflow: hidden; }

.sidebar__user { display: flex; align-items: center; gap: 12px; margin: 12px; padding: 10px; border-radius: 16px; background: rgb(255 255 255 / .06); }
.sidebar__avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--sidebar); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar__user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar__user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-role { display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgb(255 255 255 / .55); }
.dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.dot--online { background: #34d399; }

/* Sélecteur de boutique */
.shop-switcher { position: relative; margin: 0 12px 8px; }
.shop-switcher__button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left;
  border: 1px solid rgb(255 255 255 / .1); border-radius: 12px; background: rgb(255 255 255 / .06); color: #fff; transition: background .15s;
}
.shop-switcher__button:hover { background: rgb(255 255 255 / .1); }
.shop-switcher__initial { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #fff; color: var(--sidebar); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.shop-switcher__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-switcher__eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgb(255 255 255 / .4); }
.shop-switcher__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-switcher__chevron { color: rgb(255 255 255 / .5); }
.dropdown {
  position: absolute; left: 0; right: 0; z-index: 60; margin-top: 6px; padding: 6px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-float);
  animation: pop-in .14s ease-out;
}
.dropdown__title { padding: 4px 10px 6px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.dropdown__list { max-height: 256px; overflow-y: auto; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px;
  background: transparent; text-align: left; font-size: 13px; transition: background .15s;
}
.dropdown__item:hover { background: var(--surface-muted); }
.dropdown__item.is-selected { background: var(--surface-muted); font-weight: 600; cursor: default; opacity: 1; }
.dropdown__item .truncate { flex: 1; }
.dropdown__action {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; padding: 10px; border: 0;
  border-top: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--brand); font-size: 13px; font-weight: 600; text-align: left;
}
.dropdown__action:hover { background: var(--brand-soft); }

.topbar-mobile { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--sidebar); color: #fff; }
.topbar-mobile__name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .sidebar-backdrop, .sidebar__close, .topbar-mobile { display: none; }
  .shell__main { padding-left: 256px; }
  .page { padding: 40px 40px 64px; }
}

/* ---------- Fenêtres (dialog) ---------- */
.sheet {
  width: 100%; max-width: 468px; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink);
  overflow-y: auto; animation: sheet-in .24s cubic-bezier(.2, .9, .3, 1);
}
.sheet::backdrop { background: rgb(0 0 0 / .55); animation: fade-in .16s ease-out; }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 28px; } }
.sheet__body { padding: 8px 20px 20px; }
.sheet__handle { width: 40px; height: 4px; margin: 2px auto 14px; border-radius: 999px; background: var(--line); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet__head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- Devise (liste avec recherche) ---------- */
.combobox { position: relative; }
.combobox__button {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 14px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.combobox__button:hover, .combobox__button[aria-expanded="true"] { border-color: var(--ink); }
.combobox__code { display: grid; place-items: center; min-width: 48px; height: 28px; padding: 0 8px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; }
.combobox__name { flex: 1; }
.combobox__label { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.combobox__panel {
  position: absolute; left: 0; right: 0; z-index: 40; margin-top: 6px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-float); animation: pop-in .14s ease-out;
}
.combobox__search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.combobox__search input { flex: 1; height: 44px; border: 0; outline: none; background: transparent; }
.combobox__list { max-height: 288px; overflow-y: auto; padding: 6px; }
.combobox__group { padding: 6px 12px 4px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.combobox__group--sep { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.combobox__option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; font-size: 13px; }
.combobox__option.is-highlighted { background: var(--surface-muted); }
.combobox__option-code { width: 40px; font-weight: 700; }
.combobox__option-name { flex: 1; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combobox__option-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .combobox__panel { position: static; } /* dans une fenêtre : la liste s'ouvre dans le flux, jamais coupée */
.combobox__empty { padding: 24px 12px; text-align: center; font-size: 13px; color: var(--ink-muted); }

/* ---------- Notifications ---------- */
.toasts { position: fixed; inset: 16px 0 auto; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-float);
  animation: pop-in .2s ease-out; pointer-events: auto; transition: opacity .3s, transform .3s;
}
.toast--success .icon { color: #34d399; }
.toast--error .icon { color: #f87171; }
.toast.is-leaving { opacity: 0; transform: translateY(-6px); }

/* ---------- Connexion / erreurs ---------- */
.auth-main { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 40px 16px; }
.auth-box { width: 100%; max-width: 352px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.auth-brand h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand p { margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.auth-logo { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 16px; background: var(--brand); color: #fff; box-shadow: var(--shadow-float); }
.card--lg .hint.text-center { margin-top: 16px; }
.card--lg .btn--pill { margin-top: 16px; }

/* ---------- Animations ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* =============================================================================
   Étape 2 — Articles : cartes, galerie, formulaire en 2 étapes, répartition
   ============================================================================= */
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.flip { transform: rotate(180deg); }
.link-button { align-self: flex-start; border: 0; background: transparent; padding: 0; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.link-button:hover { color: var(--ink); }
.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .hide-sm { display: none; } }

/* Cartes d'articles */
.card--product { align-items: center; }
.thumb { width: 68px; height: 68px; flex-shrink: 0; border-radius: 16px; object-fit: cover; background: var(--surface-muted); }
.thumb--empty { display: grid; place-items: center; color: var(--ink-subtle); }
.split-mini { max-width: 260px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.split-bar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-hover); }
.split-bar span { height: 100%; transition: width .3s; }
.split-bar--thin { height: 6px; width: 100%; }
.split-bar--thick { height: 10px; margin: 8px 0; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }
.pagination__page { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.pagination__page:hover { background: var(--surface); color: var(--ink); }
.pagination__page.is-current { background: var(--ink); color: #fff; }
.pagination__gap { padding: 0 4px; color: var(--ink-subtle); font-size: 12px; }

/* Formulaire article */
.progress { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 20px; }
.progress span { height: 3px; border-radius: 999px; background: var(--line); transition: background .2s; }
.progress span.is-done { background: var(--ink); }
.textarea { height: auto; padding: 12px 14px; resize: none; line-height: 1.45; }
.floating { position: relative; }
.floating label { position: absolute; top: -8px; left: 12px; padding: 0 4px; background: var(--surface); font-size: 11px; font-weight: 500; color: var(--ink-muted); }
.floating .input { height: 52px; font-size: 15px; }
.margin-line { margin-top: -8px; padding: 0 4px; font-size: 12px; font-weight: 500; color: var(--success); }
.margin-line.is-negative { color: var(--danger); }
.stepper-row { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper__btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--surface-muted); color: var(--ink); font-size: 16px; font-weight: 600; }
.stepper__btn:hover:not(:disabled) { background: var(--surface-hover); }
.stepper__btn:disabled { opacity: .35; cursor: default; }
.stepper__value { width: 48px; border: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 600; outline: none; font-variant-numeric: tabular-nums; }
.stepper--sm .stepper__btn { width: 32px; height: 32px; border-radius: 10px; }
.stepper--sm .stepper__value { width: 40px; }
.split-button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 48px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: rgb(238 241 247 / .6); transition: background .15s;
}
.split-button:hover { background: var(--surface-muted); }
.split-button.is-invalid { border-color: rgb(220 38 38 / .4); background: var(--danger-soft); }
.split-button__title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.split-button__summary { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; font-size: 11px; color: var(--ink-muted); }
.split-button.is-invalid .split-button__summary { color: var(--danger); font-weight: 600; }

/* Galerie */
.gallery__list { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery__item { position: relative; }
.gallery__thumb { position: relative; display: block; width: 72px; height: 72px; padding: 0; overflow: hidden; border: 0; border-radius: 16px; box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; }
.gallery__thumb:hover { box-shadow: 0 0 0 2px var(--line); }
.gallery__thumb.is-main { box-shadow: 0 0 0 2px var(--brand); cursor: default; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__badge { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 2px 0; border-radius: 6px; background: rgb(79 70 229 / .92); color: #fff; font-size: 9px; font-weight: 600; text-align: center; }
.gallery__remove {
  position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--danger); font-size: 16px; line-height: 1; box-shadow: var(--shadow-float);
}
.gallery__remove:hover { background: var(--danger); color: #fff; }
.gallery__add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 72px; height: 72px;
  border: 1px dashed var(--ink-subtle); border-radius: 16px; background: transparent; color: var(--ink-muted); font-size: 10px; font-weight: 500;
}
.gallery__add:hover { border-color: var(--ink); color: var(--ink); }
.gallery .hint { margin-top: 8px; }

/* Panneau « Répartir » */
.split-total { padding: 16px; border-radius: 16px; background: var(--surface-muted); }
.split-total__value { font-size: 18px; }
.split-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.split-row { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; }
.split-row__dot { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 700; }
.split-row__dot--shop { background: var(--surface-hover); color: var(--ink-muted); }
.split-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.split-row__qty { width: 48px; text-align: center; font-size: 15px; font-weight: 600; }
.empty--compact { padding: 32px 16px; border: 1px dashed var(--line); border-radius: 16px; }

/* =============================================================================
   Étape 3 — commandes, historique, statistiques, extensions
   ============================================================================= */
.text-ink { color: var(--ink); }
.text-whatsapp { color: #008069; }
.row-start { display: flex; align-items: center; gap: 8px; }
.row-end-gap { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.mt-2 { margin-top: 8px; }
.icon.inline { display: inline-block; vertical-align: -2px; }
.card--tight { padding: 16px; }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--neutral { background: var(--surface-muted); color: var(--ink); }
.badge--xs { padding: 1px 8px; font-size: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); font-size: 12px; font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.back-link:hover { color: var(--ink); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-muted); font-size: 13px; color: var(--ink-muted); }
.notice--danger { background: var(--danger-soft); color: var(--danger); }
.loading { padding: 32px 0; text-align: center; font-size: 13px; color: var(--ink-muted); }

/* Carte de commande */
.order { padding: 16px; }
.order__head { display: flex; align-items: flex-start; gap: 12px; }
.thumb--sm { width: 48px; height: 48px; border-radius: 12px; }
.order__amount { flex-shrink: 0; font-size: 15px; font-weight: 700; }
.order__bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.order__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn--ring { width: 36px; height: 36px; border: 1px solid var(--line); }
.order__controls { display: grid; gap: 8px; margin-top: 12px; }
.order__controls form.is-busy { opacity: .55; pointer-events: none; }
@media (min-width: 640px) { .order__controls--2 { grid-template-columns: 1fr 1fr; } }
.select-box { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.select-box:focus-within { border-color: var(--ink); }
.select-box select { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; }
.total-line { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 16px; background: var(--surface-muted); }
.total-line strong { font-size: 16px; }
select.input { appearance: auto; }

/* Historique (frise) */
.timeline { position: relative; display: flex; flex-direction: column; gap: 16px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 17px; width: 1px; background: var(--line); }
.timeline__item { position: relative; display: flex; gap: 12px; }
.timeline__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; box-shadow: 0 0 0 4px var(--surface); }
.timeline__dot.is-created { background: var(--brand-soft); color: var(--brand); }
.timeline__dot.is-status { background: var(--info-soft); color: var(--info); }
.timeline__dot.is-assigned { background: var(--success-soft); color: var(--success); }
.timeline__dot.is-system { background: var(--warning-soft); color: var(--warning); }
.timeline__main { flex: 1; min-width: 0; padding-top: 2px; }
.timeline__message { font-weight: 500; line-height: 1.35; }
.timeline__meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.timeline__time { font-size: 11px; color: var(--ink-subtle); font-variant-numeric: tabular-nums; }

/* Statistiques */
.kpi { padding: 16px; }
.kpi--ring { display: flex; flex-direction: column; align-items: center; padding: 20px 16px; }
.kpi__label { margin-top: 12px; font-weight: 600; }
.kpi__caption { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.kpi__value { margin-top: 4px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.ring { position: relative; width: 92px; height: 92px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle + circle { transition: stroke-dashoffset .7s; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.stat-rows { display: flex; flex-direction: column; gap: 10px; }
.stat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stat-row__label { flex: 1; min-width: 0; }
.stat-row__amount { min-width: 96px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot--ink { background: var(--ink); }
.dot--brand { background: var(--brand); }
.dot--success { background: var(--success); }
.dot--info { background: var(--info); }
.dot--danger { background: var(--danger); }
.dot--warning { background: var(--warning); }
.stat-row .dot { width: 8px; height: 8px; }
.avatar--xs { width: 32px; height: 32px; font-size: 11px; }
.avatar--soft { background: var(--brand-soft); color: var(--brand); }

/* Extensions */
.extension { padding: 16px; }
.extension__head { display: flex; align-items: center; gap: 12px; }
.extension__icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.extension__cta { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-top: 16px; padding: 0 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
.extension__cta:hover { background: var(--sidebar-2); }
.extension__note { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-muted); font-size: 12px; line-height: 1.45; }
.text-success { color: var(--success); }
.extension__cta.is-disabled { opacity: .3; pointer-events: none; }

/* =============================================================================
   Étape 4 — Chatflow : liste, éditeur, conversation WhatsApp, tunnel public
   ============================================================================= */
.mb-2 { margin-bottom: 8px; }
.mt-3 { margin-top: 12px; }
.divider { margin: 16px 0; border: 0; border-top: 1px solid var(--line); }
.input--sm { height: 36px; font-size: 13px; }
.field__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-error { margin-top: 12px; font-size: 12px; color: var(--danger); }
.icon-btn--soft { width: 32px; height: 32px; background: var(--surface-muted); color: var(--ink); }
.icon-btn--soft:hover { background: var(--surface-hover); }
.icon-btn--soft:disabled { opacity: .35; cursor: default; }
.icon-btn--danger-soft { background: var(--danger-soft); color: var(--danger); }
.icon-btn--danger-soft:hover { background: var(--danger-soft); filter: brightness(.96); color: var(--danger); }
@media (max-width: 560px) { .grid-2--stack { grid-template-columns: 1fr; } }

/* Choix du style de closing */
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice__body { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgb(238 241 247 / .5); transition: border-color .15s, background .15s; }
.choice:hover .choice__body { border-color: var(--ink-subtle); }
.choice input:checked + .choice__body { border-color: var(--brand); background: var(--brand-soft); }
.choice input:focus-visible + .choice__body { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Éditeur */
.page--wide { max-width: 1180px; }
.editor__bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.editor__dirty { padding: 2px 10px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-weight: 600; }
.editor__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.editor__grid { display: grid; gap: 20px; }
.editor__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor__meta { display: grid; gap: 12px; }
@media (min-width: 640px) { .editor__meta { grid-template-columns: 1fr 1fr; } }
.tabs { display: grid; grid-template-columns: 1fr 1fr; max-width: 360px; margin: 0 auto 16px; padding: 4px; border-radius: 16px; background: var(--surface-muted); }
.tabs__item { height: 36px; border: 0; border-radius: 12px; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.tabs__item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.editor .editor__preview { display: none; }
.editor[data-view="preview"] .editor__preview { display: block; }
.editor[data-view="preview"] .editor__main { display: none; }
@media (min-width: 1100px) {
  .editor__tabs { display: none; }
  .editor__grid { grid-template-columns: minmax(0, 1fr) 390px; align-items: start; }
  .editor .editor__preview, .editor[data-view="preview"] .editor__preview { display: block; position: sticky; top: 20px; }
  .editor[data-view="preview"] .editor__main { display: flex; }
}
.step-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -2px; }
.step-tab { position: relative; flex-shrink: 0; height: 36px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--surface-muted); color: var(--ink-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.step-tab:hover { color: var(--ink); }
.step-tab.is-active { background: var(--ink); color: #fff; }
.step-tab__error { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 999px; background: var(--danger); }
.editor-section { display: flex; flex-direction: column; }
.editor-rows { display: flex; flex-direction: column; gap: 8px; }
.editor-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: rgb(238 241 247 / .7); }
.editor-row .input { height: 40px; min-width: 0; }
.editor-row__select { width: 42%; flex-shrink: 0; }
.editor-row--wrap { flex-wrap: wrap; }
@media (max-width: 560px) {
  .editor-row { flex-wrap: wrap; }
  .editor-row .grow { min-width: 0; flex-basis: 60%; }
  .editor-row__select { width: 100%; }
}
.editor-slide { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.editor-slide .input { height: 40px; }
.editor-slide__kind { width: 160px; }
.editor-slide__image { display: flex; align-items: center; gap: 8px; }
.editor-slide__file { display: flex; flex: 1; align-items: center; gap: 8px; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.editor-slide__file img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.link-add { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 600; }
.link-add:disabled { opacity: .35; cursor: default; }
.link-danger { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 600; }
.link-danger:hover { text-decoration: underline; }
.toggle-chip { height: 40px; padding: 0 12px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.toggle-chip.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.step-errors { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 10px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 12px; }
.wa-frame { height: min(720px, calc(100dvh - 120px)); min-height: 520px; max-width: 400px; margin: 0 auto; }

/* Conversation WhatsApp */
.wa { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #efeae2; box-shadow: var(--shadow-float); }
.wa-icon { width: 16px; height: 16px; flex-shrink: 0; }
.wa-icon--xs { width: 12px; height: 12px; }
.wa-icon--sm { width: 14px; height: 14px; }
.wa-icon--lg { width: 28px; height: 28px; }
.wa-icon--verified { width: 16px; height: 16px; color: #7ee2a8; }
.wa-icon--green { color: #008069; }
.wa-icon--read { width: 14px; height: 14px; color: #53bdeb; vertical-align: -3px; }
.wa__header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #075e54; color: #fff; }
.wa__avatar { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; overflow: hidden; border-radius: 999px; background: rgb(255 255 255 / .2); font-size: 14px; font-weight: 700; }
.wa__avatar-img { width: 100%; height: 100%; object-fit: cover; }
.wa__titlebox { flex: 1; min-width: 0; }
.wa__title { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wa__status { font-size: 12px; color: rgb(255 255 255 / .75); }
.wa__restart { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .15); color: #fff; font-size: 12px; font-weight: 600; }
.wa__restart:hover { background: rgb(255 255 255 / .25); }
.wa__scroll { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.wa__day { display: flex; justify-content: center; margin-bottom: 12px; }
.wa__day span { padding: 2px 10px; border-radius: 6px; background: rgb(255 255 255 / .9); font-size: 11px; color: var(--ink-muted); box-shadow: var(--shadow-card); }
.wa__list { display: flex; flex-direction: column; gap: 8px; }
.wa-empty { margin-top: 40px; text-align: center; font-size: 12px; color: var(--ink-muted); }
.wa-msg { display: flex; flex-direction: column; gap: 6px; width: 88%; animation: msg-in .22s ease-out; }
.wa-msg--user { align-self: flex-end; align-items: flex-end; width: auto; max-width: 82%; }
.wa-bubble { overflow: hidden; border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: var(--shadow-card); }
.wa-bubble--user { padding: 8px 12px; border-radius: 12px 4px 12px 12px; background: #d9fdd3; font-size: 14px; }
.wa-bubble__text { display: block; padding: 8px 12px 0; font-size: 14px; line-height: 1.4; white-space: pre-line; color: var(--ink); }
.wa-bubble--user .wa-bubble__text { padding: 0; }
.wa-bubble__time { display: block; padding: 2px 10px 6px; text-align: right; font-size: 10px; color: var(--ink-muted); }
.wa-bubble--user .wa-bubble__time { padding: 2px 0 0; }
.wa-note { align-self: center; max-width: 90%; padding: 6px 12px; border-radius: 8px; background: #fff5c4; text-align: center; font-size: 11px; color: rgb(11 20 55 / .8); box-shadow: var(--shadow-card); animation: msg-in .22s ease-out; }
.wa-product { padding: 4px; }
.wa-product__img { display: block; width: 100%; height: 160px; border-radius: 8px; object-fit: cover; }
.wa-product__img--empty { display: grid; place-items: center; height: 112px; background: var(--surface-muted); color: var(--ink-subtle); }
.wa-product__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.wa-product__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; }
.wa-product__price { flex-shrink: 0; font-size: 14px; font-weight: 700; color: #008069; }
.wa-carousel { display: flex; gap: 8px; margin-right: -14%; padding-right: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.wa-carousel::-webkit-scrollbar { display: none; }
.wa-slide { width: 170px; flex-shrink: 0; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); scroll-snap-align: start; }
.wa-slide__img { display: block; width: 100%; height: 96px; object-fit: cover; }
.wa-slide__quote { display: grid; place-items: center; height: 64px; background: var(--brand-soft); color: var(--brand); }
.wa-slide__text { padding: 8px 10px; font-size: 12px; line-height: 1.35; }
.wa-choice { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; background: #fff; color: #008069; font-size: 14px; font-weight: 600; text-align: start; box-shadow: var(--shadow-card); }
.wa-choice:hover { background: #f7fbf9; }
.wa-choice__label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wa-qty { padding: 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); }
.wa-qty__row { display: flex; align-items: center; justify-content: space-between; }
.wa-qty__btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--surface-muted); color: var(--ink); }
.wa-qty__btn:disabled { opacity: .35; }
.wa-qty__value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wa-qty__total { margin: 8px 0; text-align: center; font-size: 13px; color: var(--ink-muted); }
.wa-qty__total strong { color: var(--ink); }
.wa-qty .wa-choice { box-shadow: none; border: 1px solid var(--line); }
.wa-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-card); }
.wa-field { display: flex; flex-direction: column; gap: 6px; }
.wa-field__label { font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.wa-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #f5f6f8; font-size: 16px; color: var(--ink); outline: none; transition: border-color .15s, background .15s; }
.wa-input:focus { border-color: #008069; background: #fff; }
.wa-select { position: relative; }
.wa-input--select { appearance: none; -webkit-appearance: none; padding-block: 0; padding-inline: 44px 40px; }
.wa-icon--field { position: absolute; top: 50%; inset-inline-start: 14px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.wa-icon--chevron { position: absolute; top: 50%; inset-inline-end: 14px; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.wa-picker { display: block; text-align: start; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.wa-picker.is-empty { color: var(--ink-subtle); }
.wa-form__error { font-size: 12px; color: var(--danger); }

/* Panneaux « Date souhaitée » / « Heure souhaitée » (montent du bas, conversation floutée) */
.wa { position: relative; }
.wa-sheet { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; background: rgb(11 20 55 / .25); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: wa-fade .18s ease-out; }
.wa-sheet.is-closing { opacity: 0; transition: opacity .18s; }
.wa-sheet__panel { width: 100%; max-height: 92%; overflow-y: auto; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -10px 30px rgb(15 23 42 / .12); animation: wa-up .22s ease-out; }
.wa-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.wa-sheet__title { font-size: 17px; font-weight: 600; color: var(--ink); }
.wa-sheet__close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--surface-muted); color: var(--ink); }
.wa-sheet__label { margin: 4px 0 10px; font-size: 13px; color: var(--ink-muted); }
.wa-quick { display: grid; gap: 8px; margin-bottom: 16px; }
.wa-quick--3 { grid-template-columns: repeat(3, 1fr); }
.wa-quick--4 { grid-template-columns: repeat(4, 1fr); }
.wa-quick__btn { height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 15px; }
.wa-quick__btn:hover:not(:disabled) { border-color: #008069; }
.wa-quick__btn.is-selected { border-color: #008069; background: #008069; color: #fff; font-weight: 600; }
.wa-quick__btn:disabled { opacity: .35; cursor: not-allowed; }
.wa-cal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wa-cal__month { font-size: 17px; font-weight: 600; color: var(--ink); }
.wa-cal__arrow { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--surface-muted); color: var(--ink); }
.wa-cal__arrow:disabled { opacity: .35; cursor: not-allowed; }
.wa-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; text-align: center; }
.wa-cal__dow { padding: 6px 0 10px; font-size: 13px; color: var(--ink-muted); }
.wa-cal__day { height: 44px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.wa-cal__day:hover:not(:disabled) { background: #f0faf6; }
.wa-cal__day:disabled { color: var(--ink-subtle); opacity: .55; cursor: not-allowed; }
.wa-cal__day.is-today { border-color: var(--line); font-weight: 700; }
.wa-cal__day.is-selected { border-color: #008069; background: #008069; color: #fff; font-weight: 700; }
.wa-wheels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.wa-wheel { padding: 10px 6px 6px; border: 1px solid var(--line); border-radius: 14px; }
.wa-wheel__title { margin-bottom: 6px; text-align: center; font-size: 13px; color: var(--ink-muted); }
.wa-wheel__list { position: relative; display: flex; flex-direction: column; gap: 2px; height: 168px; overflow-y: auto; scroll-snap-type: y proximity; }
.wa-wheel__item { flex-shrink: 0; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; scroll-snap-align: center; }
.wa-wheel__item:hover:not(:disabled) { background: #f0faf6; }
.wa-wheel__item:disabled { color: var(--ink-subtle); opacity: .5; cursor: not-allowed; }
.wa-wheel__item.is-selected { background: #008069; color: #fff; font-weight: 700; }
.wa-sheet__apply { width: 100%; height: 50px; border: 0; border-radius: 14px; background: #008069; color: #fff; font-size: 15px; font-weight: 600; }
.wa-sheet__apply:disabled { background: var(--surface-muted); color: var(--ink-muted); }
/* Paiement en ligne : bouton « Payer » du récapitulatif et page de retour */
.wa-pay { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin-top: 16px; border: 0; border-radius: 12px; background: #635bff; color: #fff; font-size: 15px; font-weight: 600; }
.wa-pay:hover { filter: brightness(1.08); }
.wa-pay:disabled { opacity: .8; }
.wa-pay .wa-icon { width: 18px; height: 18px; }
.wa-or { margin: 12px 0 -6px; text-align: center; font-size: 12px; color: var(--ink-muted); }
.paid-card { width: 100%; max-width: 420px; gap: 8px; padding: 40px 24px 28px; }
.paid-card__icon { background: var(--success-soft); color: var(--success); }
.paid-card__title { font-size: 18px; font-weight: 700; }
.paid-card__recap { display: flex; justify-content: space-between; gap: 12px; width: 100%; margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-muted); font-size: 14px; }
.btn--whatsapp { background: #25d366; color: #0b2e1a; }
.btn--whatsapp:hover { filter: brightness(.95); }
.paid-card__back { margin-top: 6px; font-size: 13px; color: var(--ink-muted); text-decoration: underline; }

/* Langues de droite à gauche (arabe…) : les flèches changent de sens */
.wa[dir="rtl"] .wa-choice .wa-icon, .wa[dir="rtl"] .wa-cal__arrow .wa-icon, .wa[dir="rtl"] .wa-submit .wa-icon { transform: scaleX(-1); }
@keyframes wa-fade { from { opacity: 0; } }
@keyframes wa-up { from { transform: translateY(100%); } }
.wa-submit { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; margin-top: 4px; border: 0; border-radius: 12px; background: #00a884; color: #fff; font-size: 15px; font-weight: 600; }
.wa-submit:hover { filter: brightness(1.05); }
.wa-submit:disabled { opacity: .7; }
.wa-recap { width: 92%; padding: 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-card); animation: msg-in .22s ease-out; }
.wa-recap__title { font-size: 15px; font-weight: 700; }
.wa-recap__item { margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.wa-recap__total { margin-top: 6px; font-size: 15px; font-weight: 700; }
.wa-recap__details { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.wa-confirm { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin-top: 16px; border: 0; border-radius: 12px; background: #25d366; color: #0b2e1a; font-size: 15px; font-weight: 600; }
.wa-confirm:hover { filter: brightness(.95); }
.wa-confirm:disabled { opacity: .8; }
.wa-confirm .wa-icon { width: 20px; height: 20px; }
.wa-spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.wa-done { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #dcf8c6; font-size: 13px; }
.wa-done__title { font-weight: 600; color: #0b2e1a; }
.wa-done__link { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-weight: 600; color: #008069; text-decoration: underline; }
.wa-error { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 500; }
.wa-typing { display: flex; gap: 4px; align-self: flex-start; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: var(--shadow-card); }
.wa-typing span { width: 6px; height: 6px; border-radius: 999px; background: var(--ink-subtle); animation: wa-bounce 1s infinite; }
.wa-typing span:nth-child(2) { animation-delay: .15s; }
.wa-typing span:nth-child(3) { animation-delay: .3s; }
.wa__footer { padding: 4px 12px 12px; border-top: 1px solid rgb(0 0 0 / .05); background: #efeae2; }
.wa-seller { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 500; }
.wa-seller:hover { border-color: var(--ink-subtle); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes wa-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* Tunnel public : plein écran sur mobile (iPhone compris), carte centrée sur ordinateur */
.public-flow { background: #d1d7db; }
.public-flow__main { display: flex; justify-content: center; height: 100vh; height: 100dvh; }
.public-flow__chat { width: 100%; max-width: 460px; height: 100%; }
.public-flow__chat.wa { border: 0; border-radius: 0; }
@media (min-width: 640px) {
  .public-flow__main { padding: 24px 0; }
  .public-flow__chat.wa { border-radius: 22px; }
}
