/* ==========================================================================
   BUSINESS+ — Feuille de style principale
   Charte : Indigo #1B1F3B · Orange #FF8A00 · Sable #F6F1E7
            vert succès #27AE60 · rouge alerte #C0392B
   Typos : Archivo Black (titres/logo) · Inter (interface) · Space Mono (montants)
   Approche mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables de la charte graphique
   -------------------------------------------------------------------------- */
:root {
  /* Couleurs de marque BUSINESS+ */
  --indigo: #1B1F3B;
  --indigo-2: #2A2F5A;   /* dégradé d'en-tête */
  --orange: #FF8A00;
  --orange-fonce: #E67A00;
  --sable: #F6F1E7;
  --vert: #27AE60;
  --rouge: #C0392B;
  --orange-alerte: #E67E22;
  --blanc: #FFFFFF;

  /* Neutres */
  --encre: #1B1F3B;      /* texte principal */
  --gris-texte: #6B7280;
  --gris-clair: #EEF0F4;
  --bordure: #E7E2D6;    /* bordures douces sur fond sable */
  --fond: #FAF7F0;       /* fond général (sable très clair) */

  /* Alias de compatibilité (le code inline utilise encore ces noms) */
  --or: var(--orange);
  --or-fonce: var(--orange-fonce);
  --rose-poudre: var(--indigo);
  --rose-fonce: var(--indigo-2);
  --rose-voile: var(--fond);
  --anthracite: var(--encre);
  --orange-couleur: var(--orange-alerte);

  /* Rayons et ombres */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --ombre: 0 2px 10px rgba(27, 31, 59, 0.06);
  --ombre-forte: 0 6px 24px rgba(27, 31, 59, 0.16);

  /* Dimensions */
  --hauteur-nav: 68px;
  --tap: 48px;

  /* Typographies */
  --titre: 'Archivo Black', system-ui, -apple-system, sans-serif;
  --texte: 'Inter', system-ui, -apple-system, sans-serif;
  --montant: 'Space Mono', ui-monospace, 'Courier New', monospace;
}

/* --------------------------------------------------------------------------
   2. Réinitialisation et bases
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--texte);
  background: var(--fond);
  color: var(--encre);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--hauteur-nav) + env(safe-area-inset-bottom, 0px) + 32px);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--titre); font-weight: 400; color: var(--encre); letter-spacing: -.2px; }
h1 { font-size: 23px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; font-family: var(--texte); font-weight: 700; }

a { color: var(--orange-fonce); text-decoration: none; }
img { max-width: 100%; display: block; }

.cache { display: none !important; }

/* --------------------------------------------------------------------------
   3. En-tête de page (indigo)
   -------------------------------------------------------------------------- */
.entete {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-2) 100%);
  color: var(--sable);
  padding: 18px 16px 22px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--ombre);
  position: relative;
}
.entete .ligne { display: flex; align-items: center; gap: 12px; }
/* Icône carrée (le « + » orange sur carré indigo) : elle porte son propre
   fond et ses propres angles arrondis — ni fond blanc ni rognage ici. */
.entete .logo {
  width: 46px; height: 46px;
  object-fit: contain; flex: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  border-radius: 12px;
}
.entete h1 { font-size: 21px; color: var(--blanc); }
.entete .sous-titre { font-size: 12px; color: rgba(246,241,231,.75); margin-top: 2px; }
/* Sur-titre discret (nom du commerce / marque BUSINESS+) */
.entete .eyebrow {
  font-family: var(--texte);
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1px;
}
.entete .fermer { background: rgba(255,255,255,.16); color: var(--blanc); }

/* --------------------------------------------------------------------------
   4. Conteneur et cartes
   -------------------------------------------------------------------------- */
.conteneur { padding: 16px; max-width: 720px; margin: 0 auto; }

.carte {
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 14px;
  margin-bottom: 12px;
}
.carte-titre {
  font-family: var(--texte);
  font-weight: 700;
  font-size: 16px;
  color: var(--indigo);
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.grille-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat {
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 14px;
  border-left: 4px solid var(--orange);
}
.stat.rose { border-left-color: var(--indigo); }
.stat.rouge { border-left-color: var(--rouge); }
.stat.vert { border-left-color: var(--vert); }
.stat .libelle { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--gris-texte); }
.stat .valeur { font-family: var(--montant); font-weight: 700; font-size: 20px; margin-top: 4px; word-break: break-word; color: var(--indigo); }

