/* Fidélité — feuille de style unique (polices : fonts.css, hébergées localement).
   Pages client et aperçus de carte : couleurs du commerce via --c-bg, --c-fg, --c-label, --c-accent.
   Espace restaurant (comptoir, gérant) : palette fixe ci-dessous. */

:root {
  --green: #1E3928;
  --green-mid: #36513D;
  --green-dark: #14261B;
  --green-ink: #0F1A13;
  --gold: #C3AB79;
  --gold-light: #EED089;
  --gold-ink: #75592A;
  --cream: #F2E9D4;
  --paper: #F6F1E6;
  --surface: #FFFFFF;
  --surface-2: #FBF8F1;
  --line: #E4DCC9;
  --line-strong: #CFC6B2;
  --line-soft: #EFE8D8;
  --text: #1A2A1F;
  --text-2: #3F4A41;
  --text-3: #4E574C;
  --on-dark-muted: #B9C2B5;
  --on-dark-soft: #D9DED6;
  --danger: #9B2C1F;
  --danger-bg: #FBEAE6;
  --danger-line: #E8B4A9;
  --warn-bg: #FBF0D9;
  --warn-line: #E2C27A;
  --warn-text: #5A3A08;
  --ok-bg: #E4EEDD;
  --ok-line: #B6CDA8;
  --ok-text: #1E3928;
  --font-title: "Cinzel", Georgia, "Times New Roman", serif;
  --font-text: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --focus: #1E3928;
  --shadow: 0 1px 2px rgba(20, 38, 27, .06), 0 8px 24px -12px rgba(20, 38, 27, .18);

  /* Couleurs du commerce par défaut (remplacées dans l'attribut style des pages client) */
  --c-bg: #1E3928;
  --c-fg: #F2E9D4;
  --c-label: #C3AB79;
  --c-accent: #C3AB79;
}

