/* ============================================================
   Mon Club Parfum — Thème commun (élégant / parfumerie)
   ============================================================ */
:root {
  /* Club Parfum Grasse — or, vert citron, teal, rose */
  --plum: #333333;
  --plum-soft: #4FB68D;
  --gold: #D4AF37;
  --gold-soft: #E8D48B;
  --gold-muted: #C5A059;
  --lime: #A2E635;
  --teal: #4FB68D;
  --teal-dark: #2D6B56;
  --pink: #F8C8DC;
  --cream: #FFFFFF;
  --cream-card: #FFFFFF;
  --ink: #333333;
  --ink-muted: #6B7280;
  --line: #E5EBE8;
  --danger: #b23b4b;
  --ok: #4FB68D;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 34px rgba(51, 51, 51, 0.10);
  --shadow-sm: 0 4px 14px rgba(51, 51, 51, 0.08);
  --maxw: 760px;
  --font-display: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-serif: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(70% 45% at 95% 5%, rgba(162, 230, 53, 0.14) 0%, transparent 55%),
    radial-gradient(55% 40% at 5% 95%, rgba(248, 200, 220, 0.22) 0%, transparent 50%),
    radial-gradient(90% 50% at 50% -5%, rgba(212, 175, 55, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #fff 0%, #FAFCFA 100%);
  -webkit-font-smoothing: antialiased;
}

/* ---------- En-tête ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  color: var(--ink);
  padding: 16px 18px;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 16px rgba(51, 51, 51, 0.06);
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.app-header .brand-logo {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-muted) 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 20px;
  font-family: var(--font-display);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.35);
}
.app-header .brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.1;
}
.app-header .brand-sub {
  font-size: 0.72rem;
  color: var(--teal-dark);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ---------- Conteneur ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px 92px;
}

.section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Navigation flottante ---------- */
.fab-zone {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.fab-nav {
  position: relative;
  right: auto;
  bottom: auto;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(45, 107, 86, 0.45), 0 4px 12px rgba(51, 51, 51, 0.2);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.fab-nav.open { transform: rotate(90deg); }
.fab-action {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-muted) 100%);
  color: #fff;
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.45), 0 4px 12px rgba(51, 51, 51, 0.18);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
.fab-action[hidden] { display: none !important; }
.fab-action:active { transform: scale(0.94); }
.archives-intro { font-size: 0.85rem; margin: -6px 0 14px; }
.archive-view-ic { font-size: 1rem; opacity: 0.55; }
.fab-menu {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(300px, calc(100vw - 32px));
  padding: 12px;
  background: var(--cream-card);
  border: 1.5px solid rgba(45, 107, 86, 0.15);
  border-radius: 18px;
  box-shadow:
    0 22px 55px rgba(51, 51, 51, 0.38),
    0 10px 24px rgba(45, 107, 86, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.15);
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fab-menu button[data-tab="offres"] .ic { font-size: 1.2rem; }
.fab-menu.is-open {
  display: grid;
}
.fab-menu[hidden] {
  display: none !important;
}
.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(51, 51, 51, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
}
.fab-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.fab-menu button[data-tab="archives"] .ic { font-size: 1.25rem; }
.fab-menu button {
  border: none;
  background: rgba(79, 182, 141, 0.08);
  border-radius: 14px;
  padding: 10px 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.fab-menu button .ic { font-size: 1.35rem; line-height: 1; }
.fab-menu button.active {
  background: rgba(162, 230, 53, 0.22);
  color: var(--teal-dark);
}

/* ---------- Archives commandes ---------- */
.archive-client-block {
  background: rgba(212, 175, 55, 0.12);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.archive-client-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
}
.archive-client-name {
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 0.92rem;
}
.archive-client-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.archive-client-count {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 600;
}
.archive-chevron {
  font-size: 0.65rem;
  color: var(--teal-dark);
  transition: transform 0.2s;
}
.archive-client-block.open .archive-chevron { transform: rotate(180deg); }
.archive-order-list {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 12px;
}
.archive-client-block.open .archive-order-list { display: flex; }
.archive-order-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: left;
}
.archive-order-row:active { transform: scale(0.99); }

/* ---------- Onglets bas (legacy, masqué) ---------- */
.tabbar { display: none; }

/* ---------- Sections / panneaux ---------- */
.panel { display: none; }
.panel.active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 14px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0;
  color: var(--teal-dark);
}

/* ---------- Type de demande (devis / commande) ---------- */
.demande-type-bar {
  display: flex;
  gap: 0;
  padding: 3px;
  background: rgba(45, 107, 86, 0.08);
  border-radius: 12px;
}
.demande-type-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.demande-type-tab.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 2px 8px rgba(51, 51, 51, 0.08);
}
.demande-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 4px;
}
.demande-type-badge.devis {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-muted);
}
.demande-type-badge.commande {
  background: rgba(79, 182, 141, 0.15);
  color: var(--teal-dark);
}
.ratio-devis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 6px;
}
.ratio-devis-stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(45, 107, 86, 0.06);
  border-radius: 12px;
}
.ratio-devis-stat .num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.ratio-devis-stat .lbl {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}

