/* ==========================================================================
   Thème « Studio Live » — l'énergie des lives, la lisibilité d'un outil
   de gestion. Titres : Sora · Texte : Manrope (repli system-ui hors ligne)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

/* display:flex sur .modal-overlay écraserait l'attribut hidden sans ceci */
[hidden] { display: none !important; }

:root {
  --ink: #1c1b2b;          /* encre profonde : topbar, mode live */
  --ink-soft: #2a2940;
  --bg: #f6f5f1;           /* papier chaud */
  --card: #ffffff;
  --text: #232135;
  --muted: #716f88;
  --border: #e6e3dc;
  --primary: #5b5bd6;      /* iris électrique */
  --primary-dark: #4c4ac2;
  --primary-soft: #eeedfb;
  --danger: #e5484d;       /* corail live */
  --success: #2f9e68;
  --warning: #d97706;
  --gold: #f5c518;         /* or Whatnot */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,27,43,.06), 0 4px 14px rgba(28,27,43,.05);
  --shadow-lift: 0 6px 22px rgba(28,27,43,.12);
  --font-display: 'Sora', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3, h4, .brand, .modal h2 {
  font-family: var(--font-display);
  letter-spacing: -.015em;
}

/* ---------- Barre du haut (encre sombre, esprit studio) ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--ink);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.brand { font-size: 1.15rem; color: #fff; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .95rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  color: rgba(255,255,255,.62);
  transition: background .15s, color .15s;
}
.tab:hover { background: rgba(255,255,255,.1); color: #fff; }
.tab.active { background: var(--primary); color: #fff; }
.topbar .btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.85);
}
.topbar .btn.ghost:hover { background: rgba(255,255,255,.1); filter: none; }

/* ---------- Statistiques ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px 20px 0;
  max-width: 1200px;
  margin: 0 auto;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  border-top: 3px solid transparent;
  transition: border-color .15s;
}
.stat:hover { border-top-color: var(--primary); }
.stat .value { font-size: 1.55rem; font-weight: 800; font-family: var(--font-display); letter-spacing: -.02em; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.alert { border-top-color: var(--danger); }
.stat.alert .value { color: var(--danger); }

/* ---------- Panneaux ---------- */
.tab-panel { max-width: 1200px; margin: 0 auto; padding: 16px 20px 60px; }

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar input[type=search] {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
}
.check { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: .92rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
  transition: filter .15s, transform .1s, box-shadow .15s;
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91,91,214,.35);
}
.btn.primary:hover { background: var(--primary-dark); filter: none; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }

/* ---------- Grille produits ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.product-card.low { border-color: var(--danger); }

.product-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg);
  cursor: pointer;
}
.product-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--border);
}

.product-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.product-name { font-weight: 700; line-height: 1.25; }
.product-sku { font-size: .75rem; color: var(--muted); }
.product-price { font-weight: 800; white-space: nowrap; font-family: var(--font-display); letter-spacing: -.02em; color: var(--primary-dark); }
.badge-low {
  font-size: .72rem;
  background: #fee2e2;
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  align-self: flex-start;
}

.stock-rows { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.stock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px 8px;
}
.stock-row .chan { flex: 1; color: var(--muted); }
.stock-row .qty { font-weight: 700; min-width: 30px; text-align: center; }
.stock-row button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.stock-row button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.stock-row.big { padding: 8px 10px; }
.stock-row.big .qty { font-size: 1.25rem; min-width: 44px; }
.stock-row.big .qty.zero { color: var(--danger); }

.sale-row { display: flex; gap: 6px; }
.sale-btn {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}
.sale-btn:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.sale-btn:disabled { opacity: .45; cursor: not-allowed; }

.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; padding: 7px; text-align: center; font-size: .85rem; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; line-height: 1.7; }

/* ---------- Cartes génériques ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h2 { margin-bottom: 6px; font-size: 1.15rem; }
.card h3 { margin-bottom: 6px; }
.card h4 { margin: 14px 0 6px; }
.card.success { border-color: var(--success); background: #f0fdf4; }
.muted { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }

/* ---------- Zone de dépôt ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.over, .dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Mapping import ---------- */
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mapping-grid label { font-size: .85rem; display: flex; flex-direction: column; gap: 4px; }
.mapping-grid select, .import-options select {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.import-options { display: flex; gap: 20px; flex-wrap: wrap; margin: 10px 0; font-size: .9rem; align-items: flex-start; }
.import-options > label { display: flex; flex-direction: column; gap: 4px; }
.target-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.target-fieldset legend { font-size: .85rem; color: var(--muted); padding: 0 6px; }
.target-fieldset .check { color: var(--text); cursor: pointer; }
.muted.small { font-size: .78rem; margin: 0; }

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 12px; text-align: left; white-space: nowrap; }
th {
  background: var(--ink);
  color: rgba(255,255,255,.85);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primary-soft); }