/* Couleurs dérivées : recalculées sur chaque élément qui redéfinit les couleurs du commerce */
.brand,
.wcard,
.poster {
  --c-hi: color-mix(in oklab, var(--c-accent) 62%, #FFF4D2);
  --c-muted: color-mix(in srgb, var(--c-fg) 76%, var(--c-bg));
  --c-soft: color-mix(in srgb, var(--c-fg) 88%, var(--c-bg));
  --c-line: color-mix(in srgb, var(--c-fg) 26%, var(--c-bg));
  --c-sep: color-mix(in srgb, var(--c-fg) 16%, var(--c-bg));
  --c-dash: color-mix(in srgb, var(--c-fg) 60%, var(--c-bg));
  --c-deep: color-mix(in srgb, var(--c-bg) 56%, #000);
  --c-on-accent: color-mix(in srgb, var(--c-bg) 62%, #000);
  --c-ink: color-mix(in srgb, var(--c-accent) 52%, #000);
}
@supports (color: oklch(from red l c h)) {
  .brand,
  .wcard,
  .poster {
    --c-hi: oklch(from var(--c-accent) min(0.93, calc(l + 0.12)) calc(c * 1.45) h);
  }
}

/* ------------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.ic { display: inline-block; flex: none; vertical-align: middle; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.title-font { font-family: var(--font-title); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 58px; border-radius: 14px; font-size: 18px; font-weight: 700; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn--primary { background: var(--green); color: var(--gold-light); }
.btn--primary:hover { background: var(--green-mid); }
.btn--gold { background: var(--gold); color: var(--green-dark); }
.btn--gold:hover { background: #CDB788; }
.btn--outline { border-color: var(--green); color: var(--green); background: var(--surface); }
.btn--outline:hover { background: var(--surface-2); }
.btn--quiet { border-color: var(--line-strong); color: var(--green); background: var(--surface); }
.btn--quiet:hover { border-color: var(--green); }
.btn--ondark { border-color: #5C6B4F; color: var(--cream); }
.btn--ondark:hover { border-color: var(--gold); }
.btn--danger { background: var(--danger); color: #FFFFFF; }
.btn--danger:hover { background: #82241A; }
.btn--accent { background: var(--c-accent); color: var(--c-on-accent); }
.btn--accent:hover { filter: brightness(1.06); }
.btn--hint {
  border: 1px dashed #A49C86;
  color: var(--text-3);
  background: transparent;
  cursor: default;
  font-size: 14px;
  padding: 0 14px;
}
.btn:disabled { cursor: default; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ formulaires */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; font-weight: 600; color: var(--text); }
.field__opt { font-weight: 400; color: var(--text-3); }
.field__hint { font-size: 13px; line-height: 1.45; color: var(--text-3); }
.field__error {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 13px; font-weight: 600; color: var(--danger);
}
.field__error .ic { margin-top: 1px; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}
.input::placeholder { color: #69705F; opacity: 1; }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--green); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
textarea.input { min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
select.input { padding-right: 36px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.input--file { padding: 10px 12px; min-height: 0; font-size: 14px; }
.input--code { text-transform: uppercase; letter-spacing: .08em; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--green); }

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }

.field--short .input { max-width: 220px; }

.honeypot { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------------ messages */

.flashes { display: flex; flex-direction: column; gap: 10px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px; font-weight: 500; line-height: 1.45;
  color: var(--text);
}
.flash .ic { margin-top: 1px; }
.flash--ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.flash--erreur { background: var(--danger-bg); border-color: var(--danger-line); color: #7A2217; }
.flash--info { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.flashes--top { max-width: 480px; margin: 16px auto 0; padding: 0 20px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  font-size: 14px; line-height: 1.5;
}
.notice .ic { margin-top: 2px; }
.notice--warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); }
.notice--error { background: var(--danger-bg); border: 1px solid var(--danger-line); color: #7A2217; }
.notice--ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); }
.notice--soft { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }

/* ------------------------------------------------------------------ logo */

.logo-mono {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.05;
  color: var(--c-hi, var(--gold-light));
  overflow-wrap: anywhere;
}

/* ================================================================== PAGES CLIENT */

.client {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-fg);
  --focus: var(--c-hi);
}
.client--deep { background: var(--c-deep); }
.client a:not(.btn):not(.wallet-btn) { color: var(--c-hi); }

.client__inner {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 36px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.client__inner--tight { padding-top: 20px; gap: 18px; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.hero__logo { width: 104px; height: 104px; object-fit: contain; }
.hero__logo.logo-mono { width: auto; height: auto; font-size: 34px; }
.hero__title { font-family: var(--font-title); font-weight: 600; font-size: 26px; line-height: 1.2; color: var(--c-hi); text-wrap: balance; }
.hero__text { font-size: 15px; line-height: 1.5; color: var(--c-soft); }

.promise {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--c-accent);
  border-radius: 12px;
  font-size: 14px; line-height: 1.45;
}
.promise .ic { color: var(--c-hi); }
.promise__title { display: block; font-weight: 700; color: var(--c-hi); font-size: 15px; }
.promise__text { display: block; color: var(--c-soft); }
.promise__rule { display: block; color: var(--c-muted); font-size: 13px; margin-top: 2px; }

.client .field__label { color: var(--c-fg); }
.client .field__opt, .client .field__hint { color: var(--c-muted); }
.client .input {
  background: #F7F2E7;
  border-color: var(--c-line);
  color: #1A2A1F;
}
.client .input:focus-visible { outline-color: var(--c-hi); border-color: var(--c-accent); }
.client .check { color: var(--c-soft); }
.client .check input { accent-color: var(--c-accent); }

.client-error {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: #FBEAE6; color: #7A2217;
  font-size: 14px; font-weight: 600;
}
.client-error .ic { margin-top: 1px; }

.legal-mini { font-size: 12px; line-height: 1.55; color: var(--c-muted); text-align: center; }
.client .legal-mini a { color: var(--c-fg); }

.client-text { font-size: 14px; line-height: 1.55; color: var(--c-soft); text-align: center; }

/* Bandeau de bienvenue */
.welcome {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c-accent) 16%, var(--c-deep));
  border: 1px solid color-mix(in srgb, var(--c-accent) 55%, var(--c-deep));
}
.welcome__check {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-accent); color: var(--c-on-accent);
}
.welcome__title { font-family: var(--font-title); font-weight: 600; font-size: 18px; color: var(--c-hi); }
.welcome__text { font-size: 14px; line-height: 1.45; color: var(--c-soft); }

/* ------------------------------------------------------------------ la carte (Wallet) */

.wcard {
  background: var(--c-bg);
  color: var(--c-fg);
  border: 1px solid var(--c-line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .7);
}
.wcard--ready { border: 1.5px solid var(--c-accent); }

.wcard__head { display: flex; align-items: center; gap: 12px; }
.wcard__logo { width: 46px; height: 46px; object-fit: contain; flex: none; }
.wcard__brand { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wcard__name {
  font-family: var(--font-title); font-weight: 600; font-size: 20px;
  letter-spacing: .04em; line-height: 1.15; color: var(--c-hi);
  overflow-wrap: anywhere;
}
.wcard__label, .wcard__kind {
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--c-label);
}
.wcard__count { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.wcard__value { font-size: 22px; font-weight: 700; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wcard--ready .wcard__value { color: var(--c-hi); }

.wcard__reward {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--c-accent); color: var(--c-on-accent);
}
.wcard__reward-kicker { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.wcard__reward-title { font-family: var(--font-title); font-size: 21px; font-weight: 700; line-height: 1.2; }
.wcard__reward-text { font-size: 14px; line-height: 1.4; }

.wcard__progress {
  padding: 14px 4px;
  border-top: 1px solid var(--c-sep);
  border-bottom: 1px solid var(--c-sep);
  display: flex; flex-direction: column; gap: 10px;
}
.wcard__status { font-size: 13px; line-height: 1.45; color: var(--c-muted); }

.wcard__fields { display: flex; gap: 16px; }
.wcard__fields > div { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.wcard__fields > div + div { flex: 1.6; }
.wcard__field { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.wcard__qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-box { background: #FFFFFF; border-radius: 12px; padding: 10px; width: 164px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.wcard__serial { font-size: 12px; letter-spacing: .14em; color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* Tampons */
.stamps {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 12px;
  justify-items: center;
  --c-on-accent-stamp: var(--c-on-accent);
}
.stamp {
  width: 100%; max-width: 54px; aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed var(--c-dash);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: var(--c-dash);
  font-variant-numeric: tabular-nums;
}
.stamp.is-on { background: var(--c-accent); border: 0; color: var(--c-on-accent); }
.stamp .ic { width: 50%; height: 50%; }

/* Version claire (comptoir, gérant) */
.stamps--light {
  --c-accent: #C3AB79;
  --c-on-accent: #1E3928;
  --c-dash: #687060;
}
.stamps--row {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start;
}
.stamps.stamps--row { gap: 8px; }
.stamps--row .stamp { width: 36px; height: 36px; max-width: none; font-size: 12px; }
.stamps--row .stamp .ic { width: 18px; height: 18px; }
.stamps--compact { gap: 10px; }
.stamps--compact .stamp { max-width: 44px; font-size: 13px; }

/* Barre de points */
.bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--c-fg) 18%, transparent); overflow: hidden; }
.bar__fill { height: 100%; width: var(--pct, 0%); background: var(--c-accent); border-radius: inherit; transition: width .3s; }
.bar--light { background: var(--line-soft); --c-accent: #C3AB79; height: 12px; }
.bar--light .bar__fill { background: var(--green-mid); }
.bar--light.is-ready .bar__fill { background: var(--gold); }

/* Boutons Wallet (dessinés en HTML/CSS, sans images de marque) */
.wallet-btns { display: flex; flex-direction: column; gap: 10px; }
.wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 8px 22px;
  border-radius: 12px; border: 1px solid #4A4A4A;
  background: #000000; color: #FFFFFF;
  text-decoration: none;
}
.client a.wallet-btn { color: #FFFFFF; }
.wallet-btn:hover { background: #1C1C1C; }
.wallet-btn--google { border-radius: 999px; }
.wallet-btn__glyph {
  width: 30px; height: 24px; flex: none; border-radius: 5px;
  background: linear-gradient(180deg, #FFFFFF 0 22%, #3D3D3D 22% 26%, #D9D9D9 26% 48%, #3D3D3D 48% 52%, #A8A8A8 52% 74%, #3D3D3D 74% 78%, #FFFFFF 78%);
  border: 1.5px solid #FFFFFF;
}
.wallet-btn--google .wallet-btn__glyph { border-radius: 7px; }
.wallet-btn__text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.wallet-btn__small { font-size: 12px; font-weight: 500; letter-spacing: .01em; }
.wallet-btn__big { font-size: 19px; font-weight: 600; letter-spacing: -.005em; }

.soon {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  border: 1px dashed var(--c-line);
  font-size: 14px; line-height: 1.5; color: var(--c-soft);
}
.soon .ic { color: var(--c-hi); margin-top: 2px; }

/* Infos du commerce */
.venue { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--c-bg) 70%, var(--c-deep)); border: 1px solid var(--c-sep); font-size: 14px; }
.venue__name { font-family: var(--font-title); font-weight: 600; font-size: 16px; color: var(--c-hi); }
.venue__msg { color: var(--c-soft); }
.venue__row { display: flex; gap: 10px; align-items: flex-start; color: var(--c-soft); }
.venue__row .ic { color: var(--c-label); margin-top: 2px; }
.client .venue a { color: var(--c-fg); }

/* Mes données */
.mydata { border: 1px solid var(--c-line); border-radius: 14px; }
.mydata > summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 16px;
  font-weight: 600; cursor: pointer; list-style: none;
}
.mydata > summary::-webkit-details-marker { display: none; }
.mydata > summary .ic:last-child { margin-left: auto; transition: transform .2s; color: var(--c-muted); }
.mydata[open] > summary .ic:last-child { transform: rotate(180deg); }
.mydata__body { padding: 0 16px 18px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.55; color: var(--c-soft); }
.mydata__body ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.mydata__danger { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--c-sep); }
.mydata__danger .check { color: var(--c-fg); }

/* Page simple (suppression, erreur) */
.center-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; }
.center-page .client__inner { text-align: center; align-items: center; }
.big-icon {
  width: 88px; height: 88px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--c-accent); color: var(--c-hi);
}
.error-code { font-family: var(--font-title); font-size: 56px; font-weight: 700; line-height: 1; color: var(--c-hi); }

