/* ============================================================
   Masli — Apothicaire Moderne
   Palette : papier crème · vert forêt profond · gold subtil
   Typo    : Fraunces (display serif) · Plus Jakarta Sans (body)
            · JetBrains Mono (data)
   ============================================================ */

:root {
  /* Surfaces */
  --bg:           #F4EFE3;
  --bg-warm:      #EFE7D2;
  --surface:      #FFFFFF;
  --surface-alt:  #FBF8F0;

  /* Texte */
  --ink:          #1A1815;
  --ink-soft:     #3D3A33;
  --muted:        #8B8478;
  --muted-soft:   #B7B0A2;

  /* Accents */
  --accent:       #1B4332;
  --accent-mid:   #2D5F4F;
  --accent-soft:  #E1ECE4;
  --accent-pale:  #F0F5F1;
  --gold:         #B8954A;
  --gold-soft:    #F2EBD7;
  --danger:       #8B2C2C;
  --danger-soft:  #F4DCDC;

  /* Bordures */
  --border:       #DCD3BE;
  --border-soft:  #ECE3CC;
  --border-dark:  #C5BAA0;

  /* Forme */
  --radius:       4px;
  --radius-lg:    8px;

  /* Ombre */
  --shadow-sm:    0 1px 2px rgba(26, 24, 21, 0.04);
  --shadow:       0 1px 2px rgba(26, 24, 21, 0.04), 0 8px 24px -8px rgba(26, 24, 21, 0.08);
  --shadow-lg:    0 1px 2px rgba(26, 24, 21, 0.04), 0 24px 48px -16px rgba(26, 24, 21, 0.12);

  /* Type */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body:    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* L'attribut HTML `hidden` doit TOUJOURS masquer, même si une classe fixe un
   `display` (sinon l'overlay/les aperçus restent visibles en permanence). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

/* Texture papier subtile */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(184, 149, 74, 0.04), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(27, 67, 50, 0.03), transparent 60%);
  mix-blend-mode: multiply;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--bg); }

/* ---------- topbar ---------- */
.topbar {
  position: relative;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  font-variation-settings: "opsz" 30;
  align-self: center;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.1);
}
.brand__name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144;
}
.brand__sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  font-feature-settings: "ss01";
}
.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar__link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.topbar__link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.topbar__link--ghost {
  color: var(--muted);
  border: 1px solid var(--border);
  margin-left: 8px;
}
.topbar__link--ghost:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

/* ---------- container ---------- */
.container {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 24px 32px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--muted-soft);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}
.footer__rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* ---------- typography utils ---------- */
.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 600;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 32px 0 24px;
  margin-bottom: 64px;
}
.hero__head {
  max-width: 720px;
  margin-bottom: 36px;
}
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 24px;
}
.hero__eyebrow-line {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}
.hero__title-em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.hero__sub {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0;
  line-height: 1.6;
}

