/*
 * Biashara — Feuille de style
 *
 * Logique :
 * 1. Toutes les couleurs sont des « variables » (--fond, --texte…) définies une
 *    fois pour le thème clair, puis redéfinies pour le thème sombre.
 * 2. Palette sobre : neutres + un seul accent (indigo). Typographie Inter,
 *    chiffres à largeur fixe (les montants restent alignés).
 * 3. Mise en page : barre latérale sur PC (≥ 1024 px), barre d'onglets en bas
 *    sur téléphone. Le contenu prend TOUTE la largeur disponible.
 * 4. Les changements d'onglet sont instantanés ; seules les fenêtres (feuilles)
 *    s'animent en douceur.
 * 5. Mode simple (html[data-simple="1"]) : très grandes tuiles, gros chiffres,
 *    seulement les écrans Vendre et Crédits. Pour ceux qui lisent peu.
 *
 * Police Inter : © The Inter Project Authors, licence SIL Open Font License 1.1.
 */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fond: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --bord: rgba(15, 15, 25, 0.08);
  --bord-fort: rgba(15, 15, 25, 0.15);
  --texte: #0d0d14;
  --texte-2: #3b3b48;
  --discret: #6b6b78;

  --accent: #4338ca;
  --accent-fort: #3730a3;
  --accent-doux: rgba(67, 56, 202, 0.08);
  --sur-accent: #ffffff;

  --attente: #a15c07;
  --attente-doux: rgba(161, 92, 7, 0.09);
  --alerte: #c0262d;
  --alerte-doux: rgba(192, 38, 45, 0.08);

  --nuit-1: #0b0b12;
  --nuit-2: #1a1838;

  --rayon: 18px;
  --rayon-s: 12px;
  --ombre: 0 1px 2px rgba(15, 15, 25, 0.04), 0 8px 24px -14px rgba(15, 15, 25, 0.14);
  --ombre-forte: 0 24px 60px -20px rgba(15, 15, 25, 0.35);
  --doux: cubic-bezier(0.16, 1, 0.3, 1);
  --marge: clamp(16px, 3vw, 40px);
  --lateral: 264px;
}

[data-theme="dark"] {
  --fond: #09090d;
  --surface: #121218;
  --surface-2: #1a1a22;
  --bord: rgba(255, 255, 255, 0.07);
  --bord-fort: rgba(255, 255, 255, 0.13);
  --texte: #f3f3f6;
  --texte-2: #c6c6d0;
  --discret: #8c8c99;
  --accent: #a5b4fc;
  --accent-fort: #c7d2fe;
  --accent-doux: rgba(165, 180, 252, 0.12);
  --sur-accent: #15133a;
  --attente: #fbbf24;
  --attente-doux: rgba(251, 191, 36, 0.12);
  --alerte: #fb7185;
  --alerte-doux: rgba(251, 113, 133, 0.12);
  --nuit-1: #0e0e16;
  --nuit-2: #1b1940;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.3);
  --ombre-forte: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* overflow-x: clip : une page décalée pendant un glissement ne doit jamais élargir l'écran (sinon tout saute sur Android). */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  font-variant-numeric: tabular-nums;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; overflow-x: clip;
}
html.feuille-ouverte, html.feuille-ouverte body { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Coquille ---------- */
.coquille { display: flex; min-height: 100dvh; }

.lateral {
  display: none;
  position: sticky; top: 0;
  width: var(--lateral); height: 100dvh; flex: none;
  padding: 22px 16px;
  border-right: 1px solid var(--bord);
  background: var(--surface);
  flex-direction: column; gap: 24px;
}
.marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.marque img { border-radius: 9px; }
.lateral .marque { padding: 4px 8px; }

.lateral-nav { display: flex; flex-direction: column; gap: 2px; }
.lateral-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--texte-2); font-weight: 500; font-size: 15px;
}
.lateral-nav a svg { width: 20px; height: 20px; flex: none; opacity: 0.8; }
.lateral-nav a:hover { background: var(--surface-2); color: var(--texte); }
.lateral-nav a[aria-current="page"] { background: var(--accent-doux); color: var(--accent); }
.lateral-nav a[aria-current="page"] svg { opacity: 1; }
.lateral-nav .compte { margin-inline-start: auto; font-size: 12px; font-weight: 650; background: var(--alerte); color: #fff; border-radius: 99px; padding: 1px 8px; }

.lateral-bas { margin-top: auto; }
.carte-boutique { border: 1px solid var(--bord); border-radius: var(--rayon-s); padding: 14px; background: var(--surface-2); font-size: 13px; }
.carte-boutique b { display: block; font-size: 14px; }
.carte-boutique span { color: var(--discret); }
.carte-boutique .role-ligne { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bord); }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.entete {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) var(--marge) 10px;
  background: color-mix(in srgb, var(--fond) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--bord);
}
.marque-mobile { font-size: 17px; }
.entete-droite { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.choix-boutique {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 10px 6px 12px; border-radius: 99px;
  border: 1px solid var(--bord); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--texte);
}
.choix-boutique .pt { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px var(--accent-doux); }
.choix-boutique span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.choix-boutique svg { width: 14px; height: 14px; color: var(--discret); flex: none; }

.pilule-simple { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--bord); background: var(--surface-2); color: var(--texte-2); font-size: 13px; font-weight: 600; }
.pilule-simple svg { width: 16px; height: 16px; }
.pilule-simple[aria-pressed="true"] { background: var(--accent); color: var(--sur-accent); border-color: transparent; }

.btn-theme { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--bord); background: var(--surface-2); color: var(--texte-2); cursor: pointer; }
.btn-theme:hover { color: var(--texte); background: var(--surface); }
.btn-theme svg { width: 18px; height: 18px; }
.btn-theme .ic-lune { display: none; }
[data-theme="dark"] .btn-theme .ic-soleil { display: none; }
[data-theme="dark"] .btn-theme .ic-lune { display: block; }

.bandeau-demo { margin: 12px var(--marge) 0; padding: 9px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--bord); color: var(--discret); font-size: 13px; }
.bandeau-demo b { color: var(--texte-2); font-weight: 600; }

.vue { flex: 1; padding: 20px var(--marge) 8px; outline: none; }

/* Bas de page commun MMBT (pied-mmbt.css) aux couleurs de Biashara */
.pm { --pm-accent: var(--accent); --pm-sur-accent: var(--sur-accent); --pm-texte: var(--texte); --pm-doux: var(--discret); --pm-bord: var(--bord); --pm-fond: transparent; margin-top: 24px; border-top: 1px solid var(--bord); }
.pm footer.pm-pied { padding-left: var(--marge); padding-right: var(--marge); padding-bottom: calc(26px + 150px + env(safe-area-inset-bottom)); }

/* Barre d'onglets du téléphone (verre dépoli) */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--bord);
}
.onglets a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; text-decoration: none; color: var(--discret); font-size: 11px; font-weight: 550; border-radius: 12px; }
.onglets a svg { width: 23px; height: 23px; }
.onglets a[aria-current="page"] { color: var(--accent); }
.onglets .compte { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px; background: var(--alerte); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }

