/* Les Glorieuses — feuille de style unique. Mobile d'abord. Thème de marque sombre : aubergine profond, violet
   lavande (#D8B4FE), marron bronze (#6B4F3B), argenté (#C0C0C0) ; titres à empattements en capitales espacées.
   Contrastes vérifiés (WCAG) : texte 16:1, texte secondaire 9:1, lavande 10:1, bronze clair 7:1 sur les surfaces.
   Le marron de la marque (2,5:1 sur fond sombre) ne sert qu'en décor (dégradés, filets), jamais pour du texte. */

:root {
  --fond: #0c0910;
  --surface: #16121b;
  --surface-2: #1f1925;
  --surface-3: #2a2232;
  --bord: #2a2331;
  --bord-fort: #3e3448;
  --texte: #f4eff8;
  --texte-2: #b8b2bf;
  --argent: #c0c0c0;
  --accent: #d8b4fe;            /* violet lavande */
  --accent-fort: #e9d5ff;
  --accent-profond: #9f72e3;
  --accent-doux: #241b2e;
  --sur-accent: #1a0f24;
  --bronze: #6b4f3b;            /* marron de la marque */
  --bronze-clair: #c79b76;
  --bronze-doux: #241a14;
  --vert: #7ddba3;
  --vert-doux: #132419;
  --rouge: #ff8f8f;
  --rouge-doux: #2e1518;
  --jaune: #f2c978;
  --jaune-doux: #2a2111;
  --bleu: #9dc4ff;
  --bleu-doux: #142035;
  --gris-doux: #241e2a;
  --ombre: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 10px 30px rgb(0 0 0 / 0.35);
  --lueur: 0 0 0 1px rgb(216 180 254 / 0.4), 0 8px 28px rgb(159 114 227 / 0.3);
  --filet: linear-gradient(90deg, transparent, rgb(216 180 254 / 0.45), rgb(199 155 118 / 0.35), transparent);
  --rayon: 16px;
  --rayon-petit: 10px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --police-titre: "Didot", "Bodoni 72", "Bodoni Moda", "Playfair Display", "Noto Serif Display", "Libre Bodoni", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--bord-fort) transparent; }