tr.row-missing-report:hover td, tr.row-unpaid:hover td { background: #fef2f2; }
tr.row-tovalidate:hover td { background: #fffbeb; }

.actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.actions .spacer { flex: 1; }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lift);
}
.modal h2 { margin-bottom: 14px; }

.form-columns { display: flex; gap: 18px; flex-wrap: wrap; }
.photo-side { flex: 0 0 180px; }
.fields-side { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }

.photo-drop {
  width: 180px;
  height: 180px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s;
}
.photo-drop:hover, .photo-drop.over { border-color: var(--primary); }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }

form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
form input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: var(--font-body);
  color: var(--text);
  width: 100%;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(91,91,214,.18);
}
.row2 label, .row3 label { min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stock-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 12px; }
.stock-fieldset legend { font-size: .85rem; color: var(--muted); padding: 0 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  max-width: 90vw;
}
.toast.error { background: var(--danger); }

/* ---------- Historique ---------- */
.delta-pos { color: var(--success); font-weight: 700; }
.delta-neg { color: var(--danger); font-weight: 700; }
.row-cancelled td { opacity: .45; text-decoration: line-through; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.live-ongoing { color: var(--danger); font-weight: 600; }

/* ---------- Lancer un live ---------- */
.btn.live-launch {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  font-weight: 600;
}
.btn.live-launch:hover { background: #b91c1c; }
.modal.narrow { max-width: 440px; }
.platform-buttons { display: flex; gap: 14px; margin: 18px 0 6px; }
.platform-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.platform-btn:hover { transform: translateY(-2px); }
.platform-btn.tiktok:hover { border-color: #000; }
.platform-btn.whatnot:hover { border-color: #f5c518; }
.platform-icon { font-size: 2rem; display: flex; align-items: center; }
.platform-icon img { width: 2.2rem; height: 2.2rem; }

/* Logo TikTok inline, aligné sur le texte comme un emoji */
.ico-tiktok {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  display: inline-block;
}

/* ---------- Mode live plein écran ---------- */
.no-scroll { overflow: hidden; }
.live-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.live-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--ink);
  border-bottom: 3px solid var(--danger);
  color: #fff;
  flex-wrap: wrap;
}
.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.live-badge { font-weight: 700; font-size: 1.05rem; }
.live-timer { font-variant-numeric: tabular-nums; font-size: 1.05rem; opacity: .9; }
.live-counters { font-size: .95rem; opacity: .9; }

.live-body {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  overflow: hidden;
}
.live-left { flex: 1.6; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.live-search {
  padding: 16px 18px;
  font-size: 1.15rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  width: 100%;
}
.live-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.live-product {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  transition: border-color .1s, background .1s;
}
.live-product:hover:not(:disabled) { border-color: var(--success); background: #f0fdf4; }
.live-product:active:not(:disabled) { background: #dcfce7; }
.live-product.out { opacity: .5; cursor: not-allowed; }
.live-product img, .live-noimg {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.live-product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-product-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-product-sku { font-size: .8rem; color: var(--muted); }
.live-product-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.live-product-price { font-weight: 700; }
/* étiquette « achat » à côté du prix d'achat affiché en live */
.live-product-price small,
.live-sale-price small {
  font-size: .6em;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .55;
}
.live-product-stock { font-size: .78rem; color: var(--muted); }
.live-product-stock.zero { color: var(--danger); font-weight: 700; }
.live-product-action {
  font-size: .8rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: .5px;
}

.live-log {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-width: 380px;
}
.live-log h3 { margin-bottom: 10px; font-size: 1rem; }
.live-sales { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.live-sale {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 7px 10px;
}
.live-sale.cancelled { opacity: .5; text-decoration: line-through; }
.live-sale-time { font-variant-numeric: tabular-nums; color: var(--muted); flex-shrink: 0; }
.live-sale-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.live-sale-name small { color: var(--muted); font-weight: 400; }
.live-sale-price { flex-shrink: 0; font-weight: 700; }
.live-sale-undo {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;
}
.live-sale-undo:hover { background: var(--warning); color: #fff; border-color: var(--warning); }
.live-sale-undone { font-size: .75rem; color: var(--danger); flex-shrink: 0; }
.empty.small-pad { padding: 20px 0; }

/* ---------- Cadeaux ---------- */
.live-gift-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .85rem;
  padding: 0;
}
.live-gift-btn:hover { background: #fef3c7; border-color: var(--warning); }
.live-gift-spacer { width: 28px; flex-shrink: 0; }
.live-sale.gift {
  margin-left: 26px;
  background: #fffbeb;
  border: 1px dashed #fcd34d;
}
.live-sale-no.gift { min-width: auto; }
.live-sale-price.offert { color: var(--warning); font-weight: 700; font-size: .78rem; }
.live-product-action.gift { color: var(--warning); }
.gift-modal { max-width: 560px; }
/* le sélecteur de cadeau doit passer au-dessus du mode live (z-index 60) */
#giftModal { z-index: 70; }

/* ---------- Vérification des lives (rapport / validation) ---------- */
.lives-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.settings-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.fees-setting {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: .85rem;
  max-width: 340px;
}
.fees-setting summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.fees-setting .muted.small { margin: 8px 0; }
.fees-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.fees-grid strong { grid-column: 1 / -1; margin-top: 4px; }
.fees-grid label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.fees-grid input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
.vat-setting { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.vat-setting span { display: flex; align-items: center; gap: 6px; }
.vat-setting input {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
}

tr.row-missing-report td { background: #fef2f2; }
tr.row-tovalidate td { background: #fffbeb; }
tr.row-unpaid td { background: #fef2f2; }

.status-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-badge.missing { background: #fee2e2; color: var(--danger); }
.status-badge.tovalidate { background: #fef3c7; color: #92400e; }
.status-badge.validated { background: #dcfce7; color: var(--success); }

.pay-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.pay-badge.paid { background: #dcfce7; color: var(--success); }
.pay-badge.pending { background: #fef3c7; color: #92400e; }
.pay-badge.failed { background: #fee2e2; color: var(--danger); }

.verify-banner {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: .95rem;
}
.verify-banner.missing { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.verify-banner.validated { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

.verify-panel {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
}
.verify-list { margin: 8px 0 12px 20px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.btn.success-btn { background: var(--success); border-color: var(--success); color: #fff; font-weight: 600; }
.btn.success-btn:hover { background: #15803d; }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: var(--danger); }
.gift-modal .live-search { margin: 10px 0; border-color: var(--warning); }
.gift-results { max-height: 45vh; overflow-y: auto; }

.recap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.recap-grid.wide { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* les tuiles avec infobulle l'indiquent au survol */
.recap-grid .stat[title] { cursor: help; }

/* ---------- Sortie de stock motivée ---------- */
.so-label { margin: 12px 0 6px; }
.so-reasons { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.so-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  flex-wrap: wrap;
}
.so-reason:hover { border-color: var(--primary); }
.so-reason:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
#soOther {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
}
#soQty { max-width: 140px; }

.live-sale-no {
  font-weight: 800;
  color: var(--primary);
  min-width: 32px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.muted-cell { color: var(--muted); }
.export-link { font-size: .85rem; font-weight: 400; margin-left: 10px; }

.report-import {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
  background: var(--bg);
}
.report-import .muted.small { margin: 6px 0 10px; }
#reportConfig { margin-top: 14px; }
#reportConfig .mapping-grid { margin-top: 10px; }

/* ---------- Ventes par photos ---------- */
.api-key-setup {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--card);
  font-size: .88rem;
}
.api-key-setup summary { cursor: pointer; font-weight: 600; }
.key-row { display: flex; gap: 8px; margin-top: 6px; }
.key-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.photos-actions { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.photos-actions label { display: flex; flex-direction: column; gap: 4px; }
.photos-actions select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.photo-progress {
  margin-top: 12px;
  padding: 10px 14px;
  background: #eef2ff;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: .9rem;
}
#photoReview { margin-top: 14px; }
.photo-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.photo-no { width: 70px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; }
.photo-no-prefix { font-weight: 700; color: var(--primary); margin-right: 2px; }
#photoReview select { max-width: 320px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; }
.sale-photo-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: middle;
}

/* ---------- Onglet Statistiques ---------- */
.stats-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.stats-filters { display: flex; gap: 10px; }
.stats-filters select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: .9rem;
}
.ai-report-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ai-report {
  margin-top: 16px;
  padding: 18px 22px;
  background: #f8f7ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  line-height: 1.65;
  font-size: .95rem;
}
.ai-report h3 { margin: 14px 0 6px; font-size: 1.02rem; }
.ai-report h3:first-child { margin-top: 0; }
.ai-report ul { margin: 6px 0 6px 22px; display: flex; flex-direction: column; gap: 4px; }
.ai-report p { margin: 6px 0; }

/* ---------- Frais manuels à l'import du rapport ---------- */
.manual-fee-row {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
}
.manual-fee-row label { font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fee-input-wrap { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.manual-fee-row input {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
}
.manual-fee-row .muted.small { margin: 8px 0 0; }

/* ---------- Comptabilité ---------- */
.stat.ac-net {
  border: 2px solid var(--primary);
  background: var(--primary-soft);
}
.stat.ac-net .value { color: var(--primary-dark); }
.ac-method li { padding-left: 0; }
.ac-method li::before { display: none; }
.ac-method { list-style: disc; margin-left: 20px; margin-top: 10px; }

/* ---------- Fusion de lives ---------- */
#mergeLiveModal label { display: block; font-weight: 600; margin-top: 8px; }
#mergeLiveModal select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--card);
}

/* ---------- Suppression d'un live ---------- */
.dl-btn:hover { background: #fee2e2; border-color: var(--danger); }
.dl-summary {
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  margin-bottom: 12px;
  line-height: 1.6;
}
#deleteLiveModal label { display: block; font-weight: 600; margin-top: 8px; }
#deleteLiveModal input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  letter-spacing: .06em;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Correction de vente et frais de live ---------- */
.se-no-row { display: flex; align-items: center; gap: 6px; }
.se-no-row input { width: 110px; }
#saleEditModal label { display: block; margin-bottom: 12px; font-weight: 600; }
#saleEditModal input, #saleEditModal select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  margin-top: 4px;
}
.live-fees { margin: 12px 0; }

/* ---------- Live : pastille « rejoindre » et coût ---------- */
.live-indicator-btn {
  background: #fee2e2;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-weight: 700;
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .35); }
  50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
}
.live-cost { color: #fbbf24; }
.live-header .btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: rgba(255, 255, 255, .9);
}
.live-header .btn.ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Connexion et sécurité ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}
.login-box {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  padding: 34px 36px;
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.login-brand { font-family: var(--font-display); font-size: 1.3rem; }
.login-box input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  text-align: center;
}
.login-error { color: var(--danger); font-weight: 600; font-size: .9rem; }
.sec-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; min-width: 240px; }
.sec-grid input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
}

/* ---------- Équipe, plateaux & accès ---------- */
.team-grid { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 14px; }
.team-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; min-width: 180px; }
.team-grid input, .team-grid select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
}
#teamUsers { margin: 12px 0; }
#teamUsers select { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .88rem; }
#teamUsers td .btn + .btn { margin-left: 6px; }
.plateau-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.plateau-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; padding: 6px 12px; }
.chip-x {
  border: none;
  background: none;
  cursor: pointer;
  font-size: .8rem;
  color: inherit;
  opacity: .6;
  padding: 0 2px;
}
.chip-x:hover { opacity: 1; }
#tpName {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  min-width: 220px;
}
.live-plateau { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.live-plateau select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; }

/* ---------- Rôle « liveur » : interface d'administration masquée ----------
   (le serveur refuse de toute façon ces routes — ceci évite juste les
   boutons morts et les données invisibles) */
.role-liveur .tabs .tab[data-tab="lives"],
.role-liveur .tabs .tab[data-tab="stats"],
.role-liveur .tabs .tab[data-tab="compta"],
.role-liveur .tabs .tab[data-tab="import"],
.role-liveur .tabs .tab[data-tab="movements"],
.role-liveur #stats,
.role-liveur .topbar a[href="/api/export.csv"],
.role-liveur #btnInventory,
.role-liveur #btnWebPhotos,
.role-liveur #btnAdd,
.role-liveur .card-footer > .btn,
.role-liveur .btn.ghost-mini,
.role-liveur .live-cost { display: none !important; }

/* ---------- Modale Ventes par photos ---------- */
.photo-sales-modal {
  max-width: 920px;
  width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
}
.ps-step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
}
.ps-step > strong { display: block; margin-bottom: 10px; font-family: var(--font-display); }
.ps-live-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ps-live-row select {
  flex: 1;
  min-width: 240px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: .9rem;
}
.ps-create {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius);
}
.ps-create-grid { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.ps-create-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; }
.ps-create-grid input, .ps-create-grid select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: .9rem;
}

/* ---------- Sauvegarde ---------- */
.backup-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.backup-row input {
  flex: 1;
  min-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
}
#backupStatus { margin: 8px 0 12px; }
.restore-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 14px;
  text-align: center;
  padding: 24px;
  font-family: var(--font-body);
}

/* ---------- Meilleurs créneaux de live ---------- */
.slots-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 18px; }
.slots-grid h4, #liveSlots h4 { margin: 10px 0 10px; }
.slot-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.slot-label { width: 84px; flex: none; font-weight: 600; font-size: .85rem; }
.slot-bar-track { flex: 1; background: var(--bg); border-radius: 6px; height: 18px; overflow: hidden; }
.slot-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 6px; }
.slot-value { width: 150px; flex: none; font-weight: 700; font-family: var(--font-display); font-size: .85rem; }
.slot-value small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: .72rem; }
.slot-curve {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 6px 4px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 6px;
}
.slot-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.slot-col-bar { width: 70%; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); border-radius: 6px 6px 0 0; min-height: 4px; }
.slot-col-label { font-size: .7rem; color: var(--muted); }
@media (max-width: 760px) { .slots-grid { grid-template-columns: 1fr; } }

/* ---------- Variantes de produits ---------- */
.variant-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
}
.variant-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.variant-row:last-child { border-bottom: none; }
.variant-row.low { background: #fff7ed; }
.variant-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
}
.variant-name:hover { color: var(--primary-dark); text-decoration: underline; }
.variant-row button:not(.sale-btn) {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.variant-row .qty { min-width: 26px; text-align: center; font-weight: 800; font-family: var(--font-display); }
.variant-row .qty.zero { color: var(--danger); }
.variant-sales { display: flex; gap: 4px; }
.sale-btn.mini { padding: 3px 7px; font-size: .8rem; }
.sale-btn.mini .ico-tiktok { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Chips marque / catégorie, prix HT-TTC, filtres ---------- */
.product-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.tag-brand { background: var(--ink); color: #fff; }
.tag-cat { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #c7d2fe; }
.tag-eu { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag-plateau { background: #fdf4ff; color: #a21caf; border: 1px solid #f5d0fe; }
.vat-check { margin-top: 4px; font-weight: 600; }
.lots-info {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  line-height: 1.7;
}
.card-footer { display: flex; align-items: flex-end; gap: 10px; }
.card-footer .btn { flex: none; }
.price-block {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  text-align: right;
}
.price-caption { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.price-ht {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary-dark);
}
.price-ht small { font-size: .7rem; font-weight: 700; color: var(--muted); }
.price-ttc { font-size: .78rem; color: var(--muted); }
.product-price small { font-size: .68rem; color: var(--muted); }
.product-price .price-ttc { display: block; font-weight: 400; font-family: var(--font-body); }
.toolbar select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: .88rem;
  max-width: 190px;
}

/* ---------- Photos depuis le web ---------- */
.wp-modal { max-width: 980px; width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.wp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 10px; }
.wp-results {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 160px;
}
.wp-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.wp-row:last-child { border-bottom: none; }
.wp-product { width: 250px; flex: none; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wp-product strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-thumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wp-thumb {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid transparent;
  cursor: pointer;
  background: var(--bg);
}
.wp-thumb:hover { border-color: #c7d2fe; }
.wp-thumb.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(91,91,214,.25); }
.wp-skip {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 1rem;
}
.wp-skip:hover { background: #fee2e2; border-color: var(--danger); }
.wp-steps { margin: 6px 0 10px 20px; display: flex; flex-direction: column; gap: 5px; }
.wp-key-row { flex-wrap: wrap; }
.wp-key-row input { flex: 1; min-width: 200px; }

/* ---------- Mode inventaire ---------- */
.inv-modal { max-width: 820px; width: 94vw; display: flex; flex-direction: column; max-height: 88vh; }
.inv-modal .live-search { margin: 10px 0 12px; }
.inv-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 220px;
}
.inv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.inv-row:last-child { border-bottom: none; }
.inv-row.counted { background: var(--primary-soft); }
.inv-photo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}
.inv-photo.placeholder { display: flex; align-items: center; justify-content: center; background: var(--bg); }
.inv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-stock { color: var(--muted); font-size: .82rem; flex: none; }
.inv-input {
  width: 76px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  flex: none;
}
.inv-diff { width: 44px; text-align: center; font-weight: 800; font-family: var(--font-display); flex: none; }
.inv-diff.ok { color: var(--success); }
.inv-diff.ko { color: var(--danger); }
.inv-actions { margin-top: 14px; align-items: center; }

/* ---------- Frais d'envoi et retours ---------- */
.ship-input {
  width: 74px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  text-align: right;
}
.btn.ghost-mini {
  padding: 2px 7px;
  font-size: .75rem;
  margin-left: 4px;
  background: transparent;
  border: 1px solid var(--border);
}
.btn.ghost-mini:hover { background: #fee2e2; border-color: var(--danger); }

/* ---------- Historique : filtres et pagination ---------- */
.mov-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mov-filters input[type="search"] { flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.mov-filters select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-size: .9rem; }
.mov-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.mov-pager .btn[disabled] { opacity: .4; cursor: default; }
.btn.small { padding: 4px 10px; font-size: .8rem; }

/* ---------- Code-barres ---------- */
.product-barcode {
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}
form label .muted.small { display: block; margin-top: 4px; font-weight: 400; }

/* ---------- Onglet Aide / Tutoriel ---------- */
.tuto-intro h2 { font-size: 1.35rem; }
.tuto-principle {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: .95rem;
}
.tuto-principle-icon { font-size: 1.6rem; line-height: 1; }
.tuto-flow-title { margin: 18px 0 10px; font-size: 1rem; }
.tuto-flow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tuto-flow li {
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.35;
}
.tuto-flow li small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.tuto-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.tuto-section { padding: 0; overflow: hidden; }
.tuto-section summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  user-select: none;
}
.tuto-section summary::-webkit-details-marker { display: none; }
.tuto-section summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--muted);
  transition: transform .2s;
}
.tuto-section[open] summary::after { transform: rotate(180deg); }
.tuto-section summary:hover { background: var(--primary-soft); }
.tuto-section[open] summary { border-bottom: 1px solid var(--border); }
.tuto-emoji { font-size: 1.25rem; line-height: 1; }
.tuto-body { padding: 16px 20px 20px; line-height: 1.65; font-size: .93rem; }
.tuto-body p { margin: 0 0 10px; }
.tuto-body p:last-child { margin-bottom: 0; }
.tuto-body ul { margin: 0 0 10px 20px; display: flex; flex-direction: column; gap: 6px; }
.tuto-body em { font-style: normal; font-weight: 600; color: var(--primary-dark); }
.tuto-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .85em;
}
.tuto-steps {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  counter-reset: tuto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tuto-steps li {
  counter-increment: tuto;
  position: relative;
  padding-left: 34px;
}
.tuto-steps li::before {
  content: counter(tuto);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 700;
}
.tuto-btn {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(28,27,43,.08);
  font-size: .85em;
  font-weight: 600;
  white-space: nowrap;
}
.tuto-btn.live { background: var(--danger); border-color: var(--danger); color: #fff; }
.tuto-note {
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  font-size: .88rem;
}
.tuto-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tuto-btn .ico-tiktok { vertical-align: -3px; }

/* ==========================================================================
   Espacement et alignement — passe UI/UX globale
   Tout groupe de boutons respire : titres avec actions, cellules de tableau,
   blocs repliables, panneaux de vérification.
   ========================================================================== */

/* Titres de cartes contenant des boutons ou liens d'action */
.card h2, .card h3, .card h4, #liveDetail h3, #liveDetail h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.card h2 .export-link, .card h4 .export-link { margin-left: auto; }

/* Boutons voisins dans une cellule de tableau (⬇ + ↩ Restaurer, etc.) */
td .btn + .btn, td .btn + a.btn, td a.btn + .btn { margin-left: 6px; }
td .btn { vertical-align: middle; }

/* Boutons à l'intérieur des blocs repliables (frais, clé API, sauvegarde) */
.fees-setting .btn, .api-key-setup > .btn { margin: 8px 8px 4px 0; }
details.api-key-setup { margin: 12px 0; }

/* En-tête de l'onglet Lives : boutons + note sur leur propre ligne */
.lives-head .btn + .btn { margin-left: 8px; }
.lives-head > div > .muted.small { display: block; margin-top: 8px; }

/* Panneau de vérification : bouton valider détaché de la liste */
.verify-panel .success-btn { margin-top: 12px; }
.verify-list li { margin-bottom: 6px; }
.verify-list li .btn { margin-left: 6px; }

/* Zones d'import (rapport, photos) : boutons espacés du texte */
.report-import .btn { margin-top: 4px; }
.report-import .btn + input + div { margin-top: 12px; }

/* Barres d'actions génériques : jamais de boutons collés */
.actions { flex-wrap: wrap; }
.backup-row .btn { flex: none; }

/* Petites zones où des boutons se suivent hors flex */
.photos-actions { row-gap: 10px; }
.wp-head { row-gap: 10px; }

@media (max-width: 760px) {
  .live-body { flex-direction: column; overflow-y: auto; }
  .live-left { flex: none; }
  .live-results { max-height: 50vh; }
  .live-log { max-width: none; min-height: 200px; }
}

@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .photo-side { flex: 1; }
  .photo-drop { width: 100%; }
}