/* ---------- dropzone ---------- */
.dropzone-form { margin: 0; }
.dropzone {
  display: block;
  position: relative;
  cursor: pointer;
  background: var(--surface);
  border: 1.5px dashed var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  pointer-events: none;
  transition: inset 0.3s ease;
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.dropzone:hover::before { inset: 12px; }
.dropzone input { display: none; }
.dropzone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  position: relative;
}
.dropzone__icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  opacity: 0.85;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.dropzone:hover .dropzone__icon {
  transform: translateY(-4px);
}
.dropzone__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 60;
}
.dropzone__hint {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.dropzone--loading {
  border-color: var(--accent);
  background: var(--accent-pale);
  pointer-events: none;
}
.dropzone--loading .dropzone__icon { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ---------- ledger (historique) ---------- */
.ledger-section { }
.ledger-section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.ledger-section__count {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.ledger__row {
  display: grid;
  grid-template-columns: 160px 1fr 110px auto;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all 0.2s ease;
  animation: row-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: calc(var(--row-index, 0) * 60ms);
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ledger__row:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.ledger__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ledger__name strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2px;
}
.ledger__name small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.ledger__statut {
  text-align: center;
}
.ledger__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--bg-warm);
  color: var(--muted);
  border: 1px solid var(--border-soft);
}
.badge--ok {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn--primary:hover {
  background: var(--accent-mid);
  border-color: var(--accent-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn--primary:active { transform: translateY(0); }
.btn--large { padding: 13px 24px; font-size: 14px; }

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--icon {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-soft);
  padding: 7px 9px;
}
.btn--icon:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.btn--toggle {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.btn--toggle:hover { background: var(--accent-pale); }

.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
}
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.inline { display: inline; margin: 0; }

/* ---------- empty state ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 32px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  gap: 16px;
}
.empty__icon {
  width: 56px;
  height: 56px;
  color: var(--muted-soft);
  margin-bottom: 8px;
}
.empty__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  margin: 0;
}
.empty__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ---------- back link ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 24px;
  padding: 6px 0;
  transition: all 0.2s ease;
}
.back:hover { color: var(--accent); transform: translateX(-2px); }

/* ---------- card / sections ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
  gap: 24px;
  flex-wrap: wrap;
}
.card__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  max-width: 400px;
}
.card__hint strong { color: var(--ink); font-weight: 600; }

/* Aide sous un champ de formulaire. */
.field__hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.field__hint code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2, rgba(0,0,0,.06));
}

/* Gamme complète : en-tête (label + bouton import) et lignes CIP. */
.impl-gamme__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.impl-gamme__import { cursor: pointer; }
.impl-gamme-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.impl-gamme-row .field__input { margin: 0; }
.impl-gamme-row__qte { flex: 0 0 84px; width: 84px; }

/* Sous-titre de groupe dans l'historique (par type de présentoir). */
.ledger__group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.ledger__group-title:first-of-type { margin-top: 8px; }
.ledger__group-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2, rgba(0,0,0,.06));
  color: var(--muted);
}

/* ---------- doc-meta (editor head) ---------- */
.doc-meta { margin-bottom: 28px; }
.doc-meta__eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 600;
}
.doc-meta__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}
.doc-meta__sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.doc-meta__file {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.doc-meta__file span {
  font-family: var(--font-mono);
  color: var(--ink-soft);
}

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { width: 100%; margin-bottom: 16px; }
.field__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.field__label em { font-style: italic; text-transform: none; letter-spacing: 0; }
.field__input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-alt);
  color: var(--ink);
  transition: all 0.18s ease;
}
.field__textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.5;
  font-family: var(--font-mono);
  white-space: pre;
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-pale);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ---------- groupes opérateur ---------- */
.groupe {
  margin-bottom: 28px;
  border-radius: var(--radius);
  overflow: hidden;
}
.groupe__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(to right, var(--accent-soft), var(--accent-pale));
  border-left: 3px solid var(--accent);
  border-bottom: 1px solid var(--border-soft);
}
.groupe__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--accent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--accent);
  font-variant-numeric: tabular-nums;
}
.groupe__nom {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 60;
}
.groupe__fill { flex: 1; }
.groupe__count {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--accent);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* ---------- table lignes ---------- */
.lignes {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}
.lignes thead { background: var(--surface-alt); }
.lignes th {
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.lignes td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.lignes tbody tr:last-child td { border-bottom: none; }
.lignes tbody tr { transition: background 0.15s ease; }
.lignes tbody tr:hover { background: var(--surface-alt); }

.th-num, .cell-num { text-align: right; }
.th-num { padding-right: 16px; }
.cell-num { font-variant-numeric: tabular-nums; padding-right: 16px; }
.cell-mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.cell-nom { color: var(--ink); }
.cell-ro { color: var(--ink-soft); }
.cell-strong { font-weight: 600; color: var(--ink); }

.cell-edit input[type="number"],
.cell-edit input[type="text"] {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: var(--surface-alt);
  color: var(--ink);
  transition: all 0.15s ease;
}
.cell-edit input[type="number"]:hover,
.cell-edit input[type="text"]:hover { border-color: var(--border-dark); }
.cell-edit input[type="number"]:focus,
.cell-edit input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-pale);
}
/* hide spinners */
.cell-edit input::-webkit-outer-spin-button,
.cell-edit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell-edit input[type=number] { -moz-appearance: textfield; }
/* colonnes texte éditables (code EAN, désignation) : alignées à gauche, plus larges */
.cell-edit--code input[type="text"] { width: 122px; text-align: left; }
.cell-edit--text { width: 42%; }
.cell-edit--text input[type="text"] {
  width: 100%;
  min-width: 160px;
  text-align: left;
  font-family: var(--font-sans, inherit);
}