/* --------------------------------------------------------------------------
   5. Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--texte);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-or { background: var(--orange); color: var(--blanc); box-shadow: 0 3px 10px rgba(255,138,0,.35); }
.btn-rose { background: var(--indigo); color: var(--blanc); }
.btn-clair { background: var(--gris-clair); color: var(--encre); }
.btn-contour { background: transparent; color: var(--orange-fonce); border: 1.5px solid var(--orange); }
.btn-rouge { background: var(--rouge); color: var(--blanc); }
.btn-vert { background: var(--vert); color: var(--blanc); }
.btn-bloc { width: 100%; }
.btn-petit { min-height: 38px; padding: 8px 14px; font-size: 13px; }

/* Bouton d'action flottant — le « + » BUSINESS+, toujours orange */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--hauteur-nav) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--blanc);
  font-size: 30px; line-height: 1; font-weight: 700;
  border: none;
  box-shadow: var(--ombre-forte);
  cursor: pointer;
  z-index: 40;
}

/* --------------------------------------------------------------------------
   6. Formulaires
   -------------------------------------------------------------------------- */
.champ { margin-bottom: 14px; }
.champ label {
  display: block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--gris-texte);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font-family: var(--texte);
  font-size: 16px;
  color: var(--encre);
  background: var(--blanc);
  border: 1.5px solid var(--bordure);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,138,0,.15);
}
.aide { font-size: 12px; color: var(--gris-texte); margin-top: 4px; }

.recherche { position: relative; margin-bottom: 12px; }
.recherche input { padding-left: 40px; }
.recherche::before {
  content: '🔍';
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .55;
}

.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.puce {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--blanc);
  border: 1.5px solid var(--bordure);
  font-size: 13px; font-weight: 600;
  color: var(--gris-texte);
  cursor: pointer;
  min-height: 38px;
}
.puce.actif { background: var(--orange); border-color: var(--orange); color: var(--blanc); }

/* --------------------------------------------------------------------------
   7. Badges et pastilles
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-rouge { background: rgba(192,57,43,.12); color: var(--rouge); }
.badge-vert { background: rgba(39,174,96,.12); color: var(--vert); }
.badge-orange { background: rgba(230,126,34,.14); color: #B35C0E; }
.badge-or { background: rgba(255,138,0,.16); color: var(--orange-fonce); }
.badge-rose { background: rgba(27,31,59,.10); color: var(--indigo); }
.badge-indigo { background: rgba(27,31,59,.10); color: var(--indigo); }
.badge-gris { background: var(--gris-clair); color: var(--gris-texte); }

/* Sous-valeur d'un indicateur (« dont 2 promesses en retard ») */
.stat .sous-valeur {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rouge);
  margin-top: 3px;
}

/* Ligne d'échéance / de variante : date/nom + montant/qté + corbeille */
.ligne-echeance {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ligne-echeance .e-date, .ligne-echeance .v-nom { flex: 1.3; min-width: 0; }
.ligne-echeance .e-montant, .ligne-echeance .v-qte { flex: 1; min-width: 0; }
.ligne-echeance .btn-rond { flex: none; }

/* --------------------------------------------------------------------------
   7 bis. Photo d'article
   -------------------------------------------------------------------------- */
.apercu-photo { margin-bottom: 10px; }
.apercu-photo img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bordure);
  margin-bottom: 8px;
  background: var(--sable);
}
.photo-detail {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid var(--bordure);
}

/* --------------------------------------------------------------------------
   8. Listes d'éléments
   -------------------------------------------------------------------------- */
.item {
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 13px 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  border-left: 4px solid transparent;
}
.item:active { box-shadow: var(--ombre-forte); }
.item.alerte { border-left-color: var(--rouge); }
.item .corps { flex: 1; min-width: 0; }
.item .titre { font-weight: 700; font-size: 15px; }

.detail {
  font-size: 12.5px; color: var(--gris-texte); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item .droite { text-align: right; flex: none; }
.item .prix { font-family: var(--montant); font-weight: 700; color: var(--indigo); font-size: 14px; }

.vignette {
  width: 52px; height: 52px; flex: none;
  border-radius: var(--radius-sm);
  background: var(--sable) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--titre); font-size: 20px; color: var(--indigo);
  border: 1px solid var(--bordure);
}