/* Barre panier (téléphone) */
.barre-panier {
  position: fixed; left: 12px; right: 12px; z-index: 29;
  bottom: calc(70px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px; border: 0; border-radius: 16px;
  background: var(--accent); color: var(--sur-accent);
  box-shadow: 0 14px 34px -12px rgba(67, 56, 202, 0.6);
  font-size: 15px; font-weight: 600; text-align: start;
  animation: monte 0.35s var(--doux) both;
}
.barre-panier .nb { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); font-size: 13.5px; }
[data-theme="dark"] .barre-panier .nb { background: rgba(21, 19, 58, 0.15); }
.barre-panier .total { margin-inline-start: auto; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.barre-panier svg { width: 18px; height: 18px; }
@keyframes monte { from { transform: translateY(16px); opacity: 0; } }

@media (min-width: 1024px) {
  .lateral { display: flex; }
  .marque-mobile { display: none; }
  .onglets, .barre-panier { display: none !important; }
  .vue { padding-bottom: 40px; }
  .pm footer.pm-pied { padding-bottom: 26px; }
  .choix-boutique span { max-width: 340px; }
}

/* ---------- Éléments communs ---------- */
.titre-vue { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.titre-vue h1 { margin: 0; font-size: clamp(26px, 3.2vw, 34px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
.titre-vue p { margin: 6px 0 0; color: var(--discret); }
.titre-vue .actions-titre { display: flex; gap: 8px; flex-wrap: wrap; }

.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: clamp(16px, 2vw, 22px); min-width: 0; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.carte-titre h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.carte-titre a, .lien { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 550; background: none; border: 0; padding: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--bord-fort); background: var(--surface); font-weight: 600; font-size: 15px; text-decoration: none; transition: transform 0.15s var(--doux), background 0.15s; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-accent { background: var(--accent); border-color: transparent; color: var(--sur-accent); }
.btn-accent:hover { background: var(--accent-fort); }
.btn-accent:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-calme { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--alerte); }
.btn-plein { width: 100%; }
.btn-petit { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-icone { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 99px; border: 0; background: var(--surface-2); color: var(--texte-2); flex: none; }
.btn-icone svg { width: 18px; height: 18px; }

.puce { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.puce::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.puce-ok { color: var(--accent); background: var(--accent-doux); }
.puce-attente { color: var(--attente); background: var(--attente-doux); }
.puce-alerte { color: var(--alerte); background: var(--alerte-doux); }
.puce-neutre { color: var(--discret); background: var(--surface-2); }

.barre { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.barre i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.vide { text-align: center; color: var(--discret); padding: 28px 12px; }
.positif { color: var(--accent); }
/* Un chiffre négatif est toujours rouge, même dans un bloc qui a déjà sa couleur. */
.negatif, .valeur.negatif, .positif.negatif { color: var(--alerte) !important; }

/* ---------- Tableau : grand bandeau sombre ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr);
  border-radius: 26px;
  background:
    radial-gradient(110% 90% at 90% 0%, rgba(129, 140, 248, 0.20), transparent 55%),
    linear-gradient(160deg, var(--nuit-2), var(--nuit-1) 72%);
  color: #f3f3f8;
  box-shadow: var(--ombre-forte);
  isolation: isolate;
}
.hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.hero-texte { padding: clamp(22px, 3.4vw, 40px); position: relative; z-index: 1; }
.hero-lieu { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: rgba(243, 243, 248, 0.7); }
.hero-lieu::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a5b4fc; box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.18); }
.hero-chiffre { margin-top: 16px; }
.hero-chiffre .etiq { font-size: 14px; color: rgba(243, 243, 248, 0.62); }
.hero-chiffre strong { display: block; font-size: clamp(46px, 7vw, 84px); line-height: 1; font-weight: 250; letter-spacing: -0.05em; margin-top: 6px; white-space: nowrap; }
.hero-chiffre strong small { font-size: 0.36em; font-weight: 400; letter-spacing: -0.01em; margin-left: 8px; color: rgba(243, 243, 248, 0.55); }
.hero-sous { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; font-size: 14px; color: rgba(243, 243, 248, 0.7); }
.hero-sous b { color: #fff; font-weight: 600; }
.hero-sous .tendance { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: rgba(165, 180, 252, 0.16); color: #c7d2fe; font-weight: 600; font-size: 13px; }
.hero-sous .tendance.baisse { background: rgba(251, 113, 133, 0.14); color: #fda4af; }
.hero-courbe { position: relative; padding: 0 clamp(8px, 2vw, 24px) clamp(14px, 2vw, 24px); align-self: end; }
.hero-courbe svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero-courbe .trait { fill: none; stroke: url(#degradeTrait); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--long); stroke-dashoffset: var(--long); animation: trace 1.6s var(--doux) 0.15s forwards; }
.hero-courbe .aire { fill: url(#degradeAire); opacity: 0; animation: apparait 1s ease 0.7s forwards; }
.hero-courbe .point { fill: #fff; opacity: 0; animation: apparait 0.4s ease 1.5s forwards; }
.hero-courbe .halo { fill: rgba(199, 210, 254, 0.25); opacity: 0; animation: apparait 0.4s ease 1.5s forwards, pulse 2.4s ease-in-out 2s infinite; transform-box: fill-box; transform-origin: center; }
.hero-courbe .jours { display: flex; justify-content: space-between; font-size: 11.5px; color: rgba(243, 243, 248, 0.45); margin-top: 6px; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes apparait { to { opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.8); opacity: 0.4; } }
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: stretch; min-height: 300px; }
  .hero-courbe { padding-top: 40px; }
}

/* Chiffres clés */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; }
.kpi { padding: 16px 18px; }
.kpi .etiquette { font-size: 13px; color: var(--discret); font-weight: 500; }
.kpi .valeur { font-size: clamp(19px, 2.1vw, 25px); font-weight: 650; letter-spacing: -0.03em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sous { font-size: 12.5px; color: var(--discret); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.kpi { text-align: start; cursor: pointer; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.grille { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1700px) { .grille.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Classement (meilleures ventes) */
.classement { display: flex; flex-direction: column; gap: 12px; }
.classement .rang { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.classement .rang .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.classement .rang .barre { height: 5px; margin-top: 6px; }
.classement .rang .v { text-align: end; font-weight: 650; font-size: 14px; white-space: nowrap; }
.classement .rang .v small { display: block; color: var(--discret); font-weight: 500; font-size: 12px; }

/* ---------- Listes ---------- */
.liste { display: flex; flex-direction: column; }
.ligne { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--bord); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: start; width: 100%; }
.ligne:last-child { border-bottom: 0; }
button.ligne:hover { background: var(--surface-2); border-radius: 12px; }
.vignette { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--texte-2); flex: none; }
.vignette svg { width: 22px; height: 22px; }
.vignette.initiales { font-weight: 650; font-size: 14px; color: var(--accent); background: var(--accent-doux); }
.ligne .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .m { font-size: 13px; color: var(--discret); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .montant { text-align: end; }
.ligne .montant b { display: block; font-weight: 650; font-size: 15px; white-space: nowrap; }
.ligne .montant small { display: block; color: var(--discret); font-size: 12.5px; white-space: nowrap; }
.ligne .montant .puce { margin-top: 4px; }
.ligne-actions { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: -2px; }

.filtres { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--bord); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtres button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 550; color: var(--discret); white-space: nowrap; }
.filtres button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }

.resume { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin-bottom: 16px; }

/* Tableau de stock (PC) */
.table-stock { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table-stock th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--discret); padding: 0 10px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.table-stock td { padding: 12px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.table-stock tr:last-child td { border-bottom: 0; }
.table-stock tbody tr { cursor: pointer; }
.table-stock tbody tr:hover td { background: var(--surface-2); }
.table-stock .num { text-align: end; }
.table-stock .nom { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.table-stock .nom .vignette { width: 36px; height: 36px; border-radius: 10px; }
.table-stock .nom .vignette svg { width: 18px; height: 18px; }
.table-stock .cat { color: var(--discret); }
.mobile-seul { display: block; }
.pc-seul { display: none; }
@media (min-width: 900px) { .mobile-seul { display: none; } .pc-seul { display: block; } }

/* ---------- Caisse (Vendre) ---------- */
.caisse { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .caisse { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (min-width: 1600px) { .caisse { grid-template-columns: minmax(0, 1fr) 420px; } }
.recherche { position: relative; flex: 1; min-width: 200px; }
.recherche svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--discret); pointer-events: none; }
.recherche input { width: 100%; min-height: 44px; padding: 10px 14px 10px 42px; border-radius: 12px; border: 1px solid var(--bord-fort); background: var(--surface); font-size: 16px; -webkit-appearance: none; }
.recherche input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-doux); }
.barre-outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

.tuiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 168px), 1fr)); }
.tuile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px; border-radius: 16px; border: 1px solid var(--bord); background: var(--surface);
  box-shadow: var(--ombre); text-align: start; min-width: 0;
  transition: transform 0.14s var(--doux), border-color 0.14s;
}
.tuile:hover { border-color: var(--bord-fort); }
.tuile:active { transform: scale(0.97); }
.tuile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--texte-2); }
.tuile .ic svg { width: 22px; height: 22px; }
.tuile .n { font-weight: 600; font-size: 14.5px; line-height: 1.25; width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.5em; }
.tuile .p { font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; }
.tuile .s { font-size: 12px; color: var(--discret); }
.tuile .s.bas { color: var(--alerte); font-weight: 600; }
.tuile .qte { position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--accent); color: var(--sur-accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; animation: pop 0.25s var(--doux); }
.tuile.choisie { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.tuile.epuise { opacity: 0.45; }
@keyframes pop { from { transform: scale(0.6); } }

.ticket-pc { display: none; }
@media (min-width: 1024px) { .ticket-pc { display: flex; } }
.ticket { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.ticket-haut { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--bord); }
.ticket-haut h2 { margin: 0; font-size: 16px; font-weight: 650; }
.ticket-lignes { max-height: 46vh; overflow: auto; padding: 4px 20px; }
.tl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.tl:last-child { border-bottom: 0; }
.tl .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl .pu { font-size: 12.5px; color: var(--discret); }
.tl .st { font-weight: 650; text-align: end; white-space: nowrap; }
.compteur { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--bord-fort); border-radius: 10px; overflow: hidden; justify-self: end; }
.compteur button { width: 34px; height: 32px; border: 0; background: var(--surface-2); font-size: 18px; line-height: 1; color: var(--texte-2); }
.compteur span { min-width: 34px; text-align: center; font-weight: 650; font-size: 14px; }
.ticket-bas { padding: 16px 20px 20px; border-top: 1px solid var(--bord); background: var(--surface-2); }
.ticket-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.ticket-total span { color: var(--discret); font-weight: 550; }
.ticket-total strong { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.ticket-benef { font-size: 12.5px; color: var(--discret); margin: -10px 0 14px; text-align: end; }

/* Moyens de paiement */
.paiements { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.paiements button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--bord-fort); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--texte-2); }
.paiements button svg { width: 22px; height: 22px; }
.paiements button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-doux); box-shadow: 0 0 0 1px var(--accent) inset; }