/* ---------- totaux sticky ---------- */
.totaux {
  position: sticky;
  bottom: 16px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  transition: padding 0.25s ease;
}
.totaux__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.totaux__eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.totaux__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: var(--accent);
  font-variation-settings: "opsz" 60;
}
.totaux__detail { margin-bottom: 14px; }
.totaux__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.totaux__table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.totaux__table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.totaux__table tbody tr:last-child td { border-bottom: none; }
.totaux__table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12.5px; }
.op-num {
  display: inline-block;
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.op-name { color: var(--ink); }

.totaux__resume {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
  background: linear-gradient(to right, var(--accent), var(--accent-mid));
  color: var(--bg);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.totaux__resume::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(184,149,74,.15), transparent 60%);
  pointer-events: none;
}
.totaux__resume-block { display: flex; flex-direction: column; gap: 2px; flex: 1; position: relative; }
.totaux__label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 600;
}
.totaux__value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144;
}
.totaux__value--big { font-size: 28px; font-style: italic; }
.totaux__divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  position: relative;
}

.totaux .when-closed { display: none; }
.totaux--reduit .totaux__detail,
.totaux--reduit .totaux__head .totaux__eyebrow,
.totaux--reduit .totaux__head .totaux__title { display: none; }
.totaux--reduit .when-open { display: none; }
.totaux--reduit .when-closed { display: inline; }
.totaux--reduit { padding: 14px 24px; }
.totaux--reduit .totaux__head { margin-bottom: 0; position: absolute; top: 18px; right: 24px; }

/* ---------- actions bar ---------- */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.actions-bar a:not(.btn--primary) { margin-right: auto; }

