* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #1a1a2e;
  min-height: 100vh;
  font-size: 16px;
}

/* ÉCRANS */
.ecran { display: none; min-height: 100vh; flex-direction: column; }
.ecran.actif { display: flex; }

/* LOGIN */
#ecran-login {
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 16px;
  background: linear-gradient(160deg, #1a6b3c 0%, #0d4a2a 100%);
}
#ecran-login .logo { font-size: 64px; }
.logo-img { max-width: 180px; max-height: 110px; object-fit: contain; background: white; padding: 10px 16px; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
#ecran-login h1 { color: white; font-size: 28px; font-weight: 700; }
#ecran-login .card { width: 100%; max-width: 380px; }

/* CARTES */
.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* INPUTS */
input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: #1a6b3c; }
/* 👓 25/08, plainte de Baye : « parfois on ne voit pas les écritures ».
   La marge NÉGATIVE (-6px) faisait remonter le champ SUR le texte du
   libellé — sur téléphone ou avec une police agrandie, l'écriture
   disparaissait derrière le champ. Marges positives, libellé en bloc :
   le texte a toujours sa place. Les libellés qui portent leur propre
   style en ligne (cases à cocher, etc.) ne sont pas touchés. */
label { display: block; font-size: 14px; color: #666; font-weight: 500; margin: 10px 0 5px; }

/* BOUTONS */
.btn-vert {
  background: #1a6b3c;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-vert:active { transform: scale(0.97); background: #145530; }

.btn-bleu {
  background: #1565c0;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-bleu:active { background: #0d47a1; }

.btn-wave {
  background: #0076FF;
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-wave img { height: 28px; }

.grand { width: 100%; padding: 16px; font-size: 18px; }

/* ENTÊTE */
.entete {
  background: #1a6b3c;
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  min-height: 60px;
}
.entete.admin { background: #1565c0; }

.btn-retour {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}
.btn-deconnexion {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* GROS BOUTONS REPRÉSENTANT */
.actions-principales {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 16px 16px;
}
.gros-btn {
  aspect-ratio: 1;
  border-radius: 20px;
  font-weight: 700;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  min-height: 110px;
  max-height: 150px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Bouton large pleine largeur (compact) */
.btn-large {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
  transition: transform 0.1s;
}
.btn-large:active { transform: scale(0.98); }

/* STATS */
.stats-rapides {
  display: flex;
  gap: 12px;
  padding: 0 16px 24px;
}
.stat {
  flex: 1;
  background: white;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat span { font-size: 28px; font-weight: 700; color: #1a6b3c; }
.stat.rouge span { color: #c62828; }
.stat small { font-size: 12px; color: #888; }

/* FILTRES */
.filtres {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
}
.filtre {
  background: white;
  border: 2px solid #e8ecf0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.filtre.actif { background: #1a6b3c; color: white; border-color: #1a6b3c; }
.filtre.rouge.actif { background: #c62828; border-color: #c62828; }

/* LISTE ABONNÉS */
#liste-abonnes, #liste-abonnes-admin {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carte-abonne {
  background: white;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}
.carte-abonne .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.avatar.vert { background: #1a6b3c; }
.avatar.rouge { background: #c62828; }
.avatar.gris { background: #9e9e9e; }

.carte-abonne .infos { flex: 1; min-width: 0; }
/* 08/10 (Keur Gaye, écran étroit) : les badges de droite (« 🏠 Code maison · 11 app. ») écrasaient la colonne du texte jusqu’à
   une lettre par ligne — la colonne du texte garde 150 px, les badges passent dessous, à droite */
.carte-abonne { flex-wrap: wrap; }
.carte-abonne .infos { flex: 1 1 150px; min-width: 150px; }
.carte-abonne .detail { overflow-wrap: anywhere; }
.carte-abonne > .infos ~ div { margin-left: auto; }
.carte-abonne .nom { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-abonne .detail { font-size: 13px; color: #888; margin-top: 2px; }
.carte-abonne .badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.badge.actif { background: #e8f5e9; color: #1a6b3c; }
.badge.suspendu { background: #ffebee; color: #c62828; }

/* ADMIN */
.admin-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}
.admin-btn {
  background: white;
  border: 2px solid #e8ecf0;
  border-radius: 14px;
  padding: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.admin-btn:hover, .admin-btn.actif { background: #1565c0; color: white; border-color: #1565c0; }

/* Menu rangé par thèmes (groupes) */
.admin-menu.groupes { display: block; }
.admin-menu.groupes > .menu-groupe-titre:first-child { margin-top: 0; }
.menu-groupe-titre { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 4px 8px; }
.menu-sous-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.admin-section { padding: 0 16px 24px; }
.admin-section h2 { font-size: 18px; margin-bottom: 12px; color: #333; }
.admin-section.cache { display: none; }

/* CARTE VILLAGE ADMIN */
.carte-village {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.carte-village .village-titre { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.carte-village .village-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.village-stat { font-size: 13px; color: #555; }
.village-stat strong { color: #1a6b3c; }

/* REVENUS */
.carte-revenu {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.revenu-village { font-weight: 600; font-size: 15px; }
.revenu-montant { font-size: 18px; font-weight: 700; color: #1a6b3c; }

/* ACTIONS ADMIN SUR ABONNÉ */
.actions-abonne {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-action {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-reconnecter { background: #e8f5e9; color: #1a6b3c; }
.btn-deconnecter { background: #ffebee; color: #c62828; }

/* INFO BOX */
.info-box {
  background: #e8f5e9;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #2e7d32;
}

/* MESSAGES */
.erreur { color: #ffcccc; font-size: 14px; text-align: center; margin-top: 8px; }
.succes { color: #e8f5e9; font-size: 14px; text-align: center; margin-top: 8px; }
#ajout-message { padding: 0 16px; margin-top: 8px; font-size: 15px; }
.msg-ok { background: #e8f5e9; color: #1a6b3c; padding: 14px; border-radius: 12px; }
.msg-err { background: #ffebee; color: #c62828; padding: 14px; border-radius: 12px; }

/* PAIEMENT PAGE */
#ecran-paiement {
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 20px;
  background: linear-gradient(160deg, #0076FF 0%, #004db3 100%);
}
#ecran-paiement .logo { font-size: 64px; }
#ecran-paiement h2 { color: white; font-size: 22px; font-weight: 700; }
#ecran-paiement .card { width: 100%; max-width: 380px; gap: 16px; }
#paiement-info { font-size: 15px; line-height: 1.8; color: #333; }
#paiement-info strong { color: #0076FF; font-size: 20px; }

/* OVERLAY */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-size: 48px;
}
#overlay.cache { display: none; }

/* Masquage générique */
.cache { display: none !important; }

/* Carte cliquable (ouvre une page détail) */
.carte-clic { cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; }
.carte-clic:active { transform: scale(0.99); }
.carte-clic:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }

/* CHOIX DE SECTEUR */
#ecran-secteur { background: #f0f4f8; }
.secteur-btn {
  border: none;
  border-radius: 18px;
  padding: 24px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: transform 0.1s;
}
.secteur-btn:active { transform: scale(0.98); }

/* Sections boutique */
.boutique-section { padding-bottom: 24px; }
.boutique-section.cache { display: none; }

/* BADGE NOTIFICATION */
.badge-notif {
  display: none;
  background: #c62828;
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.badge-notif.actif { display: inline-block; }

/* ALERTES */
.carte-alerte {
  background: white;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #ccc;
}
.carte-alerte.haute { border-left-color: #c62828; }
.carte-alerte.moyenne { border-left-color: #f59e0b; }
.carte-alerte.info { border-left-color: #1565c0; }
.carte-alerte .alerte-icone { font-size: 24px; }
.carte-alerte .alerte-titre { font-weight: 600; font-size: 14px; }
.carte-alerte .alerte-detail { font-size: 13px; color: #888; margin-top: 2px; }

/* MATÉRIEL */
.carte-materiel {
  background: white;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.carte-materiel .mat-haut { display: flex; justify-content: space-between; align-items: flex-start; }
.carte-materiel .mat-nom { font-weight: 700; font-size: 15px; }
.carte-materiel .mat-cat { font-size: 12px; color: #888; }
.carte-materiel .mat-stock { font-size: 13px; padding: 3px 10px; border-radius: 10px; font-weight: 600; }
.mat-stock.ok { background: #e8f5e9; color: #1a6b3c; }
.mat-stock.bas { background: #ffebee; color: #c62828; }
.carte-materiel .mat-prix { color: #1565c0; font-weight: 700; }
.carte-materiel .mat-doc { background: #f8f9fa; border-radius: 8px; padding: 10px; font-size: 13px; margin-top: 8px; color: #555; white-space: pre-wrap; line-height: 1.5; }
.mat-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mat-actions button { font-size: 12px; padding: 6px 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* BILAN FINANCIER */
.bilan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bilan-card { background: white; border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.bilan-card .bc-label { font-size: 12px; color: #888; }
.bilan-card .bc-valeur { font-size: 18px; font-weight: 700; margin-top: 4px; }
.bc-valeur.positif { color: #1a6b3c; }
.bc-valeur.negatif { color: #c62828; }

/* GRAPHIQUES (barres) */
.graph {
  background: white;
  border-radius: 12px;
  padding: 16px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  overflow-x: auto;
}
.graph-barre {
  flex: 1;
  min-width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}
.graph-barre .gb-val { font-size: 10px; font-weight: 700; color: #1a6b3c; }
.graph-barre .gb-bar { width: 70%; background: linear-gradient(180deg, #1a6b3c, #2e9e5b); border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.3s; }
.graph-barre.bleu .gb-bar { background: linear-gradient(180deg, #1565c0, #42a5f5); }
.graph-barre.bleu .gb-val { color: #1565c0; }
.graph-barre .gb-label { font-size: 9px; color: #888; text-align: center; white-space: nowrap; }

/* TICKETS SAV */
.carte-ticket {
  background: white;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #ccc;
}
.carte-ticket.ouvert { border-left-color: #c62828; }
.carte-ticket.en_cours { border-left-color: #f59e0b; }
.carte-ticket.resolu { border-left-color: #1a6b3c; opacity: 0.7; }
.ticket-titre { font-weight: 700; font-size: 15px; }
.ticket-meta { font-size: 12px; color: #888; margin-top: 3px; }
.ticket-desc { font-size: 13px; color: #555; margin-top: 6px; }
.ticket-statut { font-size: 12px; padding: 3px 10px; border-radius: 10px; font-weight: 600; }
.ts-ouvert { background: #ffebee; color: #c62828; }
.ts-en_cours { background: #fff3e0; color: #e65100; }
.ts-resolu { background: #e8f5e9; color: #1a6b3c; }
.ticket-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ticket-actions button { font-size: 12px; padding: 6px 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* VIDE */
.vide {
  text-align: center;
  padding: 40px 20px;
  color: #aaa;
  font-size: 15px;
}
.vide span { font-size: 48px; display: block; margin-bottom: 12px; }

@media (max-width: 380px) {
  .gros-btn { font-size: 14px; min-height: 110px; }
  .stat span { font-size: 22px; }
}

/* ════════════════════════════════════════════════════════
   🔌 CHOIX DE L'APPAREIL VU PAR LE ROUTEUR
   Évite de recopier une adresse MAC à la main : les Tenda affichent
   souvent une adresse clonée qui change au redémarrage.
   ════════════════════════════════════════════════════════ */
.btn-choisir-app {
  width: 100%;
  margin-top: 8px;
  padding: 13px 12px;
  background: #00695c;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn-choisir-app:active { background: #004d40; }

.aide-mac {
  font-size: 12px;
  color: #00695c;
  background: #e0f2f1;
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  line-height: 1.45;
}

.avert-mac {
  font-size: 13px;
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  line-height: 1.45;
}

/* 📱 29/09 — abonné téléphone : le prix de l'opérateur (champ libre + ses prix habituels en un geste)
   et le récapitulatif de ce qui sera enregistré (remplace « 25 000 FCFA / 1 mois gratuit » écrits en dur) */
.montant-atl { display: flex; align-items: center; gap: 8px; }
.montant-atl input { flex: 1 1 auto; min-width: 0; font-size: 18px; font-weight: 700; }
.devise-atl { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: #1a6b3c; white-space: nowrap; }
.puces-atl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.puces-atl:empty { display: none; }
.puce-atl {
  border: 1.5px solid #a5d6a7;
  background: #fff;
  color: #1a6b3c;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.puce-atl.actif { background: #1a6b3c; color: #fff; border-color: #1a6b3c; }
.recap-atl {
  background: #f1f8e9;
  border: 1px solid #c5e1a5;
  border-radius: 12px;
  padding: 11px 13px;
  margin-top: 10px;
  font-size: 13px;
  color: #33691e;
  line-height: 1.6;
}
.recap-atl:empty { display: none; }
.recap-atl b { color: #1b5e20; }

.voile-appareils {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.boite-appareils {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.boite-appareils-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #00695c;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.boite-appareils-tete button {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 17px;
  cursor: pointer;
}
.boite-appareils-corps {
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.appareils-info {
  font-size: 13px;
  color: #555;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.appareils-vide {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  padding: 8px 4px 16px;
}

.appareil-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 10px;
  font-family: inherit;
  cursor: pointer;
}
.appareil-item:active { border-color: #00695c; background: #f1f8f6; }
.appareil-pris { background: #fafafa; border-color: #e0e0e0; }
.appareil-mac {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: .5px;
  font-family: ui-monospace, monospace;
}
.appareil-det { font-size: 12px; color: #666; margin-top: 3px; }
.appareil-badges { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge-clonee {
  font-size: 11px;
  font-weight: 700;
  color: #e65100;
  background: #fff3e0;
  border-radius: 6px;
  padding: 3px 7px;
}
.badge-pris {
  font-size: 11px;
  font-weight: 700;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 6px;
  padding: 3px 7px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🖥️ MODE SUPERMARCHÉ — 13 août 2026 (demande de Baye : « la boutique doit
   ressembler aux logiciels des supermarchés, comme la capture Diaba »).
   Sur GRAND ÉCRAN uniquement (ordinateur, caisse Android type SUNMI) :
   menu latéral fixe à gauche + tableaux de gestion. Le téléphone garde
   l'affichage actuel — les détaillants travaillent à une main.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 920px) {
  #ecran-boutique { background: #eef2f6; }
  #ecran-boutique .entete { position: sticky; top: 0; z-index: 50; }
  /* Le menu devient une barre latérale fixe, toujours visible (le
     display:none posé par cacherMenu est volontairement battu ici). */
  #ecran-boutique .admin-menu.groupes {
    display: block !important;
    position: fixed; left: 0; top: 60px; bottom: 0; width: 256px; overflow-y: auto;
    background: linear-gradient(180deg, #0d2743, #123a63);
    padding: 12px 10px 46px; margin: 0; box-shadow: 2px 0 12px rgba(0,0,0,.18); z-index: 40;
  }
  #ecran-boutique .menu-sous-grille { display: block !important; }
  #ecran-boutique .admin-menu .menu-groupe-titre {
    color: #8fb3d9 !important; font-size: 11px; text-transform: uppercase;
    letter-spacing: .09em; margin: 16px 8px 4px;
  }
  #ecran-boutique .admin-menu .admin-btn {
    display: block; width: 100%; text-align: left; background: transparent; color: #dfe9f4;
    border: none; border-radius: 9px; padding: 11px 12px; font-size: 14px; margin: 2px 0;
    cursor: pointer; font-weight: 600;
  }
  #ecran-boutique .admin-menu .admin-btn:hover { background: rgba(255,255,255,.09); }
  #ecran-boutique .admin-menu .admin-btn.actif { background: #1565c0; color: #fff; }
  #ecran-boutique .boutique-section { margin-left: 256px; padding: 16px 18px 30px; }
  #ecran-boutique .btn-retour-menu { display: none !important; }
  /* Produits : la table remplace les cartes sur grand écran */
  #ecran-boutique .prod-cartes { display: none; }
  #ecran-boutique .prod-table { display: block; }
}

/* 🛡️ SUPERADMIN au même habit que la boutique (15 août 2026, demande de Baye :
   « l'interface superadmin comme celle de la boutique ») : barre latérale
   fixe violette + contenu à droite sur grand écran ; téléphone inchangé
   (grille de menu, une rubrique à la fois). */
@media (min-width: 920px) {
  #ecran-superadmin { background: #eef2f6; min-height: 100vh; }
  #ecran-superadmin .entete { position: sticky; top: 0; z-index: 50; }
  #ecran-superadmin .admin-menu.groupes {
    display: block !important;
    position: fixed; left: 0; top: 60px; bottom: 0; width: 256px; overflow-y: auto;
    background: linear-gradient(180deg, #2a0a4d, #4a148c);
    padding: 12px 10px 46px; margin: 0; box-shadow: 2px 0 12px rgba(0,0,0,.18); z-index: 40;
  }
  #ecran-superadmin .menu-sous-grille { display: block !important; }
  #ecran-superadmin .admin-menu .menu-groupe-titre {
    color: #c9a6ef !important; font-size: 11px; text-transform: uppercase;
    letter-spacing: .09em; margin: 16px 8px 4px;
  }
  #ecran-superadmin .admin-menu .admin-btn {
    display: block; width: 100%; text-align: left; background: transparent; color: #ecdff8;
    border: none; border-radius: 9px; padding: 11px 12px; font-size: 14px; margin: 2px 0;
    cursor: pointer; font-weight: 600;
  }
  #ecran-superadmin .admin-menu .admin-btn:hover { background: rgba(255,255,255,.09); }
  #ecran-superadmin .admin-menu .admin-btn.actif { background: #7b1fa2; color: #fff; }
  #ecran-superadmin .boutique-section { margin-left: 256px; padding: 16px 18px 30px; }
  #ecran-superadmin .btn-retour-menu { display: none !important; }
}
/* 🧾 31/10 : dépassements — boutons au doigt, cartes qui ne débordent jamais à 375 px */
.dpc-btn { border: none; border-radius: 8px; padding: 9px 12px; min-height: 38px; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer; max-width: 100%; white-space: normal; }
.dpc-btn[disabled] { opacity: .45; cursor: not-allowed; }
.dpc-chip { border: 1px solid #b0bec5; background: #fff; color: #263238; border-radius: 16px; padding: 7px 11px; min-height: 34px; font-size: 12.5px; font-weight: 600; cursor: pointer; max-width: 100%; white-space: normal; text-align: left; }
.dpc-chip.actif { background: #263238; color: #fff; border-color: #263238; }
.dpc-pill { display: inline-block; color: #fff; border-radius: 10px; padding: 2px 8px; font-size: 11.5px; font-weight: 700; }
.dpc-carte { border: 1px solid #e3e8ee; border-radius: 8px; padding: 8px; margin-top: 8px; background: #fff; overflow-wrap: anywhere; }
/* 🧮 31/10 : réparer l'historique — le bouton et son message restent à l'écran sur une longue liste (body a overflow-x:hidden : position:sticky n'y tient pas) ; le bas et la droite restent libres pour la pastille de langue et la cloche */
.rhc-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 76px 56px 16px; background: #fff; border-top: 1px solid #cfd8dc; box-shadow: 0 -2px 8px rgba(20,40,60,.1); max-height: 45vh; overflow-y: auto; }
@media (min-width: 920px) { .rhc-barre { left: 256px; padding: 8px 76px 8px 16px; } }


/* 🌐 LE SECTEUR WIFI AU MÊME HABIT QUE LA BOUTIQUE (25 août 2026,
   demande de Baye, captures à l'appui : la boutique a sa barre latérale
   fixe sur grand écran, le WiFi affichait encore la grande grille de
   boutons pleine page). Même mécanique exactement, en VERT WiFi.
   Le téléphone ne change pas : grille de menu, une rubrique à la fois. */
@media (min-width: 920px) {
  #ecran-admin { background: #eef2f6; min-height: 100vh; }
  #ecran-admin .entete { position: sticky; top: 0; z-index: 50; }
  #ecran-admin .admin-menu.groupes {
    display: block !important;
    position: fixed; left: 0; top: 60px; bottom: 0; width: 256px; overflow-y: auto;
    background: linear-gradient(180deg, #0b3d23, #14532d);
    padding: 12px 10px 46px; margin: 0; box-shadow: 2px 0 12px rgba(0,0,0,.18); z-index: 40;
  }
  #ecran-admin .menu-sous-grille { display: block !important; }
  #ecran-admin .admin-menu .menu-groupe-titre {
    color: #9ed4b4 !important; font-size: 11px; text-transform: uppercase;
    letter-spacing: .09em; margin: 16px 8px 4px;
  }
  #ecran-admin .admin-menu .admin-btn {
    display: block; width: 100%; text-align: left; background: transparent; color: #e2f2e8;
    border: none; border-radius: 9px; padding: 11px 12px; font-size: 14px; margin: 2px 0;
    cursor: pointer; font-weight: 600;
  }
  #ecran-admin .admin-menu .admin-btn:hover { background: rgba(255,255,255,.09); }
  #ecran-admin .admin-menu .admin-btn.actif { background: #1a6b3c; color: #fff; }
  #ecran-admin .admin-section { margin-left: 256px; padding: 16px 18px 30px; }
  #ecran-admin .btn-retour-menu, #ecran-admin .retour-menu-admin { display: none !important; }
}

/* Table « Gestion des produits » (cachée sur téléphone) */
.prod-table { display: none; }
.prod-table .pt-scroll { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.prod-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 940px; }
.prod-table th {
  position: sticky; top: 0; background: #f2f6fa; color: #456; text-align: left;
  padding: 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid #e1e8ef; white-space: nowrap;
}
.prod-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.prod-table tr.pt-ligne { cursor: pointer; }
.prod-table tr.pt-ligne:hover { background: #f5f9fd; }
.pt-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-chip { border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap; display: inline-block; }
.pt-cb { font-family: monospace; font-size: 12px; color: #345; }
/* 📷 12/09 (Baye : « je ne vois plus les photos ») : la règle générale
   « img { max-width: 100% } » (02/09, compatibilité téléphone) écrase la
   vignette dans une cellule de tableau à largeur automatique — la cellule se
   calcule à zéro et l'image avec elle (largeur rendue : 0 px, constaté).
   Ici la vignette a une taille fixe, jamais bornée par la cellule. */
.prod-table th:first-child, .prod-table td:first-child { width: 44px; min-width: 44px; }
.prod-table td img { max-width: none; width: 34px; height: 34px; }


/* ══════════ 📱 BLINDAGE TÉLÉPHONE GLOBAL (02/09/2026, demande de Baye :
   « tout le système doit être compatible avec les écrans des téléphones ») ══════════
   Règle : AUCUN écran ne doit jamais défiler horizontalement. Les tableaux
   larges défilent DANS leur cadre (overflow-x:auto posé écran par écran) ;
   tout le reste se replie. Les animations restent actives sur téléphone. */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }
input, select, textarea { max-width: 100%; box-sizing: border-box; }
.card, .carte-revenu, .admin-section { word-wrap: break-word; min-width: 0; }
.carte-revenu { flex-wrap: wrap; }
@media (max-width: 640px) {
  .stats-rapides { flex-wrap: wrap; }
  .stats-rapides .stat { flex: 1 1 40%; min-width: 130px; }
  table { font-size: 12px; }
  .card { padding-left: 12px; padding-right: 12px; }
}