/* Reçu */
.recu { margin: 0 auto 16px; max-width: 340px; padding: 22px 22px 18px; border-radius: 6px; background: #fdfdfb; color: #16161d; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -18px rgba(0,0,0,.35); position: relative; }
.recu::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: radial-gradient(circle at 6px 0, #fdfdfb 6px, transparent 6.5px) 0 0 / 12px 8px repeat-x; }
.recu .c { text-align: center; }
.recu .tt { font-weight: 700; font-size: 14px; letter-spacing: 0.02em; }
.recu hr { border: 0; border-top: 1px dashed #16161d55; margin: 10px 0; }
.recu .l { display: flex; justify-content: space-between; gap: 10px; }
.recu .l span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recu .tot { font-weight: 700; font-size: 14px; }
.succes { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.succes .rond { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--sur-accent); flex: none; animation: pop 0.35s var(--doux); }
.succes .rond svg { width: 24px; height: 24px; }
.succes b { display: block; font-size: 17px; }
.succes span { color: var(--discret); font-size: 14px; }

/* ---------- Graphiques ---------- */
.graph-zone { position: relative; padding-bottom: 26px; }
.graph { width: 100%; height: clamp(180px, 22vw, 280px); display: block; }
.graph-dates { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; }
.graph-dates span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--discret); white-space: nowrap; }
.graph-dates span:last-child { transform: translateX(-80%); }
.graph .b { fill: var(--accent); opacity: 0.85; }
.graph .b2 { fill: var(--accent); opacity: 0.28; }
.graph .b:hover { opacity: 1; }
.graph .axe { stroke: var(--bord); stroke-width: 1; }
.graph text { fill: var(--discret); font-size: 11px; font-family: inherit; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--discret); margin-top: 10px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--accent); }
.legende i.clair { opacity: 0.28; }
.legende i.moyen { opacity: 0.6; }
.repartition { display: flex; height: 12px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 4px 0 2px; }
.repartition i { display: block; background: var(--accent); }
.repartition i:nth-child(2) { opacity: 0.6; }
.repartition i:nth-child(3) { opacity: 0.28; }

.table-releve { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table-releve th { text-align: end; font-size: 12.5px; font-weight: 600; color: var(--discret); padding: 0 10px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.table-releve th:first-child, .table-releve td:first-child { text-align: start; }
.table-releve td { text-align: end; padding: 12px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.table-releve tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--bord-fort); }
.defile { overflow-x: auto; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.champ label { font-size: 13.5px; font-weight: 600; color: var(--texte-2); }
.champ input, .champ select, .champ textarea { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--bord-fort); background: var(--surface); font-size: 16px; -webkit-appearance: none; appearance: none; }
.champ select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23737380' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-doux); }
.champ .aide { font-size: 12.5px; color: var(--discret); }
.champ.erreur input, .champ.erreur select { border-color: var(--alerte); box-shadow: 0 0 0 4px var(--alerte-doux); }
.deux { display: grid; gap: 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.boutons { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.boutons .btn { flex: 1; }
.encadre { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--texte-2); font-size: 14px; margin-bottom: 14px; }
.encadre b { color: var(--texte); }

/* Réglages */
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--bord); }
.reglage:last-child { border-bottom: 0; }
.reglage .txt span { display: block; color: var(--discret); font-size: 13px; }
.reglage .txt b { font-weight: 600; font-size: 15px; }
.interrupteur { position: relative; width: 48px; height: 28px; border-radius: 99px; border: 0; background: var(--bord-fort); flex: none; transition: background 0.2s; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 0.25s var(--doux); }
.interrupteur[aria-checked="true"] { background: var(--accent); }
.interrupteur[aria-checked="true"]::after { transform: translateX(20px); }
.role-choix { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--bord); }
.role-choix button { border: 0; background: none; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 550; color: var(--discret); white-space: nowrap; }
.role-choix button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.liste-boutiques button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--bord); background: var(--surface); text-align: start; margin-bottom: 8px; }
.liste-boutiques button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.liste-boutiques .drap { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--texte-2); flex: none; }
.liste-boutiques b { display: block; font-size: 15px; }
.liste-boutiques span { color: var(--discret); font-size: 13px; }
.liste-boutiques .droite { margin-inline-start: auto; text-align: end; }