body {
  margin: 0;
  font: 16px/1.5 var(--police);
  background: var(--fond);
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* Halos lavande et bronze, fixes derrière tout le site (un calque fixe : background-attachment ne marche pas sur iPhone) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -8%, rgb(216 180 254 / 0.16), transparent 62%),
    radial-gradient(700px 460px at -12% 104%, rgb(107 79 59 / 0.34), transparent 60%),
    radial-gradient(600px 380px at 50% 120%, rgb(159 114 227 / 0.10), transparent 70%),
    var(--fond);
}
::selection { background: rgb(216 180 254 / 0.35); color: var(--texte); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h1 {
  font-family: var(--police-titre); font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: clamp(1.65rem, 4.6vw, 2.25rem);
}
h2 { font-family: var(--police-titre); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.01em; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 0.75em; }
a { color: var(--accent); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ——— Utilitaires ——— */
.muet { color: var(--texte-2); }
.petit { font-size: 0.86rem; }
.centre { text-align: center; }
.droite { text-align: right; }
.gras { font-weight: 700; }
.nombre, .montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.positif { color: var(--vert); }
.negatif { color: var(--rouge); }
.cache { display: none !important; }
.ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ligne.espace { justify-content: space-between; }
.pile { display: grid; gap: 12px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.deux-colonnes { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.deux-colonnes > *, .pile > * { min-width: 0; }
@media (min-width: 900px) { .deux-colonnes { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.collant { position: sticky; top: 120px; }
/* petit libellé en capitales espacées, comme la navigation */
.surtitre { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--argent); }

/* ——— En-tête et navigation ——— */
.entete {
  position: sticky; top: 0; z-index: 20;
  background: rgb(12 9 16 / 0.78);
  backdrop-filter: saturate(1.3) blur(14px); -webkit-backdrop-filter: saturate(1.3) blur(14px);
}
.entete::after { content: ""; display: block; height: 1px; background: var(--filet); }
.entete-barre {
  max-width: 1200px; margin: 0 auto; padding: 12px 16px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.marque {
  display: flex; align-items: center; gap: 11px; color: var(--texte); text-decoration: none; min-width: 0;
  font-family: var(--police-titre); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.12em;
}
.marque-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Le logo (couronne, couverts, laurier, en or) : on ne le retouche pas, on lui donne seulement un léger halo */
.logo { display: block; flex: none; width: 40px; height: 40px; filter: drop-shadow(0 0 8px rgb(194 163 82 / 0.28)); }
.logo.grand {
  width: 168px; height: 168px;
  filter: drop-shadow(0 0 24px rgb(194 163 82 / 0.30)) drop-shadow(0 0 60px rgb(159 114 227 / 0.20));
}
.moi { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: var(--texte); line-height: 1.2; flex: none; }
.moi-nom { font-weight: 600; font-size: 0.9rem; }
.moi-role { font-size: 0.66rem; color: var(--argent); text-transform: uppercase; letter-spacing: 0.16em; }
.nav {
  max-width: 1200px; margin: 0 auto; padding: 2px 8px 0;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative; flex: none; padding: 10px 12px 12px;
  color: var(--texte-2); text-decoration: none; font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  display: inline-flex; align-items: center; gap: 7px; transition: color 0.15s;
}
.nav a:hover { color: var(--texte); }
.nav a.actif { color: var(--texte); }
.nav a.actif::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 12px rgb(216 180 254 / 0.7);
}
.badge {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; letter-spacing: 0;
  background: var(--accent); color: var(--sur-accent); font-size: 0.7rem; font-weight: 800;
  display: inline-grid; place-items: center;
}

/* ——— Page ——— */
.page { max-width: 760px; margin: 0 auto; padding: 26px 16px 120px; }
.page.large { max-width: 1200px; }
.page-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-tete h1 { margin-bottom: 4px; }
.page-tete h1::after { content: ""; display: block; width: 44px; height: 2px; margin-top: 10px; background: linear-gradient(90deg, var(--accent), var(--bronze-clair)); }
.page-tete p { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-titre {
  margin: 30px 0 12px; display: flex; align-items: center; gap: 8px;
  font-family: var(--police); font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.2em; color: var(--argent);
}

/* ——— Cartes ——— */
.carte {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0) 40%), var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 18px; box-shadow: var(--ombre); margin-bottom: 14px;
}
.carte > :last-child { margin-bottom: 0; }
.carte.etroite { max-width: 460px; }
.carte.plate { box-shadow: none; }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.carte-tete h2, .carte-tete h3 { margin: 0; }

/* ——— Tuiles de chiffres ——— */
.tuiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-bottom: 18px; }
.tuile {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.03), rgb(255 255 255 / 0) 50%), var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon); padding: 15px 16px; box-shadow: var(--ombre);
}
.tuile-libelle { font-size: 0.68rem; color: var(--argent); font-weight: 650; display: block; text-transform: uppercase; letter-spacing: 0.16em; }
.tuile-valeur { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; display: block; margin-top: 6px; }
.tuile-detail { font-size: 0.8rem; color: var(--texte-2); display: block; margin-top: 3px; }
.tuile.accent { background: linear-gradient(160deg, rgb(216 180 254 / 0.16), rgb(216 180 254 / 0.04)), var(--surface); border-color: rgb(216 180 254 / 0.3); }
.tuile.accent .tuile-valeur { color: var(--accent); }
.tuile.vert { background: linear-gradient(160deg, rgb(125 219 163 / 0.14), rgb(125 219 163 / 0.03)), var(--surface); border-color: rgb(125 219 163 / 0.25); }
.tuile.vert .tuile-valeur { color: var(--vert); }
.tuile.rouge { background: linear-gradient(160deg, rgb(255 143 143 / 0.14), rgb(255 143 143 / 0.03)), var(--surface); border-color: rgb(255 143 143 / 0.25); }
.tuile.rouge .tuile-valeur { color: var(--rouge); }
.tuile.jaune { background: linear-gradient(160deg, rgb(242 201 120 / 0.13), rgb(242 201 120 / 0.03)), var(--surface); border-color: rgb(242 201 120 / 0.25); }
.tuile.jaune .tuile-valeur { color: var(--jaune); }
a.tuile { text-decoration: none; color: inherit; display: block; transition: border-color 0.15s, box-shadow 0.15s; }
a.tuile:hover { border-color: rgb(216 180 254 / 0.45); box-shadow: var(--lueur); }

