/* Base de facturation GS1 Senegal - feuille de style autonome (aucun CDN). */
:root {
  --gs1-bleu: #002c6c;
  --gs1-bleu-clair: #0a4ea8;
  --gs1-orange: #f26334;
  --fond: #f4f6fa;
  --surface: #ffffff;
  --bordure: #dfe4ee;
  --texte: #1c2536;
  --texte-doux: #64708a;
  --vert: #14804a;
  --vert-fond: #e3f5eb;
  --ambre: #9a6a00;
  --ambre-fond: #fdf3d8;
  --rouge: #b3261e;
  --rouge-fond: #fdeceb;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .05);
  --rayon: 10px;
  --offset-entete: 160px;   /* hauteur reelle de .barre-fixe, calculee au chargement */
}

* { box-sizing: border-box; }
/* Les conteneurs en display:flex/grid ignorent l'attribut hidden sans cette regle. */
[hidden] { display: none !important; }
html { height: 100%; }
body { min-height: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 14px/1.5 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ------------------------------------------------------------- en-tete --- */
.barre-fixe { position: sticky; top: 0; z-index: 30; }
.entete {
  background: var(--gs1-bleu);
  color: #fff;
  padding: 18px 30px 0;
  box-shadow: 0 2px 10px rgba(0, 44, 108, .18);
}
.entete-haut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
/* Bloc strictement invariant : ni le libelle ni la vue courante ne doivent en
   modifier la largeur, sans quoi le commutateur se deplace a chaque clic. */
.marque { display: flex; align-items: center; gap: 14px; flex: none; }
.marque h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
/* Le logo GS1 est fourni sur fond blanc opaque : il lui faut son propre cadre
   clair pour rester lisible sur le bandeau bleu. */
.logo {
  background: #fff; border-radius: 9px; padding: 6px 9px; display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(2, 12, 32, .22);
}
.logo img { display: block; height: 30px; width: auto; }
.logo.grand { padding: 8px 12px; }
.logo.grand img { height: 42px; }
/* Les indicateurs changent de contenu d'une vue a l'autre : leur donner une
   ligne dediee evite que leur largeur ne deplace le logo, le commutateur ou le
   bloc de compte, qui doivent rester immobiles. */
.bandeau-contexte {
  display: flex; align-items: center; gap: 16px; min-height: 60px; margin-top: 4px;
}
/* Le sous-titre cede la place le premier : la rangee d'indicateurs ne se brise
   pas, sans quoi une tuile isolee retombe seule a la ligne. */
.bandeau-contexte #sous-titre {
  margin: 0; font-size: 12.5px; color: #a9bde0;
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.kpis {
  display: flex; gap: 7px; flex: 0 0 auto; flex-wrap: nowrap;
  align-items: center; margin-left: auto;
}
/* Sous cette largeur, la rangee ne tient plus : les indicateurs prennent leur
   propre ligne et retombent au besoin sur deux rangs. Rien n'est jamais rogne
   ni renvoye derriere un defilement : l'en-tete grandit, et le calcul de
   --offset-entete suit par le ResizeObserver. */
@media (max-width: 1240px) {
  .bandeau-contexte { flex-wrap: wrap; align-items: flex-start; gap: 8px; padding-bottom: 6px; }
  .bandeau-contexte #sous-titre { flex: 1 1 100%; }
  .kpis { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
}
/* Chaque indicateur est une tuile : le pictogramme donne un point d'entree a
   l'oeil et la valeur cesse de flotter au milieu du bandeau. */
.kpi {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
}
.kpi-icone {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255, 255, 255, .10); color: #cddcf5;
}
.kpi-icone svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
/* Les montants portent la couleur GS1 : ils se distinguent des effectifs sans
   qu'il faille lire l'etiquette. */
.kpi-montant .kpi-icone { background: rgba(242, 99, 52, .22); color: #ffb69d; }
.kpi-texte { min-width: 0; }
/* Chiffres a chasse fixe : les valeurs restent alignees d'une vue a l'autre. */
.kpi .valeur {
  font-size: 18px; font-weight: 600; line-height: 1.15;
  font-variant-numeric: tabular-nums; letter-spacing: .2px;
}
.kpi .etiquette {
  font-size: 10.5px; color: #a9bde0; text-transform: uppercase;
  letter-spacing: .4px; white-space: nowrap; margin-top: 1px;
}

.onglets-mois { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; padding-bottom: 0; }
.onglet {
  border: 0; background: transparent; color: #c3d3ee; padding: 9px 14px 11px;
  border-bottom: 3px solid transparent; white-space: nowrap; font-size: 13px; border-radius: 6px 6px 0 0;
}
.onglet:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.onglet.actif { color: #fff; border-bottom-color: var(--gs1-orange); font-weight: 600; }
.onglet .compte {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 10px;
  background: rgba(255, 255, 255, .16); font-size: 11px;
}
.onglet.actif .compte { background: var(--gs1-orange); }

/* ------------------------------------------------------------ barre d'outils */
.outils {
  display: flex; align-items: center; gap: 10px; padding: 14px 24px;
  flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--bordure);
  padding-left: 30px; padding-right: 30px;
}
.recherche { position: relative; flex: 1 1 260px; max-width: 380px; }
.recherche input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--bordure);
  border-radius: var(--rayon); background: #fbfcfe;
}
.recherche input:focus { outline: 2px solid var(--gs1-bleu-clair); outline-offset: -1px; background: #fff; }
.recherche .loupe { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--texte-doux); }