/* ---------- compte ---------- */
.compte { max-width: 560px; }
.compte__head { margin-bottom: 32px; }
.compte__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 42px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-variation-settings: "opsz" 144;
}
.compte__title em { font-style: italic; color: var(--accent); font-weight: 300; }
.compte__sub { color: var(--ink-soft); font-size: 14px; margin: 0; }
.compte__sub strong { color: var(--accent); font-weight: 600; }
.compte__form {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.compte__section {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 20px;
  color: var(--ink);
  font-variation-settings: "opsz" 60;
}
.compte__warning {
  font-size: 12px;
  color: var(--muted);
  background: var(--gold-soft);
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ---------- alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert--ok {
  background: var(--accent-pale);
  color: var(--accent);
  border-color: var(--accent);
}
.alert--err {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- telechargement ---------- */
.telechargement {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.telechargement__box {
  max-width: 480px;
  text-align: center;
  padding: 56px 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.telechargement__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  color: var(--accent);
  animation: check-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.telechargement__icon svg { width: 100%; height: 100%; }
.telechargement__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  margin: 12px 0 12px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.telechargement__title em { font-style: italic; color: var(--accent); }
.telechargement__sub { color: var(--muted); font-size: 13px; margin: 0; }
.telechargement__sub a { color: var(--accent); font-weight: 600; }
@keyframes check-pop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--accent);
  color: var(--bg);
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1), toast-out 0.4s ease 3.6s forwards;
}
.toast svg { flex-shrink: 0; }
.toast--error {
  background: #8c2f23;
  color: #fdece9;
  max-width: 440px;
  line-height: 1.45;
  align-items: flex-start;
  animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast--error svg { margin-top: 1px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-12px); }
}

/* ---------- reveal animation ---------- */
.reveal {
  animation: reveal-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.reveal--delay-1 { animation-delay: 100ms; }
.reveal--delay-2 { animation-delay: 200ms; }
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .container { padding: 24px 20px 60px; }
  .topbar__inner { padding: 14px 20px; flex-wrap: wrap; }
  .brand__sub { display: none; }
  .hero { padding-top: 16px; margin-bottom: 40px; }
  .hero__title { font-size: clamp(32px, 9vw, 48px); }
  .field-grid { grid-template-columns: 1fr; }
  .ledger__row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
  }
  .ledger__date { font-size: 11px; }
  .ledger__actions { flex-wrap: wrap; }
  .totaux__resume { flex-direction: column; align-items: flex-start; gap: 12px; }
  .totaux__divider { display: none; }
  .lignes { font-size: 12px; }
  .lignes th, .lignes td { padding: 8px 6px; }
  .cell-edit input[type="number"],
  .cell-edit input[type="text"] { width: 56px; padding: 5px 8px; }
  .cell-edit--code input[type="text"] { width: 92px; }
  .cell-edit--text input[type="text"] { width: 100%; min-width: 0; }
}

/* ---------- implantation (merchandising IA) ---------- */
.impl-form { margin-top: 4px; }
.impl-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.impl-produits {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}
.impl-produit {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.impl-produit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.impl-produit__num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
}
.impl-produit__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.impl-produit__grid .field--full { grid-column: 1 / -1; margin-bottom: 0; }

/* résultat */
.impl-result {
  margin-bottom: 40px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.impl-figure { margin: 18px 0 0; }
.impl-figure__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 440px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--bg-warm);
}
.impl-figure__cap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.impl-figure__meta { font-size: 12px; color: var(--muted); }
.impl-regen {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

@media (max-width: 880px) {
  .impl-produit__grid { grid-template-columns: 1fr 1fr; }
  .impl-form__actions { flex-direction: column; align-items: stretch; }
  .impl-figure__cap { flex-direction: column; align-items: flex-start; }
}

/* aperçu d'image (TG + produit) — borné en largeur ET hauteur */
.impl-preview {
  display: block; margin-top: 10px;
  width: auto; height: auto; max-width: 240px; max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border-soft);
  background: var(--bg-warm);
}
.impl-preview--sm { max-width: 140px; max-height: 130px; }

/* message inline de validation du formulaire */
.impl-form__msg {
  margin: 14px 0 0; padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--danger); background: var(--danger-soft);
  border-radius: var(--radius);
}

/* parcours guidé en étapes numérotées */
.impl-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.impl-step {
  display: grid; grid-template-columns: 40px 1fr; gap: 18px;
  position: relative; padding-bottom: 26px;
}
.impl-step:last-child { padding-bottom: 0; }
.impl-step:not(:last-child)::before {
  content: ""; position: absolute; left: 19px; top: 44px; bottom: 6px;
  width: 2px; background: var(--border-soft);
}
.impl-step__num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 600; z-index: 1;
}
.impl-step__body { padding-top: 5px; min-width: 0; }
.impl-step__title { margin: 0 0 2px; font-size: 16px; font-weight: 700; color: var(--ink); }
.impl-step__hint { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.impl-add-btn { margin-top: 14px; }
@media (max-width: 600px) {
  .impl-step { grid-template-columns: 32px 1fr; gap: 12px; }
  .impl-step__num { width: 32px; height: 32px; font-size: 15px; }
  .impl-step:not(:last-child)::before { left: 15px; top: 36px; }
}

/* présentoirs de référence (un emplacement par type) */
.impl-ref__img {
  width: auto; height: auto; max-width: 220px; max-height: 200px; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-warm); box-shadow: var(--shadow-sm);
}
.impl-refs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 12px;
}
.impl-ref-slot {
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-alt);
}
.impl-ref-slot__title { margin: 0; font-weight: 700; font-size: 14px; color: var(--ink); }
.impl-ref-slot__empty {
  font-size: 12.5px; color: var(--muted); padding: 22px 12px; text-align: center;
  border: 1px dashed var(--border-dark); border-radius: var(--radius);
}
.impl-ref-slot .impl-ref__img { width: 100%; max-width: 100%; max-height: 150px; }
.impl-ref-slot__file { font-size: 12px; }
.impl-ref-slot__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
@media (max-width: 720px) { .impl-refs { grid-template-columns: 1fr; } }