/* Page confidentialité */
.legal-head { background: var(--c-bg); color: var(--c-fg); }
.legal-head__inner { max-width: 760px; margin: 0 auto; padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 14px; }
.legal-head__top { display: flex; align-items: center; gap: 12px; }
.legal-head__logo { width: 52px; height: 52px; object-fit: contain; }
.legal-head__logo.logo-mono { width: auto; height: auto; font-size: 18px; }
.legal-head__title { font-family: var(--font-title); font-weight: 600; font-size: 28px; line-height: 1.2; color: var(--c-hi); }
.legal-head__sub { color: var(--c-soft); font-size: 15px; }
.legal-head a.back { color: var(--c-hi); font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.legal { background: var(--paper); color: var(--text); }
.legal__inner { max-width: 760px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 26px; }
.legal section { display: flex; flex-direction: column; gap: 8px; }
.legal h2 { font-family: var(--font-title); font-weight: 600; font-size: 20px; color: var(--green); }
.legal p, .legal li { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.legal a { color: var(--green); font-weight: 600; }
.legal strong { color: var(--text); }
.legal__box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }

/* ================================================================== CONNEXION */

.login {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 70% at 50% 0%, #2A4A35 0%, var(--green) 45%, var(--green-dark) 100%);
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  --focus: var(--gold-light);
}
.login__inner { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; align-items: stretch; }
.login__head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login__logo { width: 96px; height: 96px; object-fit: contain; }
.login__logo.logo-mono { width: auto; height: auto; font-size: 30px; }
.login__title { font-family: var(--font-title); font-weight: 600; font-size: 28px; color: var(--gold-light); }
.login__sub { font-size: 15px; color: var(--on-dark-soft); }
.login__card {
  background: var(--paper); color: var(--text);
  border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
  --focus: var(--green);
}
.login .big-icon { border-color: var(--gold); color: var(--gold-light); }
.login__foot {font-size: 13px; line-height: 1.5; color: var(--on-dark-muted); text-align: center; }

/* ================================================================== COMPTOIR */

.staff { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); }