/* ---------- Statistiques (accueil) ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat .num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--plum);
}
.stat .lbl { font-size: 0.78rem; color: var(--ink-muted); margin-top: 2px; }
.stat.sales { background: linear-gradient(135deg, var(--plum) 0%, var(--teal-dark) 100%); border: none; }
.stat.sales .num { color: #fff; }
.stat.sales .lbl { color: rgba(255,255,255,0.9); }
.stat.gold { background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 55%, var(--gold-muted) 100%); border: none; }
.stat.gold .num { color: var(--gold-soft); }
.stat.gold .lbl { color: rgba(255,255,255,0.9); }

/* ---------- Cadre statistiques ---------- */
.vp-cumul {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 60%, var(--gold-muted) 100%);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vp-cumul-label { color: rgba(255,255,255,0.85); font-size: 0.82rem; font-weight: 600; }
.vp-cumul-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--gold-soft); }

.stat-block { margin-top: 18px; }
.stat-block-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

/* Graphique en barres verticales */
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 150px;
  padding-top: 14px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-val { font-size: 0.62rem; color: var(--ink-muted); font-weight: 700; margin-bottom: 3px; min-height: 12px; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-fill {
  width: 100%;
  min-height: 3px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-soft) 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
}
.bar-lbl { font-size: 0.68rem; color: var(--ink-muted); margin-top: 6px; text-transform: capitalize; }

/* Barres horizontales (catégories) */
.hbar-row { margin-bottom: 12px; }
.hbar-head { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; }
.hbar-head .muted { font-size: 0.76rem; }
.hbar-track { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--teal-dark) 0%, var(--lime) 100%); border-radius: 999px; transition: width 0.4s ease; }

/* Meilleures ventes */
.best-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}
.best-row:last-child { border-bottom: none; }
.best-rank { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.best-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-qty { color: var(--ink-muted); font-size: 0.74rem; white-space: nowrap; }
.best-amount { font-weight: 700; color: var(--plum); white-space: nowrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-muted) 100%); color: #fff; box-shadow: 0 4px 14px rgba(212, 175, 55, 0.28); }
.btn-plum { background: var(--teal-dark); color: #fff; }
.btn-wa { background: #25D366; color: #fff; }
.btn-payee { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(178, 59, 75, 0.28); }
.btn-ghost { background: transparent; color: var(--plum); border: 1.5px solid var(--line); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid #e6c4ca; }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.order-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-actions-row {
  display: grid;
  gap: 8px;
}
.order-actions-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.order-actions-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.order-actions .btn {
  width: 100%;
  margin: 0;
  line-height: 1.2;
  white-space: normal;
}
.order-actions-row.cols-3 .btn { font-size: 0.95rem; padding: 12px 6px; }
.order-actions-row.cols-2 .btn { font-size: 0.8rem; padding: 12px 10px; }
.order-actions .btn-payee { font-size: 1.05rem; padding: 14px 12px; letter-spacing: 0.02em; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 12px; }
.field-disabled label,
.field-disabled .hint { color: var(--ink-muted); opacity: 0.65; }
.input:disabled,
.select:disabled,
.textarea:disabled {
  background: #eceae6;
  color: var(--ink-muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}
.field .hint { font-weight: 500; color: var(--ink-muted); font-size: 0.72rem; }
.input, .select, .textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(79, 182, 141, 0.22);
}
.textarea { resize: vertical; min-height: 70px; }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; }

.form-block {
  background: rgba(212, 175, 55, 0.18);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  padding: 14px 14px 6px;
  margin-bottom: 12px;
}
.form-block .field:last-child,
.form-block .field-row:last-child,
.form-block .stock-inline:last-child { margin-bottom: 8px; }
.photo-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.filter-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}
.filter-row .select { flex: 1; min-width: 0; }
.filter-genre {
  width: 100%;
  margin-bottom: 12px;
}
.filter-genre[hidden] {
  display: none !important;
}
.btn-stock-filter {
  flex-shrink: 0;
  white-space: nowrap;
  background: rgba(212, 175, 55, 0.14);
  color: var(--teal-dark);
  border: 2px solid rgba(212, 175, 55, 0.45);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-stock-filter.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-muted) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.28);
}