/* bouton en cours de génération */
.btn.is-loading { opacity: .75; cursor: progress; }

/* overlay plein écran pendant la génération IA */
.impl-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 24, 21, 0.55); backdrop-filter: blur(2px);
}
.impl-overlay__card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 30px 36px; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); text-align: center; max-width: 90vw;
}
.impl-overlay__txt { margin: 0; font-size: 14.5px; color: var(--ink); }
.impl-overlay__txt small { color: var(--muted); }
.impl-overlay__spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: impl-spin .8s linear infinite;
}
@keyframes impl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .impl-overlay__spinner { animation-duration: 2s; } }

/* ---------- archive : historique classé (laboratoire / année / mois) ---------- */
.archive { display: flex; flex-direction: column; gap: 10px; }
.archive__labo {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.archive__sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.archive__sum::-webkit-details-marker { display: none; }
.archive__sum--labo {
  padding: 14px 18px;
  background: var(--surface-alt);
}
.archive__sum--annee { padding: 9px 18px 9px 26px; }
.archive__chevron { transition: transform 0.2s ease; color: var(--muted); flex-shrink: 0; }
details[open] > .archive__sum > .archive__chevron { transform: rotate(90deg); }
.archive__labo-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.archive__annee-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.archive__count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.archive__annee { border-top: 1px solid var(--border-soft); }
.archive__mois { padding: 0 18px 8px 26px; }
.archive__mois-titre {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 12px 0 4px;
  font-weight: 600;
}

/* archive : 3e niveau repliable = laboratoire (tout fermé par défaut) */
.archive__annee > .archive__labo3 { border-top: 1px solid var(--border-soft); }
.archive__sum--labo3 { padding: 8px 18px 8px 42px; }
.archive__labo3-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.archive__labo3 > .ledger { padding: 0 18px 10px 42px; }

/* ===================================================================
   Multi-pharmacie : auth (login), badges sémantiques, espace admin
   =================================================================== */

/* ---------- auth / login ---------- */
.auth { min-height: 62vh; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth__card {
  width: 100%; max-width: 384px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 38px 34px;
}
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.auth__mark {
  width: 52px; height: 52px; border-radius: 13px;
  background: var(--accent); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-serif); font-style: italic; font-weight: 700; font-size: 30px;
  box-shadow: var(--shadow-sm);
}
.auth__title { font-family: var(--font-serif); font-size: 22px; font-weight: 400; color: var(--ink); margin: 0; }
.auth__title em { font-style: italic; color: var(--accent); }
.auth__sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.auth .field--full { margin-bottom: 18px; }
.auth .actions-bar { margin-top: 6px; }
.auth__card .btn--primary { width: 100%; justify-content: center; }

/* ---------- badges sémantiques ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
  font-family: var(--font-sans);
}
.badge--soft  { background: var(--accent-soft); color: var(--accent); }
.badge--gold  { background: var(--gold-soft);   color: var(--gold); }
.badge--muted { background: var(--surface-alt);  color: var(--muted); border-color: var(--border-soft); }
.badge--ok    { background: var(--accent-pale);  color: var(--accent-mid); }
.badge--off   { background: var(--danger-soft);  color: var(--danger); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- espace admin ---------- */
.admin { max-width: 940px; }
.admin-create {
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 8px 0 30px;
}
.admin-create .compte__section { margin-top: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.field-row .field--full { margin-bottom: 0; }
.field-row .field { margin-bottom: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form select,
.inline-form input[type="text"] {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  font-size: 12px; color: var(--ink);
  font-family: var(--font-sans);
}
.inline-form input[type="text"] { max-width: 130px; }
.inline-form select:focus,
.inline-form input:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-pale);
}
.admin .lignes td { vertical-align: middle; }
.admin .cell-actions { white-space: nowrap; }

/* ---------- Motion : pré-masquage anti-flash (révélé par JS) ---------- */
/* Ne masque que les éléments explicitement animés ; révélés par motion-ui.js.
   Si Motion ne charge pas, le .catch retire .has-motion → tout réapparaît. */
.has-motion [data-motion],
.has-motion [data-motion-stagger] > *,
.has-motion .admin .lignes tbody tr { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .has-motion [data-motion],
  .has-motion [data-motion-stagger] > *,
  .has-motion .admin .lignes tbody tr { opacity: 1; }
}

/* ---------- champ mot de passe : œil afficher/masquer ---------- */
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap input { width: 100%; padding-right: 44px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); border-radius: var(--radius);
  transition: color 0.15s ease, background 0.15s ease;
}
.pwd-toggle:hover { color: var(--accent); background: var(--accent-pale); }
.pwd-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pwd-toggle .eye-off { display: none; }
.pwd-toggle.is-on .eye-on { display: none; }
.pwd-toggle.is-on .eye-off { display: block; }

