:root {
  --fond: #f4f5f2;
  --carte: #ffffff;
  --texte: #1c2321;
  --doux: #66706c;
  --bord: #e2e5e0;
  --accent: #0f766e;
  --accent-fonce: #0b5a54;
  --accent-clair: #e3f2ef;
  --or: #b7791f;
  --or-clair: #fdf3dc;
  --rouge: #c0392b;
  --rouge-clair: #fbe9e7;
  --vert: #1e8449;
  --vert-clair: #e5f5ea;
  --orange-money: #ff7900;
  --mtn: #e5b800;
  --ombre: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .05);
  --rayon: 14px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #111614;
    --carte: #1a201e;
    --texte: #e8ece9;
    --doux: #9aa5a0;
    --bord: #2a3330;
    --accent: #2bb3a3;
    --accent-fonce: #5fd0c2;
    --accent-clair: #16302c;
    --or: #e0a84a;
    --or-clair: #2e2615;
    --rouge: #ef6f61;
    --rouge-clair: #2f1916;
    --vert: #4cc27a;
    --vert-clair: #15291c;
    --ombre: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --fond: #111614;
    --carte: #1a201e;
    --texte: #e8ece9;
    --doux: #9aa5a0;
    --bord: #2a3330;
    --accent: #2bb3a3;
    --accent-fonce: #5fd0c2;
    --accent-clair: #16302c;
    --or: #e0a84a;
    --or-clair: #2e2615;
    --rouge: #ef6f61;
    --rouge-clair: #2f1916;
    --vert: #4cc27a;
    --vert-clair: #15291c;
    --ombre: none;
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
.chargement { padding: 40px; text-align: center; color: var(--doux); }
.nombre { font-variant-numeric: tabular-nums; }

/* ---------- Mise en page ---------- */
.coquille { min-height: 100vh; display: flex; }
.lateral { display: none; }
.colonne { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.principal { width: 100%; min-width: 0; padding: 12px max(16px, env(safe-area-inset-left, 0px)) calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right, 0px)); max-width: 1200px; margin: 0 auto; }
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.entete h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.entete .sous { color: var(--doux); font-size: 14px; }

.nav-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--carte); border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bas a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--doux); text-decoration: none; font-size: 12px; font-weight: 500;
}
.nav-bas a svg { width: 24px; height: 24px; }
.nav-bas a.actif { color: var(--accent); }

@media (min-width: 900px) {
  .nav-bas { display: none; }
  .lateral {
    display: flex; flex-direction: column; width: 230px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
    background: var(--carte); border-right: 1px solid var(--bord); padding: 18px 12px; overflow-y: auto;
  }
  .lateral .marque { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 10px 18px; }
  .lateral .marque img { width: 32px; height: 32px; }
  .lateral a {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px;
    color: var(--texte); text-decoration: none; font-weight: 500; margin-bottom: 2px;
  }
  .lateral a svg { width: 20px; height: 20px; color: var(--doux); }
  .lateral a:hover { background: var(--fond); }
  .lateral a.actif { background: var(--accent-clair); color: var(--accent-fonce); }
  .lateral a.actif svg { color: var(--accent); }
  .lateral .pied { margin-top: auto; font-size: 13px; color: var(--doux); padding: 10px; }
  .principal { padding: 20px 28px 40px; }
}