.vide {
  text-align: center;
  padding: 34px 18px;
  color: var(--gris-texte);
  font-size: 14px;
}
.vide .emoji { font-size: 34px; display: block; margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   9. Grille des variantes
   -------------------------------------------------------------------------- */
.grille-pointures { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.pointure {
  border: 1.5px solid var(--bordure);
  border-radius: var(--radius-sm);
  background: var(--blanc);
  padding: 8px 4px;
  text-align: center;
  min-height: var(--tap);
  cursor: pointer;
  font-family: var(--texte);
  color: var(--encre);
}
.pointure .p-num { font-weight: 700; font-size: 15px; }
.pointure .p-qte { font-size: 11px; color: var(--gris-texte); margin-top: 2px; }
.pointure.dispo { border-color: rgba(39,174,96,.5); background: rgba(39,174,96,.06); }
.pointure.rupture { opacity: .45; cursor: not-allowed; background: var(--gris-clair); }
.pointure.selection { border-color: var(--orange); background: rgba(255,138,0,.14); box-shadow: 0 0 0 2px rgba(255,138,0,.2); }

.ligne-ajust { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--bordure); }
.ligne-ajust:last-child { border-bottom: none; }
.ligne-ajust .p-label { min-width: 60px; font-weight: 700; }
.ligne-ajust .p-val { flex: 1; text-align: center; font-family: var(--montant); font-weight: 700; font-size: 18px; }
.btn-rond {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 1.5px solid var(--bordure);
  background: var(--blanc); font-size: 20px; line-height: 1;
  color: var(--encre); cursor: pointer;
}
.btn-rond:active { background: var(--gris-clair); }

/* --------------------------------------------------------------------------
   10. Panier de vente
   -------------------------------------------------------------------------- */
.ligne-panier {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed var(--bordure);
}
.ligne-panier:last-child { border-bottom: none; }
.ligne-panier .corps { flex: 1; min-width: 0; }
.total-panier {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; margin-top: 8px;
  background: rgba(255,138,0,.1);
  border-radius: var(--radius-sm);
}
.total-panier .montant { font-family: var(--montant); font-size: 20px; color: var(--orange-fonce); font-weight: 700; }

.barre-total {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--hauteur-nav) + env(safe-area-inset-bottom, 0px));
  background: var(--blanc);
  border-top: 1px solid var(--bordure);
  box-shadow: 0 -4px 16px rgba(27,31,59,.08);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  z-index: 30;
}
.barre-total .infos { flex: 1; min-width: 0; }
.barre-total .montant { font-family: var(--montant); font-size: 19px; font-weight: 700; color: var(--indigo); }
.barre-total .compte { font-size: 12px; color: var(--gris-texte); }

/* --------------------------------------------------------------------------
   11. Modales
   -------------------------------------------------------------------------- */
.modale {
  position: fixed; inset: 0;
  background: rgba(27,31,59,.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
  animation: fondu .18s ease;
}
.modale-boite {
  background: var(--blanc);
  width: 100%; max-width: 720px;
  border-top-left-radius: 24px; border-top-right-radius: 24px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  max-height: 92vh; overflow-y: auto;
  animation: monte .22s cubic-bezier(.2,.8,.3,1);
}
.modale-entete {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modale-entete h2 { font-size: 18px; color: var(--indigo); }
.fermer {
  background: var(--gris-clair); border: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer; color: var(--encre);
}
.actions-modale { display: flex; gap: 10px; margin-top: 16px; }
.actions-modale .btn { flex: 1; }

@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes monte { from { transform: translateY(28px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

/* --------------------------------------------------------------------------
   12. Notifications (toasts)
   -------------------------------------------------------------------------- */
#zone-toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: 14px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 32px); max-width: 420px;
}
.toast {
  background: var(--indigo); color: var(--blanc);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--ombre-forte);
  animation: descend .2s ease;
}
.toast.succes { background: var(--vert); }
.toast.erreur { background: var(--rouge); }
.toast.info { background: var(--indigo-2); }
@keyframes descend { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --------------------------------------------------------------------------
   13. Barre d'onglets fixe
   -------------------------------------------------------------------------- */
.nav-onglets {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--hauteur-nav) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--blanc);
  border-top: 1px solid var(--bordure);
  box-shadow: 0 -2px 14px rgba(27,31,59,.07);
  display: flex; z-index: 50;
}
.nav-onglets a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px; font-weight: 600; letter-spacing: -.1px;
  color: var(--gris-texte);
  text-decoration: none;
  position: relative;
}
.nav-onglets a .ic { font-size: 19px; line-height: 1; }
.nav-onglets a.actif { color: var(--orange-fonce); }
.nav-onglets a.actif::before {
  content: ''; position: absolute; top: 0;
  width: 28px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--orange);
}
.nav-onglets a .pastille {
  position: absolute; top: 6px; right: 50%; margin-right: -20px;
  background: var(--rouge); color: var(--blanc);
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--radius-pill);
  font-size: 10px; line-height: 17px; text-align: center; font-weight: 700;
}