/* ---------- liens auth + mentions légales ---------- */
.auth__forgot { text-align: center; margin: 16px 0 0; font-size: 13px; }
.auth__forgot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.auth__forgot a:hover { color: var(--accent); border-color: var(--accent); }
.footer__link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--border); }
.footer__link:hover { border-color: var(--accent); }
.legal p { color: var(--ink-soft); font-size: 14px; line-height: 1.7; max-width: 60ch; margin: 0 0 14px; }
.legal .compte__section { margin-top: 26px; }

/* ---------- tarifs / plans ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  display: flex; flex-direction: column; gap: 10px;
}
.plan--feature { border-color: var(--accent); box-shadow: var(--shadow); }
.plan__badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--gold-soft); color: var(--gold);
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  padding: 3px 9px; border-radius: 999px;
}
.plan__name { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.plan__price { margin: 2px 0 0; display: flex; align-items: baseline; gap: 6px; }
.plan__amount { font-family: var(--font-serif); font-size: 38px; font-weight: 500; color: var(--ink); }
.plan__period { color: var(--muted); font-size: 14px; }
.plan__note { color: var(--accent-mid); font-size: 13px; margin: 0; }
.plan__features { list-style: none; padding: 0; margin: 10px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.plan__features li { color: var(--ink-soft); font-size: 13.5px; padding-left: 22px; position: relative; }
.plan__features li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plan .btn { margin-top: auto; justify-content: center; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

/* ===================================================================
   PAGES PUBLIQUES — traitement premium (centré, double-bezel, air)
   =================================================================== */

.public { min-height: calc(100dvh - 160px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 72px 20px 96px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent-mid);
  background: var(--accent-pale);
  border: 1px solid var(--accent-soft);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 22px;
}

.display {
  font-family: var(--font-serif);
  font-weight: 360;
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.04; letter-spacing: -0.02em;
  color: var(--ink); margin: 0;
  font-variation-settings: "opsz" 120;
}
.display em { font-style: italic; color: var(--accent); font-weight: 360; }

.lede { color: var(--ink-soft); font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6; max-width: 46ch; margin: 20px auto 0; }