.topbar { background: var(--green); color: var(--cream); --focus: var(--gold-light); }
.topbar__inner {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 10px 20px; min-height: 68px;
  display: flex; align-items: center; gap: 12px;
}
.topbar__logo { width: 42px; height: 42px; object-fit: contain; flex: none; }
.topbar__logo.logo-mono { width: auto; height: auto; font-size: 13px; }
.topbar__titles { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.topbar__title { font-family: var(--font-title); font-size: 18px; font-weight: 600; color: var(--gold-light); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__sub { font-size: 12px; color: var(--on-dark-muted); }
.topbar__link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px; padding: 0 4px;
  color: var(--gold); font-size: 14px; font-weight: 600; text-decoration: none;
}
.topbar__link:hover { color: var(--gold-light); }
.topbar__ok { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; color: var(--on-dark-muted); }
.topbar__ok .ic { color: var(--gold-light); }

.switcher { display: flex; gap: 8px; align-items: center; }
.switcher .input { min-height: 44px; font-size: 14px; }
.switcher--bar { background: var(--green-dark); }
.switcher--bar .switcher { max-width: 480px; margin: 0 auto; padding: 8px 20px; }
.switcher--bar label { color: var(--on-dark-muted); font-size: 13px; white-space: nowrap; }

.staff__main {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 20px 20px 28px;
  display: flex; flex-direction: column; gap: 18px;
  flex: 1;
}

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.block { display: flex; flex-direction: column; gap: 8px; }

/* Viseur */
.viewfinder {
  position: relative;
  height: 340px;
  border-radius: 18px;
  background: #0E1410;
  overflow: hidden;
  color: var(--on-dark-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  --focus: var(--gold-light);
}
.viewfinder video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity .2s;
}
.viewfinder.is-live video { opacity: 1; }
.vf-frame {
  position: absolute; left: 50%; top: 46%;
  width: min(62%, 220px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.vf-c { position: absolute; width: 40px; height: 40px; border: 0 solid var(--gold); }
.vf-c--tl { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 10px; }
.vf-c--tr { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 10px; }
.vf-c--bl { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 10px; }
.vf-c--br { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 10px; }
.vf-line {
  position: absolute; left: 10%; right: 10%; top: 50%;
  height: 2px; background: var(--gold-light);
  box-shadow: 0 0 12px rgba(238, 208, 137, .8);
}
.viewfinder:not(.is-live) .vf-line { display: none; }
.viewfinder.is-live .vf-line { animation: vf-scan 2.2s ease-in-out infinite alternate; }
.viewfinder:has(.vf-status[data-kind="error"]) .vf-frame { opacity: .3; }
@keyframes vf-scan { from { top: 12%; } to { top: 88%; } }
.vf-start { position: relative; z-index: 2; }
.vf-stop { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(14, 20, 16, .72); }
.vf-status {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 2;
  text-align: center; font-size: 13px; line-height: 1.45; color: var(--on-dark-soft);
}
.vf-status[data-kind="error"] {
  background: rgba(14, 20, 16, .9);
  border: 1px solid #8A5A2B; border-radius: 10px; padding: 10px 12px;
  color: #F6E3B0;
}
.viewfinder.is-live .vf-start { display: none; }

.scan-title { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.scan-title strong { font-size: 17px; font-weight: 700; color: var(--text); }
.scan-title span { font-size: 14px; color: var(--text-3); }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 4px 0 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface);
}
.searchbar:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--green); }
.searchbar > .ic { color: var(--text-3); }
.searchbar input {
  flex: 1; min-width: 0; height: 50px;
  border: 0; outline: none; background: transparent;
  font-size: 16px; color: var(--text);
}
.searchbar input::placeholder { color: #69705F; opacity: 1; }
.searchbar button {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px;
  background: var(--green); color: var(--gold-light);
}

.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line-soft); }
.list__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 10px 14px;
  font-size: 14px; color: var(--text); text-decoration: none;
}
a.list__row:hover { background: var(--surface-2); }
.list__main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.list__title { font-weight: 600; overflow-wrap: anywhere; }
.list__sub { font-size: 13px; color: var(--text-3); }
.list__side { display: flex; align-items: center; gap: 8px; color: var(--text-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list__side .ic { color: var(--text-3); }
.list__empty { padding: 16px 14px; font-size: 14px; color: var(--text-3); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line);
}
.tag--ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.tag--muted { background: var(--line-soft); color: var(--text-2); border-color: var(--line); }

.bottomnav {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav__inner { max-width: 480px; margin: 0 auto; display: flex; }
.bottomnav a {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; padding: 8px 0 10px;
  font-size: 12px; font-weight: 600; color: var(--text-3); text-decoration: none;
}
.bottomnav a[aria-current="page"] { color: var(--green); font-weight: 700; }
.bottomnav a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 30%; right: 30%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}

/* Fiche client */
.who { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  background: var(--green); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 26px; font-weight: 600;
}
.who__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who__name { font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.who__meta { font-size: 13px; line-height: 1.45; color: var(--text-3); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; }
.tile__label { font-size: 12px; line-height: 1.3; color: var(--text-3); }
.tile__value { font-size: 22px; font-weight: 700; color: var(--green); line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile__value small { font-size: 14px; font-weight: 600; }
.tile__value--sm { font-size: 18px; }

.status-line { font-size: 14px; color: var(--text-2); }
.status-line strong { color: var(--green); }

.actions { display: flex; flex-direction: column; gap: 10px; }
.btn--reward {
  min-height: 64px; border-radius: 14px;
  background: var(--gold); color: var(--green-dark);
  font-size: 18px; font-weight: 700;
  box-shadow: 0 0 0 3px rgba(195, 171, 121, .35);
}
.btn--reward:hover { background: #CDB788; }
.amount { display: flex; gap: 10px; align-items: stretch; }
.amount__input { position: relative; flex: 1; }
.amount__input .input { min-height: 58px; font-size: 22px; font-weight: 700; padding-right: 40px; border-radius: 14px; }
.amount__suffix { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 700; color: var(--text-3); pointer-events: none; }

.undo-row { display: flex; justify-content: center; }
.undo-row form { display: flex; }

/* Confirmation après action */
.confirm {
  background: var(--green); color: var(--cream);
  border-radius: 18px;
  padding: 26px 20px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  --focus: var(--gold-light);
}
.confirm--reward { border: 2px solid var(--gold); background: linear-gradient(180deg, #24432F 0%, var(--green) 100%); }
.confirm__check {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--green-dark);
}
.confirm__title { font-family: var(--font-title); font-size: 28px; font-weight: 600; line-height: 1.15; color: var(--gold-light); }
.confirm__line { font-size: 18px; font-weight: 600; }
.confirm__text { font-size: 15px; line-height: 1.55; color: var(--on-dark-soft); }
.confirm .stamps--row { justify-content: center; --c-dash: #8E9A82; --c-accent: #C3AB79; --c-on-accent: #1E3928; }
.confirm .stamps--row .stamp { width: 30px; height: 30px; }
.confirm .stamps--row .stamp .ic { width: 15px; height: 15px; }
.confirm .bar { width: 100%; --c-fg: #F2E9D4; --c-accent: #C3AB79; }
.confirm .btn { width: 100%; }
.confirm .link-btn { color: var(--gold); text-align: center; }

.alert-box {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text);
}
.alert-box__head { display: flex; gap: 10px; align-items: flex-start; }
.alert-box__title { font-size: 17px; font-weight: 700; }
.alert-box__text { font-size: 14px; line-height: 1.5; }
.alert-box__actions { display: flex; flex-direction: column; gap: 10px; }
.alert-box .btn--quiet { color: var(--warn-text); border-color: var(--warn-line); }

/* ================================================================== GÉRANT */

.admin { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; background: var(--paper); }

.side {
  flex: 1 1 250px; max-width: 272px; min-width: 244px;
  background: var(--green); color: var(--cream);
  padding: 28px 18px 22px;
  display: flex; flex-direction: column; gap: 6px;
  --focus: var(--gold-light);
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; text-decoration: none; color: inherit; min-width: 0; }
.side__logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.side__logo.logo-mono { width: auto; height: auto; font-size: 12px; }
.side__names { display: flex; flex-direction: column; min-width: 0; }
.side__name { font-family: var(--font-title); font-size: 18px; font-weight: 600; color: var(--gold-light); line-height: 1.2; overflow-wrap: anywhere; }
.side__sub { font-size: 12px; color: var(--on-dark-muted); }
.side__nav { display: flex; flex-direction: column; gap: 4px; }
.side__link {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 12px; border-radius: 10px;
  color: var(--cream); font-size: 15px; font-weight: 500; text-decoration: none;
}
.side__link:hover { background: rgba(242, 233, 212, .07); }
.side__link[aria-current="page"] { background: var(--green-mid); color: var(--gold-light); font-weight: 600; }
.side__foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.side__switch { margin-top: auto; padding: 18px 4px 0; display: flex; flex-direction: column; gap: 6px; }
.side__switch + .side__foot { margin-top: 0; padding-top: 10px; }
.side__switch label { font-size: 12px; color: var(--on-dark-muted); }
.side__switch-row { display: flex; gap: 6px; }
.side__switch-row .input { flex: 1; min-width: 0; min-height: 44px; font-size: 14px; }
.side__logout { color: var(--gold); }
.side__logout:hover { color: var(--gold-light); }

.admin-main {
  flex: 999 1 560px; min-width: 0;
  padding: 32px clamp(16px, 3vw, 40px) 48px;
  display: flex; flex-direction: column; gap: 24px;
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head__titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-title { font-family: var(--font-title); font-size: 32px; font-weight: 600; line-height: 1.15; color: var(--green); }
.page-sub { font-size: 15px; color: var(--text-3); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--green); text-decoration: none; align-self: flex-start; }
.back-link:hover { text-decoration: underline; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.panel--dark { background: var(--green); border-color: var(--green); color: var(--cream); --focus: var(--gold-light); }
.panel--soft { background: var(--surface-2); }
.panel--danger { border-color: var(--danger-line); }
.panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.panel__title { font-size: 17px; font-weight: 700; color: var(--text); }
.panel--dark .panel__title { color: var(--gold-light); }
.panel__sub { font-size: 13px; color: var(--text-3); }
.panel--dark .panel__sub { color: var(--on-dark-muted); }
.panel__link { font-size: 14px; font-weight: 600; color: var(--green); }
.panel__text { font-size: 14px; line-height: 1.55; color: var(--text-2); }

.row-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.row-wrap > .grow-2 { flex: 2 1 460px; }
.row-wrap > .grow-1 { flex: 1 1 280px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi__label { font-size: 14px; color: var(--text-3); }
.kpi__value { font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--green); font-variant-numeric: tabular-nums; }
.kpi__note { font-size: 13px; color: var(--text-3); }

/* Histogramme en HTML/CSS */
.chart-wrap { container-type: inline-size; }
.chart { --plot: 220px; display: flex; flex-direction: column; gap: 8px; }
.chart__plot {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: 12px;
  align-items: end;
  height: calc(var(--plot) + 28px);
  border-bottom: 1px solid var(--line-strong);
  background: repeating-linear-gradient(to top, transparent 0 calc(var(--plot) / 4 - 1px), var(--line-soft) calc(var(--plot) / 4 - 1px) calc(var(--plot) / 4));
  background-size: 100% var(--plot);
  background-repeat: no-repeat;
  background-position: bottom;
}
.chart__col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart__count { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart__bar {
  width: 100%; max-width: 44px;
  height: max(3px, calc(var(--plot) * var(--h, 0) / 100));
  background: var(--green-mid);
  border-radius: 6px 6px 0 0;
}
.chart__col.is-current .chart__bar { background: var(--gold); }
.chart__col.is-current .chart__count { color: var(--gold-ink); }
.chart__labels { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: 12px; }
.chart__label { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 12px; color: var(--text-3); line-height: 1.3; }
.chart__label strong { font-weight: 600; color: var(--text-2); }
.chart__label.is-current strong { color: var(--gold-ink); }
@container (max-width: 480px) {
  .chart { --plot: 150px; }
  .chart__plot, .chart__labels { column-gap: 6px; }
  .chart__date { display: none; }
}

.near-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.near-list li { border-top: 1px solid var(--green-mid); }
.near-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 46px; padding: 8px 0;
  color: var(--cream); text-decoration: none; font-size: 15px; font-weight: 600;
}
.near-list a:hover .near-list__name { text-decoration: underline; }
.near-list__value { font-size: 14px; color: var(--gold-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.near-empty { font-size: 14px; color: var(--on-dark-muted); border-top: 1px solid var(--green-mid); padding-top: 12px; }

/* Tableaux */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text-3); font-weight: 600; white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; }
.table .sub { display: block; font-size: 12px; color: var(--text-3); letter-spacing: .04em; font-weight: 400; white-space: nowrap; }
.table a { color: var(--green); font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table--compact th, .table--compact td { padding: 10px 8px; }
.table--recent { min-width: 520px; }
.table--clients { min-width: 860px; }
.table--clients td { white-space: nowrap; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--flush .table th:first-child, .panel--flush .table td:first-child { padding-left: 20px; }
.panel--flush .table th:last-child, .panel--flush .table td:last-child { padding-right: 20px; }

.minibar { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.minibar__track { width: 96px; height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; flex: none; }
.minibar__fill { display: block; height: 100%; width: var(--pct, 0%); background: var(--green-mid); border-radius: inherit; }
.minibar.is-near .minibar__fill, .minibar.is-ready .minibar__fill { background: var(--gold); }
.minibar__value { font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.chip:hover { border-color: var(--green); }
.chip[aria-current="true"] { background: var(--green); border-color: var(--green); color: var(--gold-light); font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.toolbar__search { flex: 1 1 280px; display: flex; flex-direction: column; gap: 4px; }
.toolbar__search label { font-size: 13px; font-weight: 600; color: var(--text-2); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-3); }
.pager__links { display: flex; gap: 8px; }

.copy-field { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.copy-field .input { flex: 1 1 240px; min-width: 0; font-size: 14px; background: var(--surface-2); font-variant-numeric: tabular-nums; }

.problems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.problems li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.problems li .ic { color: #8A5A16; margin-top: 2px; }
.panel--todo { background: var(--surface-2); border-style: dashed; }
.panel--todo .panel__title { font-size: 15px; }

.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px 20px; }
.dl > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.dl dd { font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.dl dd .muted { font-weight: 400; }

.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 0 1 200px; }

/* Réglages */
.settings { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.settings__form { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; margin: 0; }
.settings__aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.section-title .ic { color: var(--green); }
.section-intro { font-size: 14px; line-height: 1.5; color: var(--text-3); margin-top: -6px; }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); width: fit-content; max-width: 100%; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label {
  display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  font-size: 14px; font-weight: 500; color: var(--text);
  cursor: pointer;
}
.segmented label + input + label, .segmented input + label + input + label { border-left: 1px solid var(--line-strong); }
.segmented input:checked + label { background: var(--green); color: var(--gold-light); font-weight: 600; }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.plain legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }

.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px 16px; }
.color-field { display: flex; align-items: center; gap: 12px; }
.color-field input[type="color"] {
  width: 56px; height: 48px; flex: none;
  padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); cursor: pointer;
}
.color-field__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.color-field__hex { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.logo-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-thumb {
  width: 64px; height: 64px; flex: none; border-radius: 12px;
  background: var(--green); display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: 4px;
}
.logo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.logo-thumb .logo-mono { font-size: 10px; text-align: center; }
.logo-field .field { flex: 1 1 220px; }
.file-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.file-pick__name { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.file-input:focus-visible + .file-pick label, .file-input:focus-visible ~ .file-pick .btn { outline: 3px solid var(--focus); outline-offset: 2px; }

.save-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.save-bar .btn { flex: 1 1 220px; }

.preview-block { display: flex; flex-direction: column; gap: 12px; }
.preview-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.preview-stage { background: linear-gradient(160deg, #E9E1CF, #DCD2BC); border-radius: 18px; padding: 22px; display: flex; justify-content: center; }
.preview-stage .wcard { width: 100%; max-width: 360px; }
.preview-note { font-size: 13px; line-height: 1.5; color: var(--text-3); }

.wallet-status { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wallet-status li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }

/* Kit QR (écran) */
.kit { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.kit__main { flex: 1 1 360px; max-width: 560px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kit__side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kit__sticker { max-width: 300px; }
.sheet-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* ------------------------------------------------------------------ affiche A5 / autocollant A6 */
/* Mesures en cqw : l'affiche garde ses proportions à l'écran comme à l'impression. */

.poster-wrap { container-type: inline-size; width: 100%; }
.poster {
  width: 100%;
  aspect-ratio: 148 / 210;
  background: #FBF7EE;
  color: #1A2A1F;
  padding: 3.6cqw;
  box-shadow: var(--shadow);
  overflow: hidden;
  --ink: var(--c-bg);
}
.poster__frame {
  height: 100%;
  border: .3cqw solid var(--c-accent);
  border-radius: 1.1cqw;
  padding: 4.6cqw 5cqw 4cqw;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 2cqw;
}
.poster__logo { width: 20cqw; height: 20cqw; object-fit: contain; }
.poster__logo.logo-mono { width: auto; height: auto; font-size: 7cqw; color: var(--ink); }
.poster__eyebrow { margin-top: .6cqw; font-size: 2.35cqw; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--c-ink); }
.poster__headline { font-family: var(--font-title); font-weight: 700; font-size: 8.6cqw; line-height: 1.06; color: var(--ink); text-wrap: balance; }
.poster__when { font-size: 3.4cqw; font-weight: 600; color: #1A2A1F; }
.poster__detail { font-size: 2.5cqw; color: #4E574C; margin-top: -1cqw; }
.poster__qr { display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; margin-top: 1cqw; }
.poster__qrbox { background: #FFFFFF; border: .36cqw solid var(--c-accent); border-radius: 2.5cqw; padding: 2cqw; width: 35cqw; }
.poster__qrbox svg { display: block; width: 100%; height: auto; }
.poster__scan { font-size: 2.5cqw; font-weight: 600; color: var(--ink); }
.poster__steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.2cqw; width: 100%; margin-top: 1.2cqw; }
.poster__steps li { display: flex; flex-direction: column; align-items: center; gap: 1.1cqw; font-size: 2.5cqw; line-height: 1.35; color: #1A2A1F; }
.poster__num {
  width: 5.4cqw; height: 5.4cqw; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--c-hi);
  font-size: 2.7cqw; font-weight: 700;
}
.poster__foot { margin-top: auto; font-size: 2.3cqw; color: #4E574C; }

.poster--sticker .poster__frame { padding: 6cqw 6cqw 5cqw; gap: 2.6cqw; justify-content: center; }
.poster--sticker .poster__logo { width: 24cqw; height: 24cqw; }
.poster--sticker .poster__eyebrow { font-size: 3.4cqw; }
.poster--sticker .poster__headline { font-size: 9.4cqw; }
.poster--sticker .poster__when { font-size: 4.6cqw; }
.poster--sticker .poster__qrbox { width: 48cqw; padding: 2.6cqw; }
.poster--sticker .poster__scan { font-size: 3.6cqw; }
.poster--sticker .poster__foot { margin-top: 1cqw; font-size: 3.2cqw; }

/* ------------------------------------------------------------------ petits écrans */

@media (max-width: 819px) {
  .side {
    flex-basis: 100%; max-width: none; min-width: 0;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 12px 16px; gap: 8px 12px;
  }
  .side__brand { padding: 0; flex: 1 1 auto; }
  .side__logo { width: 38px; height: 38px; }
  .side__name { font-size: 16px; }
  .side__nav {
    order: 3; flex-basis: 100%;
    flex-direction: row; gap: 6px;
    overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 2px 16px 4px;
  }
  .side__nav::-webkit-scrollbar { display: none; }
  .side__link { flex: none; min-height: 44px; padding: 0 12px; font-size: 14px; white-space: nowrap; background: rgba(242, 233, 212, .06); }
  .side__foot, .side__switch + .side__foot { margin: 0; padding: 0; flex-direction: row; align-items: center; }
  .side__foot .side__link { background: none; padding: 0 4px; }
  .side__switch { order: 4; flex-basis: 100%; margin: 0; padding: 4px 0 0; flex-direction: row; align-items: center; gap: 10px; }
  .side__switch-row { flex: 1; }
  .admin-main { padding-top: 22px; gap: 20px; }
  .page-title { font-size: 26px; }
  .settings__aside { display: contents; }
  .settings__aside > * { flex: 1 1 100%; min-width: 0; }
  .settings__aside > .preview-block { order: -1; }
  .settings__aside > .panel { order: 2; }
}

@media (max-width: 420px) {
  .client__inner { padding-left: 20px; padding-right: 20px; }
  .wcard { padding: 16px; }
  .stamps { gap: 10px; }
  .tiles { gap: 8px; }
  .tile { padding: 10px; }
  .tile__value { font-size: 20px; }
  .kpi__value { font-size: 28px; }
  .panel { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ impression du kit QR */

@page kit { size: A5 portrait; margin: 0; }

@media print {
  .print-hide, .side, .flashes, .page-head, .no-print { display: none !important; }
  body, .admin, .admin-main { background: #FFFFFF !important; display: block !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  .kit { display: block; }
  .kit__main, .kit__side, .kit__sticker { max-width: none; display: block; }
  .print-sheet {
    page: kit;
    width: 148mm; height: 210mm;
    display: flex; align-items: center; justify-content: center;
    break-after: page; break-inside: avoid;
    margin: 0;
  }
  .print-sheet:last-of-type { break-after: auto; }
  .print-sheet--a5 .poster-wrap { width: 148mm; }
  .print-sheet--a6 .poster-wrap { width: 105mm; outline: .3mm dashed #9A9A9A; outline-offset: 0; }
  .poster { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-label { display: none; }
}