/* Bandeau de résultat (bilan) */
.resultat {
  border-radius: var(--rayon); padding: 22px 22px; margin-bottom: 16px; border: 1px solid var(--bord);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.resultat.gain { background: linear-gradient(120deg, rgb(125 219 163 / 0.16), rgb(216 180 254 / 0.06)), var(--surface); border-color: rgb(125 219 163 / 0.28); }
.resultat.perte { background: linear-gradient(120deg, rgb(255 143 143 / 0.16), rgb(107 79 59 / 0.12)), var(--surface); border-color: rgb(255 143 143 / 0.28); }
.resultat.neutre { background: var(--surface-2); }
.resultat-libelle { font-weight: 650; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--argent); }
.resultat-valeur { font-family: var(--police-titre); font-size: 2.6rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums lining-nums; }
.resultat.gain .resultat-valeur { color: var(--vert); }
.resultat.perte .resultat-valeur { color: var(--rouge); }

/* ——— Boutons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent-fort), var(--accent) 45%, #b98cf5);
  color: var(--sur-accent); font-weight: 700; letter-spacing: 0.02em; text-decoration: none;
  cursor: pointer; transition: box-shadow 0.2s, transform 0.05s, background 0.2s, border-color 0.2s; user-select: none; white-space: nowrap;
  box-shadow: 0 6px 22px rgb(159 114 227 / 0.22);
}
.btn:hover { box-shadow: var(--lueur); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn.secondaire { background: rgb(255 255 255 / 0.02); color: var(--texte); border-color: rgb(216 180 254 / 0.45); box-shadow: none; }
.btn.secondaire:hover { background: var(--accent-doux); border-color: var(--accent); box-shadow: 0 0 18px rgb(216 180 254 / 0.18); }
.btn.doux { background: var(--accent-doux); color: var(--accent); border-color: rgb(216 180 254 / 0.2); box-shadow: none; }
.btn.doux:hover { border-color: rgb(216 180 254 / 0.5); }
.btn.vert { background: linear-gradient(135deg, #a5ecc2, var(--vert)); color: #0b1f13; box-shadow: 0 6px 22px rgb(125 219 163 / 0.2); }
.btn.vert:hover { box-shadow: 0 0 0 1px rgb(125 219 163 / 0.5), 0 8px 28px rgb(125 219 163 / 0.3); }
.btn.danger { background: linear-gradient(135deg, #ffb3b3, var(--rouge)); color: #2b0b0e; box-shadow: none; }
.btn.danger:hover { box-shadow: 0 0 0 1px rgb(255 143 143 / 0.5), 0 8px 28px rgb(255 143 143 / 0.25); }
.btn.fantome { background: transparent; color: var(--texte-2); box-shadow: none; }
.btn.fantome:hover { background: var(--surface-2); color: var(--texte); }
.btn.lien { background: none; color: var(--accent); padding: 6px 0; min-height: 0; font-weight: 600; box-shadow: none; border-radius: 4px; }
.btn.lien:hover { text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.btn.petit { min-height: 36px; padding: 6px 15px; font-size: 0.86rem; }
.btn.large { width: 100%; }
.btn.occupe { position: relative; color: transparent !important; }
.btn.occupe::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--sur-accent) var(--sur-accent) transparent transparent;
  animation: tourne 0.7s linear infinite;
}
.btn.secondaire.occupe::after, .btn.fantome.occupe::after, .btn.doux.occupe::after { border-color: var(--accent) var(--accent) transparent transparent; }
.btn-icone {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent;
  color: var(--texte-2); font-size: 1.5rem; line-height: 1; cursor: pointer; flex: none;
}
.btn-icone:hover { background: var(--surface-2); color: var(--texte); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ——— Formulaires ——— */
.formulaire { display: grid; gap: 15px; }
.champ { display: grid; gap: 6px; }
.champ-libelle { font-weight: 600; font-size: 0.88rem; color: var(--texte); }
.aide { color: var(--texte-2); font-size: 0.8rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: #110d15; border: 1px solid var(--bord-fort); border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #7d7586; }
textarea { resize: vertical; min-height: 68px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(216 180 254 / 0.18), 0 0 20px rgb(159 114 227 / 0.15); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); }
input[type=date] { color-scheme: dark; }
.case { display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer; }
.recherche { margin-bottom: 12px; }