/* ---------- Composants ---------- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte.pad { padding: 16px; }
.section-titre { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin: 22px 2px 8px; }
.grille { display: grid; gap: 12px; }
.grille.kpi { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grille.kpi { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grille.kpi { grid-template-columns: repeat(6, 1fr); } }
.kpi .carte { padding: 14px; }
.kpi .lib { font-size: 13px; color: var(--doux); }
.kpi .val { font-size: 21px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.kpi .val.neg { color: var(--rouge); }
.kpi .val.pos { color: var(--vert); }
.kpi .note { font-size: 12px; color: var(--doux); margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte);
  padding: 10px 16px; border-radius: 11px; font-weight: 600; cursor: pointer; min-height: 44px; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn.principal-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.principal-btn:hover { background: var(--accent-fonce); }
.btn.danger { color: var(--rouge); border-color: var(--rouge); background: transparent; }
.btn.plein { width: 100%; }
.btn.grand { min-height: 54px; font-size: 18px; }
.btn.petit { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icone { border: none; background: none; padding: 8px; cursor: pointer; color: var(--doux); border-radius: 8px; display: inline-flex; }
.btn-icone:hover { background: var(--fond); }

label.champ { display: block; margin-bottom: 12px; }
label.champ > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--doux); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--bord); border-radius: 11px; background: var(--carte); min-height: 44px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-clair); }
input.pin { font-size: 24px; letter-spacing: .4em; text-align: center; }

.recherche { position: relative; }
.recherche input, .recherche input:not([type=checkbox]) { padding-left: 42px; font-size: 17px; }
.recherche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--doux); }

.segment { display: flex; background: var(--fond); border: 1px solid var(--bord); border-radius: 12px; padding: 3px; gap: 3px; }
.segment button { flex: 1; border: none; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--doux); }
.segment button.actif { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }

.puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce { flex-shrink: 0; border: 1px solid var(--bord); background: var(--carte); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.puce.actif { background: var(--accent); color: #fff; border-color: var(--accent); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fond); color: var(--doux); white-space: nowrap; }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }
.badge.or { background: var(--or-clair); color: var(--or); }
.badge.vert { background: var(--vert-clair); color: var(--vert); }
.badge.accent { background: var(--accent-clair); color: var(--accent-fonce); }
.badge.orange { background: #fff1e6; color: #c25b00; }
.badge.mtn { background: #fff8d6; color: #8a6d00; }
@media (prefers-color-scheme: dark) { .badge.orange { background: #3a2412; color: #ffa65c; } .badge.mtn { background: #33300f; color: #f0d256; } }

.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
.liste > li:last-child { border-bottom: none; }
.liste > li.cliquable { cursor: pointer; }
.liste > li.cliquable:hover { background: var(--fond); }
.liste .corps { flex: 1; min-width: 0; }
.liste .titre { font-weight: 600; overflow-wrap: anywhere; }
.liste .meta { font-size: 13px; color: var(--doux); margin-top: 2px; }
.liste .droite { text-align: right; flex-shrink: 0; }
.liste .montant { font-weight: 700; }
.liste .vide { justify-content: center; color: var(--doux); padding: 28px; }
.stock-pastille { min-width: 44px; text-align: center; font-weight: 700; font-size: 15px; padding: 5px 8px; border-radius: 10px; background: var(--fond); }
.stock-pastille.bas { background: var(--or-clair); color: var(--or); }
.stock-pastille.zero { background: var(--rouge-clair); color: var(--rouge); }

.alerte { padding: 12px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.alerte.or { background: var(--or-clair); color: var(--or); }
.alerte.rouge { background: var(--rouge-clair); color: var(--rouge); }
.alerte.info { background: var(--accent-clair); color: var(--accent-fonce); }
.alerte svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

.barre-hors-ligne { background: var(--or-clair); color: var(--or); font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 12px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Vente ---------- */
.vente-zone { display: grid; gap: 16px; }
@media (min-width: 900px) { .vente-zone { grid-template-columns: 1fr 380px; align-items: start; } .panier { position: sticky; top: 24px; } }
.resultats { margin-top: 12px; max-height: none; }
.prod-ligne .prix { font-weight: 700; }
.prod-ligne .prix.manque { color: var(--or); font-weight: 600; font-size: 13px; }
.ajout-btn { width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--accent-clair); color: var(--accent-fonce); font-size: 24px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.panier h2 { font-size: 17px; margin: 0; }
.panier .entete-panier { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--bord); }
.panier-ligne { padding: 12px 16px; border-bottom: 1px solid var(--bord); }
.panier-ligne .haut { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.panier-ligne .bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.qte { display: inline-flex; align-items: center; border: 1px solid var(--bord); border-radius: 11px; overflow: hidden; }
.qte button { width: 40px; height: 38px; border: none; background: var(--fond); font-size: 20px; cursor: pointer; }
.qte span { min-width: 40px; text-align: center; font-weight: 700; }
.prix-libre { max-width: 150px; min-height: 38px !important; padding: 7px 10px !important; }
.panier .pied-panier { padding: 14px 16px; }
.total-ligne { display: flex; justify-content: space-between; margin: 4px 0; color: var(--doux); }
.total-ligne.grand { color: var(--texte); font-size: 22px; font-weight: 800; margin: 10px 0 14px; }
.panier-flottant { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 15; }
@media (min-width: 900px) { .panier-flottant { display: none; } }

/* ---------- Graphique ---------- */
.histo { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 8px 4px 0; }
.histo .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.histo .barre { width: 100%; max-width: 38px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.histo .lib { font-size: 11px; color: var(--doux); margin-top: 6px; white-space: nowrap; }

.repartition { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--fond); margin: 10px 0; }
.repartition div { height: 100%; }
.legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---------- Modale & toasts ---------- */
.voile { position: fixed; inset: 0; background: rgba(10, 15, 13, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .voile { align-items: center; padding: 20px; } }
.modale { background: var(--carte); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modale { border-radius: 20px; } }
.modale h2 { margin: 0 0 4px; font-size: 20px; }
.modale .sous { color: var(--doux); font-size: 14px; margin-bottom: 16px; }
.modale .actions { display: flex; gap: 10px; margin-top: 16px; }
.modale .actions .btn { flex: 1; }
.code-geant { font-size: 40px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 18px; border: 2px dashed var(--accent); border-radius: 16px; color: var(--accent-fonce); margin: 12px 0; font-family: ui-monospace, Menlo, Consolas, monospace; }

#toasts { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--texte); color: var(--carte); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: entre .2s ease-out; }
.toast.erreur { background: var(--rouge); color: #fff; }
.toast.succes { background: var(--vert); color: #fff; }
@keyframes entre { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Connexion ---------- */
.connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.connexion .carte { width: 100%; max-width: 380px; padding: 28px 22px; }
.connexion .logo { width: 64px; height: 64px; display: block; margin: 0 auto 14px; }
.connexion h1 { text-align: center; font-size: 22px; margin: 0 0 4px; }
.connexion p.sous { text-align: center; color: var(--doux); margin: 0 0 22px; font-size: 15px; }

.ligne-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ligne-flex > * { flex: 1; min-width: 0; }
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.discret { color: var(--doux); font-size: 14px; }
.cache { display: none !important; }
.prix-saisie { display: flex; gap: 8px; }
.prix-saisie input { min-height: 38px; padding: 7px 10px; width: 110px; }
.prix-saisie input.enregistre { border-color: var(--vert); }
.lien { color: var(--accent); background: none; border: none; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; }
.voile.dialogue { z-index: 55; }

/* ---------- Marque AyeCompta ---------- */
.mot-marque { font-weight: 700; letter-spacing: -.02em; color: var(--texte); }
.mot-marque b { color: var(--accent); font-weight: 800; }
.mot-marque.grand { display: block; font-size: 30px; margin-bottom: 4px; }
.connexion h1 .mot-marque { font-size: inherit; }

/* ---------- Après la vente ---------- */
.succes-vente { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--vert-clair); color: var(--vert); }
.succes-vente svg { width: 34px; height: 34px; flex-shrink: 0; }
.succes-vente .discret { color: inherit; opacity: .85; }
.montant-geant { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.btn.whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn.whatsapp svg { width: 18px; height: 18px; }
.actions-facture { flex-wrap: wrap; }
.etapes ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }

/* ---------- Facture ---------- */
.facture { --f-encre: #1c2321; --f-doux: #5f6965; --f-trait: #dfe3df; --f-fond: #ffffff; --f-accent: #0f766e;
  background: var(--f-fond); color: var(--f-encre); border: 1px solid var(--f-trait); border-radius: 12px; padding: 18px 16px; font-size: 14px; color-scheme: light; }
.f-entete { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--f-accent); color: var(--f-doux); font-size: 13px; }
.f-boutique { font-size: 18px; font-weight: 800; color: var(--f-encre); margin-bottom: 2px; }
.f-titre { text-align: right; flex-shrink: 0; }
.f-titre > div:first-child { font-weight: 800; letter-spacing: .12em; color: var(--f-accent); }
.f-num { font-weight: 700; color: var(--f-encre); font-variant-numeric: tabular-nums; }
.f-client { padding: 10px 0; border-bottom: 1px solid var(--f-trait); }
.f-client span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--f-doux); }
.f-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.f-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--f-doux); padding: 8px 4px 6px; border-bottom: 1px solid var(--f-trait); }
.f-table td { padding: 7px 4px; border-bottom: 1px solid var(--f-trait); vertical-align: top; }
.f-table th:not(:first-child), .f-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.f-totaux { display: grid; gap: 4px; margin-top: 8px; }
.f-totaux > div { display: flex; justify-content: space-between; gap: 10px; color: var(--f-doux); }
.f-totaux .f-total { color: var(--f-encre); font-size: 18px; font-weight: 800; padding: 6px 0; }
.f-pied { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--f-trait); text-align: center; color: var(--f-doux); }
.f-pied span { font-size: 11px; opacity: .8; }