.stock-summary {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(79, 182, 141, 0.08) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stock-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.stock-summary-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.stock-summary-total {
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.stock-summary-total strong {
  font-size: 1.05rem;
  color: var(--plum);
}
.stock-summary-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stock-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 600;
}
.stock-cat-chip strong {
  color: var(--teal-dark);
  font-size: 0.88rem;
}
.stock-cat-chip-active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.14);
  color: var(--teal-dark);
}

.genre-radios {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.genre-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.genre-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal-dark);
  cursor: pointer;
  flex-shrink: 0;
}
.badge-genre {
  display: inline-block;
  background: rgba(45, 107, 86, 0.12);
  color: var(--teal-dark);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---------- Interrupteur glissant ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(79, 182, 141, 0.08);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
}
.toggle-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(79, 182, 141, 0.28);
}

.badge-stock {
  display: inline-block;
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 4px;
}

.order-line-remise {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.order-line-remise .hint { margin: 0; white-space: nowrap; }
.pv-barred {
  text-decoration: line-through;
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.88rem;
}
.pv-remise, .line-net-price {
  font-weight: 700;
  color: var(--plum);
}
.line-price-display .vp-badge,
.line-price-display .badge-stock {
  margin-left: 4px;
}
.remise-montant {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--plum);
  white-space: nowrap;
  margin-left: auto;
}
.order-remise-input {
  width: 64px;
  padding: 6px 8px;
  font-size: 0.85rem;
  text-align: center;
}
.order-prod-row .prod-info { min-width: 0; }
.order-detail-line { margin-bottom: 10px; }

.stock-inline { margin-top: 0; }
.stock-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stock-inline-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.stock-inline .toggle-switch {
  width: 38px;
  height: 22px;
}
.stock-inline .toggle-slider::before {
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
}
.stock-inline .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}
.stock-qte-block {
  display: none;
  align-items: center;
  gap: 8px;
}
.stock-qte-block.is-visible {
  display: inline-flex !important;
}
.stock-qte-block[hidden] {
  display: none !important;
}
.stock-qte-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.stock-qte-stepper {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.stock-qte-input {
  width: 46px;
  border: none;
  padding: 6px 4px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--ink);
  background: transparent;
  -moz-appearance: textfield;
}
.stock-qte-input:focus { outline: none; }
.stock-qte-input::-webkit-outer-spin-button,
.stock-qte-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stock-qte-arrows {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}
.stock-qte-arrows button {
  flex: 1;
  width: 24px;
  min-height: 14px;
  border: none;
  background: rgba(79, 182, 141, 0.1);
  color: var(--teal-dark);
  font-size: 0.5rem;
  line-height: 1;
  padding: 2px 0;
  cursor: pointer;
}
.stock-qte-arrows button:active {
  background: rgba(79, 182, 141, 0.22);
}
.stock-qte-arrows button + button {
  border-top: 1px solid var(--line);
}

.order-prod-row.in-panier {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
}
.panier-offre-section {
  margin-bottom: 14px;
}
.panier-recap-pave {
  background: var(--teal-dark);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  color: #fff;
}
.panier-recap-hero {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.panier-recap-total-lbl {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.9);
}
.panier-recap-total-amt {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold-soft);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.panier-recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panier-recap-vp {
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}
.panier-recap-vp-num {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: 0.82rem;
}
.panier-recap-remise {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.panier-recap-remise label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  flex: 1;
  min-width: 0;
}
.panier-recap-remise .hint {
  color: rgba(255, 255, 255, 0.55);
}
.panier-recap-remise-input {
  width: 72px;
  flex-shrink: 0;
  padding: 6px 8px;
  font-size: 0.88rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}
.panier-recap-remise-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.panier-offre-list {
  gap: 8px;
  min-height: 52px;
}
.panier-offre-row {
  padding: 8px;
  align-items: flex-start;
  background: rgba(79, 182, 141, 0.06);
  border-color: rgba(45, 107, 86, 0.2);
}
.panier-offre-remise {
  margin-top: 6px;
}
.panier-offre-remove {
  flex-shrink: 0;
  color: var(--danger);
  font-size: 1rem;
  padding: 4px 8px;
}
.panier-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.panier-add-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