/* Choix en grandes cases (type de compte, paiement) */
.choix { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choix-option {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; cursor: pointer;
  border: 1px solid var(--bord-fort); border-radius: 14px; background: #110d15; transition: border-color 0.15s, box-shadow 0.15s;
}
.choix-option:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); box-shadow: 0 0 22px rgb(159 114 227 / 0.18); }
.choix-option input { margin-top: 2px; }
.choix-option span { display: grid; }
.choix-option small { color: var(--texte-2); }

/* Bascule segmentée (Espèces | PayPal, Jour | Semaine…) */
.segments { display: inline-flex; padding: 4px; gap: 4px; background: #110d15; border: 1px solid var(--bord); border-radius: 999px; flex-wrap: wrap; }
.segments button {
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-weight: 650; color: var(--texte-2); cursor: pointer; min-height: 38px; transition: background 0.15s, color 0.15s;
}
.segments button:hover { color: var(--texte); }
.segments button[aria-pressed=true] { background: var(--accent); color: var(--sur-accent); box-shadow: 0 4px 16px rgb(159 114 227 / 0.3); }
.segments.large { display: flex; }
.segments.large button { flex: 1; }

/* Puces de catégories */
.puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce {
  flex: none; border: 1px solid var(--bord-fort); background: transparent; color: var(--texte-2);
  padding: 7px 15px; border-radius: 999px; font-weight: 600; font-size: 0.74rem; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.12em; transition: all 0.15s;
}
.puce:hover { color: var(--texte); border-color: rgb(216 180 254 / 0.5); }
.puce[aria-pressed=true] { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }

/* ——— Pastilles ——— */
.pastille {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.74rem; font-weight: 650; white-space: nowrap; background: var(--gris-doux); color: var(--texte-2); letter-spacing: 0.02em;
}
.pastille.accent { background: var(--accent-doux); color: var(--accent); border-color: rgb(216 180 254 / 0.25); }
.pastille.vert { background: var(--vert-doux); color: var(--vert); border-color: rgb(125 219 163 / 0.2); }
.pastille.rouge { background: var(--rouge-doux); color: var(--rouge); border-color: rgb(255 143 143 / 0.2); }
.pastille.jaune { background: var(--jaune-doux); color: var(--jaune); border-color: rgb(242 201 120 / 0.2); }
.pastille.bleu { background: var(--bleu-doux); color: var(--bleu); border-color: rgb(157 196 255 / 0.2); }
.pastilles { display: flex; gap: 6px; flex-wrap: wrap; }

/* ——— Compteur − n + ——— */
.compteur { display: inline-flex; align-items: center; background: #110d15; border: 1px solid var(--bord); border-radius: 999px; padding: 3px; flex: none; }
.compteur-btn {
  width: 38px; height: 38px; border: none; border-radius: 50%; background: var(--surface-3);
  font-size: 1.25rem; font-weight: 600; color: var(--accent); cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
}
.compteur-btn:hover:not(:disabled) { background: var(--accent-doux); box-shadow: 0 0 0 1px rgb(216 180 254 / 0.4); }
.compteur-btn:disabled { color: #574d61; cursor: default; background: transparent; }
.compteur-valeur { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.compteur.vide .compteur-valeur { color: var(--texte-2); }
.compteur.petit .compteur-btn { width: 32px; height: 32px; font-size: 1.1rem; }

/* ——— Catalogue client (cartes produit) ——— */
.categorie-titre {
  margin: 28px 0 12px; font-family: var(--police-titre); font-weight: 400; font-size: 1.25rem;
  text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 14px;
}
.categorie-titre::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgb(216 180 254 / 0.35), transparent); }
.produits { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.produit {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0) 60%), var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon); padding: 15px 16px; transition: border-color 0.15s, box-shadow 0.15s;
}
.produit:hover { border-color: rgb(216 180 254 / 0.3); }
.produit.choisi { border-color: rgb(216 180 254 / 0.7); box-shadow: var(--lueur); }
.produit.epuise { opacity: 0.5; }
.produit-infos { min-width: 0; }
.produit-nom { font-weight: 650; display: block; }
.produit-desc { color: var(--texte-2); font-size: 0.84rem; display: block; }
.produit-prix { font-weight: 700; color: var(--bronze-clair); font-variant-numeric: tabular-nums; display: block; margin-top: 4px; letter-spacing: 0.02em; }