/* ================= Version 2 : boutiques, crédits, bilans ================= */
.neg { color: var(--rouge); }
.pos { color: var(--vert); }
.barre-haut {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 18;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--fond); border-bottom: 1px solid var(--bord);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 19; background: var(--fond); }
@media (min-width: 900px) { .barre-haut { padding: 12px 28px; } }
.boutique-btn {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
  border: 1px solid var(--bord); background: var(--carte); border-radius: 12px; padding: 6px 12px 6px 6px; cursor: pointer; min-height: 44px;
}
.boutique-btn:disabled { cursor: default; opacity: 1; }
.boutique-btn .nom-b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boutique-btn .chev { width: 18px; height: 18px; color: var(--doux); flex-shrink: 0; }
.logo-b { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; flex-shrink: 0; background: #fff; border: 1px solid var(--bord); }
.logo-b.vide { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-clair); color: var(--accent-fonce); font-weight: 800; font-size: 13px; border: none; }
.cloche { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--texte); }
.cloche svg { width: 22px; height: 22px; }
.pastille-n { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--rouge); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.icone-rond { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-clair); color: var(--accent-fonce); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icone-rond svg { width: 20px; height: 20px; }
.icone-rond.rouge { background: var(--rouge-clair); color: var(--rouge); }
.icone-rond.or { background: var(--or-clair); color: var(--or); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-clair); color: var(--accent-fonce); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.liste > li.non-lue { background: var(--accent-clair); }
.liste > li.en-retard { box-shadow: inset 4px 0 0 var(--rouge); }
.lib-champ { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--doux); }
label.case { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; font-weight: 500; }
label.case input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.cases-b { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.segment.quatre button { font-size: 13px; padding: 9px 4px; }
.bloc-credit { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--rouge-clair); }
.bloc-credit .champ { margin-bottom: 8px; }
.bloc-credit .segment { background: var(--carte); }
.succes-vente.credit { background: var(--or-clair); color: var(--or); }
.modale.large { max-width: 680px; }
.credit-resume { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.credit-resume > div { background: var(--fond); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.credit-resume span { display: block; font-size: 12px; color: var(--doux); }
.credit-resume b { font-size: 16px; overflow-wrap: anywhere; }
.credit-resume .rouge b { color: var(--rouge); }
.rappel-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rappel-btns .btn { flex: 1 1 130px; }
.rappel-btns svg, .actions-facture svg { width: 18px; height: 18px; }
.code-txt { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
.kpi.trois { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grille.deux-blocs { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); margin-top: 0; }
.connexion .carte.inscription { max-width: 560px; }
.connexion .liste { text-align: left; border: 1px solid var(--bord); border-radius: 12px; }
.choix-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.apercu-logo { width: 64px; height: 64px; border-radius: 14px; border: 1px dashed var(--bord); display: inline-flex; align-items: center; justify-content: center; color: var(--doux); background: #fff; overflow: hidden; }
.apercu-logo img { width: 100%; height: 100%; object-fit: contain; }
.apercu-logo svg { width: 26px; height: 26px; }
label.btn input[type=file] { display: none; }
textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--bord); border-radius: 11px; background: var(--carte); resize: vertical; }
.apercu-message { background: var(--fond); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.apercu-message > div { margin-top: 4px; }

/* Mes boutiques */
.grille-boutiques { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.carte-boutique { text-align: left; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 12px; color: var(--texte); }
.carte-boutique:hover { border-color: var(--accent); }
.carte-boutique.courante { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-clair); }
.cb-haut { display: flex; align-items: center; gap: 10px; }
.cb-haut .logo-b { width: 40px; height: 40px; }
.cb-nom { flex: 1; min-width: 0; }
.cb-nom .titre { font-weight: 700; overflow-wrap: anywhere; }
.cb-nom .meta { font-size: 13px; color: var(--doux); }
.cb-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cb-chiffres > div { background: var(--fond); border-radius: 10px; padding: 8px; min-width: 0; }
.cb-chiffres span { display: block; font-size: 11px; color: var(--doux); }
.cb-chiffres b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.cb-chiffres small { color: var(--doux); font-size: 11px; }

/* Facture : logo et crédit */
.f-id { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.f-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.f-reste { color: #b0301f !important; font-weight: 800; }
.f-annulee { text-align: center; color: #b0301f; font-weight: 800; letter-spacing: .1em; border: 2px solid #b0301f; border-radius: 8px; padding: 4px; margin-top: 6px; }

/* Bilan */
.bilan { --f-encre: #1c2321; --f-doux: #5f6965; --f-trait: #dfe3df; background: #fff; color: var(--f-encre); border: 1px solid var(--f-trait); border-radius: 12px; padding: 18px 16px; color-scheme: light; }
.bilan .discret { color: var(--f-doux); }
.bl-entete { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 2px solid #0f766e; margin-bottom: 12px; }
.bl-entete .f-boutique { font-size: 18px; font-weight: 800; }
.bl-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; }
.bl-bloc { border: 1px solid var(--f-trait); border-radius: 10px; padding: 10px 12px; }
.bl-bloc h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #0f766e; }
.bl-ligne { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--f-trait); font-size: 14px; }
.bl-ligne:last-child { border-bottom: none; }
.bl-ligne span { color: var(--f-doux); min-width: 0; overflow-wrap: anywhere; }
.bl-ligne b { white-space: nowrap; }
.bl-ligne.total b { font-size: 16px; }
.bl-ligne.neg b { color: #b0301f; }
.bl-ligne.pos b { color: #1e8449; }
.bilan .f-pied { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--f-trait); text-align: center; color: var(--f-doux); font-size: 11px; }

/* Impression (facture A5, bilan A4) */
#impression { display: none; }
@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; }
  body::before { display: none; }
  #app, #modal-racine, #toasts, .voile { display: none !important; }
  #impression { display: block; }
  #impression .facture, #impression .bilan { border: none; padding: 0; }
  .impression-facture { max-width: 148mm; margin: 0 auto; }
}
.pastille-n[hidden] { display: none; }
.ligne-echeance { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 10px 0; }

/* ================= Version 3 : commandes, statistiques, assistant, import, synchro ================= */
.barre-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.ligne-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.barre-hors-ligne { flex-wrap: wrap; }
.entete { flex-wrap: wrap; }

/* Import */
.zone-fichier { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--bord); border-radius: 14px; cursor: pointer; text-align: center; font-weight: 600; }
.zone-fichier:hover { border-color: var(--accent); background: var(--accent-clair); }
.zone-fichier svg { width: 28px; height: 28px; color: var(--accent); }
.zone-fichier input { display: none; }
.grille-import { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0 12px; }
.table-defile { overflow-x: auto; max-width: 100%; }
.t-simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-simple th { text-align: left; font-size: 12px; font-weight: 600; color: var(--doux); padding: 8px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.t-simple td { padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.t-simple tr:last-child td { border-bottom: none; }
.t-simple td.nombre { white-space: nowrap; }
.t-simple tr.ligne-courante td { background: var(--accent-clair); }
.credit-resume.quatre { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* Commandes */
input.mini { width: 96px; min-height: 36px !important; padding: 6px 8px !important; }
.liste > li.eteint { opacity: .5; }
.liste .coche { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.liste .qte-cmd { width: 80px; flex-shrink: 0; text-align: center; min-height: 40px !important; padding: 6px !important; font-weight: 700; }
.pied-cmd { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; z-index: 5; }
@media (min-width: 900px) { .pied-cmd { bottom: 12px; } }
.t-cmd td:first-child { min-width: 160px; }
label.case.petit { font-size: 13px; margin: 4px 0 0; }
label.case.petit input { width: 16px; height: 16px; }
.btn svg { width: 18px; height: 18px; }

/* Statistiques */
.var { font-weight: 700; font-size: 13px; white-space: nowrap; }
.var.hausse { color: var(--vert); }
.var.baisse { color: var(--rouge); }
.var.neutre { color: var(--doux); }
.histo-12 { height: 170px; }
.histo .val-barre { font-size: 10px; color: var(--doux); margin-bottom: 3px; white-space: nowrap; }

/* Assistant */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 220px; margin-bottom: 12px; }
.chat-vide { text-align: center; color: var(--doux); padding: 26px 12px; border: 1px dashed var(--bord); border-radius: 14px; }
.chat-vide svg { width: 34px; height: 34px; color: var(--accent); }
.bulle { max-width: min(680px, 92%); padding: 12px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.bulle.moi { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bulle.ia { align-self: flex-start; background: var(--carte); border: 1px solid var(--bord); border-bottom-left-radius: 4px; }
.bulle.ia p { margin: 0 0 6px; }
.bulle.ia ul { margin: 4px 0 8px; padding-left: 20px; }
.bulle.ia li { margin: 3px 0; }
.bulle.ia li.num { list-style: none; margin-left: -20px; }
.bulle.attente { color: var(--doux); font-style: italic; }
.bulle .moteur { font-size: 12px; margin-top: 6px; }
.calculs { margin-top: 8px; background: var(--fond); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.calculs summary { cursor: pointer; font-weight: 600; color: var(--accent-fonce); }
.alerte.petite { padding: 8px 10px; font-size: 13px; }
.zone-question { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; margin-top: 10px; background: var(--fond); padding: 6px 0; }
@media (min-width: 900px) { .zone-question { bottom: 12px; } }
.zone-question input { flex: 1; min-width: 0; }
#exemples .puce { white-space: nowrap; }
.liste > li input.qte-cmd { width: 80px; }
input.mini, .t-simple input.mini { width: 96px; }
.t-cmd input.mini { width: 72px; }

/* v3.1 : saisie rapide sur trois prix (achat, détail, gros) sans déborder sur téléphone */
.liste .prix-saisie input { flex: 1 1 0; min-width: 0; width: auto; max-width: 120px; }

/* v4 : transferts en 3 étapes */
.etapes-tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.etapes-tr > div { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 10px; font-size: 13px; line-height: 1.35; }
.etapes-tr b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-clair); color: var(--accent-fonce); margin-right: 6px; font-size: 12px; }
.etapes-tr small { display: block; color: var(--doux); margin-top: 3px; }
.suivi-tr { display: grid; gap: 2px; margin: 12px 0; }
.suivi-tr > div { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; color: var(--doux); }
.suivi-tr > div > span { flex: 0 0 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bord); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.suivi-tr > div.fait { color: var(--texte); }
.suivi-tr > div.fait > span { background: var(--vert); border-color: var(--vert); color: #fff; }
.suivi-tr small { display: block; color: var(--doux); font-size: 12.5px; }
.txt-or { color: var(--or); font-weight: 600; }
@media (max-width: 520px) { .etapes-tr { grid-template-columns: 1fr; } }

/* v4 : facture fournisseur */
.ff-reglages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.ff-frais { margin: 4px 0 6px; }
.ff-frais .ligne-flex { gap: 10px; flex-wrap: wrap; }
.ff-ligne { padding: 10px 12px; margin-bottom: 8px; }
.ff-ligne.eteint { opacity: .5; }
.ff-l1, .ff-l3 { display: flex; align-items: center; gap: 8px; }
.ff-l1 .ff-des { flex: 1; min-width: 0; font-weight: 600; }
.ff-l2 { display: grid; grid-template-columns: 80px 120px 1fr; gap: 10px; margin: 8px 0; align-items: end; }
.ff-l2 label span, .ff-res span { display: block; font-size: 12px; color: var(--doux); margin-bottom: 3px; }
.ff-l2 input { width: 100%; min-width: 0; }
.ff-res { text-align: right; }
.ff-res b { font-size: 17px; display: block; }
.ff-res small { display: block; font-size: 12px; }
.ff-l3 { flex-wrap: wrap; }
.ff-l3 input { flex: 1 1 180px; min-width: 0; }
.ff-totaux { margin: 10px 0; }
td.neg, .nombre.neg { color: var(--rouge); }
@media (max-width: 560px) {
  .ff-reglages { grid-template-columns: 1fr; }
  .ff-l2 { grid-template-columns: 70px 1fr; }
  .ff-res { grid-column: 1 / -1; text-align: left; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .ff-res b, .ff-res span, .ff-res small { display: inline; margin: 0; }
}

/* ===== v4 : métiers ===== */
.icone-rond.vert { background: var(--vert-clair); color: var(--vert); }
.txt-rouge { color: var(--rouge); font-weight: 600; }
.txt-vert { color: var(--vert); font-weight: 600; }
/* Choix du type d'activité */
.choix-activite { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.activite-carte { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1.5px solid var(--bord); border-radius: 12px; background: var(--carte); cursor: pointer; }
.activite-carte input { position: absolute; opacity: 0; pointer-events: none; }
.activite-carte b { display: block; font-size: 14px; }
.activite-carte small { display: block; color: var(--doux); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.activite-carte:has(input:checked) { border-color: var(--accent); background: var(--accent-clair); }
.activite-carte:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .choix-activite { grid-template-columns: 1fr; } }
.kpi-metier { margin-bottom: 12px; }
.kpi-metier a.carte { text-decoration: none; color: inherit; }
/* Dossiers */
.dos-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dos-tete h2 { margin-bottom: 2px; }
.dos-client { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.etapes-dos { display: flex; flex-wrap: wrap; gap: 6px; }
.barre-progres { height: 10px; background: var(--fond); border-radius: 99px; overflow: hidden; border: 1px solid var(--bord); }
.barre-progres > div { height: 100%; background: var(--vert); border-radius: 99px; }
.ticket-infos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 10px 0; }
.ticket-infos > div span { display: block; font-size: 12px; color: var(--doux); }
.ticket-infos > div b { font-weight: 600; overflow-wrap: anywhere; }
.dos-totaux { margin-top: 10px; }
.dos-details { margin-top: 12px; }
.dos-details summary { cursor: pointer; color: var(--doux); font-weight: 600; padding: 6px 0; }
.bulle-message { white-space: pre-wrap; background: var(--accent-clair); margin: 10px 0; }
.grille-champs .champ.plein { grid-column: 1 / -1; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); resize: vertical; box-sizing: border-box; }
@media (max-width: 520px) { .ticket-infos { grid-template-columns: 1fr; } }
/* Restaurant */
.grille-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.table-carte { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; min-height: 96px; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--bord); background: var(--carte); color: var(--texte); font: inherit; cursor: pointer; }
.table-carte.occupee { border: 1.5px solid var(--accent); background: var(--accent-clair); }
.table-carte.a-servir { border-color: var(--vert); box-shadow: 0 0 0 3px var(--vert-clair); }
.table-carte .t-nom { font-weight: 700; font-size: 16px; }
.table-carte .t-total { font-weight: 700; color: var(--accent-fonce); }
.table-carte .t-info { font-size: 12.5px; color: var(--doux); }
.grille-plats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0; }
.plat-btn { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); font: inherit; cursor: pointer; min-height: 64px; }
.plat-btn:active { background: var(--accent-clair); }
.plat-btn span { font-weight: 600; font-size: 14px; line-height: 1.25; }
.plat-btn b { color: var(--accent-fonce); font-size: 13px; }
.ticket-lignes { max-height: 34vh; overflow-y: auto; }
.note-plat { margin-top: 4px; min-height: 34px; padding: 6px 10px; font-size: 13px; width: 100%; }
.stock-pastille.plat { background: var(--accent-clair); color: var(--accent-fonce); }
.stock-pastille.plat svg { width: 18px; height: 18px; }
.grille-bons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bon { padding: 0; overflow: hidden; border-top: 5px solid var(--accent); }
.bon.attente { border-top-color: var(--or); }
.bon.urgent { border-top-color: var(--rouge); }
.bon-tete { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; background: var(--fond); }
.bon-tete b { font-size: 17px; }
.bon-tete span { color: var(--doux); font-size: 13px; }
.bon ul { list-style: none; margin: 0; padding: 0; }
.bon li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--bord); font-size: 16px; }
.bon li.pret { opacity: .55; }
.bon-note { font-size: 13px; color: var(--rouge); font-weight: 600; }
/* Pharmacie */
.bloc-ordo { margin-top: 10px; }
.bloc-ordo > b { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.bloc-ordo > b svg { width: 18px; height: 18px; }
.t-echeancier td small { display: block; font-size: 12px; margin-top: 2px; }

/* ---------- Messagerie ---------- */
body.page-messages .principal { max-width: 1300px; padding-bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); }
.msg-app { display: grid; grid-template-columns: 1fr; gap: 14px; height: calc(100dvh - 76px - var(--nav-h) - env(safe-area-inset-bottom) - 20px); min-height: 380px; }
.msg-app .msg-fil { display: none; }
.msg-app.avec-fil .msg-liste { display: none; }
.msg-app.avec-fil .msg-fil { display: flex; }
@media (min-width: 900px) {
  body.page-messages .principal { padding-bottom: 20px; }
  .msg-app { grid-template-columns: 340px 1fr; height: calc(100dvh - 76px - 40px); }
  .msg-app .msg-fil, .msg-app.avec-fil .msg-liste { display: flex; }
  .fil-tete .retour { display: none; }
}
.msg-liste { display: flex; flex-direction: column; overflow: hidden; }
.msg-liste-tete { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
.msg-liste-tete h1 { font-size: 20px; margin: 0; }
.msg-liste .liste { overflow-y: auto; flex: 1; }
.conv .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .corps { min-width: 0; }
.conv.actif { background: var(--accent-clair); }
.meta.gras { color: var(--texte); font-weight: 700; }
.conv-droite { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.pastille-n.statique { position: static; }
.avatar.groupe { background: var(--or-clair); color: var(--or); }
.avatar.groupe svg { width: 20px; height: 20px; }
.avatar.patron { background: var(--accent); color: #fff; }
.avatar.petit { width: 32px; height: 32px; font-size: 12px; }
.msg-fil { flex-direction: column; overflow: hidden; min-width: 0; }
.msg-vide { margin: auto; text-align: center; color: var(--doux); padding: 30px; max-width: 360px; }
.msg-vide svg { width: 44px; height: 44px; color: var(--accent); }
.msg-vide.petit { margin-top: 30px; }
.fil-tete { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--bord); }
.fil-tete .corps { flex: 1; min-width: 0; }
.fil-tete .titre { font-weight: 700; }
.fil-tete .meta { font-size: 13px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil-tete .retour svg { transform: rotate(90deg); width: 22px; height: 22px; }
.fil-tete .btn-icone svg { width: 22px; height: 22px; }
.fil-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--fond); overscroll-behavior: contain; }
.plus-anciens { align-self: center; margin-bottom: 8px; }
.sep-jour { text-align: center; margin: 10px 0 6px; }
.sep-jour span { font-size: 12px; color: var(--doux); background: var(--carte); border: 1px solid var(--bord); border-radius: 999px; padding: 3px 10px; text-transform: capitalize; }
.msg { align-self: flex-start; max-width: min(78%, 520px); background: var(--carte); border: 1px solid var(--bord); border-radius: 16px 16px 16px 4px; padding: 7px 11px 5px; position: relative; overflow-wrap: anywhere; }
.msg.mien { align-self: flex-end; background: var(--accent-clair); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.msg.avec-media { padding: 4px 4px 5px; }
.msg.avec-media .texte, .msg.avec-media .auteur, .msg.avec-media .pied-msg { padding-left: 7px; padding-right: 7px; }
.msg .auteur { font-size: 12px; font-weight: 700; color: var(--accent-fonce); margin-bottom: 2px; }
.msg .texte { line-height: 1.4; }
.msg .texte a { color: var(--accent-fonce); }
.msg .supprime { color: var(--doux); font-style: italic; }
.pied-msg { font-size: 11px; color: var(--doux); text-align: right; margin-top: 2px; display: flex; justify-content: flex-end; gap: 3px; align-items: center; }
.pied-msg .suppr { border: none; background: none; color: var(--doux); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 0 0 6px; opacity: .5; }
.pied-msg .suppr:hover { opacity: 1; color: var(--rouge); }
.media-img { border: none; padding: 0; background: none; cursor: zoom-in; display: block; }
.media-img img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; }
.msg video { display: block; max-width: 100%; max-height: 340px; border-radius: 12px; background: #000; }
.vocal { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.vocal svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.vocal audio { height: 36px; max-width: 240px; min-width: 0; flex: 1; }
.vocal .discret { white-space: nowrap; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px; text-decoration: none; color: var(--texte); background: var(--carte); border-radius: 10px; }
.doc svg { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }
.doc small { display: block; color: var(--doux); }
.photo-grande { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 12px; }
.fil-envoi:empty { display: none; }
.fil-envoi { padding: 6px 12px; border-top: 1px solid var(--bord); }
.envoi-cours { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--doux); }
.envoi-cours span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envoi-cours progress { width: 120px; accent-color: var(--accent); }
.fil-saisie { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--bord); background: var(--carte); }
.fil-saisie .btn-icone svg { width: 24px; height: 24px; }
.saisie-zone { flex: 1; min-width: 0; }
.saisie-zone textarea { width: 100%; resize: none; min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; line-height: 1.35; }
.case-sms { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--doux); margin: 4px 6px 0; cursor: pointer; }
.btn-rond { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.btn-rond svg { width: 21px; height: 21px; }
.btn-rond[hidden] { display: none; }
.enregistrement { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--bord); background: var(--carte); }
.enregistrement #chrono { font-weight: 700; font-variant-numeric: tabular-nums; }
.enregistrement .discret { flex: 1; }
.point-rouge { width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); animation: clignote 1s infinite; }
@keyframes clignote { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .point-rouge { animation: none; } }
.choix-joindre { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.choix-joindre button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; cursor: pointer; color: var(--texte); font: inherit; }
.choix-joindre svg { width: 28px; height: 28px; color: var(--accent); }
.choix-joindre small { color: var(--doux); }
.liste-cases { max-height: 280px; overflow-y: auto; margin-bottom: 10px; }
.liste-dest { max-height: 260px; overflow-y: auto; padding: 2px 12px; margin-bottom: 12px; }
.liste-dest label.case { margin: 8px 0; }
.dest-tete { justify-content: space-between; margin-bottom: 6px; }
.sms-outils { justify-content: space-between; align-items: center; margin: -4px 0 10px; }
.etapes-android { margin: 6px 0; padding-left: 20px; }
.etapes-android li { margin: 3px 0; }
.sms-outils > *, .dest-tete > * { flex: 0 1 auto !important; width: auto; }
.sms-outils .discret { text-align: right; }

/* ---------- Abonnement, bandeaux, plateforme ---------- */
#bandeaux:empty { display: none; }
#bandeaux { padding: 10px max(16px, env(safe-area-inset-left, 0px)) 0; max-width: 1200px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { #bandeaux { padding: 14px 28px 0; } }
.bandeau { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte); font-size: 14px; }
.bandeau > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.bandeau > span { flex: 1; min-width: 0; }
.bandeau .btn { flex-shrink: 0; }
.bandeau.or { background: var(--or-clair); border-color: transparent; }
.bandeau.or > svg { color: var(--or); }
.bandeau.accent, .bandeau.info { background: var(--accent-clair); border-color: transparent; }
.essai-info { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: var(--accent-clair); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
.essai-info svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
details.code-inscr { margin: 4px 0 12px; }
details.code-inscr summary { cursor: pointer; color: var(--accent-fonce); font-weight: 600; padding: 6px 0; }
.etat-abo { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.etat-abo.fini { background: var(--rouge-clair); border-color: transparent; }
.offre { text-align: center; }
.offre-prix { font-size: 40px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-fonce); }
.offre-prix small { font-size: 16px; font-weight: 500; color: var(--doux); margin-left: 6px; }
.offre-liste { list-style: none; padding: 0; margin: 14px auto 0; text-align: left; max-width: 420px; display: grid; gap: 8px; }
.offre-liste li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.offre-liste svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.etapes-paiement { margin: 0 0 12px; padding-left: 20px; }
.etapes-paiement li { margin: 6px 0; }
.etapes-paiement ul { margin: 6px 0; padding-left: 18px; }
.connexion.bloque { align-items: flex-start; }
.large-bloque { max-width: 560px !important; text-align: left; }
.large-bloque > h1, .large-bloque > .logo, .large-bloque > .sous { text-align: center; }
.large-bloque > .sous { margin-bottom: 18px; }
.actions-bloque { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; }
.actions-bloque .btn { width: 100%; }
.actions-bloque .btn svg { width: 18px; height: 18px; }
.kpi .val.petit-val { font-size: 18px; }
.onglets-pf { overflow-x: auto; }
.onglets-pf button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.onglets-pf .pastille-n[hidden] { display: none; }
a.alerte { text-decoration: none; color: inherit; }
.connexion .large-bloque .carte { max-width: none; padding: 16px; }
.connexion .large-bloque .carte .liste { margin: -16px; }
@media (max-width: 520px) { #f-demande .deux-col, #pf-prol .deux-col { grid-template-columns: 1fr; gap: 0; } }
.etapes-paiement .nombre { white-space: nowrap; }

/* ---------- Bloc-notes ---------- */
.note-rapide { display: flex; gap: 8px; padding: 8px; margin-bottom: 12px; }
.note-rapide input { flex: 1; border: none !important; box-shadow: none !important; }
.note-rapide .btn { flex: 0 0 auto; }
.note-rapide .btn svg { width: 18px; height: 18px; }
.notes-outils { flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.notes-outils .segment { flex: 0 1 auto; }
.grille-notes { columns: 1; column-gap: 12px; }
@media (min-width: 640px) { .grille-notes { columns: 2; } }
@media (min-width: 1100px) { .grille-notes { columns: 3; } }
.grille-notes > * { break-inside: avoid; margin-bottom: 12px; display: block; }
.note { padding: 12px 14px; cursor: pointer; }
.note:focus-visible { outline: 2px solid var(--accent); }
.note-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.note h3 { margin: 2px 0 6px; font-size: 16px; overflow-wrap: anywhere; }
.note .epingle { padding: 4px; opacity: .35; }
.note .epingle.actif { opacity: 1; color: var(--accent); }
.note .epingle svg { width: 18px; height: 18px; }
.note-texte { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 15px; }
.note-liste { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.note-liste li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.note-liste .barre { text-decoration: line-through; color: var(--doux); }
.coche { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 2px solid var(--bord); background: var(--carte); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.coche.fait { background: var(--accent); border-color: var(--accent); }
.note-liste.edition input { flex: 1; min-height: 38px; padding: 6px 10px; }
.note-progres { margin-top: 6px; font-size: 12px; }
.note-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; }
.note-pied .badge { display: inline-flex; align-items: center; gap: 4px; }
.note-pied .badge svg { width: 12px; height: 12px; }
.vide-notes { text-align: center; color: var(--doux); }
.vide-notes svg { width: 36px; height: 36px; color: var(--accent); }
.note-jaune { background: #fff6cc; border-color: #f0dc8a; }
.note-vert { background: #e3f5e6; border-color: #b9e1c1; }
.note-bleu { background: #e2effc; border-color: #b6d3f2; }
.note-rose { background: #fde7ee; border-color: #f2bccd; }
.note-violet { background: #efe6fb; border-color: #d3c1f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note-jaune { background: #3a3417; border-color: #5a4f1f; } :root:not([data-theme="light"]) .note-vert { background: #173322; border-color: #24503a; } :root:not([data-theme="light"]) .note-bleu { background: #172a3d; border-color: #24425f; } :root:not([data-theme="light"]) .note-rose { background: #3a1c27; border-color: #5a2c3d; } :root:not([data-theme="light"]) .note-violet { background: #2b2140; border-color: #45366a; } }
.form-note { border-radius: 14px; padding: 4px; margin: -4px; }
.form-note .titre-note { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.couleurs-note { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pastille-couleur { cursor: pointer; }
.pastille-couleur input { position: absolute; opacity: 0; pointer-events: none; }
.pastille-couleur span { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bord); }
.pastille-couleur.note-blanc span { background: var(--carte); }
.pastille-couleur.note-jaune span { background: #fff1a8; } .pastille-couleur.note-vert span { background: #bfe8c8; } .pastille-couleur.note-bleu span { background: #bcd9f7; } .pastille-couleur.note-rose span { background: #f7c3d4; } .pastille-couleur.note-violet span { background: #d9c7f5; }
.pastille-couleur input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-clair); }
.pastille-couleur input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- 5.1 : paiement en ligne, reçus, avis, marque ---------- */
.connexion { flex-direction: column; }
.signature { text-align: center; color: var(--doux); font-size: 13px; margin: 14px 0 0; }
.alerte.vert { background: var(--vert-clair); border-color: transparent; }
.alerte.vert svg { color: var(--vert); }
.paiement-direct { margin-top: 12px; }
.paiement-direct .btn svg { width: 20px; height: 20px; }
.recu-abo { font-size: 14px; }
.recu-tete { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); margin-bottom: 12px; }
.marque-recu { font-size: 22px; } .marque-recu b { color: var(--accent); }
.recu-titre { font-size: 20px; font-weight: 800; letter-spacing: .08em; color: var(--accent-fonce); }
.recu-client { margin-bottom: 12px; line-height: 1.5; }
.recu-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.recu-table td { padding: 8px 0; border-bottom: 1px solid var(--bord); vertical-align: top; }
.recu-table td:last-child { text-align: right; }
.recu-table tr.total td { font-weight: 800; font-size: 16px; border-bottom: none; }
.note-avis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
.note-avis label, .echelle-avis label { cursor: pointer; text-align: center; }
.note-avis input, .echelle-avis input { position: absolute; opacity: 0; pointer-events: none; }
.note-avis span { display: block; font-size: 30px; padding: 8px 0; border-radius: 12px; border: 2px solid transparent; filter: grayscale(.6); }
.note-avis small { display: block; font-size: 11px; color: var(--doux); }
.note-avis input:checked + span { border-color: var(--accent); background: var(--accent-clair); filter: none; }
.note-avis input:focus-visible + span, .echelle-avis input:focus-visible + span { outline: 2px solid var(--accent); }
.echelle-avis { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.echelle-avis span { display: block; padding: 9px 0; border-radius: 8px; border: 1px solid var(--bord); font-weight: 700; font-size: 14px; }
.echelle-avis input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.echelle-legende { justify-content: space-between; font-size: 12px; margin: 4px 0 12px; }
.liste-propositions label.case { margin: 8px 0; font-weight: 400; align-items: flex-start; }
.merci-avis { text-align: center; }
.merci-avis svg { width: 44px; height: 44px; color: var(--or); }
.barre-avis { display: grid; grid-template-columns: 28px 1fr 30px; align-items: center; gap: 8px; margin: 6px 0; }
.barre-avis div { background: var(--fond); border-radius: 6px; height: 12px; overflow: hidden; }
.barre-avis i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
@media (max-width: 700px) { .avis-cols { grid-template-columns: 1fr; } }
@media print { .impression-facture .recu-abo { max-width: 148mm; margin: 0 auto; } }
.code-long { font-size: 18px; font-weight: 700; text-align: center; padding: 16px 10px; margin: 12px 0; background: var(--fond); border-radius: 12px; overflow-wrap: anywhere; user-select: all; }

.nowrap { white-space: nowrap; }

/* Connexion : aide pour les employés · accès d'un nouvel employé */
.aide-employe { margin: 16px 0 0; font-size: 14px; }
.aide-champ { display: block; margin-top: 6px; color: var(--doux); font-size: 13px; line-height: 1.4; font-weight: 400; }
.aide-champ svg { width: 14px; height: 14px; vertical-align: -2px; }
.choix-langue { display: inline-flex; align-items: center; gap: 6px; color: var(--doux); font-size: 14px; }
.connexion .choix-langue { display: flex; justify-content: center; margin: 14px auto 0; }
.choix-langue svg { width: 18px; height: 18px; flex-shrink: 0; }
.choix-langue select { width: auto; min-height: 0; padding: 6px 28px 6px 10px; font-size: 14px; border-radius: 10px; }
.liste li > .choix-langue { flex-shrink: 0; }
.devise-boutique { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-clair); color: var(--accent-fonce); margin-left: 6px; vertical-align: 2px; }
.acces-employe { display: grid; gap: 10px; margin: 14px 0 4px; }
.acces-employe > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.acces-employe b { font-size: 17px; letter-spacing: .02em; overflow-wrap: anywhere; }

/* ---------- Dépôt Orange Money / MTN → code par WhatsApp ---------- */
.etapes-depot { margin: 0; padding: 0; list-style: none; counter-reset: etape; display: grid; gap: 14px; }
.etapes-depot > li { counter-increment: etape; position: relative; padding-left: 40px; line-height: 1.5; }
.etapes-depot > li::before { content: counter(etape); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-clair); color: var(--accent-fonce); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.numeros-depot { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.numeros-depot li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--fond, #f4f4f2); border-radius: 10px; padding: 8px 10px; }
.numeros-depot li span { color: var(--doux); font-size: 14px; }
.numeros-depot li b { font-size: 18px; letter-spacing: .02em; white-space: nowrap; }
.numeros-depot li .btn { margin-left: auto; }
.numeros-depot li .btn svg { width: 15px; height: 15px; }
.suivi-depot { display: flex; gap: 10px; align-items: flex-start; background: var(--or-clair, #fdf3d8); border-color: transparent; margin-bottom: 12px; font-size: 15px; }
.suivi-depot.ok { background: var(--accent-clair); }
.suivi-depot svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--accent-fonce); }
#f-demande .principal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#f-demande .principal-btn svg { width: 18px; height: 18px; }
.boutons-demande { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 520px) { .boutons-demande { justify-content: flex-start; } }