/* ---------- Feuille (fenêtre) ---------- */
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(5, 5, 10, 0.45); display: flex; align-items: flex-end; justify-content: center; animation: voileIn 0.25s ease both; }
.feuille {
  width: 100%; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--ombre-forte);
  animation: feuilleIn 0.42s var(--doux) both;
}
.feuille-poignee { width: 38px; height: 5px; border-radius: 5px; background: var(--bord-fort); margin: 2px auto 8px; }
.feuille-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -8px; background: var(--surface); padding: 6px 0 12px; z-index: 1; }
.feuille-entete h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.feuille .ticket { position: static; display: flex; flex-direction: column; margin: 0 -20px -20px; }
.feuille .ticket-lignes { max-height: none; }
.feuille .titre-pc { display: none; }
.feuille .ticket-haut { padding-top: 4px; }
.feuille .ticket-haut h2 { font-size: 14px; color: var(--discret); font-weight: 600; }
@media (min-width: 720px) {
  .voile { align-items: center; padding: 24px; }
  .feuille { max-width: 560px; border-radius: 24px; padding-bottom: 24px; animation-name: fenetreIn; }
  .feuille-poignee { display: none; }
}
@keyframes voileIn { from { opacity: 0; } }
@keyframes feuilleIn { from { transform: translateY(100%); } }
@keyframes fenetreIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.toast { position: fixed; left: 50%; bottom: calc(140px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #0d0d14; color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 550; box-shadow: var(--ombre-forte); transition: opacity 0.25s, transform 0.35s var(--doux); max-width: calc(100% - 32px); text-align: center; }
[data-theme="dark"] .toast { background: #f3f3f6; color: #0d0d14; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

@media (max-width: 480px) {
  .kpi .valeur { font-size: 17.5px; letter-spacing: -0.02em; }
  .kpi { padding: 14px; }
  .marque-mobile span { display: none; }
  .pilule-simple span { display: none; }
  .pilule-simple { width: 36px; padding: 0; justify-content: center; }
  .choix-boutique span { max-width: 38vw; }
}

/* ---------- MODE SIMPLE : grandes images, gros chiffres, peu de mots ---------- */
[data-simple="1"] .tuiles { grid-template-columns: repeat(auto-fill, minmax(min(46%, 210px), 1fr)); gap: 12px; }
[data-simple="1"] .tuile { align-items: center; text-align: center; padding: 18px 10px 16px; gap: 8px; border-radius: 22px; }
[data-simple="1"] .tuile .ic { width: 84px; height: 84px; border-radius: 24px; background: var(--accent-doux); color: var(--accent); }
[data-simple="1"] .tuile .ic svg { width: 46px; height: 46px; stroke-width: 1.6; }
[data-simple="1"] .tuile .n { font-size: 15px; min-height: 0; -webkit-line-clamp: 1; text-align: center; }
[data-simple="1"] .tuile .p { font-size: 21px; }
[data-simple="1"] .tuile .s { display: none; }
[data-simple="1"] .tuile .qte { min-width: 34px; height: 34px; font-size: 16px; }
[data-simple="1"] .barre-outils .filtres { display: none; }
[data-simple="1"] .titre-vue p { display: none; }
[data-simple="1"] .paiements button { padding: 18px 6px; font-size: 15px; }
[data-simple="1"] .paiements button svg { width: 34px; height: 34px; }
[data-simple="1"] .ticket-total strong { font-size: 40px; }
[data-simple="1"] .barre-panier { padding: 16px 18px; font-size: 17px; }
[data-simple="1"] .barre-panier .total { font-size: 20px; }
[data-simple="1"] .btn { min-height: 54px; font-size: 17px; }
[data-simple="1"] .ligne .t { font-size: 17px; }
[data-simple="1"] .ligne .montant b { font-size: 18px; }
[data-simple="1"] .vignette { width: 52px; height: 52px; }
[data-simple="1"] .onglets a { font-size: 13px; }
[data-simple="1"] .onglets a svg { width: 28px; height: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}

/* Impression du relevé : seulement le contenu, sur fond blanc */
@media print {
  .lateral, .entete, .onglets, .barre-panier, .bandeau-demo, .pm, .toast, .actions-titre, .filtres { display: none !important; }
  body { background: #fff; color: #000; }
  .carte { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .vue { padding: 0; }
}

/* Signature « Conçu par MMBT » : MMBT scintille aux couleurs du drapeau comorien
   (statique si « réduire les animations » est demandé). */
.mmbt-sig { font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .mmbt-sig {
    background-image: linear-gradient(100deg, #e0b400 0%, currentColor 30%, #ce1126 55%, #3d4fb3 80%, #e0b400 100%);
    background-image: linear-gradient(100deg, color-mix(in srgb, #fcd116 78%, currentColor) 0%, currentColor 30%, color-mix(in srgb, #ce1126 85%, currentColor) 55%, color-mix(in srgb, #3d4fb3 70%, currentColor) 80%, color-mix(in srgb, #fcd116 78%, currentColor) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: mmbt-sig 6s linear infinite;
  }
}
@keyframes mmbt-sig { to { background-position: -250% 0; } }
.mmbt-sig--fixe { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .mmbt-sig { animation: none; } }

/* ---------- Choix d'affichage (sélecteurs à icônes) ---------- */
.filtres button { display: inline-flex; align-items: center; gap: 6px; }
.filtres button svg { width: 16px; height: 16px; flex: none; }
.filtres-icones button { padding: 7px 10px; }
.carte-titre .filtres { padding: 3px; border-radius: 11px; }
.carte-titre .filtres button { padding: 5px 8px; border-radius: 8px; }
.note-carte { margin: 14px 0 0; font-size: 13px; color: var(--discret); }
.note-carte a { color: var(--accent); text-decoration: none; font-weight: 550; }
.hero-lien { all: unset; cursor: pointer; color: rgba(243, 243, 248, 0.7); border-bottom: 1px dashed rgba(243, 243, 248, 0.3); }
.hero-lien:hover { color: #fff; }
.hero-lien:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; border-radius: 4px; }
.btn-danger.confirmer { background: var(--alerte); color: #fff; border-color: transparent; }

/* ---------- Graphiques ronds ---------- */
.anneau { position: relative; width: 100%; max-width: 220px; aspect-ratio: 1; margin: 0 auto; }
.anneau svg { width: 100%; height: 100%; display: block; }
.anneau .piste { fill: none; stroke: var(--surface-2); stroke-width: 20; }
.anneau .arc { fill: none; stroke: var(--accent); stroke-width: 20; animation: arcIn 0.9s var(--doux) both; }
.anneau-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 22%; }
.anneau-centre b { font-size: clamp(18px, 2vw, 24px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.anneau-centre span { font-size: 12px; color: var(--discret); margin-top: 2px; }
.anneau-bloc { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 560px) { .anneau-bloc { grid-template-columns: 200px minmax(0, 1fr); } }
.anneau-legende { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.al { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--bord); font-size: 14px; }
.al:last-child { border-bottom: 0; }
.al i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.al .n { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al .v { text-align: end; font-weight: 650; white-space: nowrap; }
.al .v small { display: block; font-weight: 500; font-size: 12px; color: var(--discret); }
@keyframes arcIn { from { stroke-dasharray: 0 1000; } }

.graph-rond { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 760px) { .graph-rond { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } }
.cadran { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.cadran svg { width: 100%; height: auto; display: block; overflow: visible; }
.cadran text { fill: var(--discret); font-size: 10.5px; font-family: inherit; }
.cadran .piste-fine { fill: none; stroke: var(--bord-fort); stroke-width: 1; }
.cadran line { stroke: var(--accent); stroke-linecap: round; animation: rayon 0.8s var(--doux) both; transform-origin: 160px 160px; }
.cadran line.r2 { opacity: 0.28; }
.cadran .anneau-centre { padding: 0 32%; }
.cadran .anneau-centre b { font-size: clamp(16px, 2.2vw, 22px); }
@keyframes rayon { from { transform: scale(0.45); opacity: 0; } }
.cadran.anneaux .piste { fill: none; stroke: var(--surface-2); }
.cadran.anneaux .arc { fill: none; stroke: var(--accent); stroke-linecap: round; animation: arcIn 1s var(--doux) both; }
.cadran.anneaux .arc-clair { opacity: 0.3; }
.cadran.anneaux text { font-size: 11px; font-weight: 600; }
.graph-faits { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.graph-faits > div { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.graph-faits span { display: block; font-size: 12.5px; color: var(--discret); }
.graph-faits b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.graph-faits small { color: var(--discret); font-size: 12.5px; }
.graph-faits .legende { grid-column: 1 / -1; background: none; padding: 0; margin: 0; }

/* ---------- Mosaïque des clients ---------- */
.mosaique-clients { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tuile-client { display: flex; flex-direction: column; gap: 12px; }
.tuile-client.en-retard { border-color: color-mix(in srgb, var(--alerte) 35%, var(--bord)); }
.tc-haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.avatar-age { position: relative; width: 60px; height: 60px; border: 0; padding: 0; background: none; flex: none; }
.avatar-age svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar-age .piste { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.avatar-age .arc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; animation: arcIn 0.9s var(--doux) both; }
.en-retard .avatar-age .arc { stroke: var(--alerte); }
.avatar-age span { position: absolute; inset: 9px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-doux); color: var(--accent); font-weight: 700; font-size: 15px; }
.tc-nom { all: unset; cursor: pointer; display: block; min-width: 0; }
.tc-nom b { display: block; font-size: 16px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-nom span { display: block; font-size: 13px; color: var(--discret); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-montant { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.tc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.tc-actions .btn { padding: 0 8px; }

/* ---------- Mosaïque du stock ---------- */
.mosaique-stock { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 190px), 1fr)); }
.tuile-stock { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; color: inherit; font: inherit; transition: transform 0.14s var(--doux), border-color 0.14s; }
.tuile-stock:hover { border-color: var(--bord-fort); }
.tuile-stock:active { transform: scale(0.98); }
.tuile-stock.bas { border-color: color-mix(in srgb, var(--alerte) 35%, var(--bord)); }
.jauge { position: relative; width: 64px; height: 64px; display: grid; place-items: center; color: var(--texte-2); }
.jauge svg.j { position: absolute; inset: 0; width: 100%; height: 100%; }
.jauge .piste { fill: none; stroke: var(--surface-2); stroke-width: 4.5; }
.jauge .arc { fill: none; stroke: var(--accent); stroke-width: 4.5; stroke-linecap: round; animation: arcIn 0.9s var(--doux) both; }
.tuile-stock.bas .jauge .arc { stroke: var(--alerte); }
.jauge > svg:not(.j) { width: 24px; height: 24px; position: relative; }
.ts-nom { font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.ts-stock { font-size: 13px; color: var(--discret); }
.ts-stock b { font-size: 18px; color: var(--texte); font-weight: 700; }
@media (max-width: 560px) { .barre-outils .recherche { flex-basis: 100%; } }
.defile-h { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; max-width: 100%; }
.defile-h .filtres { flex: none; }
@media (max-width: 560px) { .defile-h { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--marge)); padding: 0 var(--marge); } .defile-h::-webkit-scrollbar { display: none; } }

/* ---------- Deux monnaies : la principale en grand, l'autre en petit ---------- */
.autre { display: block; font-size: 12px; font-weight: 500; color: var(--discret); letter-spacing: 0; margin-top: 1px; white-space: nowrap; }
.kpi .autre { font-size: 12.5px; margin-top: 0; }
.tuile .p .autre { font-size: 11.5px; font-weight: 500; }
.tc-montant .autre { font-size: 13px; }
.table-stock .autre { display: inline; margin-left: 6px; }
.ticket-autre { text-align: end; font-size: 13px; color: var(--discret); margin: -10px 0 12px; }
.hero-autre { display: block; margin-top: 8px; font-size: 15px; color: rgba(243, 243, 248, 0.55); }
.btn-monnaie { width: auto; min-width: 36px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
[data-simple="1"] .tuile .p .autre { font-size: 13px; }

/* ---------------------------------------------------------------------------
   Catalogue de produits (ajout d'un article en quelques lettres)
   --------------------------------------------------------------------------- */
.cat-intro { margin: 0 0 12px; color: var(--discret); font-size: 14px; }
.cat-intro b { color: var(--texte); font-weight: 650; }
.cat-champ { display: block; margin-bottom: 14px; }
.cat-zone { min-height: min(56vh, 480px); } /* hauteur stable : la fenêtre ne « saute » pas pendant la frappe */
/* Mosaïque des rayons */
.cat-rayons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-rayons button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--bord); background: var(--surface); text-align: start; min-width: 0; transition: border-color .15s, background .15s; }
.cat-rayons button:hover { border-color: var(--bord-fort); background: var(--surface-2); }
.cat-rayons .vignette { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 8px; }
.cat-rayons .vignette svg { width: 20px; height: 20px; }
.cat-rayons b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cat-rayons small { font-size: 12.5px; color: var(--discret); }
@media (min-width: 720px) { .cat-rayons { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Résultats */
.cat-fil { display: flex; align-items: center; gap: 10px; margin: -2px 0 6px; font-size: 14px; }
.cat-fil span { color: var(--discret); }
.cat-fil span::before { content: "·"; margin-right: 10px; }
.cat-liste .ligne { padding: 10px 4px; }
.cat-liste .ligne:hover { background: var(--surface-2); border-radius: 12px; }
.cat-liste mark { background: none; color: var(--accent); font-weight: 700; }
.cat-plus { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-doux); color: var(--accent); }
.cat-plus svg { width: 16px; height: 16px; }
.cat-deja { opacity: .72; }
.cat-vide { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 12px; }
.cat-vide > svg { width: 28px; height: 28px; color: var(--discret); margin-bottom: 4px; }
.cat-vide span { color: var(--discret); font-size: 14px; margin-bottom: 10px; }
.cat-libre { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px dashed var(--bord-fort); background: none; text-align: start; }
.cat-libre > svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.cat-libre b { display: block; font-size: 14.5px; }
.cat-libre small { color: var(--discret); font-size: 13px; }
.cat-retour { margin-bottom: 12px; display: inline-block; }
.cat-choisi { display: flex; gap: 10px; align-items: flex-start; }
.cat-choisi svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
/* Choix de l'image en dessins */
.choix-image { margin-bottom: 14px; border: 1px solid var(--bord-fort); border-radius: 12px; background: var(--surface); }
.choix-image summary { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; cursor: pointer; list-style: none; }
.choix-image summary::-webkit-details-marker { display: none; }
.choix-image summary .vignette { width: 38px; height: 38px; border-radius: 10px; }
.choix-image summary b { display: block; font-size: 13.5px; font-weight: 600; color: var(--texte-2); }
.choix-image summary small { color: var(--discret); font-size: 12.5px; }
.choix-image summary > svg { width: 18px; height: 18px; margin-inline-start: auto; color: var(--discret); transition: transform .2s; }
.choix-image[open] summary > svg { transform: rotate(180deg); }
.grille-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; padding: 4px 10px 12px; max-height: 236px; overflow-y: auto; }
.grille-images label { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--texte-2); cursor: pointer; border: 1px solid transparent; }
.grille-images label svg { width: 22px; height: 22px; }
.grille-images input { position: absolute; opacity: 0; pointer-events: none; }
.grille-images label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--accent-doux); }
.grille-images label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-doux); }
/* Bénéfice calculé pendant la saisie des prix */
.marge-direct { margin: -4px 0 14px; font-size: 13.5px; min-height: 0; }
.marge-direct:empty { display: none; }
.marge-direct span { display: inline-block; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); color: var(--texte-2); }
.marge-direct .pos b { color: var(--accent); }
.marge-direct .neg b { color: var(--alerte); }

/* ---------------------------------------------------------------------------
   Images en couleur : vrais emojis + teinte douce par rayon (réglage « Couleur »)
   --h = teinte du rayon (0 à 360), donnée par catalogue.js
   --------------------------------------------------------------------------- */
.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif; font-size: 22px; line-height: 1; display: block; }
.vignette[data-teinte], .tuile .ic[data-teinte], [data-simple="1"] .tuile .ic[data-teinte] { background: hsl(var(--h) 70% 95.5%); color: hsl(var(--h) 45% 36%); }
[data-theme="dark"] .vignette[data-teinte], [data-theme="dark"] .tuile .ic[data-teinte], [data-theme="dark"][data-simple="1"] .tuile .ic[data-teinte] { background: hsl(var(--h) 22% 16%); color: hsl(var(--h) 60% 78%); }
.tuile .ic .emo { font-size: 24px; }
.jauge .emo { font-size: 24px; position: relative; }
.table-stock .nom .vignette .emo { font-size: 18px; }
.cat-rayons .vignette .emo { font-size: 20px; }
[data-simple="1"] .tuile .ic .emo { font-size: 48px; }
[data-simple="1"] .vignette .emo { font-size: 26px; }

/* ---------------------------------------------------------------------------
   Arabe : la page se lit de droite à gauche (dir="rtl")
   La plupart des mises en page (grilles, flex) s'inversent toutes seules ;
   on corrige ici les quelques éléments placés « à gauche » ou « à droite ».
   --------------------------------------------------------------------------- */
[dir="rtl"] body { font-family: "Inter", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", sans-serif; }
[dir="rtl"] .lateral { border-right: 0; border-left: 1px solid var(--bord); }
[dir="rtl"] .recherche svg { left: auto; right: 14px; }
[dir="rtl"] .recherche input { padding: 10px 42px 10px 14px; }
[dir="rtl"] .champ select { background-position: left 14px center; padding-right: 14px; padding-left: 38px; }
[dir="rtl"] .tuile .qte { right: auto; left: 10px; }
[dir="rtl"] .onglets .compte { left: auto; right: calc(50% + 6px); }
[dir="rtl"] .hero-chiffre strong small { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .legende i { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .table-stock .autre { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .cat-fil span::before { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .interrupteur::after { left: auto; right: 3px; }
[dir="rtl"] .interrupteur[aria-checked="true"]::after, [dir="rtl"] .interrupteur.actif::after { transform: translateX(-20px); }
/* Les graphiques et courbes gardent le temps de gauche à droite, comme partout dans le monde. */
[dir="rtl"] .graph-zone, [dir="rtl"] .graph, [dir="rtl"] .courbe, [dir="rtl"] .graph-dates, [dir="rtl"] .hero-courbe { direction: ltr; }
/* Montants et numéros de téléphone : toujours lus dans le bon ordre. */
[dir="rtl"] .montant b, [dir="rtl"] .num, [dir="rtl"] .v, [dir="rtl"] .p, [dir="rtl"] .kpi strong { unicode-bidi: plaintext; }
.reglages-titre { margin: 18px 0 10px; font-size: 13.5px; font-weight: 650; color: var(--texte-2); }
.paiements { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }

/* ---------------------------------------------------------------------------
   Tout réagit au toucher : chiffres clés, barres, parts de graphique, classements
   --------------------------------------------------------------------------- */
button.kpi, a.kpi { position: relative; font: inherit; color: inherit; transition: transform 0.18s var(--doux), border-color 0.18s, box-shadow 0.18s; }
button.kpi::after, a.kpi::after { content: "›"; position: absolute; top: 12px; inset-inline-end: 16px; font-size: 18px; line-height: 1; color: var(--discret); opacity: 0.55; transition: opacity 0.18s, transform 0.18s var(--doux); }
[dir="rtl"] button.kpi::after, [dir="rtl"] a.kpi::after { content: "‹"; }
button.kpi:hover, a.kpi:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--ombre); }
button.kpi:hover::after, a.kpi:hover::after { opacity: 1; color: var(--accent); transform: translateX(2px); }
button.kpi:active, a.kpi:active { transform: scale(0.975); }
.graph .touche { fill: transparent; cursor: pointer; transition: fill 0.15s; }
.graph .touche:hover, .graph .touche:active { fill: var(--accent-doux); }
.graph .b, .graph .b2 { pointer-events: none; }
.cadran line.touche { stroke: transparent; stroke-linecap: butt; cursor: pointer; transition: stroke 0.15s; animation: none; }
.cadran line.touche:hover, .cadran line.touche:active { stroke: var(--accent-doux); }
.cadran line.r1, .cadran line.r2 { pointer-events: none; }
.cadran.anneaux circle[data-action] { cursor: pointer; pointer-events: stroke; transition: opacity 0.15s; }
.cadran.anneaux circle.arc[data-action]:hover { opacity: 0.75; }
button.al, button.rang, .reglage-btn { width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: start; cursor: pointer; border-radius: 10px; transition: background 0.15s; }
button.al { border-bottom: 1px solid var(--bord); border-radius: 0; }
button.al:hover, button.rang:hover, .reglage-btn:hover, button.al:active, button.rang:active { background: var(--surface-2); }
button.rang { padding: 6px; margin: -6px; width: calc(100% + 12px); }
button.rang[data-action=""], button.ligne[data-action=""] { cursor: default; }
.sous-titre { font-size: 13px; font-weight: 650; color: var(--discret); margin: 18px 0 2px; }
.intro-feuille { margin: 0 0 8px; color: var(--discret); font-size: 14px; }
.ligne-simple { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------------------------------------------------------------------------
   Scanner de codes-barres
   --------------------------------------------------------------------------- */
.btn-scan svg { width: 20px; height: 20px; }
.champ-scan { display: flex; gap: 8px; }
.champ-scan input { flex: 1; min-width: 0; }
.champ-scan .btn { flex: none; }
.scan-zone { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; margin-bottom: 10px; }
.scan-zone video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-cadre { position: absolute; inset: 22% 8%; border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.38); }
.scan-cadre i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; border-radius: 2px; background: #a5b4fc; box-shadow: 0 0 12px #818cf8; animation: balayage 1.8s ease-in-out infinite; }
@keyframes balayage { 0%, 100% { transform: translateY(-34px); opacity: 0.5; } 50% { transform: translateY(34px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scan-cadre i { animation: none; } }
.scan-etat { margin: 0 0 12px; text-align: center; font-size: 14px; color: var(--discret); }
.scan-resultat { margin-bottom: 12px; min-height: 68px; }
.scan-resultat .ligne { border: 1px solid var(--accent); border-radius: 14px; padding: 10px 12px; background: var(--accent-doux); }
#scanForm:not(:empty) { margin-top: 10px; }
@media (max-width: 479px) { .btn-scan span { display: none; } .btn-scan { padding-inline: 12px; } }

/* Réglages : un groupe de boutons (langue, monnaie…) ne doit jamais être coupé.
   S'il n'y a pas la place à côté du texte, il passe en dessous, en entier. */
.reglage { flex-wrap: wrap; }
.reglage .txt { flex: 1 1 140px; min-width: 0; }
.reglage .filtres { flex: none; max-width: 100%; overflow: visible; }

/* « Créer mon propre article » est placé sous la recherche, avant la liste : on inverse ses marges. */
.cat-libre { margin-top: 0; margin-bottom: 14px; }

/* =====================================================================================
   SIGNATURE MMBT : fluidité « iPhone ». Verre dépoli, gestes, retours visuels en soie.
   Les changements d'onglet restent instantanés : seuls les éléments qui se superposent
   (feuilles, messages, thème) sont animés.
   ===================================================================================== */

/* En-tête de verre : la ligne du bas n'apparaît que lorsque la page a défilé. */
.entete { border-bottom-color: transparent; transition: border-color 0.25s ease; }
.defile .entete { border-bottom-color: var(--bord); }

/* Feuille : sortie animée (elle redescend sur téléphone, s'efface sur PC). */
.voile.sort { animation: voileOut 0.24s ease both; pointer-events: none; }
.voile.sort .feuille { animation: feuilleOut 0.24s cubic-bezier(0.4, 0, 1, 1) both; }
@keyframes voileOut { to { opacity: 0; } }
@keyframes feuilleOut { to { transform: translateY(100%); } }
@keyframes fenetreOut { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@media (min-width: 720px) { .voile.sort .feuille { animation-name: fenetreOut; } }
/* La poignée et le titre se tirent au doigt : on empêche la page de défiler pendant le geste. */
.feuille-poignee, .feuille-entete { touch-action: none; }
.feuille-poignee { cursor: grab; }
/* Titre de la feuille en verre dépoli : le contenu passe dessous en transparence. */
.feuille-entete { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); margin: 0 -20px; padding-inline: 20px; }

/* Message court (toast) en verre. */
.toast { background: color-mix(in srgb, #0d0d14 82%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45); transition: opacity 0.3s ease, transform 0.45s var(--doux); }
[data-theme="dark"] .toast { background: color-mix(in srgb, #f3f3f6 86%, transparent); }

/* Tout ce qui se touche répond sous le doigt (léger enfoncement, retour en ressort). */
.ligne, .btn-icone, .pilule-simple, .filtres button, .cat-rayons button, .cat-libre, .liste-boutiques button, .paiements button, .choix-boutique { transition: transform 0.2s var(--doux), background-color 0.15s, border-color 0.15s, color 0.15s; }
button.ligne:active, .cat-rayons button:active, .cat-libre:active, .liste-boutiques button:active { transform: scale(0.985); }
.btn-icone:active, .pilule-simple:active, .choix-boutique:active, .paiements button:active { transform: scale(0.94); }
.onglets a svg { transition: transform 0.25s var(--doux); }
.onglets a:active svg { transform: scale(0.88); }

/* L'image de l'article qui vole vers le ticket. */
.envol { position: fixed; z-index: 70; margin: 0; pointer-events: none; display: grid; place-items: center; border-radius: 14px; will-change: transform, opacity; }

/* Vente réussie : le rond rebondit, un halo s'élargit, la coche se dessine. */
.succes .rond { position: relative; animation: rebond 0.55s var(--doux) both; }
.succes .rond::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: halo 0.9s 0.15s ease-out both; }
.succes .coche { stroke-dasharray: 22; stroke-dashoffset: 22; animation: trace 0.4s 0.28s ease-out forwards; }
@keyframes rebond { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes halo { from { transform: scale(1); opacity: 0.55; } to { transform: scale(1.9); opacity: 0; } }

/* Thème clair ⇄ sombre : le nouveau thème s'ouvre en cercle depuis le bouton. */
.vt-theme::view-transition-old(root) { animation: none; }
.vt-theme::view-transition-new(root) { animation: reveleTheme 0.6s cubic-bezier(0.3, 0, 0.2, 1) both; }
@keyframes reveleTheme { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); } to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0)); } }

@media (prefers-reduced-motion: reduce) {
  .succes .coche { stroke-dashoffset: 0; }
  .succes .rond::after { display: none; }
}
.feuille-poignee, .feuille-entete { -webkit-user-select: none; user-select: none; }

/* =====================================================================================
   LE COMPTE : inscription, connexion, accès employé, abonnement
   ===================================================================================== */
/* Bouton « lien » dans le bandeau du haut. */
.bandeau-demo .lien { font-weight: 600; margin-inline-start: 4px; }
/* Point à côté du nom de la boutique : orange quand des ventes attendent le retour d'internet. */
.choix-boutique .pt.attend { background: var(--attente); box-shadow: 0 0 0 3px var(--attente-doux); }

/* Formulaires du compte. */
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .grille-2 { grid-template-columns: 1fr; } }
.coche { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 16px; font-size: 14px; color: var(--texte-2); line-height: 1.45; cursor: pointer; }
.coche input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.coche a, .note-compte a, .oubli a { color: var(--accent); font-weight: 600; text-decoration: none; }
.coches { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0 12px; }
.coches .coche { margin-bottom: 10px; }
.form-erreur { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--alerte-doux); color: var(--alerte); font-size: 14px; font-weight: 550; }
.liens-compte { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-top: 16px; }
.liens-compte .lien { font-size: 14px; }
.lien-danger { color: var(--alerte) !important; }
.oubli { margin-top: 14px; font-size: 14px; color: var(--discret); text-align: center; }
.oubli summary { cursor: pointer; list-style: none; color: var(--texte-2); font-weight: 550; }
.oubli summary::-webkit-details-marker { display: none; }
.oubli p { margin: 8px 0 0; text-align: start; }
.note-compte { margin: 12px 0 0; font-size: 13.5px; color: var(--discret); line-height: 1.5; }
.code-saisie { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 650; font-variant-numeric: tabular-nums; }
/* Bouton pendant que le serveur répond : grisé, avec un petit cercle qui tourne. */
.btn.occupe { opacity: 0.7; pointer-events: none; }
.btn.occupe::after { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: tourne 0.7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Carte « Mon compte » en haut des réglages. */
.carte-compte { padding: 16px; border-radius: 16px; border: 1px solid var(--bord); background: var(--surface-2); margin-bottom: 8px; }
.carte-compte > div:first-child b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.carte-compte > div:first-child > span { display: block; color: var(--discret); font-size: 13.5px; overflow-wrap: anywhere; }
.carte-compte .ligne-puces { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.carte-compte .boutons { margin-top: 14px; }
.carte-compte .boutons:empty { display: none; }
.carte-compte .liens-compte { justify-content: flex-start; margin-top: 12px; }
.carte-compte .btn:not(.btn-accent) { background: var(--surface); }

/* Offres d'abonnement. */
.offres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.offre { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 16px; border: 1px solid var(--bord-fort); }
.offre-plus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.offre b { font-size: 14px; color: var(--texte-2); }
.offre .prix { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.offre small { color: var(--discret); font-size: 13px; }
.offre .btn { margin-top: 12px; text-decoration: none; }

/* Accès employé. */
.code-employe { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 18px 16px; margin: 12px 0; border-radius: 16px; background: var(--accent-doux); }
.code-employe small { color: var(--texte-2); font-size: 13px; }
.code-employe b { font-size: 30px; font-weight: 700; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: var(--accent); direction: ltr; }
.code-employe span { color: var(--discret); font-size: 13px; }
.code-employe .btn { margin-top: 10px; text-decoration: none; }
.ligne-acces { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--bord); }
.ligne-acces:last-child { border-bottom: 0; }
.ligne-acces b { display: block; font-size: 15px; }
.ligne-acces span { color: var(--discret); font-size: 13px; }
.actions-acces { display: flex; gap: 8px; }

/* Compte créé mais boutique pas encore chargée (pas d'internet). */
.vide-compte { max-width: 460px; margin: 12vh auto 0; text-align: center; }
.vide-compte b { font-size: 20px; letter-spacing: -0.02em; }
.vide-compte p { color: var(--discret); margin: 8px 0 20px; }

/* Boutique toute neuve : le premier geste, au centre, sans liste vide. */
.premier-pas { margin: 28px auto 12px; padding: 34px 22px 28px; border: 1px dashed var(--bord-fort); border-radius: 22px; display: flex; flex-direction: column; align-items: center; }
.premier-pas p { margin: 8px 0 18px; max-width: 34ch; }
.pastille-pas { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; background: var(--accent-doux); color: var(--accent); animation: pas-entre 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.pastille-pas svg { width: 24px; height: 24px; }
@keyframes pas-entre { from { transform: scale(0.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pastille-pas { animation: none; } }

/* Champs obligatoires : une étoile après le nom du champ, dans tous les formulaires de l'appli. */
.champ:has(input[required], select[required], textarea[required]) > label::after,
.coche:has(input[required]) > span::after { content: " *"; color: var(--alerte); font-weight: 700; }
.legende-oblig { margin: 0 0 12px; font-size: 12.5px; color: var(--discret); text-align: end; }
.legende-oblig b { color: var(--alerte); font-weight: 700; }
/* Le message rouge sous le champ : caché, il se déplie seulement quand le champ obligatoire est vide. */
.champ .manque { display: none; font-size: 12.5px; font-weight: 600; color: var(--alerte); }
.champ.erreur .manque { display: block; animation: manque-entre 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
.champ.erreur .manque + .aide { display: none; }
.champ.erreur input, .champ.erreur select { animation: secoue 0.32s ease both; }
.coche.erreur { color: var(--alerte); }
.coche.erreur input { outline: 2px solid var(--alerte); outline-offset: 2px; border-radius: 4px; }
@keyframes manque-entre { from { opacity: 0; transform: translateY(-4px); } }
@keyframes secoue { 20% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .champ.erreur .manque, .champ.erreur input, .champ.erreur select { animation: none; } }

/* Confirmation « lien envoyé » : une coche qui se dessine. */
.succes-compte { text-align: center; padding: 8px 4px 4px; }
.succes-compte svg { width: 56px; height: 56px; fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 10px; }
.succes-compte circle { opacity: 0.18; }
.succes-compte path { stroke-dasharray: 34; stroke-dashoffset: 34; animation: trace 0.45s 0.15s ease-out forwards; }
.succes-compte b { display: block; font-size: 19px; letter-spacing: -0.02em; }
.succes-compte p { color: var(--discret); margin: 8px auto 6px; max-width: 36ch; font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .succes-compte path { animation: none; stroke-dashoffset: 0; } }

/* Boutons du reçu : « Partager le ticket » prend toute la largeur, les deux autres se partagent la ligne dessous. */
.boutons-recu .btn-large { flex: 1 1 100%; }
.boutons-recu + .liens-compte { margin-top: 12px; }
.boutons-recu + .liens-compte a { text-decoration: none; }

/* Sur le grand bloc sombre du tableau, le rouge est éclairci pour rester lisible. */
.hero .negatif { color: #ff9a8b !important; }

/* Mosaïque des crédits sur téléphone : deux cartes côte à côte, plus compactes, pour voir plus de clients d'un coup. */
@media (max-width: 720px) {
  .mosaique-clients { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tuile-client { padding: 14px 12px; gap: 8px; border-radius: 18px; }
  .tuile-client .avatar-age { width: 44px; height: 44px; }
  .tuile-client .avatar-age span { inset: 7px; font-size: 12px; }
  .tuile-client .tc-haut .pastille, .tuile-client .tc-haut > :not(.avatar-age) { font-size: 11px; padding: 3px 8px; white-space: nowrap; }
  .tc-nom b { font-size: 14.5px; }
  .tc-nom span { font-size: 12px; }
  .tc-montant { font-size: 18px; }
  .tc-montant .autre { font-size: 12px; }
  .tc-actions { grid-template-columns: 1fr; gap: 6px; }
  .tc-actions .btn { min-height: 38px; font-size: 13.5px; }
}
@media (max-width: 330px) { .mosaique-clients { grid-template-columns: 1fr; } }

/* Petits écrans : les grands montants (« 1 262 950 KMF ») tiennent en entier dans leur case. */
@media (max-width: 430px) { .graph-faits b { font-size: 16px; } .graph-faits > div { padding: 12px 13px; } }

/* ---------- Menu du bas flottant (téléphone) ----------
   Le menu ne touche plus les bords : il est « suspendu » au-dessus de la page, comme une île.
   Il garde SA couleur (encre indigo) en mode clair comme en mode sombre, et cette couleur
   glisse très lentement d'une nuance à l'autre (même idée que la signature MMBT du bas de page). */
.onglets {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 6px; gap: 2px; border: 0; border-radius: 26px; overflow: hidden; isolation: isolate;
  background-color: #17153a;
  background-image: linear-gradient(110deg, #14122e 0%, #2a2580 28%, #4338ca 50%, #3a2a8f 72%, #14122e 100%);
  background-size: 300% 100%;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 18px 40px -14px rgba(20, 18, 60, 0.65), 0 2px 8px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: onglets-couleur 16s ease-in-out infinite alternate;
}
@keyframes onglets-couleur { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .onglets { animation: none; background-position: 40% 0; } }
.onglets a, [data-theme="dark"] .onglets a { color: rgba(255, 255, 255, 0.66); border-radius: 20px; padding: 7px 2px 6px; transition: color 0.2s, background-color 0.25s; }
.onglets a[aria-current="page"], [data-theme="dark"] .onglets a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.onglets .compte { box-shadow: 0 0 0 2px #2a2580; }
/* Ce qui flotte au-dessus du menu remonte d'autant. */
.barre-panier { bottom: calc(86px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(158px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .toast { bottom: 28px; } }
[data-simple="1"] .barre-panier { bottom: calc(98px + env(safe-area-inset-bottom)); }
[data-simple="1"] .toast { bottom: calc(176px + env(safe-area-inset-bottom)); }

/* ---------- Import d'articles en lot ---------- */
.imp-choix { display: grid; gap: 10px; margin: 12px 0 4px; }
.imp-choix .cat-libre { margin-top: 0; border-style: solid; border-color: var(--bord); background: var(--surface); }
.imp-choix .cat-libre:disabled { opacity: 0.45; }
@media (min-width: 720px) { .imp-choix { grid-template-columns: repeat(3, minmax(0, 1fr)); } .imp-choix .cat-libre { flex-direction: column; align-items: flex-start; } }
.imp-entree { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.imp-colle { margin-top: 14px; }
.imp-colle textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.imp-erreur, .imp-alerte { display: flex; gap: 10px; align-items: flex-start; color: var(--alerte); }
.imp-erreur svg, .imp-alerte svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.imp-alerte { padding: 11px 13px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--alerte) 40%, transparent); margin-bottom: 12px; font-size: 14px; font-weight: 550; }
.imp-dernier { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 14px 0 0; }
/* Barre d'attente : elle va et vient tant qu'on ne connaît pas l'avancement, puis elle se remplit. */
.imp-attente { margin-top: 16px; padding: 18px 16px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.imp-attente b { display: block; margin-top: 12px; font-size: 14.5px; }
.imp-attente small { display: block; margin-top: 3px; color: var(--discret); font-size: 13px; }
.imp-barre { height: 6px; border-radius: 99px; background: var(--bord); overflow: hidden; }
.imp-barre i { display: block; height: 100%; width: 35%; border-radius: 99px; background: var(--accent); animation: imp-va 1.3s ease-in-out infinite alternate; }
.imp-barre i.mesure { animation: none; transition: width 0.3s ease; }
@keyframes imp-va { from { transform: translateX(-20%); } to { transform: translateX(205%); } }
[dir="rtl"] .imp-barre i:not(.mesure) { animation-direction: alternate-reverse; }
@media (prefers-reduced-motion: reduce) { .imp-barre i { animation: none; width: 100%; opacity: 0.5; } }
/* Les trois chiffres du bilan */
.imp-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.imp-chiffres > div { padding: 11px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.imp-chiffres b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.imp-chiffres span { display: block; font-size: 12px; color: var(--discret); line-height: 1.3; }
.imp-chiffres .attention b { color: var(--alerte); }
/* Le tableau à vérifier : il défile dans les deux sens, les titres restent en haut. */
.imp-table-zone { margin: 14px 0 6px; border: 1px solid var(--bord); border-radius: 14px; overflow: auto; max-height: 46vh; -webkit-overflow-scrolling: touch; background: var(--surface); }
.imp-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.imp-table th { position: sticky; top: 0; z-index: 1; padding: 8px 6px; background: var(--surface-2); border-bottom: 1px solid var(--bord); text-align: start; vertical-align: top; }
.imp-table th select { width: 100%; min-width: 132px; min-height: 38px; padding: 6px 26px 6px 10px; border-radius: 9px; border: 1px solid var(--bord-fort); background-color: var(--surface); font-size: 14px; font-weight: 600; }
.imp-table th small { display: block; margin: 4px 2px 0; font-size: 11.5px; font-weight: 500; color: var(--discret); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.imp-table td { padding: 0; border-bottom: 1px solid var(--bord); }
.imp-table tr:last-child td { border-bottom: 0; }
.imp-table td input { display: block; width: 100%; min-width: 96px; min-height: 42px; padding: 8px 10px; border: 0; border-radius: 0; background: transparent; font-size: 16px; }
.imp-table td:first-child input { min-width: 170px; }
.imp-table td input:focus { outline: none; background: var(--accent-doux); box-shadow: inset 0 0 0 2px var(--accent); }
.imp-table tr.incomplete td { background: color-mix(in srgb, var(--alerte) 9%, transparent); }
.imp-table tr.incomplete td:first-child { box-shadow: inset 3px 0 0 var(--alerte); }
[dir="rtl"] .imp-table tr.incomplete td:first-child { box-shadow: inset -3px 0 0 var(--alerte); }
.imp-retirer { display: grid; place-items: center; width: 40px; height: 42px; border: 0; background: none; color: var(--discret); }
.imp-retirer svg { width: 17px; height: 17px; }
.imp-maj { margin-top: 14px; }
.imp-maj[hidden] { display: none; }
@media (min-width: 720px) { .feuille:has(.imp-table) { max-width: 920px; } .imp-table td input { font-size: 14.5px; min-height: 38px; } }

/* Autorisations du téléphone (vraie appli) */
.acces-intro { margin: 0 0 6px; color: var(--discret); font-size: 14px; line-height: 1.45; }
.acces-ligne { justify-content: flex-start; }
.acces-ligne .txt { flex: 1; min-width: 0; }
.acces-icone { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2, rgba(127,127,127,0.12)); color: var(--accent); }
.acces-icone svg { width: 20px; height: 20px; }
.pastille-ok, .pastille-non { flex: none; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; }
.pastille-ok { color: #15803d; background: rgba(22, 163, 74, 0.12); }
.pastille-non { color: #b91c1c; background: rgba(220, 38, 38, 0.12); }
[data-theme="dark"] .pastille-ok { color: #4ade80; }
[data-theme="dark"] .pastille-non { color: #f87171; }

/* Glisser entre onglets : pages « aperçu » des onglets voisins, dessinées à l'avance hors de l'écran.
   Elles ont leur propre calque graphique (will-change) : les déplacer ne coûte presque rien. */
.vue-apercu { position: fixed; left: 0; right: 0; top: 0; height: 100vh; overflow: hidden; pointer-events: none; will-change: transform; z-index: 1; background: var(--fond); }
.vue-apercu *, .vue.sans-animation * { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }
@media (min-width: 1024px) { .vue-apercu { display: none; } }