/* Barre fixe en bas (panier, total de la saisie) */
.barre-fixe {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgb(12 9 16 / 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.barre-fixe::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--filet); }
.barre-fixe-contenu { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page.large ~ .barre-fixe .barre-fixe-contenu, .barre-fixe.large .barre-fixe-contenu { max-width: 1200px; }
.barre-fixe .btn { flex: none; }

/* ——— Sélection d'articles (livreur) ——— */
.selecteur { display: grid; gap: 8px; }
.selecteur-ligne {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px 11px 14px; background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.selecteur-ligne.choisi { border-color: rgb(216 180 254 / 0.65); background: linear-gradient(120deg, rgb(216 180 254 / 0.1), rgb(216 180 254 / 0.02)), var(--surface); box-shadow: 0 0 22px rgb(159 114 227 / 0.15); }
.selecteur-infos { min-width: 0; display: grid; }
.selecteur-infos strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }

/* ——— Commandes ——— */
.commande { display: grid; gap: 10px; }
.commande-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.commande-client { display: grid; gap: 1px; }
.commande-client a { text-decoration: none; overflow-wrap: anywhere; }
.commande.statut-annulee { opacity: 0.6; }
.lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.lignes li { display: flex; justify-content: space-between; gap: 12px; }
.ligne-total { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--bord); padding-top: 9px; }
.ligne-total + .ligne-total { border-top: none; padding-top: 0; }
.ligne-total strong { color: var(--bronze-clair); }
.note { background: var(--jaune-doux); border: 1px solid rgb(242 201 120 / 0.18); border-radius: 12px; padding: 8px 11px; margin: 0; font-size: 0.9rem; }