/* --- Double-bezel : coque extérieure + cœur intérieur (matière) --- */
.bezel {
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(220,211,190,0.18));
  border: 1px solid var(--border-soft);
  border-radius: 30px;
  padding: 8px;
  box-shadow: 0 1px 1px rgba(26,24,21,0.03), 0 30px 60px -28px rgba(27,67,50,0.22);
}
.bezel__core {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 23px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

/* --- Tarifs premium --- */
.pricing { width: 100%; max-width: 880px; }
.trial-cta { display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin: 34px auto 0; }
.trial-cta__pitch { font-size: 14px; color: var(--ink-soft); }
.trial-cta__note { font-size: 12.5px; color: var(--muted); }
.pricing__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 40px; }
.tier { padding: 8px; }
.tier__core { padding: 34px 30px 30px; display: flex; flex-direction: column; gap: 14px;
  text-align: left; height: 100%; }
.tier--hero { background: linear-gradient(180deg, var(--accent), var(--accent-mid)); border: none;
  box-shadow: 0 1px 1px rgba(26,24,21,0.03), 0 36px 70px -26px rgba(27,67,50,0.45); }
.tier__name { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); margin: 0; }
.tier--hero .tier__name { color: rgba(244,239,227,0.72); }
.tier__price { display: flex; align-items: baseline; gap: 7px; margin: 2px 0 0; }
.tier__amount { font-family: var(--font-serif); font-size: 52px; font-weight: 440; line-height: 1;
  color: var(--ink); letter-spacing: -0.02em; }
.tier--hero .tier__amount { color: var(--bg); }
.tier__period { color: var(--muted); font-size: 15px; }
.tier--hero .tier__period { color: rgba(244,239,227,0.7); }
.tier__note { font-size: 13px; color: var(--accent-mid); margin: 0; }
.tier--hero .tier__note { color: rgba(244,239,227,0.85); }
.tier__list { list-style: none; padding: 0; margin: 8px 0 22px; display: flex; flex-direction: column; gap: 10px; }
.tier__list li { font-size: 14px; color: var(--ink-soft); padding-left: 26px; position: relative; }
.tier--hero .tier__list li { color: rgba(244,239,227,0.92); }
.tier__list li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 11px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.tier--hero .tier__list li::before { border-color: var(--gold); }
.tier__badge { position: absolute; top: 22px; right: 22px; background: var(--gold); color: #2b2410;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 4px 11px; border-radius: 999px; }
.tier .btn { margin-top: auto; justify-content: center; border-radius: 999px; padding: 13px 22px; }
.tier--hero .btn--primary { background: var(--bg); color: var(--accent); }
.tier--hero .btn--primary:hover { background: #fff; }

/* CTA bouton-dans-bouton (flèche encerclée) */
.btn .btn__ico { display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 999px; background: rgba(255,255,255,0.16); margin-left: 4px;
  transition: transform 0.5s cubic-bezier(0.32,0.72,0,1); }
.btn--ghost .btn__ico { background: var(--accent-pale); }
.btn:hover .btn__ico { transform: translate(3px,-1px); }

.public__foot { margin-top: 34px; font-size: 13px; color: var(--muted); }
.public__foot a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--border); }

/* --- Auth premium (double-bezel sur la carte) --- */
.auth { min-height: calc(100dvh - 160px); padding: 56px 20px 80px; }
.auth__card {
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(220,211,190,0.16));
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 9px;
  box-shadow: 0 1px 1px rgba(26,24,21,0.03), 0 34px 64px -28px rgba(27,67,50,0.24);
}
.auth__inner {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  padding: 38px 34px;
}
.auth__mark { border-radius: 16px; width: 56px; height: 56px; font-size: 32px; }

@media (max-width: 720px) { .pricing__grid { grid-template-columns: 1fr; } }

/* ===================================================================
   PAGES CONNECTÉES — élévation premium (accueil, éditeur)
   =================================================================== */