/* --------------------------------------------------------------------------
   14. Écran de connexion
   -------------------------------------------------------------------------- */
body.page-login {
  padding-bottom: 0;
  background: linear-gradient(160deg, var(--indigo) 0%, var(--indigo-2) 55%, var(--indigo) 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.boite-login {
  background: var(--blanc);
  border-radius: 24px;
  box-shadow: var(--ombre-forte);
  padding: 30px 22px;
  width: 100%; max-width: 400px;
  text-align: center;
}
/* Mot-symbole large (1878x366) : largeur imposée, hauteur libre, aucun cadre
   ni fond — le contraindre dans un carré l'écrasait. */
.boite-login .mot-symbole {
  display: block;
  width: 200px; max-width: 70%; height: auto;
  margin: 0 auto 16px;
}
/* Le h1 de la page de connexion CONTIENT le mot-symbole (voir login.html) :
   il ne rend aucun texte, on neutralise ses marges par défaut. */
.boite-login h1 { margin: 0; }
.boite-login .slogan { font-family: var(--texte); font-style: italic; color: var(--orange-fonce); margin-bottom: 22px; font-size: 14px; }
.boite-login form { text-align: left; }

/* --------------------------------------------------------------------------
   15. Bannière d'installation PWA
   -------------------------------------------------------------------------- */
.banniere-install {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-fonce) 100%);
  color: var(--blanc);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--ombre);
}
.banniere-install .txt { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; }
.banniere-install .txt strong {
  display: block; font-family: var(--texte); font-weight: 700; font-size: 15px;
  white-space: nowrap;
  margin-bottom: 2px;
}
.banniere-install .btn { background: var(--blanc); color: var(--orange-fonce); min-height: 40px; padding: 8px 14px; font-size: 13px; }
.banniere-install .fermer { background: rgba(255,255,255,.25); color: var(--blanc); width: 30px; height: 30px; font-size: 15px; }

/* --------------------------------------------------------------------------
   15 bis. Mode hors ligne + abonnement
   -------------------------------------------------------------------------- */
.bandeau-hors-ligne {
  background: var(--indigo);
  color: var(--blanc);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  padding: 10px 16px;
  animation: descend .2s ease;
}
.bandeau-hors-ligne strong { font-weight: 700; }

/* Avertissement d'échéance d'abonnement (non bloquant) */
.bandeau-abonnement {
  background: rgba(230,126,34,.16);
  color: #9C4A0E;
  border-bottom: 1px solid rgba(230,126,34,.4);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  padding: 10px 16px;
}
.bandeau-abonnement strong { font-weight: 700; }