/* ——— Listes et tableaux ——— */
.liste { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); margin-bottom: 14px; }
.liste-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-top: 1px solid var(--bord); }
.liste-ligne:first-child { border-top: none; }
.liste-ligne.cliquable { cursor: pointer; transition: background 0.15s; }
.liste-ligne.cliquable:hover { background: var(--surface-2); }
.liste-principal { min-width: 0; display: grid; }
.liste-principal strong { overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.tableau-defile { overflow-x: auto; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: middle; }
th { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--argent); font-weight: 650; background: #130f18; }
tr:last-child td { border-bottom: none; }
td.nombre, th.nombre { text-align: right; }
tfoot td { font-weight: 700; background: #130f18; }
table input:not([type=checkbox]), table select { min-height: 38px; padding: 6px 10px; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: var(--surface-2); }

/* ——— Onglets ——— */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets button {
  border: none; background: none; padding: 11px 14px; font-weight: 650; color: var(--texte-2);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em;
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center;
}
.onglets button:hover { color: var(--texte); }
.onglets button[aria-selected=true] { color: var(--texte); border-bottom-color: var(--accent); }

/* ——— États ——— */
.chargement { display: flex; align-items: center; gap: 12px; color: var(--texte-2); padding: 44px 0; justify-content: center; }
.rond { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bord-fort); border-top-color: var(--accent); animation: tourne 0.8s linear infinite; box-shadow: 0 0 14px rgb(159 114 227 / 0.3); }
@keyframes tourne { to { transform: rotate(360deg); } }
.vide-etat { text-align: center; padding: 38px 18px; color: var(--texte-2); background: rgb(255 255 255 / 0.015); border: 1px dashed var(--bord-fort); border-radius: var(--rayon); }
.vide-etat strong { display: block; color: var(--texte); font-family: var(--police-titre); font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.vide-etat .actions { justify-content: center; margin-top: 14px; }
.alerte { border-radius: 14px; padding: 13px 15px; margin-bottom: 14px; display: grid; gap: 6px; justify-items: start; border: 1px solid transparent; }
.alerte p { margin: 0; }
.alerte.rouge { background: var(--rouge-doux); border-color: rgb(255 143 143 / 0.22); }
.alerte.rouge strong { color: var(--rouge); }
.alerte.jaune { background: var(--jaune-doux); border-color: rgb(242 201 120 / 0.22); }
.alerte.jaune strong { color: var(--jaune); }
.alerte.vert { background: var(--vert-doux); border-color: rgb(125 219 163 / 0.22); }
.alerte.bleu { background: var(--accent-doux); border-color: rgb(216 180 254 / 0.22); }
.alerte.bleu strong { color: var(--accent); }
.succes-etat { text-align: center; display: grid; gap: 8px; justify-items: center; }
.succes-icone {
  width: 60px; height: 60px; border-radius: 50%; background: var(--vert-doux); color: var(--vert); display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 800; box-shadow: 0 0 0 1px rgb(125 219 163 / 0.3), 0 0 30px rgb(125 219 163 / 0.2);
}
.infos { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; }
.infos dt { color: var(--argent); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; padding-top: 3px; }
.infos dd { margin: 0; overflow-wrap: anywhere; }

/* ——— Accueil (sans compte) : c'est la première page que voit un client qui scanne le QR code ——— */
.accueil { max-width: 440px; margin: 5vh auto 0; display: grid; gap: 22px; }
.accueil-marque { text-align: center; display: grid; justify-items: center; gap: 10px; }
.accueil-marque .surtitre { margin-top: 10px; }
.accueil-marque h1 {
  font-size: clamp(2.2rem, 10vw, 3.1rem); line-height: 1.02; margin: 0; letter-spacing: 0.05em;
  background: linear-gradient(180deg, #ffffff 15%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.accueil-marque h1::after { content: ""; display: block; width: 52px; height: 2px; margin: 14px auto 0; background: linear-gradient(90deg, var(--accent), var(--bronze-clair)); }
.accroche { color: var(--texte-2); font-size: 1.02rem; margin: 0; }
.accueil-carte { display: grid; gap: 12px; padding: 22px; background: rgb(22 18 27 / 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ——— Notifications ——— */
.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast {
  padding: 13px 16px; border-radius: 14px; font-weight: 600; border: 1px solid rgb(216 180 254 / 0.35);
  background: rgb(42 34 50 / 0.96); color: var(--texte); box-shadow: 0 12px 36px rgb(0 0 0 / 0.45), 0 0 24px rgb(159 114 227 / 0.18);
  animation: entree 0.2s ease-out; transition: opacity 0.3s, transform 0.3s;
}
.toast.rouge { background: rgb(46 21 24 / 0.97); color: var(--rouge); border-color: rgb(255 143 143 / 0.4); }
.toast.sortie { opacity: 0; transform: translateY(8px); }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }

/* ——— Boîtes de dialogue ——— */
.dialogue {
  border: 1px solid var(--bord-fort); border-radius: 20px; padding: 0; width: min(94vw, 520px); max-height: 90vh;
  background: var(--surface); color: var(--texte); box-shadow: 0 30px 80px rgb(0 0 0 / 0.6), 0 0 40px rgb(159 114 227 / 0.12);
}
.dialogue.large { width: min(96vw, 900px); }
.dialogue::backdrop { background: rgb(6 4 9 / 0.7); backdrop-filter: blur(4px); }
.dialogue[open] { display: flex; flex-direction: column; }
.dialogue-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 8px 22px; }
.dialogue-tete h2 { margin: 0; }
.dialogue-corps { padding: 6px 22px 18px; overflow-y: auto; }
.dialogue-pied { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 16px 16px; border-top: 1px solid var(--bord); flex-wrap: wrap; }

/* ——— Graphique ——— */
.graphique { width: 100%; overflow-x: auto; }
.graphique svg { display: block; width: 100%; height: auto; min-width: 0; }
.legende { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; color: var(--texte-2); margin-top: 10px; }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.legende i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ——— Photo de ticket ——— */
.apercu-ticket { max-height: 420px; border-radius: 14px; border: 1px solid var(--bord); object-fit: contain; background: #110d15; width: 100%; }

/* ——— Affiche du QR code (papier blanc : le contraste maximal reste le plus sûr pour les appareils photo) ——— */
.affiche {
  background: #fff; color: #120d16; border-radius: 22px; padding: 30px 28px 26px; text-align: center;
  display: grid; justify-items: center; gap: 12px; max-width: 420px; margin: 0 auto 16px;
  box-shadow: 0 0 0 1px rgb(216 180 254 / 0.5), 0 20px 60px rgb(0 0 0 / 0.45), 0 0 60px rgb(159 114 227 / 0.2);
}
.affiche h2 { font-family: var(--police-titre); font-weight: 400; font-size: 1.9rem; margin: 0; color: #120d16; text-transform: uppercase; letter-spacing: 0.08em; }
.affiche h2::after { content: ""; display: block; width: 46px; height: 2px; margin: 12px auto 0; background: linear-gradient(90deg, var(--accent-profond), var(--bronze)); }
.affiche svg { width: 100%; max-width: 300px; height: auto; }
.affiche .affiche-logo { width: 112px; height: 112px; margin-bottom: -4px; }
.affiche .affiche-appel { font-size: 0.82rem; font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: 0.22em; color: var(--bronze); }
.affiche .affiche-lien { font-size: 0.82rem; color: #5a5160; margin: 0; overflow-wrap: anywhere; }
@media print {
  body { background: #fff; }
  body::before { display: none; }
  .entete, .page > :not(.affiche), .toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .affiche { box-shadow: none; max-width: none; margin-top: 10vh; }
  .affiche svg { max-width: 12cm; }
}

/* ——— Courses : lignes du ticket (tableau sur ordinateur, petites cartes sur téléphone) ——— */
.table-courses .aide { display: block; margin-top: 3px; color: var(--vert); font-weight: 600; }
.table-courses .aide:empty { display: none; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--rouge) !important; }
@media (min-width: 641px) {
  .table-courses td { padding: 6px 8px; }
  .table-courses td.col-libelle { min-width: 150px; }
  .table-courses td.col-article { min-width: 190px; }
  .table-courses td.col-supprimer { width: 1%; }
  .table-courses tr.a-rapprocher td { background: var(--jaune-doux); }
}
@media (max-width: 640px) {
  .cadre-courses { overflow: visible; background: none; border: none; border-radius: 0; box-shadow: none; }
  .table-courses, .table-courses tbody { display: block; }
  .table-courses thead { display: none; }
  .table-courses tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end;
    background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--ombre);
  }
  .table-courses tr.a-rapprocher { background: var(--jaune-doux); border-color: rgb(242 201 120 / 0.3); }
  .table-courses td { display: grid; gap: 3px; min-width: 0; padding: 0; border: none; }
  .table-courses td[data-libelle]::before { content: attr(data-libelle); font-size: 0.66rem; font-weight: 650; color: var(--argent); text-transform: uppercase; letter-spacing: 0.12em; }
  .table-courses td.col-libelle { grid-column: 1 / 4; }
  .table-courses td.col-supprimer { grid-column: 4; grid-row: 1; }
  .table-courses td.col-prix { grid-column: 3 / 5; }
  .table-courses td.col-article { grid-column: 1 / -1; }
}

/* Très petits écrans : les grilles d'une colonne peuvent rétrécir sous la largeur de leur contenu, et les grands
   boutons passent à la ligne plutôt que d'élargir la page */
.accueil, .accueil-carte, .formulaire, .champ, .pile, .commande, .alerte, .succes-etat { grid-template-columns: minmax(0, 1fr); }
.btn.large, .alerte .btn, .accueil .btn, .vide-etat .btn { white-space: normal; text-align: center; }
h1, h2 { overflow-wrap: anywhere; }

/* Moins d'animations pour qui le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