/* ---------- Liste produits (conseiller) ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.prod-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}
.prod-thumb {
  width: 64px; height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #f0e7d8;
  flex-shrink: 0;
}
.prod-thumb.placeholder { display: grid; place-items: center; color: var(--gold); font-size: 1.5rem; }
.cat-row-editing { flex-wrap: wrap; align-items: center; }
.prod-info { flex: 1; min-width: 0; }
.prod-info .name { font-weight: 700; color: var(--ink); }
.prod-info .meta { font-size: 0.76rem; color: var(--ink-muted); margin-top: 2px; }
.prod-info .prices { font-size: 0.82rem; margin-top: 4px; }
.prod-info .prices .pv { color: var(--plum); font-weight: 700; }
.prod-info .prices .pa { color: var(--ink-muted); }
.prod-info .prices .mg {
  display: inline-block;
  background: rgba(79, 182, 141, 0.14);
  color: var(--ok);
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 700;
  font-size: 0.72rem;
  margin-left: 4px;
}
.prod-actions { display: flex; flex-direction: column; gap: 6px; }

.badge-cat {
  display: inline-block;
  background: rgba(162, 230, 53, 0.2);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Code / référence produit */
.prod-code {
  display: inline-block;
  background: var(--teal-dark);
  color: var(--gold-soft);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.product-card .pref {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.4px;
}

/* Points valeur (VP) */
.vp-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-muted) 100%);
  color: #fff;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.vp-badge-muted {
  background: #E5EBE8;
  color: var(--ink-muted);
  font-weight: 600;
}
.field-disabled .input:disabled {
  color: var(--ink-muted);
  -webkit-text-fill-color: var(--ink-muted);
  opacity: 1;
}

/* ---------- Catégorie titre (catalogue) ---------- */
.cat-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--teal-dark);
  margin: 22px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.cat-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cat-subtitle {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--plum);
  margin: 14px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}

/* ---------- Grille catalogue client ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.product-card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.product-card .ph {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f0e7d8;
}
.product-card .ph.placeholder { display: grid; place-items: center; color: var(--gold); font-size: 2.2rem; }
.product-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .pname { font-weight: 700; font-size: 0.92rem; line-height: 1.2; }
.product-card .pdesc { font-size: 0.74rem; color: var(--ink-muted); flex: 1; }
.product-card .pprice { font-family: var(--font-display); font-size: 1.15rem; color: var(--plum); font-weight: 700; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--plum);
  font-size: 1.1rem; font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
}
.qty-control .qv { min-width: 22px; text-align: center; font-weight: 700; }

/* ---------- Panier flottant ---------- */
.cart-bar {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(var(--maxw) - 0px);
  z-index: 70;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}
.cart-bar.hidden { transform: translateX(-50%) translateY(120px); opacity: 0; pointer-events: none; }
.cart-bar .ct-count { font-weight: 700; }
.cart-bar .ct-total { font-family: var(--font-display); font-size: 1.1rem; color: var(--gold-soft); }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(51, 51, 51, 0.48);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--cream-card);
  width: 100%;
  max-width: var(--maxw);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  position: relative;
  animation: slideUp 0.22s ease;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 22px; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h3 { font-family: var(--font-display); color: var(--teal-dark); margin: 0; font-size: 1.3rem; }
.modal-close {
  border: none; background: rgba(79, 182, 141, 0.12);
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer; color: var(--teal-dark);
}

/* ---------- Divers ---------- */
.empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 40px 20px;
}
.empty .ic { font-size: 2.6rem; opacity: 0.5; }
.empty p { margin: 10px 0 0; }

.toast {
  position: fixed;
  bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--teal-dark); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 200;
  font-size: 0.88rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.muted { color: var(--ink-muted); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: none; }

/* Lien de partage catalogue */
.share-box {
  background: rgba(248, 200, 220, 0.25);
  border: 1px dashed var(--teal);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--plum);
}

/* ---------- Écran d'accueil pleine page ---------- */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1a5560;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.65s ease, visibility 0.65s ease;
  overflow: hidden;
}
.app-splash img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.app-splash.dismiss {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.splash-lock { overflow: hidden; }

/* iOS — recadrage pour iPhone (logo, slogan et fleurs visibles) */
@supports (-webkit-touch-callout: none) {
  .app-splash {
    height: 100dvh;
    min-height: -webkit-fill-available;
  }
  .app-splash img {
    object-fit: cover;
    object-position: center 42%;
    min-height: 100%;
  }
}
@supports (-webkit-touch-callout: none) {
  @media (max-aspect-ratio: 9/18) {
    .app-splash img {
      object-position: center 38%;
    }
  }
  @media (max-aspect-ratio: 9/20) {
    .app-splash img {
      object-position: center 35%;
    }
  }
}