.hero { padding-top: 30px; margin-bottom: 76px; }
.hero__eyebrow {
  display: inline-flex; width: max-content; gap: 0;
  background: var(--accent-pale); border: 1px solid var(--accent-soft);
  padding: 6px 14px; border-radius: 999px;
  letter-spacing: 0.2em; color: var(--accent-mid); font-weight: 600;
  margin-bottom: 26px;
}
.hero__eyebrow-line { display: none; }

/* Dropzone premium : coque (shell) + cœur (core) */
.dropzone {
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(220,211,190,0.16));
  padding: 10px;
  box-shadow: 0 1px 1px rgba(26,24,21,0.03), 0 26px 56px -30px rgba(27,67,50,0.22);
  transition: transform 0.55s cubic-bezier(0.32,0.72,0,1), box-shadow 0.55s cubic-bezier(0.32,0.72,0,1), background 0.4s ease;
}
.dropzone::before { display: none; }
.dropzone__inner {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  padding: 50px 40px;
}
.dropzone:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
  background: linear-gradient(180deg, rgba(255,255,255,0.72), var(--accent-pale));
  box-shadow: 0 1px 1px rgba(26,24,21,0.03), 0 38px 74px -28px rgba(27,67,50,0.34);
}
.dropzone__icon { width: 50px; height: 50px; }

/* Historique : en-tête plus affirmé */
.ledger-section__head { align-items: center; }
.section-title { letter-spacing: -0.02em; }
.ledger-section__count {
  background: var(--surface-alt); border: 1px solid var(--border-soft);
  padding: 5px 12px; border-radius: 999px; font-weight: 600;
}

/* Éditeur : cartes en double-bezel doux */
.card--head, .card--data {
  border: 1px solid var(--border-soft) !important;
  border-radius: 22px !important;
  box-shadow: 0 1px 1px rgba(26,24,21,0.03), 0 26px 54px -30px rgba(27,67,50,0.18) !important;
}

/* ---------- pages légales : notes & listes ---------- */
.legal-note {
  background: var(--gold-soft); border-left: 3px solid var(--gold);
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin: 4px 0 8px;
}
.legal-list { margin: 0 0 14px; padding-left: 22px; max-width: 60ch; }
.legal-list li { color: var(--ink-soft); font-size: 14px; line-height: 1.7; margin-bottom: 8px; }
.legal-list li strong { color: var(--ink); }
.legal a { color: var(--accent); }
.footer__txt a + a::before { content: " · "; color: var(--muted); }
/* case consentement */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px;
  color: var(--ink-soft); line-height: 1.5; margin: 4px 0 2px; }
.consent input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.consent a { color: var(--accent); }

/* ============================================================
   Guide export Winpharma (page d'accueil, comptes Winpharma)
   ============================================================ */
.dropzone-help { display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.dropzone-help svg { flex-shrink: 0; }
.dropzone-help a { color: var(--accent); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--accent-soft); transition: border-color .15s ease; }
.dropzone-help a:hover { border-bottom-color: var(--accent); }

.wp-guide { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.wp-guide__sum { display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  cursor: pointer; list-style: none; user-select: none; }
.wp-guide__sum::-webkit-details-marker { display: none; }
.wp-guide__chevron { color: var(--muted); flex-shrink: 0; transition: transform .18s ease; }
.wp-guide[open] .wp-guide__chevron { transform: rotate(90deg); }
.wp-guide__sum-text { display: flex; flex-direction: column; gap: 2px; }
.wp-guide__sum-text strong { font-size: 14.5px; color: var(--ink); }
.wp-guide__sum-text small { font-size: 12.5px; color: var(--muted); }
.wp-guide__body { padding: 4px 20px 22px; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.wp-guide__note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--muted); }

/* captures d'écran Winpharma */
.wp-shot { margin: 0; }
.wp-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border-dark);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.wp-shot figcaption { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.wp-shot__num { flex-shrink: 0; width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