.indicateur-sync {
  background: rgba(255,138,0,.14);
  border: 1px solid rgba(255,138,0,.4);
  color: var(--orange-fonce);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.note-hors-ligne {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--gris-texte);
  background: var(--gris-clair);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* --------------------------------------------------------------------------
   15 ter. Écran bloquant plein (abonnement suspendu / compte non rattaché)
   -------------------------------------------------------------------------- */
.ecran-bloc {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--indigo) 0%, var(--indigo-2) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ecran-bloc-carte {
  background: var(--blanc);
  border-radius: 24px;
  box-shadow: var(--ombre-forte);
  padding: 30px 22px;
  width: 100%; max-width: 420px;
  text-align: center;
}
.ecran-bloc-carte h1 { color: var(--indigo); font-size: 22px; margin-bottom: 10px; }
.ecran-bloc-carte p { color: var(--gris-texte); font-size: 14px; margin-bottom: 12px; line-height: 1.5; }
.ecran-bloc-emoji { font-size: 48px; margin-bottom: 10px; }
/* Bloc d'identifiants d'un compte créé (récapitulatif admin ET gérant) */
.recap-ident {
  background: var(--sable);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 13px;
  word-break: break-all;
  line-height: 1.6;
}

/* Mot-symbole en tête des écrans bloquants (suspendu / compte sans commerce) */
.ecran-bloc-logo {
  display: block;
  width: 170px; max-width: 65%; height: auto;
  margin: 0 auto 16px;
}

/* --------------------------------------------------------------------------
   16. Divers
   -------------------------------------------------------------------------- */
.chargement { text-align: center; padding: 30px; color: var(--gris-texte); font-size: 14px; }
.separateur { height: 1px; background: var(--bordure); margin: 14px 0; }
.rangee { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.rangee .cle { color: var(--gris-texte); font-size: 13px; }
.rangee .val { font-weight: 600; font-size: 14px; text-align: right; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mono-montant { font-family: var(--montant); font-weight: 700; }
.lien-discret { font-size: 12px; color: var(--gris-texte); text-decoration: underline; background: none; border: none; cursor: pointer; padding: 8px; }
.texte-rouge { color: var(--rouge); }
.texte-vert { color: var(--vert); }
.texte-or { color: var(--orange-fonce); }

.prix-barre {
  text-decoration: line-through;
  color: var(--gris-texte);
  opacity: .75;
  font-size: .92em;
}

/* Carte du solde de caisse */
.carte-solde { text-align: left; }
.carte-solde .valeur-solde {
  font-family: var(--montant);
  font-size: 28px;
  font-weight: 700;
  margin-top: 2px;
  word-break: break-word;
}

/* Tablette / desktop */
@media (min-width: 600px) {
  .nav-onglets a { font-size: 12px; letter-spacing: 0; }
}
@media (min-width: 768px) {
  .grille-stats { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   Barres de trésorerie et d'objectifs (P3d)
   Barres CSS PURES : aucune bibliothèque de graphiques à charger pour quatre
   rectangles. La largeur est posée en pourcentage par le script.
   ========================================================================== */
.barre-semaine { margin-bottom: 14px; }
.barre-semaine.mois-courant { padding-left: 8px; border-left: 3px solid var(--orange); }

.barre-entete {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 5px;
}
.barre-entete .cle { font-size: 12.5px; color: var(--texte-doux, #6B6B6B); min-width: 0; }
.barre-entete .val { font-size: 13.5px; white-space: nowrap; }

.barre-piste {
  height: 14px; border-radius: 7px; overflow: hidden;
  background: var(--bordure);
}
.barre-remplie {
  height: 100%; border-radius: 7px; position: relative;
  background: linear-gradient(90deg, var(--indigo) 0%, var(--indigo-2) 100%);
  transition: width .35s ease;
  min-width: 3px;
}
.barre-remplie.atteint {
  background: linear-gradient(90deg, var(--vert) 0%, #2ECC71 100%);
}
/* Part déjà en retard, superposée en rouge au début de la barre. */
.barre-retard {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--rouge); border-radius: 7px 0 0 7px;
}
.barre-semaine .detail { margin-top: 3px; font-size: 11.5px; }

/* Texte d'analyse IA (P3e) : texte BRUT, aucun rendu Markdown. */
.texte-analyse {
  font-size: 14.5px; line-height: 1.65; white-space: normal;
  color: var(--texte, #2B2B2B);
}

/* ==========================================================================
   Tuiles du tableau de bord (P3f)
   --------------------------------------------------------------------------
   Aplats doux teintés + icône, sans filet ni bordure gauche. Classes DÉDIÉES
   (.tuiles / .tuile) : `.stat` reste inchangée car elle sert aussi à la Caisse
   et aux Créances — refondre `.stat` aurait repeint trois écrans au lieu d'un.
   Les icônes sont des SVG inline (currentColor) : aucune police d'icônes n'est
   chargée par l'application, et ce n'était pas une raison d'en ajouter une.
   ========================================================================== */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tuile { border-radius: 12px; padding: 14px; }
.tuile .haut { display: flex; align-items: center; gap: 6px; }
.tuile .ic { width: 15px; height: 15px; flex: none; }
.tuile .libelle {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  min-width: 0;
}
.tuile .valeur {
  font-family: var(--montant); font-weight: 700; font-size: 20px;
  margin-top: 6px; word-break: break-word;
}
.tuile .sous-valeur { font-size: 11.5px; font-weight: 600; margin-top: 3px; opacity: .8; }
/* Repère « cet indicateur ne suit pas la période choisie » (créances, stock). */
.tuile .hors-periode { font-size: 10px; font-weight: 600; margin-top: 3px; opacity: .55; }

.tuile-ca { background: #EEF0F7; color: #3A4170; }
.tuile-ca .valeur { color: #1B1F3B; }
.tuile-cumul { background: #FFF1DF; color: #8A5200; }
.tuile-cumul .valeur { color: #7A4500; }
.tuile-credits { background: #FBEAEA; color: #A32D2D; }
.tuile-stock { background: #EAF3DE; color: #3B6D11; }

/* Filtre de période : réutilise .filtres/.puce, avec deux sélecteurs compacts
   au même gabarit que les puces (38px de haut, pilule, gras). */
.sel-periode {
  width: auto; min-height: 38px;
  padding: 8px 12px;
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-pill);
  color: var(--gris-texte);
}
