/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5);
  border: 1px solid transparent; border-radius: var(--r-field);
  font-family: var(--font-texte); font-weight: 600; font-size: var(--fs-1); line-height: 1.2; text-decoration: none; cursor: pointer;
  background: var(--surface-2); color: var(--ink);
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); filter: brightness(.94); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--secondary { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn--secondary:hover { background: var(--brand-soft); filter: none; }
.btn--secondary:active { background: var(--brand-soft); }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); filter: none; }
.btn--ghost:active { background: var(--brand-soft); }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 56px; font-size: var(--fs-2); }
.btn__icon { width: 22px; height: 22px; flex: none; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: var(--s2); }
.field__label { font-weight: 700; font-size: var(--fs-1); }
.field__input {
  min-height: var(--tap); width: 100%; padding: 0 var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-field);
  background: var(--surface); color: var(--ink); font-size: 1rem;
  transition: border-color var(--t-fast) var(--ease);
}
.field__input:hover { border-color: var(--ink-2); }
.field__input:focus-visible { border-color: var(--focus); }
.field__input:disabled, .field__input[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.field__help { font-size: var(--fs-0); color: var(--ink-2); }
.field--error .field__input { border-color: var(--danger); }
.field__error { font-size: var(--fs-0); font-weight: 700; color: var(--danger); }

/* ---------- Pastilles de choix ---------- */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 40px; padding: 0 var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--brand); }
.chip:active { background: var(--brand-soft); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.chip:disabled, .chip[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- Carte ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); }
.card .card { border: 1px solid var(--line); border-radius: var(--r-field); }

/* ---------- Tuile de vente ---------- */
.tuile-vente {
  --repere: var(--brand);
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: var(--s1);
  min-height: 88px; width: 100%; padding: var(--s3) var(--s4) var(--s3) var(--s5);
  text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tuile-vente::before {
  content: ""; position: absolute; left: var(--s3); top: 50%; width: 8px; height: 40%;
  transform: translateY(-50%); border-radius: var(--r-pill); background: var(--repere);
}
.tuile-vente:hover { border-color: var(--repere); }
.tuile-vente:active { transform: scale(.98); background: var(--surface-2); }
.tuile-vente:disabled, .tuile-vente[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.tuile-vente__nom { font-family: var(--font-titre); font-weight: 400; font-size: var(--fs-1); line-height: 1.2; }
.tuile-vente__presentation { font-size: var(--fs-0); color: var(--ink-2); }
.tuile-vente__prix { font-size: var(--fs-2); color: var(--ink); }

/* ---------- Chiffre principal ---------- */
.stat { display: flex; flex-direction: column; gap: var(--s1); }
.stat__libelle { font-size: var(--fs-0); font-weight: 700; color: var(--ink-2); }
.stat .montant { font-size: var(--fs-5); line-height: 1.1; color: var(--ink); }
.stat--positif .montant { color: var(--ok); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--s1); padding: 2px var(--s3);
  border-radius: var(--r-pill); font-size: var(--fs-0); font-weight: 700;
  color: var(--ink-2); background: color-mix(in srgb, currentColor 14%, transparent);
}
.badge--ok { color: var(--ok); }
.badge--warn { color: var(--warn); }
.badge--danger { color: var(--danger); }

/* ---------- Bandeaux ---------- */
.banner {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  border-radius: var(--r-field); font-weight: 600; font-size: var(--fs-0);
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
}
.banner--warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: var(--warn); }
.banner--ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: var(--ok); }

/* ---------- Navigation ---------- */
.nav-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bas__item {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: 64px; min-width: 0; padding: 0 var(--s1);
  color: var(--ink-2); text-decoration: none; font-size: var(--fs-0); font-weight: 600;
  background: transparent; border: 0; cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-bas__item svg { width: 24px; height: 24px; flex: none; }
.nav-bas__item:hover { background: var(--surface-2); }
.nav-bas__item:active { background: var(--brand-soft); }
.nav-bas__item[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.nav-bas__item[aria-current="page"] { color: var(--brand); font-weight: 700; }
.nav-bas__item[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 3px;
  border-radius: 0 0 var(--r-pill) var(--r-pill); background: var(--accent);
}
.nav-bas__label { overflow: visible; white-space: nowrap; max-width: none; font-size: 0.75rem; letter-spacing: -0.01em; }

@media (min-width: 1024px) {
  .nav-bas {
    top: 0; right: auto; bottom: 0; width: 232px; flex-direction: column; justify-content: flex-start;
    gap: var(--s1); padding: var(--s5) var(--s3); border-top: 0; border-right: 1px solid var(--line);
  }
  .nav-bas__item { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--s3); height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-field); font-size: var(--fs-1); }
  .nav-bas__item[aria-current="page"] { background: var(--brand-soft); }
  .nav-bas__item[aria-current="page"]::before { top: 20%; bottom: 20%; left: 0; right: auto; width: 3px; height: auto; border-radius: var(--r-pill); }
  .page { margin-left: 232px; }
}