.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.puce {
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte-doux);
  padding: 7px 12px; border-radius: 20px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px;
}
.puce:hover { border-color: var(--gs1-bleu-clair); color: var(--gs1-bleu); }
.puce.actif { background: var(--gs1-bleu); border-color: var(--gs1-bleu); color: #fff; }
.puce .n { font-weight: 600; }

.actions { margin-left: auto; display: flex; gap: 8px; }
.bouton {
  border: 1px solid var(--bordure); background: var(--surface); padding: 8px 14px;
  border-radius: var(--rayon); font-size: 13px; display: inline-flex; align-items: center; gap: 7px;
}
.bouton:hover { background: #f0f3f9; }
.bouton.primaire { background: var(--gs1-bleu); border-color: var(--gs1-bleu); color: #fff; }
.bouton.primaire:hover { background: var(--gs1-bleu-clair); }
.bouton.danger { color: var(--rouge); border-color: #f0c7c4; background: #fff; }
.bouton.danger:hover { background: var(--rouge-fond); }
.bouton:disabled { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------- tableau --- */
.zone-tableau { padding: 18px 30px 8px; }
.cadre { background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; box-shadow: var(--ombre); overflow: hidden; }
/* La grille defile elle-meme : l'en-tete de colonnes reste alors visible sans
   dependre du defilement de la page. */
.defilement { overflow: auto; max-height: calc(100vh - var(--offset-entete) - 92px); }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1180px; }
thead th {
  position: sticky; top: 0; z-index: 10;
  background: #f7f9fc; text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--texte-doux); font-weight: 600;
  padding: 11px 12px; border-bottom: 1px solid var(--bordure); white-space: nowrap;
}
tbody td { padding: 8px 12px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
tbody tr:hover { background: #f8fafd; }
tbody tr.selectionne { background: #eef4fd; }
tbody tr.incomplet td:first-child { box-shadow: inset 3px 0 0 var(--gs1-orange); }

.nom-entreprise { font-weight: 600; color: var(--texte); }
.sous-info { font-size: 11.5px; color: var(--texte-doux); margin-top: 2px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.montant { font-weight: 600; }

.jetons { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.jeton {
  display: inline-flex; align-items: center; gap: 5px; max-width: 240px;
  background: #eef2f9; border: 1px solid #dde4f0; border-radius: 6px;
  padding: 2px 6px; font-size: 12px;
}
.jeton.principal { background: #e7f0ff; border-color: #bcd3f7; }
.jeton .texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jeton .etoile { color: var(--gs1-orange); font-size: 11px; }
.jeton button { border: 0; background: none; color: var(--texte-doux); padding: 0 2px; line-height: 1; font-size: 14px; }
.jeton button:hover { color: var(--rouge); }
.jeton.gtin { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; }

.ajout-inline {
  border: 1px dashed var(--bordure); background: transparent; color: var(--texte-doux);
  border-radius: 6px; padding: 2px 8px; font-size: 12px;
}
.ajout-inline:hover { border-color: var(--gs1-bleu-clair); color: var(--gs1-bleu); }
.saisie-inline {
  width: 230px; padding: 4px 8px; border: 1px solid var(--gs1-bleu-clair);
  border-radius: 6px; font-size: 12.5px;
}
.saisie-inline:focus { outline: 2px solid rgba(10, 78, 168, .25); }
.manquant { color: var(--gs1-orange); font-size: 12px; font-style: italic; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.facture { background: var(--vert-fond); color: var(--vert); }
.badge.valide { background: var(--vert-fond); color: var(--vert); }
.badge.calcule { background: #e8effb; color: var(--gs1-bleu-clair); }
.badge.averifier { background: var(--ambre-fond); color: var(--ambre); }

.case-verif { width: 17px; height: 17px; accent-color: var(--vert); cursor: pointer; }

/* --------------------------------------------------------------- volet --- */
.voile {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .38); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.voile.ouvert { opacity: 1; pointer-events: auto; }
.volet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); z-index: 50; box-shadow: -8px 0 30px rgba(16, 24, 40, .16);
  transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column;
}
.volet.ouvert { transform: none; }
.volet-entete { padding: 18px 22px; border-bottom: 1px solid var(--bordure); display: flex; gap: 12px; align-items: flex-start; }
.volet-entete h2 { margin: 0 0 4px; font-size: 16px; }
.volet-corps { overflow-y: auto; padding: 18px 22px 40px; flex: 1; }
.volet-pied { padding: 14px 22px; border-top: 1px solid var(--bordure); display: flex; gap: 8px; background: #fafbfd; }
.fermer { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--texte-doux); }
.fermer:hover { color: var(--texte); }

.section { margin-bottom: 26px; }
.section h3 {
  margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--texte-doux); font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.section h3::after { content: ""; flex: 1; height: 1px; background: var(--bordure); }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-size: 11.5px; color: var(--texte-doux); font-weight: 600; }
.champ input, .champ select, .champ textarea {
  border: 1px solid var(--bordure); border-radius: 8px; padding: 7px 10px; background: #fbfcfe; width: 100%;
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: 2px solid var(--gs1-bleu-clair); outline-offset: -1px; background: #fff;
}
.champ textarea { resize: vertical; min-height: 64px; }

.liste-contacts { display: flex; flex-direction: column; gap: 6px; }
.contact-ligne {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--bordure);
  border-radius: 8px; padding: 6px 10px; background: #fbfcfe;
}
.contact-ligne .valeur { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.contact-ligne .valeur.principal { font-weight: 600; }
.mini {
  border: 0; background: none; color: var(--texte-doux); font-size: 12px; padding: 2px 5px; border-radius: 5px;
}
.mini:hover { background: #eef2f9; color: var(--gs1-bleu); }
.mini.actif { color: var(--gs1-orange); }
.ajout-ligne { display: flex; gap: 6px; margin-top: 6px; }
.ajout-ligne input { flex: 1; border: 1px solid var(--bordure); border-radius: 8px; padding: 7px 10px; }

table.lignes { min-width: 0; width: 100%; }
table.lignes th { position: static; background: transparent; padding: 4px 6px; font-size: 11px; }
table.lignes td { padding: 4px 6px; border-bottom: 0; }
table.lignes input, table.lignes select {
  width: 100%; border: 1px solid var(--bordure); border-radius: 6px; padding: 5px 7px; background: #fbfcfe;
}
.recap-total {
  display: flex; justify-content: space-between; align-items: center; margin-top: 10px;
  padding: 10px 12px; border-radius: 8px; background: #f5f7fb; font-size: 13px;
}
.recap-total.ok { background: var(--vert-fond); color: var(--vert); }
.recap-total.ko { background: var(--ambre-fond); color: var(--ambre); }

.note {
  background: #f5f7fb; border-left: 3px solid var(--bordure); padding: 9px 12px;
  border-radius: 0 8px 8px 0; font-size: 12.5px; color: var(--texte-doux);
}

/* ------------------------------------------------------------- divers --- */
.vide { padding: 60px 20px; text-align: center; color: var(--texte-doux); }
.notification {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--texte); color: #fff; padding: 11px 18px; border-radius: var(--rayon);
  z-index: 60; box-shadow: var(--ombre); opacity: 0; transition: all .2s; font-size: 13px; max-width: 90vw;
}
.notification.visible { transform: translateX(-50%); opacity: 1; }
.notification.erreur { background: var(--rouge); }
.pied-page { padding: 10px 30px 22px; margin: 0; color: var(--texte-doux); font-size: 12px; }

@media (max-width: 820px) {
  .kpis { width: 100%; justify-content: space-between; margin-left: 0; }
  .grille { grid-template-columns: 1fr; }
}

/* ------------------------------------------------- navigation par vue --- */
.onglets-vues {
  display: flex; gap: 4px; background: rgba(255, 255, 255, .1); padding: 3px;
  border-radius: 9px; margin-top: 12px; align-self: flex-start; width: fit-content;
}
.onglets-vues button {
  border: 0; background: transparent; color: #c3d3ee; padding: 7px 14px;
  border-radius: 7px; font-size: 13px; white-space: nowrap;
}
.onglets-vues button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.onglets-vues button.actif { background: var(--surface); color: var(--gs1-bleu); font-weight: 600; }
.onglets-vues .compte { margin-left: 6px; font-size: 11px; opacity: .75; }

/* ------------------------------------ materialisation par mois (ecarts) --- */
.mois-cartes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.mois-carte {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px;
  padding: 9px 10px 10px; text-align: left; box-shadow: var(--ombre); position: relative;
}
.mois-carte:hover { border-color: var(--gs1-bleu-clair); }
.mois-carte.actif { border-color: var(--gs1-bleu); box-shadow: 0 0 0 2px rgba(0, 44, 108, .12); }
.mois-carte .libelle { font-size: 11px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .4px; }
.mois-carte .total { font-size: 20px; font-weight: 600; line-height: 1.25; }
.mois-carte .detail { font-size: 11px; color: var(--texte-doux); }
.mois-carte .barre { height: 5px; border-radius: 3px; background: #edf0f6; margin-top: 7px; overflow: hidden; display: flex; }
.mois-carte .barre .part-actif { background: var(--gs1-orange); }
.mois-carte .barre .part-inactif { background: #b9c2d4; }

.badge.actif { background: var(--vert-fond); color: var(--vert); }
.badge.inactif { background: #eef1f6; color: var(--texte-doux); }
.badge.lot { background: var(--ambre-fond); color: var(--ambre); }
.badge.rapproche { background: #e8effb; color: var(--gs1-bleu-clair); }
.badge.ecart { background: var(--rouge-fond); color: var(--rouge); }

.bandeau {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--bordure); border-left: 3px solid var(--gs1-orange);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--ombre);
}
.bandeau .texte { flex: 1; font-size: 13px; color: var(--texte-doux); }
.bandeau strong { color: var(--texte); }

/* ----------------------------------------------------------- connexion --- */
.page-connexion {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background: linear-gradient(160deg, var(--gs1-bleu) 0%, #041d47 55%, #06152f 100%);
}
.carte-connexion {
  width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px;
  padding: 30px 32px 26px; box-shadow: 0 24px 60px rgba(2, 12, 32, .38);
}
.carte-connexion .marque { margin-bottom: 24px; gap: 14px; }
.carte-connexion .logo { box-shadow: none; padding: 0; }
.carte-connexion .marque h1 { margin: 0; font-size: 17px; font-weight: 600; color: var(--texte); }
.carte-connexion .marque p { margin: 0; font-size: 12.5px; color: var(--texte-doux); }
.carte-connexion h2 { margin: 0 0 6px; font-size: 20px; color: var(--gs1-bleu); }
.carte-connexion .intro { margin: 0 0 16px; font-size: 13px; color: var(--texte-doux); line-height: 1.5; }
.carte-connexion .champ { margin-bottom: 14px; }
.carte-connexion .champ label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.carte-connexion .champ input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bordure);
  border-radius: 9px; background: #fbfcfe;
}
.carte-connexion .champ input:focus {
  outline: 2px solid var(--gs1-bleu-clair); outline-offset: -1px; background: #fff;
}
.carte-connexion .aide { font-size: 11.5px; color: var(--texte-doux); margin-top: 4px; }
.bouton.large { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; font-weight: 600; }
.lien {
  display: block; width: 100%; margin-top: 12px; border: 0; background: none;
  color: var(--gs1-bleu-clair); font-size: 13px; text-align: center;
}
.lien:hover { text-decoration: underline; }
.mention-bas { margin: 22px 0 0; font-size: 11.5px; color: var(--texte-doux); text-align: center; }

/* ------------------------------------------------ commutateur d'espace --- */
.commutateur-espace { display: flex; gap: 6px; }
.commutateur-espace button {
  border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #c3d3ee;
  padding: 8px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.commutateur-espace button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.commutateur-espace button.actif {
  background: var(--gs1-orange); border-color: var(--gs1-orange); color: #fff;
}
.compte { margin-left: auto; display: flex; align-items: center; gap: 12px;
          font-size: 12.5px; color: #a9bde0; }
.compte > div { text-align: right; line-height: 1.35; }
.compte .email { color: #fff; font-weight: 500; }
.compte button {
  border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #c3d3ee;
  padding: 5px 10px; border-radius: 7px; font-size: 12px;
}
.compte button:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* --------------------------------------------------- espace facturation --- */
.zone-facturation { padding: 20px 30px 40px; }
.panneau {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px;
  box-shadow: var(--ombre); padding: 18px 20px; margin-bottom: 16px;
}
.panneau > h2 {
  margin: 0 0 4px; font-size: 15px; color: var(--gs1-bleu);
}
.panneau > .sous-titre { margin: 0 0 16px; font-size: 12.5px; color: var(--texte-doux); }

.grille-mois { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.carte-mois {
  text-align: left; background: var(--surface); border: 1px solid var(--bordure);
  border-radius: 10px; padding: 12px 13px;
}
.carte-mois:hover { border-color: var(--gs1-bleu-clair); }
.carte-mois.actif { border-color: var(--gs1-bleu); box-shadow: 0 0 0 2px rgba(0, 44, 108, .12); }
.carte-mois .mois { font-size: 13px; font-weight: 600; color: var(--gs1-bleu); }
.carte-mois .nb { font-size: 22px; font-weight: 600; line-height: 1.25; }
.carte-mois .detail { font-size: 11.5px; color: var(--texte-doux); }
.carte-mois .alerte { font-size: 11.5px; color: var(--gs1-orange); font-weight: 600; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tuile { background: #f7f9fc; border: 1px solid var(--bordure); border-radius: 10px; padding: 11px 13px; }
.tuile .valeur { font-size: 21px; font-weight: 600; line-height: 1.2; }
.tuile .etiquette { font-size: 11px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .5px; }
.tuile.alerte .valeur { color: var(--gs1-orange); }
.tuile.ok .valeur { color: var(--vert); }

.barre-progression { height: 8px; background: #edf0f6; border-radius: 5px; overflow: hidden; display: flex; }
.barre-progression .envoye { background: var(--vert); }
.barre-progression .echec { background: var(--rouge); }
.barre-progression .ignore { background: #b9c2d4; }

.liste-destinataires { max-height: 460px; overflow: auto; border: 1px solid var(--bordure); border-radius: 10px; }
.liste-destinataires table { min-width: 0; }
.liste-destinataires thead th { top: 0; }

.champ-inline { display: flex; gap: 6px; align-items: center; }
.champ-inline input {
  flex: 1; min-width: 150px; border: 1px solid var(--bordure); border-radius: 6px; padding: 5px 8px; font-size: 12.5px;
}
.champ-inline input:focus { outline: 2px solid var(--gs1-bleu-clair); outline-offset: -1px; }

.formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.formulaire .large { grid-column: 1 / -1; }
.formulaire label { display: block; font-size: 12px; font-weight: 600; color: var(--texte-doux); margin-bottom: 5px; }
.formulaire input, .formulaire textarea, .formulaire select {
  width: 100%; border: 1px solid var(--bordure); border-radius: 8px; padding: 8px 10px; background: #fbfcfe;
}
.formulaire textarea { min-height: 110px; resize: vertical; font-family: inherit; }
.formulaire input:focus, .formulaire textarea:focus, .formulaire select:focus {
  outline: 2px solid var(--gs1-bleu-clair); outline-offset: -1px; background: #fff;
}
.formulaire .aide { font-size: 11.5px; color: var(--texte-doux); margin-top: 4px; }
.pied-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.pied-actions .info { font-size: 12.5px; color: var(--texte-doux); margin-right: auto; }

.sous-onglets { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.sous-onglets button {
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte-doux);
  padding: 8px 15px; border-radius: 9px; font-size: 13px;
}
.sous-onglets button.actif { background: var(--gs1-bleu); border-color: var(--gs1-bleu); color: #fff; font-weight: 600; }

/* ------------------------------------------------- editeur de texte riche --- */
.editeur { border: 1px solid var(--bordure); border-radius: 8px; overflow: hidden; background: #fff; }
.editeur-outils {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 6px;
  background: #f7f9fc; border-bottom: 1px solid var(--bordure);
}
.editeur-outils button {
  border: 1px solid transparent; background: none; color: var(--texte-doux);
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px;
}
.editeur-outils button:hover { background: #e6ebf5; color: var(--gs1-bleu); }
.editeur-outils .separateur { width: 1px; margin: 4px 4px; background: var(--bordure); }
.editeur-zone {
  min-height: 150px; max-height: 340px; overflow: auto; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.55;
}
.editeur-zone:focus { outline: 2px solid var(--gs1-bleu-clair); outline-offset: -2px; }
.editeur-zone img { max-width: 100%; height: auto; }
.editeur-zone p { margin: 0 0 8px; }
.editeur-zone table { min-width: 0; width: auto; }
.editeur-zone:empty::before { content: attr(data-invite); color: #9aa5bb; }
