/* ==========================================================================
   Arimáku — page d'administration des cartes de membre (admin.html)
   Charte : noir et blanc, « liquid glass » épuré et minimaliste.
   Des panneaux de verre dépoli (translucides, flous, filet lumineux) posés sur
   un fond clair aux halos gris. Seule la carte garde ses couleurs or et noir.

   Sur ordinateur (fenêtre d'au moins 1024 × 600 px) tout tient sur un seul
   écran : la page ne défile pas, seules les longues listes défilent dans leur
   cadre. Sur téléphone ou petite fenêtre, la page défile normalement.
   ========================================================================== */

:root {
  /* encre et papier */
  --fg: #0b0b0c;
  --fg-2: #3a3a3c;
  --muted: #86868b;
  --faint: #b9b9be;
  --bg: #eeeef0;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .16);

  /* verre */
  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .38);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-blur: blur(24px) saturate(170%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(0, 0, 0, .03), 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .06);
  --lift: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .08);

  /* états (discrets) */
  --ok: #1f7a3d;
  --warn: #9a6400;
  --danger: #c4161c;

  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, 'Segoe UI', sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -.005em;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* halos gris derrière le verre */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 8% 6%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(42vmax 42vmax at 92% 12%, #d9d9de 0%, rgba(217, 217, 222, 0) 70%),
    radial-gradient(46vmax 46vmax at 70% 100%, #e2e2e6 0%, rgba(226, 226, 230, 0) 70%),
    radial-gradient(30vmax 30vmax at 20% 90%, #f9f9fa 0%, rgba(249, 249, 250, 0) 70%),
    linear-gradient(180deg, #f4f4f6 0%, #e9e9ec 100%);
}
img, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: rgba(0, 0, 0, .14); }

/* surface de verre, réutilisée par tous les panneaux */
.glass,
.box, .card-form, .side-intro, .perk, .table-wrap, .log, .stat, .formula__hero,
.dialog__box, .gate__box, .tabs, .seg, .flip__switch, .lang-switch, .empty {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}

.h2 { font-weight: 600; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.02em; color: var(--fg); }
.muted { color: var(--muted); }
.muted strong, .muted b { color: var(--fg-2); font-weight: 600; }
.ok { color: var(--ok); }
.gold { color: var(--fg) !important; font-weight: 600; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 40px; padding: 0 1.15rem;
  font: 500 .88rem/1 var(--sans); letter-spacing: -.005em;
  color: var(--fg); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .12s, opacity .18s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn--sm { min-height: 34px; padding: 0 .95rem; font-size: .82rem; }
.btn--xs { min-height: 28px; padding: 0 .7rem; font-size: .76rem; }
.btn--block { width: 100%; }
/* bouton principal : noir plein (la classe garde son nom historique) */
.btn--gold { background: var(--fg); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 6px 16px rgba(0, 0, 0, .14); }
.btn--gold:hover:not(:disabled) { background: #2c2c2e; }
/* bouton secondaire : verre */
.btn--line {
  background: var(--glass-strong); color: var(--fg); border-color: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .05);
}
.btn--line:hover:not(:disabled) { background: #fff; }
.btn--ghost { color: var(--fg-2); }
.btn--ghost:hover:not(:disabled) { color: var(--fg); background: rgba(0, 0, 0, .05); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #a50f14; }
.btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.btn--file { position: relative; overflow: hidden; }
.btn--file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- champs ---------- */
.field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.field__label { display: flex; align-items: baseline; gap: .3rem; font-size: .78rem; font-weight: 500; color: var(--fg-2); }
.field__aside { margin-left: auto; font-weight: 400; color: var(--muted); }
.field__aside.is-bad { color: var(--danger); }
.field__hint { font-size: .74rem; color: var(--muted); }
.req { color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input {
  width: 100%; min-height: 40px; padding: .5rem .8rem;
  font: 400 .92rem/1.4 var(--sans); color: var(--fg);
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .03);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--fg); background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(196, 22, 28, .1); }
.input--area { resize: vertical; min-height: 64px; }
/* champ avec préfixe (cédula V- / E-) */
.input--prefixed { display: flex; align-items: stretch; padding: 0; overflow: hidden; }
.input--prefixed:focus-within { border-color: var(--fg); background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.input--prefixed select {
  flex: none; padding: 0 .35rem 0 .6rem; font: 600 1em/1 var(--sans); font-size: inherit; color: var(--fg);
  background: rgba(0, 0, 0, .04); border: 0; border-right: 1px solid var(--line); cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.input--prefixed select:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
.input--prefixed input { flex: 1; min-width: 0; padding: 0 .5rem; font: inherit; line-height: 1; color: inherit; background: none; border: 0; font-variant-numeric: tabular-nums; }
.input--prefixed input:focus { outline: none; }
.input--prefixed input::placeholder { color: var(--faint); }
.input--select { width: auto; padding-right: 2rem; }
.input--xs { width: 64px; min-height: 30px; padding: .2rem .5rem; font-size: .82rem; border-radius: 9px; }
input[type="date"] { color-scheme: light; }
.form-error { font-size: .82rem; color: var(--danger); }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.form-actions--end { justify-content: flex-end; }

/* ---------- accès ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate__box { width: 100%; max-width: 380px; display: grid; gap: 1rem; padding: 2rem 1.5rem; text-align: center; border-radius: 28px; }
.gate__box .field { text-align: left; }
.gate__logo { width: 150px; height: auto; margin: 0 auto .25rem; filter: brightness(0); }
.gate__title { font-weight: 600; font-size: 1.6rem; letter-spacing: -.02em; }
.gate__text { color: var(--muted); font-size: .9rem; }
.gate__error { min-height: 1.2em; color: var(--danger); font-size: .85rem; }

/* ---------- en-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .5); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 1px 0 var(--line);
}
.top__inner { max-width: 1480px; margin: 0 auto; padding: .5rem 20px; display: flex; align-items: center; gap: 1rem; }
.top__brand img { width: 88px; height: auto; filter: brightness(0); }
.top__title { display: grid; line-height: 1.15; padding-left: 1rem; border-left: 1px solid var(--line-strong); }
.top__eyebrow { font-size: .68rem; font-weight: 500; color: var(--muted); }
.top__name { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.top__actions { margin-left: auto; display: flex; gap: .25rem; }

.wrap { max-width: 1480px; margin: 0 auto; padding: 1rem 20px 3rem; }
.banner { margin-bottom: .8rem; padding: .6rem .9rem; border-radius: var(--radius-sm); background: rgba(196, 22, 28, .07); border: 1px solid rgba(196, 22, 28, .2); color: var(--danger); font-size: .85rem; }
.banner--soft { margin: 0; background: rgba(0, 0, 0, .04); border-color: var(--line); color: var(--fg-2); }

/* ---------- chiffres ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { display: flex; align-items: center; gap: .55rem; padding: .5rem .8rem; border-radius: 16px; min-width: 0; }
.stat__num { flex: none; font-size: 1.3rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; color: var(--fg); font-variant-numeric: tabular-nums; }
.stat__label { font-size: .7rem; line-height: 1.2; color: var(--muted); }

/* ---------- onglets : contrôle segmenté en verre ---------- */
.tabs-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.tabs {
  flex: 0 1 auto; min-width: 0; display: flex; gap: 2px; padding: 4px;
  border-radius: 999px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; min-height: 34px; padding: 0 1rem;
  font: 500 .86rem var(--sans); color: var(--fg-2);
  background: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.tab:hover { color: var(--fg); background: rgba(0, 0, 0, .04); }
.tab[aria-selected="true"] { color: var(--fg); background: #fff; box-shadow: var(--lift); }
.tab__count { display: inline-block; min-width: 1.6em; margin-left: .3em; padding: 0 .4em; font-size: .7rem; line-height: 1.6; text-align: center; color: var(--muted); background: rgba(0, 0, 0, .06); border-radius: 999px; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .tab__count { color: #fff; background: var(--fg); }

/* interrupteur « Éditeur visuel » (façon iOS) */
.mode-switch { position: relative; flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: .6rem; min-height: 36px; padding: 0 .2rem; font: 500 .86rem var(--sans); color: var(--fg-2); cursor: pointer; user-select: none; }
.mode-switch:hover { color: var(--fg); }
.mode-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-switch__track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: rgba(0, 0, 0, .12); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); transition: background-color .25s; }
.mode-switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .25s cubic-bezier(.3, .7, .3, 1.2); }
.mode-switch input:checked + .mode-switch__track { background: var(--fg); }
.mode-switch input:checked + .mode-switch__track::after { transform: translateX(18px); }
.mode-switch input:checked ~ .mode-switch__label { color: var(--fg); font-weight: 600; }
.mode-switch input:focus-visible + .mode-switch__track { outline: 2px solid var(--fg); outline-offset: 2px; }
.is-designing .tab { color: var(--muted); }

/* ==========================================================================
   Nouvelle carte : formulaire · aperçu · avantages
   ========================================================================== */
.maker { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(300px, 380px); gap: 1rem; align-items: start; }

.card-form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-content: start; padding: 1.1rem; border-radius: var(--radius); }
.card-form .span-2 { grid-column: 1 / -1; }
.card-form__head { display: grid; gap: .15rem; }
.card-form__head .h2 { font-size: 1.25rem; }
.card-form__head .muted { font-size: .78rem; }
.card-form__title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.num-badge {
  flex: none; padding: .25rem .7rem;
  font-size: .82rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums;
  background: var(--fg); border-radius: 999px;
}
.num-badge.is-bad { background: var(--danger); }
.card-form.is-editing { box-shadow: var(--glass-shadow), 0 0 0 1.5px var(--fg); }

.preview { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.preview__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.preview__label { font-size: .78rem; font-weight: 600; color: var(--fg); }
.preview__status { font-size: .78rem; color: var(--muted); }
.preview__status.is-saved { color: var(--ok); }

/* une seule carte, qui se retourne : recto ↔ verso */
.flip { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.flip__card { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1800px; border-radius: 3.2% / 5%; }
.flip__inner { position: relative; display: block; aspect-ratio: 1392 / 880; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, .7, .2, 1); }
.flip.is-back .flip__inner { transform: rotateY(180deg); }
.flip__face {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 3.2% / 5%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 24px 48px rgba(0, 0, 0, .22);
}
.flip__face--back { transform: rotateY(180deg); }
.flip__switch, .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; }
.flip__opt, .seg button {
  flex: 1; min-height: 30px; min-width: 84px; padding: 0 1rem;
  font: 500 .8rem var(--sans); color: var(--fg-2);
  background: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.flip__opt:hover, .seg button:hover { color: var(--fg); }
.flip__opt[aria-pressed="true"], .seg button[aria-pressed="true"] { color: var(--fg); background: #fff; box-shadow: var(--lift); }
.seg--xs { padding: 2px; }
.seg--xs button { min-height: 24px; min-width: 0; padding: 0 .55rem; font-size: .72rem; }

.downloads { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }

/* colonne Formule / avantages */
.side { min-width: 0; }
.side-intro { display: grid; gap: .6rem; padding: 1.2rem; border-radius: var(--radius); }
.side-intro__name { font-size: 1.45rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.side-intro__price { font-size: 1.05rem; font-weight: 600; }
.side-intro__price .muted { font-weight: 400; font-size: .8rem; }
.side-intro__hint { font-size: .78rem; padding-top: .6rem; border-top: 1px solid var(--line); }

/* avantages du membre */
.member { display: grid; gap: .5rem; }
.member__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 0 .1rem; }
.member__title { font-size: 1.05rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.member__period { display: grid; font-size: .72rem; line-height: 1.35; margin-top: .15rem; }
.member__head .btn { flex: none; }
.member__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }

.perk { display: flex; flex-direction: column; gap: .35rem; padding: .55rem .75rem; border-radius: 16px; min-width: 0; }
.perk--full { grid-column: 1 / -1; }
.perk--hot { box-shadow: var(--glass-shadow), 0 0 0 1.5px var(--fg); }
.perk__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.perk__title { font-size: .88rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.perk__count { font-size: .86rem; font-weight: 600; color: var(--fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.perk__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .6rem; margin-top: auto; }
.perk__meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; font-size: .74rem; line-height: 1.35; color: var(--muted); }
.perk__sub { display: block; }
.perk__undo { padding: 0; font: 500 .74rem var(--sans); color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.perk__undo:hover { color: var(--fg); }
.perk__credit { display: inline-flex; gap: .35rem; align-items: center; }


.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  min-height: 26px; padding: .2rem .6rem;
  font: 500 .72rem/1.2 var(--sans); color: var(--fg-2);
  background: rgba(255, 255, 255, .5); border: 1px dashed var(--line-strong); border-radius: 999px; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover:not(:disabled) { border-color: var(--fg); color: var(--fg); }
.chip.is-on { color: #fff; background: var(--fg); border: 1px solid var(--fg); }
.chip:disabled { opacity: .45; cursor: not-allowed; }

/* ==========================================================================
   Registre, journal
   ========================================================================== */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .75rem; }
.input--search { flex: 1 1 260px; width: auto; border-radius: 999px; padding-left: 1rem; }
#clear-log:hover { color: var(--danger); }
.table-wrap { overflow: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  position: sticky; top: 0; z-index: 1; padding: .7rem 1rem; text-align: left;
  font-size: .74rem; font-weight: 500; color: var(--muted);
  background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: .6rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .55); }
.t-num { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-name { font-weight: 600; }
.t-id { display: block; font-size: .78rem; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.t-notes { display: block; font-size: .78rem; color: var(--muted); max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-contact { font-size: .82rem; color: var(--fg-2); }
.t-contact span { display: block; }
.t-date { white-space: nowrap; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.t-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.t-actions .btn { min-height: 30px; padding: 0 .75rem; font-size: .78rem; }

.badge { display: inline-flex; align-items: center; gap: .4em; padding: .2rem .6rem; font-size: .74rem; font-weight: 500; color: var(--fg); background: rgba(0, 0, 0, .05); border-radius: 999px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--active::before { background: var(--ok); }
.badge--expired { color: var(--fg-2); }
.badge--expired::before { background: var(--warn); }
.badge--revoked { color: var(--muted); text-decoration: line-through; }
.badge--revoked::before { background: var(--danger); }

.empty { padding: 3rem 1rem; text-align: center; display: grid; gap: .5rem; justify-items: center; align-content: center; border-radius: var(--radius); }
.empty__title { font-size: 1.15rem; font-weight: 600; letter-spacing: -.015em; }
.empty .btn { margin-top: .5rem; }

.log { overflow: auto; border-radius: var(--radius); }
.log__item { display: grid; grid-template-columns: 70px 140px 1fr; gap: 1rem; align-items: baseline; padding: .6rem 1rem; border-bottom: 1px solid var(--line); font-size: .88rem; }
.log__item:last-child { border-bottom: 0; }
.log__time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.log__type { font-size: .74rem; font-weight: 600; color: var(--fg-2); }
.log__type--created, .log__type--reactivated, .log__type--renewed { color: var(--ok); }
.log__type--updated, .log__type--benefit { color: var(--fg); }
.log__type--revoked, .log__type--deleted { color: var(--danger); }
.log__text b { font-weight: 600; color: var(--fg); }
.log__detail { display: block; color: var(--muted); font-size: .8rem; }
.log__day {
  position: sticky; top: 0; padding: .45rem 1rem; font-size: .74rem; font-weight: 600; color: var(--fg);
  background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   Formule, réglages
   ========================================================================== */
.formula { display: grid; gap: 1rem; }
.formula__hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.25rem; padding: 1rem 1.3rem; border-radius: var(--radius); }
.formula__hero .muted { flex: 1 1 320px; font-size: .86rem; }
.formula__eyebrow { font-size: .72rem; font-weight: 500; color: var(--muted); }
.formula__name { font-weight: 700; font-size: 1.7rem; letter-spacing: -.03em; color: var(--fg); line-height: 1.1; }
.formula__price { font-size: 1.15rem; font-weight: 600; color: var(--fg); }
.formula__price .muted { font-weight: 400; font-size: .82rem; }
.formula__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; align-items: stretch; }
.formula__h { font-size: 1rem; font-weight: 600; letter-spacing: -.015em; }
.formula__list { display: grid; gap: .4rem; font-size: .84rem; line-height: 1.4; color: var(--fg-2); }
.formula__list li { padding-left: 1em; position: relative; }
.formula__list li::before { content: ''; position: absolute; left: 0; top: .55em; width: 4px; height: 4px; border-radius: 50%; background: var(--fg); }
.formula__list b { font-weight: 600; color: var(--fg); }
.formula .box .muted { font-size: .84rem; line-height: 1.45; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; align-items: start; }
.box { display: grid; gap: .8rem; align-content: start; padding: 1.1rem; border-radius: var(--radius); min-width: 0; }
.box .h2 { font-size: 1.1rem; }
.box .muted { font-size: .84rem; }

/* ==========================================================================
   Éditeur visuel de la carte
   ========================================================================== */
.designer { display: grid; grid-template-columns: 230px minmax(0, 1fr) 290px; gap: 1rem; align-items: start; }
.designer__h { font-size: .9rem; font-weight: 600; letter-spacing: -.01em; }
.designer__layers, .designer__props { gap: .6rem; padding: .9rem; }
.designer__stage { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.designer__bar { display: flex; justify-content: space-between; gap: 1rem; font-size: .76rem; white-space: nowrap; }
.designer__tip { overflow: hidden; text-overflow: ellipsis; }
.designer__status { color: var(--ok); font-weight: 500; }
.designer__status.is-dirty { color: var(--warn); }
.designer__canvas { display: flex; align-items: center; justify-content: center; min-height: 0; }
.designer__canvas canvas {
  width: 100%; height: auto; aspect-ratio: 1392 / 880; border-radius: 3.2% / 5%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 24px 48px rgba(0, 0, 0, .22);
  touch-action: none; user-select: none;
}
.designer__canvas canvas:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.designer__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.designer__layers .seg { width: 100%; }
.designer__layers .seg button { min-width: 0; }

.layers { display: grid; gap: 1px; }
.layer { display: flex; align-items: center; border-radius: 10px; transition: background-color .15s; }
.layer:hover { background: rgba(0, 0, 0, .04); }
.layer.is-on { background: var(--fg); }
.layer__pick { flex: 1; min-width: 0; min-height: 26px; padding: 0 .6rem; text-align: left; font: 500 .8rem var(--sans); color: var(--fg-2); background: none; border: 0; border-radius: 10px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer.is-on .layer__pick { color: #fff; }
.layer.is-hidden .layer__pick { color: var(--faint); text-decoration: line-through; }
.layer__eye { flex: none; width: 26px; height: 26px; font-size: .62rem; color: var(--fg); background: none; border: 0; border-radius: 10px; cursor: pointer; }
.layer.is-on .layer__eye { color: #fff; }

.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .6rem; align-items: end; }
.pf { display: grid; gap: .25rem; min-width: 0; }
.pf--full { grid-column: 1 / -1; }
.pf__label { font-size: .72rem; font-weight: 500; color: var(--fg-2); }
.pf .input--xs { width: 100%; }
.pf--check { display: flex; align-items: center; gap: .45rem; min-height: 30px; font-size: .8rem; color: var(--fg-2); cursor: pointer; }
.pf--check input { accent-color: var(--fg); width: 16px; height: 16px; }
.pf__color { display: flex; align-items: center; gap: .45rem; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf__color input { width: 34px; height: 28px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; }
.tokens { display: grid; gap: .3rem; font-size: .8rem; color: var(--fg-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: var(--fg); background: rgba(0, 0, 0, .06); padding: .05rem .35rem; border-radius: 5px; }
#prop-reset { justify-self: start; }

/* ---------- dos de la carte ---------- */
.backed { display: grid; grid-template-columns: minmax(300px, 520px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.backed__preview canvas { width: 100%; height: auto; aspect-ratio: 1392 / 880; border-radius: 3.2% / 5%; box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 24px 48px rgba(0, 0, 0, .22); }
.benefit-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, auto); grid-template-columns: 1fr 1fr; gap: .5rem .6rem; }
.benefit { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.benefit__n { flex: none; width: 1.3rem; font-size: .72rem; font-weight: 600; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.benefit .input { min-height: 36px; font-size: .86rem; }

/* ---------- dialogue, toast ---------- */
.dialog { padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--fg); max-width: min(440px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(240, 240, 242, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dialog__box { display: grid; gap: 1rem; padding: 1.5rem; border-radius: 24px; background: var(--glass-strong); box-shadow: var(--glass-shadow), 0 30px 60px rgba(0, 0, 0, .18); }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; max-width: calc(100vw - 32px);
  padding: .7rem 1.15rem; font-size: .86rem; font-weight: 500; color: #fff;
  background: rgba(11, 11, 12, .86); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .3s cubic-bezier(.3, .7, .3, 1.1), opacity .25s ease; pointer-events: none;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }

/* ==========================================================================
   Ordinateur : tout sur un seul écran, sans faire défiler la page
   ========================================================================== */
@media (min-width: 1024px) and (min-height: 600px) {
  html, body { height: 100%; overflow: hidden; }
  .app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
  .top { flex: none; position: static; }
  .wrap { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; padding: .75rem 20px .9rem; }
  .banner, .stats, .tabs-row { flex: none; }
  .stats { grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: .65rem; }
  .tabs-row { margin-bottom: .75rem; }

  .panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .panel[hidden] { display: none !important; }

  /* nouvelle carte : 3 colonnes à hauteur d'écran — formule / avantages · formulaire · aperçu */
  .maker { flex: 1; min-height: 0; align-items: stretch; grid-template-columns: minmax(300px, 380px) minmax(300px, 360px) minmax(0, 1fr); }
  .side { order: -1; }
  .maker > * { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .card-form { gap: .6rem .7rem; padding: .95rem 1rem; }
  .card-form .field__hint { display: none; }
  .card-form .field__label { font-size: .74rem; }
  .card-form .input { min-height: 36px; padding: .35rem .7rem; font-size: .88rem; }
  .card-form .btn { min-height: 38px; }

  /* la carte prend toute la place disponible, en gardant ses proportions */
  .preview { container-type: size; overflow: hidden; justify-content: center; gap: .6rem; }
  .preview__head { width: 100%; }
  .flip__card { width: min(100%, calc((100cqh - 150px) * 1.582)); }
  .downloads { width: 100%; }
  .downloads .btn { min-height: 32px; padding: 0 .85rem; font-size: .78rem; }

  .side-intro { min-height: 100%; align-content: start; }

  /* registre et journal : la liste défile dans son cadre */
  .table-wrap, .log { flex: 0 1 auto; min-height: 0; }
  #panel-cards .empty, #panel-log .empty { flex: 1; }

  /* formule et réglages : colonnes à hauteur d'écran */
  .formula { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .formula__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 0; }
  .formula__grid .box { overflow-y: auto; }

  /* éditeur : la carte occupe toute la hauteur disponible */
  .designer { flex: 1; min-height: 0; align-items: stretch; }
  .designer > aside { min-height: 0; overflow-y: auto; scrollbar-width: thin; align-content: start; }
  .designer__stage { min-height: 0; }
  .designer__canvas { flex: 1; container-type: size; }
  .designer__canvas canvas { width: min(100cqw, calc(100cqh * 1.582)); }

  .backed { flex: 1; min-height: 0; align-items: stretch; }
  .backed > * { min-height: 0; overflow-y: auto; }
  .backed__preview { container-type: size; justify-content: center; overflow: hidden; }
  .backed__preview canvas { width: min(100cqw, calc((100cqh - 40px) * 1.582)); }
  .settings { flex: 1; min-height: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings .box { max-height: 100%; overflow-y: auto; }
}

/* ---------- impression ---------- */
.print-area { display: none; }

@media print {
  @page { size: 85.6mm 54mm; margin: 0; }
  html, body { height: auto; overflow: visible; background: #fff; }
  body::before { display: none; }
  body > :not(.print-area) { display: none !important; }
  .print-area { display: block; }
  .print-area img { width: 85.6mm; height: 54mm; page-break-after: always; break-after: page; }
  .print-area img:last-child { page-break-after: auto; break-after: auto; }
}

/* ---------- tablette et téléphone : la page défile ---------- */
@media (max-width: 1023px), (max-height: 599px) {
  .maker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .preview { order: -1; grid-column: 1 / -1; max-width: 640px; width: 100%; margin: 0 auto; }
  .log, .table-wrap { max-height: none; }
  .designer { grid-template-columns: 1fr 1fr; }
  .designer__stage { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 1023px), (max-height: 599px) {
  .backed { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .maker { grid-template-columns: 1fr; }
  .benefit-grid { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: 1fr; }
  .designer { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tabs-row { flex-wrap: wrap; gap: .5rem; }
  .tabs { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .top__title { display: none; }
  .top__actions .btn:first-child { display: none; }
  .card-form { grid-template-columns: 1fr; }
  .card-form .span-2 { grid-column: auto; }
  .field-row { grid-template-columns: 1fr; }
  .box { padding: 1rem; }
  .log__item { grid-template-columns: 1fr; gap: .15rem; }

  /* le tableau devient une liste de fiches */
  .table-wrap { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { margin-bottom: .75rem; padding: .75rem 1rem; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--glass-shadow); }
  .table td { padding: .2rem 0; border: 0; }
  .table td[data-label]::before { content: attr(data-label) ' · '; color: var(--muted); font-size: .78rem; }
  .t-actions { justify-content: flex-start; flex-wrap: wrap; padding-top: .5rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .box, .card-form, .side-intro, .perk, .table-wrap, .log, .stat, .formula__hero,
  .dialog__box, .gate__box, .tabs, .seg, .flip__switch, .lang-switch, .empty, .top { background: #fbfbfc; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* cédula : le préfixe garde sa forme dans le formulaire compact */
.card-form .input--prefixed { padding: 0; }
.input--prefixed:has(input[aria-invalid="true"]) { border-color: var(--danger); }

/* Sélecteur de langue (FR / ES) */
.lang-switch {
  display: inline-flex; align-self: center; justify-self: center; gap: 2px; padding: 3px;
  border-radius: 999px;
}
.lang-switch button {
  min-height: 28px; min-width: 40px; padding: 0 .7rem;
  font: 600 .74rem var(--sans); letter-spacing: .08em; color: var(--muted);
  background: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.lang-switch button:hover { color: var(--fg); }
.lang-switch button.is-active { color: var(--fg); background: #fff; box-shadow: var(--lift); }
.lang-switch button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.top__actions { align-items: center; }
.top__actions .lang-switch { margin-right: .5rem; }
.gate__box .lang-switch { margin-bottom: .25rem; }

/* ==========================================================================
   Liquid Glass (style iOS) : verre clair et lumineux sur un fond coloré doux,
   reflets en haut des surfaces, capsules flottantes, textes bien contrastés.
   ========================================================================== */
:root {
  --fg: #0b0b0e;
  --fg-2: #2b2b30;
  --muted: #5c5c64;
  --faint: #9a9aa2;
  --tint: #a06d1c;                 /* or Arimáku, pour les repères actifs */
  --tint-soft: rgba(160, 109, 28, .14);
  --lg-fill: linear-gradient(180deg, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .52) 100%);
  --lg-fill-strong: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .74) 100%);
  --lg-blur: blur(28px) saturate(190%);
  --lg-edge: rgba(255, 255, 255, .75);
  --lg-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),      /* reflet du haut */
    inset 0 -1px 0 rgba(255, 255, 255, .35),     /* reflet du bas */
    inset 0 0 0 .5px rgba(255, 255, 255, .5),
    0 1px 1px rgba(20, 16, 40, .04),
    0 10px 30px rgba(20, 16, 40, .09);
  --lg-float: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 6px rgba(20, 16, 40, .08), 0 18px 40px rgba(20, 16, 40, .14);
  --field: rgba(118, 118, 128, .12);
  --line: rgba(60, 60, 67, .14);
  --line-strong: rgba(60, 60, 67, .26);
  --radius: 26px;
  --radius-sm: 14px;
}

/* fond doux et coloré : c'est lui qui fait vivre le verre */
body { background: #eef0f5; }
body::before {
  display: block;
  background:
    radial-gradient(40vmax 40vmax at 6% 0%, rgba(255, 214, 150, .75) 0%, rgba(255, 214, 150, 0) 70%),
    radial-gradient(44vmax 44vmax at 100% 8%, rgba(160, 190, 255, .6) 0%, rgba(160, 190, 255, 0) 70%),
    radial-gradient(46vmax 46vmax at 78% 100%, rgba(255, 170, 190, .45) 0%, rgba(255, 170, 190, 0) 70%),
    radial-gradient(38vmax 38vmax at 12% 95%, rgba(170, 230, 215, .5) 0%, rgba(170, 230, 215, 0) 70%),
    linear-gradient(180deg, #f6f3ee 0%, #eceef4 100%);
}

/* surfaces de verre */
.glass,
.box, .card-form, .side-intro, .perk, .table-wrap, .log, .stat, .formula__hero,
.dialog__box, .gate__box, .tabs, .seg, .flip__switch, .lang-switch, .empty {
  background: var(--lg-fill);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  border: 1px solid var(--lg-edge);
  box-shadow: var(--lg-shadow);
}
.box, .card-form, .side-intro, .table-wrap, .log, .formula__hero, .empty { border-radius: var(--radius); }
.dialog__box, .gate__box { background: var(--lg-fill-strong); border-radius: 32px; }
.perk { background: rgba(255, 255, 255, .5); border-radius: 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); }

/* barre du haut : verre flottant */
.top {
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 1px 0 rgba(60, 60, 67, .08), 0 8px 24px rgba(20, 16, 40, .05);
}

/* chiffres */
.stat { padding: .75rem .95rem; gap: .65rem; border-radius: 20px; }
.stat__num { font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em; }
.stat__label { font-size: .76rem; font-weight: 500; color: var(--muted); }
.stat:has(#st-active) .stat__num { color: #1f8a45; }
.stat:has(#st-expired) .stat__num { color: #b07000; }
.stat:has(#st-revoked) .stat__num { color: #d1242a; }

/* onglets : capsule de verre, l'onglet actif est une pastille blanche qui flotte */
.tabs { padding: 5px; gap: 3px; box-shadow: var(--lg-float); }
.tab { min-height: 36px; padding: 0 1.05rem; color: var(--fg-2); font-weight: 500; }
.tab:hover { background: rgba(255, 255, 255, .5); }
.tab[aria-selected="true"] {
  color: var(--tint); font-weight: 650; background: #fff;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(20, 16, 40, .1), 0 4px 14px rgba(20, 16, 40, .12);
}
.tab__count { color: var(--fg-2); background: var(--field); }
.tab[aria-selected="true"] .tab__count { color: #fff; background: var(--tint); }

/* sélecteurs segmentés (Recto/Verso, FR/ES…) : même pastille */
.flip__opt[aria-pressed="true"], .seg button[aria-pressed="true"], .lang-switch button.is-active {
  color: var(--fg); font-weight: 600; background: #fff;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(20, 16, 40, .1), 0 3px 10px rgba(20, 16, 40, .1);
}

/* interrupteur iOS */
.mode-switch { color: var(--fg); }
.mode-switch__track { width: 50px; height: 30px; background: rgba(120, 120, 128, .2); }
.mode-switch__track::after { width: 26px; height: 26px; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); }
.mode-switch input:checked + .mode-switch__track { background: #34c759; }
.mode-switch input:checked + .mode-switch__track::after { transform: translateX(20px); }

/* champs : remplissage gris translucide façon iOS, sans contour */
.field__label { font-size: .8rem; font-weight: 600; color: var(--fg); }
.field__hint { font-size: .76rem; color: var(--muted); }
.req { color: #d1242a; }
.input, .input--prefixed {
  background: var(--field); border: 1px solid transparent; box-shadow: none; border-radius: 12px;
}
.input:hover, .input--prefixed:hover { background: rgba(118, 118, 128, .17); border-color: transparent; }
.input:focus, .input--prefixed:focus-within {
  background: #fff; border-color: var(--tint);
  box-shadow: 0 0 0 4px var(--tint-soft);
}
.input::placeholder, .input--prefixed input::placeholder { color: var(--faint); }
.input--prefixed select { background: rgba(118, 118, 128, .1); border-right: 1px solid var(--line); }
.input[aria-invalid="true"] { border-color: #d1242a; box-shadow: 0 0 0 4px rgba(209, 36, 42, .12); }

/* boutons : capsules */
.btn--gold {
  background: linear-gradient(180deg, #2a2a30 0%, #0b0b0e 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 4px rgba(0, 0, 0, .18), 0 8px 20px rgba(0, 0, 0, .16);
}
.btn--gold:hover:not(:disabled) { background: linear-gradient(180deg, #3a3a42 0%, #1a1a1e 100%); }
.btn--line {
  background: var(--lg-fill-strong); color: var(--fg); border-color: var(--lg-edge);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(20, 16, 40, .08), 0 4px 12px rgba(20, 16, 40, .08);
}
.btn--line:hover:not(:disabled) { background: #fff; }
.btn--ghost { color: var(--fg); }
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .6); }
.btn:disabled { opacity: .4; }

/* aperçu et statuts */
.preview__label { font-size: .85rem; }
.preview__status { font-size: .8rem; font-weight: 600; color: #b07000; }
.preview__status.is-saved { color: #1f8a45; }
.num-badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 12px rgba(0, 0, 0, .18); }

/* registre et journal */
.table th { color: var(--fg-2); font-weight: 600; background: rgba(255, 255, 255, .45); }
.table tbody tr:hover { background: rgba(255, 255, 255, .6); }
.badge { font-weight: 600; background: var(--field); }
.badge--active { color: #1f8a45; background: rgba(52, 199, 89, .16); }
.badge--expired { color: #a06400; background: rgba(255, 159, 10, .18); }
.badge--revoked { color: #d1242a; background: rgba(255, 59, 48, .12); }

/* toast et dialogue : verre sombre / clair façon iOS */
.toast {
  background: rgba(30, 30, 34, .72); color: #fff;
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.dialog::backdrop { background: rgba(20, 16, 40, .18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* si l'appareil demande moins de transparence : surfaces opaques */
@media (prefers-reduced-transparency: reduce) {
  .glass, .box, .card-form, .side-intro, .perk, .table-wrap, .log, .stat, .formula__hero,
  .dialog__box, .gate__box, .tabs, .seg, .flip__switch, .lang-switch, .empty, .top, .btn--line, .toast {
    background: #fbfbfc; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .toast { background: #1c1c1f; }
}

/* état de l'enregistrement en ligne */
.sync-status { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.sync-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .18); }
.sync-status[data-state="saving"]::before { background: #ff9f0a; box-shadow: 0 0 0 3px rgba(255, 159, 10, .18); }
.sync-status[data-state="error"] { color: #d1242a; }
.sync-status[data-state="error"]::before { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255, 59, 48, .18); }
.sync-status + .top__actions { margin-left: .75rem; }
@media (max-width: 640px) { .sync-status { display: none; } }