/* ---------- Feuille basse ---------- */
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(8,34,21,.5); }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  max-height: 88vh; overflow-y: auto; padding: var(--s5); padding-top: var(--s7);
  background: var(--surface); border-top: 1px solid var(--line); border-radius: var(--r-card) var(--r-card) 0 0;
}
.feuille::before {
  content: ""; position: absolute; top: var(--s3); left: 50%; width: 40px; height: 4px;
  transform: translateX(-50%); border-radius: var(--r-pill); background: var(--line);
}
@media (min-width: 600px) {
  .feuille {
    left: 50%; right: auto; top: 50%; bottom: auto; width: 560px; max-width: calc(100vw - var(--s5));
    transform: translate(-50%, -50%); border: 1px solid var(--line); border-radius: var(--r-card);
  }
  .feuille::before { display: none; }
}

/* ---------- Carte de fidélité ---------- */
.carte-fidelite {
  position: relative; display: flex; flex-direction: column; gap: var(--s3);
  aspect-ratio: 105 / 148; max-width: 320px; margin: 0 auto; padding: var(--s5);
  background: var(--brand);
  color: var(--brand-ink); border-radius: var(--r-card); border-top: 3px solid var(--accent); overflow: hidden;
}
.carte-fidelite__marque { font-family: var(--font-titre); font-weight: 400; font-size: var(--fs-3); letter-spacing: .08em; }
.carte-fidelite__prenom { font-size: var(--fs-2); font-weight: 600; }
.carte-fidelite__grille { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); margin: auto 0; }
.tampon {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--brand-ink) 45%, transparent);
  font-weight: 700; font-size: var(--fs-2);
}
.tampon--plein { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); }
.tampon--plein::after { content: "\2713"; line-height: 1; }
.tampon--nouveau { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); }
.tampon--nouveau::after { content: "\2713"; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .tampon--nouveau { animation: tamponner var(--t-base) var(--ease) both; }
}
@keyframes tamponner {
  from { transform: scale(1.8) rotate(-12deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
.carte-fidelite__reste { font-weight: 700; font-size: var(--fs-1); }
.carte-fidelite__numero { font-size: var(--fs-0); opacity: .8; font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: var(--s4); right: var(--s4); z-index: 40;
  bottom: calc(64px + env(safe-area-inset-bottom) + var(--s4));
  max-width: 440px; margin: 0 auto; padding: var(--s3) var(--s4);
  border-radius: var(--r-field); background: var(--brand); color: var(--brand-ink);
  font-weight: 700;
}

/* ---------- État vide ---------- */
.vide { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s6) var(--s4); text-align: center; }
.vide__image { font-size: 3rem; line-height: 1; }
.vide__titre { font-family: var(--font-titre); font-weight: 400; font-size: var(--fs-3); }
.vide__texte { color: var(--ink-2); max-width: 32ch; }

/* ---------- Squelette ---------- */
.squelette { height: 72px; border-radius: var(--r-field); background: var(--surface-2); }
@media (prefers-reduced-motion: no-preference) {
  .squelette { animation: pulsation 1.6s ease-in-out infinite; }
}
@keyframes pulsation { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- Listes ---------- */
.liste-carte {
  display: flex; align-items: center; gap: var(--s3); min-height: 72px; padding: var(--s2) var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-field);
}
.liste-carte__icone { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: var(--fs-2); }
.liste-carte__texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.liste-carte__titre { font-weight: 700; }
.liste-carte__detail { font-size: var(--fs-0); color: var(--ink-2); }
.liste-carte__montant { font-size: var(--fs-2); white-space: nowrap; }
.liste-carte--annulee .liste-carte__titre,
.liste-carte--annulee .liste-carte__montant { text-decoration: line-through; color: var(--ink-2); }

.actions { display: flex; gap: var(--space-3, 12px); align-items: stretch; flex-wrap: wrap; }
.actions > * { flex: 1 1 auto; min-height: 48px; }
