/* Cockpit de prospection Beeform — feuille de style
   Palette sobre : anthracite / bleu / accent, coins arrondis, usage bureau. */

:root {
  --anthracite: #1e2530;
  --anthracite-2: #2a3342;
  --bleu: #2563eb;
  --bleu-clair: #eaf1fd;
  --accent: #f59e0b;
  --vert: #16a34a;
  --rouge: #dc2626;
  --gris: #6b7280;
  --gris-clair: #f3f4f6;
  --bordure: #e5e7eb;
  --texte: #111827;
  --fond: #f8f9fb;
  --radius: 10px;
  --ombre: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
  font-size: 14px;
}

#app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--anthracite);
  color: #d7dbe2;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
  letter-spacing: 0.2px;
}

.sidebar .sous-titre {
  font-size: 11px;
  color: #9aa4b2;
  margin: 0;
}

.marche-switch {
  display: flex;
  background: var(--anthracite-2);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}

.marche-switch button {
  flex: 1;
  border: none;
  background: transparent;
  color: #c3cad6;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.marche-switch button.actif {
  background: var(--bleu);
  color: #fff;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav button {
  text-align: left;
  border: none;
  background: transparent;
  color: #c3cad6;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav button.actif {
  background: var(--bleu);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: #6b7688;
  line-height: 1.5;
}

.btn-deconnexion {
  width: 100%;
  margin-bottom: 12px;
  padding: 9px 12px;
  background: transparent;
  color: #c3cad6;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-deconnexion:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* ---------- Page de connexion ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--anthracite);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.login-title {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--texte);
}

.login-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--gris);
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
  margin-bottom: 6px;
}

.login-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.login-input:focus {
  outline: none;
  border-color: var(--bleu);
  box-shadow: 0 0 0 3px var(--bleu-clair);
}

.login-btn {
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--bleu);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-btn:hover {
  background: #1d4ed8;
}

.login-error {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--rouge);
}

/* ---------- Zone principale ---------- */

.main {
  padding: 28px 32px;
  overflow-x: auto;
}

.main-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.main-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.badge-marche {
  font-size: 12px;
  color: var(--gris);
  background: var(--gris-clair);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Cartes / compteurs ---------- */

.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.carte {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 16px 18px;
}

.carte .valeur {
  font-size: 26px;
  font-weight: 700;
  color: var(--anthracite);
}

.carte .libelle {
  font-size: 12px;
  color: var(--gris);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.carte.accent-chaud .valeur { color: var(--rouge); }
.carte.accent-tiede .valeur { color: var(--accent); }
.carte.accent-froid .valeur { color: var(--gris); }
.carte.accent-site_ko .valeur { color: var(--gris); }

h3.section-titre {
  font-size: 14px;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 24px 0 12px 0;
}

/* ---------- Filtres ---------- */

.barre-filtres {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.barre-filtres select,
.barre-filtres input {
  border: 1px solid var(--bordure);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--texte);
}

.barre-filtres input[type="search"] {
  min-width: 220px;
}

/* ---------- Tableau ---------- */

table.tableau-prospects {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--ombre);
}

table.tableau-prospects thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gris);
  background: var(--gris-clair);
  padding: 10px 14px;
  border-bottom: 1px solid var(--bordure);
}

table.tableau-prospects tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bordure);
  font-size: 13.5px;
}

table.tableau-prospects tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

table.tableau-prospects tbody tr:hover {
  background: var(--bleu-clair);
}

table.tableau-prospects tbody tr:last-child td {
  border-bottom: none;
}

.etat-vide {
  padding: 40px;
  text-align: center;
  color: var(--gris);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--ombre);
}

/* ---------- Badges priorité / état ---------- */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-chaud { background: #fde2e2; color: var(--rouge); }
.badge-tiede { background: #fef3c7; color: #b45309; }
.badge-froid { background: #e5e7eb; color: var(--gris); }
.badge-site_ko { background: #ede9fe; color: #6d28d9; }

.badge-etat {
  background: var(--bleu-clair);
  color: var(--bleu);
}

/* ---------- Fiche prospect (panneau overlay) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
}

.fiche {
  width: 460px;
  max-width: 92vw;
  background: #fff;
  height: 100vh;
  overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fiche-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.fiche-header h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
}

.fiche-header .commune {
  color: var(--gris);
  font-size: 13px;
}

.bouton-fermer {
  border: none;
  background: var(--gris-clair);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 15px;
  color: var(--gris);
}

.capture-mobile {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  border: 1px solid var(--bordure);
  display: block;
}

.fiche-champs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  font-size: 13px;
}

.fiche-champs dt {
  color: var(--gris);
  font-weight: 600;
}

.fiche-champs dd {
  margin: 0;
}

.accroches {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accroches li {
  background: var(--gris-clair);
  border-left: 3px solid var(--bleu);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

textarea.notes {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.pipeline-boutons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bouton {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

.bouton:active { transform: scale(0.97); }
.bouton:disabled { opacity: 0.4; cursor: not-allowed; }

.bouton-primaire { background: var(--bleu); color: #fff; }
.bouton-secondaire { background: var(--gris-clair); color: var(--texte); }
.bouton-accent { background: var(--accent); color: #fff; }
.bouton-petit { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

.etat-actuel {
  text-align: center;
  padding: 8px;
  background: var(--bleu-clair);
  color: var(--bleu);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

.confirmation-copie {
  font-size: 12px;
  color: var(--vert);
  font-weight: 600;
}

/* ---------- Kanban ---------- */

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-colonne {
  background: #eef0f3;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.kanban-colonne h4 {
  margin: 4px 4px 0 4px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--gris);
  display: flex;
  justify-content: space-between;
}

.kanban-carte {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--ombre);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-carte .nom {
  font-weight: 600;
  font-size: 13px;
}

.kanban-carte .meta {
  font-size: 11.5px;
  color: var(--gris);
}

.kanban-carte .actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.kanban-carte .actions button {
  border: none;
  background: var(--gris-clair);
  border-radius: 6px;
  width: 26px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
}

.kanban-carte .actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Empêche le clic sur les boutons d'actions de déclencher l'ouverture de la fiche */
.kanban-carte .actions button {
  pointer-events: auto;
}

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}

/* ---------- Opérations (tour de contrôle) ---------- */

.ops-lancement {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.ops-carte-action {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--ombre);
}
.ops-carte-action h3 { margin: 0 0 6px; font-size: 15px; }
.ops-carte-action p { margin: 0 0 12px; font-size: 13px; color: var(--gris); }
.ops-carte-action label { display: block; font-size: 13px; margin-bottom: 10px; color: var(--texte); }
.ops-carte-action .bouton { width: 100%; }

.ops-note { font-size: 12px; color: var(--gris); margin: 4px 0 20px; }
.ops-soustitre { font-size: 14px; margin: 20px 0 10px; }

.ops-job {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ops-job-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ops-job-tete strong { font-size: 14px; }

.ops-etat { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.ops-etat-en_attente { background: var(--gris-clair); color: var(--gris); }
.ops-etat-en_cours   { background: var(--bleu-clair); color: var(--bleu); }
.ops-etat-termine    { background: #dcfce7; color: var(--vert); }
.ops-etat-erreur     { background: #fee2e2; color: var(--rouge); }

.ops-job-progress { display: flex; align-items: center; gap: 10px; }
.ops-progress {
  flex: 1; height: 8px; background: var(--gris-clair);
  border-radius: 999px; overflow: hidden;
}
.ops-progress-barre { height: 100%; background: var(--bleu); transition: width 0.3s ease; }
.ops-progress.indet .ops-progress-barre { animation: ops-indet 1.2s ease-in-out infinite; }
@keyframes ops-indet { 0% { opacity: .4; } 50% { opacity: 1; } 100% { opacity: .4; } }
.ops-progress-txt { font-size: 12px; color: var(--gris); min-width: 90px; text-align: right; }

.lien-log { background: none; border: none; color: var(--bleu); font-size: 12px; cursor: pointer; padding: 6px 0 0; }

.ops-log {
  background: var(--anthracite); color: #d7dbe2;
  border-radius: var(--radius); padding: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5;
  max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

.ops-parallele { font-size: 11px; font-weight: 400; color: var(--vert); }
.ops-carte-action label input[type="checkbox"] { margin-right: 6px; }

/* ============================ Messagerie ============================ */
.entete-vue { margin-bottom: 16px; }
.entete-vue h2 { font-size: 22px; margin: 0; color: var(--texte); }
.sous-titre-vue { color: var(--gris); font-size: 13px; margin: 4px 0 0; }

.mail-onglets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mail-onglet {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 14px; border: 1px solid var(--bordure); border-radius: 10px;
  background: #fff; cursor: pointer; font: inherit; text-align: left;
  transition: border-color .12s, background .12s;
}
.mail-onglet:hover { border-color: var(--bleu); }
.mail-onglet.actif { background: var(--bleu-clair); border-color: var(--bleu); }
.mail-onglet-nom { font-weight: 600; font-size: 13px; color: var(--texte); }
.mail-onglet-tag { font-size: 10.5px; color: var(--gris); letter-spacing: .04em; }

.mail-erreur { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; }

.mail-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px;
  align-items: start; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }

.mail-liste { list-style: none; margin: 0; padding: 0; border: 1px solid var(--bordure);
  border-radius: 12px; overflow: hidden; background: #fff; max-height: 70vh; overflow-y: auto; }
.mail-item { padding: 12px 14px; border-bottom: 1px solid var(--bordure); cursor: pointer;
  transition: background .1s; }
.mail-item:last-child { border-bottom: none; }
.mail-item:hover { background: var(--gris-clair); }
.mail-item.actif { background: var(--bleu-clair); }
.mail-item.non-lu { border-left: 3px solid var(--bleu); }
.mail-item.non-lu .mail-obj { font-weight: 700; }
.mail-de { font-size: 13px; font-weight: 600; color: var(--texte); }
.mail-obj { font-size: 13px; color: var(--texte); margin: 2px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-date { font-size: 11px; color: var(--gris); }

.mail-lecteur { border: 1px solid var(--bordure); border-radius: 12px; background: #fff;
  padding: 20px; min-height: 300px; }
.mail-vide { padding: 40px 20px; text-align: center; color: var(--gris); font-size: 14px; }
.mail-lecteur-tete { border-bottom: 1px solid var(--bordure); padding-bottom: 14px;
  margin-bottom: 14px; }
.mail-lecteur-tete h3 { margin: 0 0 6px; font-size: 17px; color: var(--texte); }
.mail-lecteur-de { margin: 0; font-size: 13px; color: var(--texte); }
.mail-corps { white-space: pre-wrap; word-wrap: break-word; font-family: inherit;
  font-size: 14px; line-height: 1.6; color: var(--texte); margin: 0 0 20px; }

.mail-repondre { border-top: 1px solid var(--bordure); padding-top: 16px;
  display: flex; flex-direction: column; gap: 10px; }
.mail-repondre label { font-size: 13px; color: var(--gris); }
.mail-repondre textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--bordure);
  border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; }
.mail-repondre textarea:focus { outline: none; border-color: var(--bleu);
  box-shadow: 0 0 0 3px var(--bleu-clair); }
.mail-repondre-bas { display: flex; align-items: center; gap: 12px; }
.mail-repondre-etat { font-size: 13px; color: var(--gris); }

.mail-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mail-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.mail-sync-etat { font-size: 12px; color: var(--gris); }

/* ============================ Campagne ============================ */
.section-titre { font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gris); margin: 26px 0 12px; }

.camp-arm { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--bordure); }
.camp-arm.off { background: #fef2f2; border-color: #fecaca; }
.camp-arm.on  { background: var(--good-bg, #e7f1ea); border-color: #86c9a3; }
.camp-arm-etat { font-size: 16px; font-weight: 800; }
.camp-arm.off .camp-arm-etat { color: #b91c1c; }
.camp-arm.on  .camp-arm-etat { color: #2f855a; }
.camp-arm-sub { font-size: 13px; color: var(--gris); margin-top: 2px; }

.camp-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.camp-box { background: var(--surface, #fff); border: 1px solid var(--bordure); border-radius: 12px; padding: 14px 16px; }
.camp-box.plein { border-color: var(--accent); background: #fffaf1; }
.camp-box-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.camp-box-mail { font-size: 12.5px; font-weight: 600; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-box-tag { font-size: 10px; color: var(--gris); flex: none; }
.camp-box-quota { font-size: 26px; font-weight: 800; color: var(--texte); margin: 8px 0 6px; }
.camp-box-quota span { font-size: 15px; font-weight: 600; color: var(--gris); }
.camp-bar { height: 7px; background: var(--gris-clair); border-radius: 99px; overflow: hidden; }
.camp-bar i { display: block; height: 100%; background: var(--bleu); border-radius: 99px; }
.camp-box.plein .camp-bar i { background: var(--accent); }

.camp-ab { width: 100%; border-collapse: collapse; font-size: 14px; }
.camp-ab th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gris); border-bottom: 1px solid var(--bordure); padding: 8px 10px; }
.camp-ab td { padding: 10px; border-bottom: 1px solid var(--bordure); }
.camp-ab tfoot td { font-weight: 700; border-top: 2px solid var(--bordure); border-bottom: none; }
.camp-rate { font-weight: 700; color: var(--bleu); }
.camp-hint { font-size: 12.5px; color: var(--gris); font-style: italic; margin-top: 10px; }

.camp-activity { list-style: none; margin: 0; padding: 0; }
.camp-activity li { display: flex; align-items: center; gap: 12px; padding: 9px 4px;
  border-bottom: 1px solid var(--bordure); font-size: 13px; }
.camp-act-kind { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--gris-clair); color: var(--gris); }
.camp-act-kind.k-mail1 { background: #eaf1fd; color: var(--bleu); }
.camp-act-kind.k-rapport { background: #e7f1ea; color: #2f855a; }
.camp-act-nom { flex: 1; font-weight: 600; color: var(--texte); }
.camp-act-box { color: var(--gris); font-size: 12px; }
.camp-act-at { color: var(--gris); font-size: 12px; flex: none; }

/* --------------------------------------------------------------------------
   Vue Journal : statistiques et journaux (audits, envois, dossier)
   Les couleurs de statut réutilisent les jetons existants ; le rouge est
   réservé à l'échec (jamais décoratif) pour qu'il reste lisible au coup d'œil.
   -------------------------------------------------------------------------- */

.jr-bloc {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.jr-bloc h3 {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: .01em;
}
.jr-bloc h4 {
  margin: 18px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gris);
}
.jr-sous { color: var(--gris); font-size: 12.5px; margin: 0; }

.jr-chiffres { display: flex; flex-wrap: wrap; gap: 10px; }
.jr-chiffre {
  flex: 1 1 120px;
  background: var(--gris-clair);
  border-radius: 8px;
  padding: 12px 14px;
}
.jr-chiffre b { display: block; font-size: 22px; line-height: 1.1; }
.jr-chiffre span { font-size: 11.5px; color: var(--gris); }
.jr-chiffre.bon b { color: var(--vert); }
.jr-chiffre.moyen b { color: #b45309; }
.jr-chiffre.mauvais b { color: var(--rouge); }

/* Liste « à recompléter » : un défaut d'intégrité doit se voir, pas se compter. */
.parc-incomplets {
  margin: 6px 0 10px; padding: 8px 12px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px;
}
.parc-incomplets h4 { margin: 0 0 4px; color: var(--rouge); }
.parc-incomplets ul { margin: 0; padding-left: 18px; }
.parc-incomplets li { font-size: 13px; margin: 2px 0; }
.parc-manque { color: var(--gris); font-size: 11.5px; margin-left: 8px; }

.jr-colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 26px;
}

.jr-barre-ligne {
  display: grid;
  grid-template-columns: 74px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}
.jr-barre-lib { color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-barre-piste { background: var(--gris-clair); border-radius: 4px; height: 9px; overflow: hidden; }
.jr-barre-piste i { display: block; height: 100%; background: var(--bleu); border-radius: 4px; }
.jr-barre-piste i.alerte { background: var(--accent); }
.jr-barre-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--texte); }

.jr-filtres { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.jr-filtres button {
  border: 1px solid var(--bordure);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--gris);
}
.jr-filtres button.actif { background: var(--bleu); border-color: var(--bleu); color: #fff; }
/* Compteur par filtre : pastille discrète collée au libellé. */
.jr-filtre-n {
  display: inline-block; margin-left: 5px; padding: 0 6px;
  border-radius: 999px; background: var(--fond, #f1f5f9);
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11px;
}
.jr-filtres button.actif .jr-filtre-n { background: rgba(255, 255, 255, 0.25); color: #fff; }

.jr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.jr-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gris);
  border-bottom: 1px solid var(--bordure);
  padding: 6px 8px;
  font-weight: 600;
}
.jr-table td { padding: 7px 8px; border-bottom: 1px solid var(--gris-clair); vertical-align: top; }
.jr-table tr.st-echec { background: #fef4f3; }
.jr-table tr.st-partiel { background: #fffaf0; }
.jr-mono { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--gris); }
.jr-detail { color: var(--gris); max-width: 380px; }
.jr-err { color: var(--rouge); font-size: 11.5px; word-break: break-word; }

.jr-statut {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 600;
}
.jr-statut.st-ok { background: #e8f6ed; color: #14713a; }
.jr-statut.st-partiel { background: #fff2dd; color: #92400e; }
.jr-statut.st-echec { background: #fdeceb; color: #a31d13; }
.jr-tag {
  display: inline-block;
  background: #fff2dd;
  color: #92400e;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 10.5px;
  margin-left: 4px;
}

.jr-recherche { display: flex; gap: 8px; margin-bottom: 12px; }
.jr-recherche input {
  flex: 0 1 260px;
  padding: 8px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.jr-recherche input:focus { outline: 2px solid var(--bleu); outline-offset: 1px; }

.jr-dossier-tete {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bordure);
}
.jr-dossier-nom { font-size: 16px; font-weight: 600; }
.jr-dossier-score b { font-size: 26px; }
.jr-dossier-score span { color: var(--gris); font-size: 12px; }
.jr-dossier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 14px;
  font-size: 12.5px;
  color: var(--gris);
}

/* --------------------------------------------------------------------------
   Vue Cohérence — surveillance de l'accord entre les chiffres du cockpit et
   ceux publiés par le site. Volontairement sobre : cette page doit se lire
   comme un constat d'huissier, pas comme un tableau de bord décoratif.
   Aucune couleur n'est décorative ici — le rouge et le vert portent le seul
   verdict qui compte, donc ils ne servent à rien d'autre.
   -------------------------------------------------------------------------- */
.coh-badge {
  display: inline-block; margin-left: .6rem; padding: .15rem .55rem;
  border-radius: 999px; font-size: .72em; font-weight: 600;
  letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
}
.coh-ok   { background: #e7f6ec; color: var(--vert);   border: 1px solid #bfe6cb; }
.coh-warn { background: #fef4e2; color: #a4620a;       border: 1px solid #f2d9a8; }
.coh-bad  { background: #fdeaea; color: var(--rouge);  border: 1px solid #f4c2c2; }

.coh-paires { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.coh-paire {
  border: 1px solid var(--bordure); border-radius: var(--radius);
  padding: .8rem .9rem; background: #fff;
}
/* Une réconciliation en défaut se signale par un liseré, pas par un fond criard :
   la page peut en contenir plusieurs, et un aplat rouge répété ne se hiérarchise plus. */
.coh-paire-bad { border-left: 3px solid var(--rouge); }
.coh-paire-lib { margin: 0 0 .35rem; font-size: .82rem; color: var(--gris); }
.coh-paire-vals { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; }
.coh-paire-vals strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.coh-paire-vals span { font-size: .78rem; color: var(--gris); }
.coh-paire-vals em { font-style: normal; font-weight: 700; color: var(--gris); padding: 0 .2rem; }
.coh-paire-bad .coh-paire-vals em { color: var(--rouge); }

.coh-series { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.coh-serie {
  border: 1px solid var(--bordure); border-radius: var(--radius);
  padding: .8rem .9rem; background: #fff; color: var(--bleu);
}
.coh-serie svg { width: 100%; height: 40px; display: block; margin: .3rem 0; }
.coh-serie-tete { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.coh-serie-lib { font-size: .82rem; color: var(--gris); }
.coh-serie-val { font-size: 1.05rem; font-weight: 600; color: var(--texte); font-variant-numeric: tabular-nums; }
.coh-serie-val em { font-style: normal; font-size: .74rem; color: var(--gris); font-weight: 400; }
.coh-serie-bas { margin: .2rem 0 0; font-size: .72rem; color: var(--gris); }

.coh-ligne-bad  td { background: #fdf5f5; }
.coh-ligne-warn td { background: #fffaf0; }
.coh-champs { font-size: .76rem; color: var(--gris); word-break: break-word; }

/* Le nom du site incomplet est cliquable : comprendre pourquoi un maillon échoue
   demande d'ouvrir le site. Le lien reste discret (pas de bleu vif) — c'est une
   liste de travail, pas une navigation principale. */
.parc-lien { color: var(--texte); text-decoration: underline; text-decoration-color: var(--bordure);
             text-underline-offset: 2px; }
.parc-lien:hover { color: var(--bleu); text-decoration-color: var(--bleu); }
.parc-hote { color: var(--gris); font-size: 11.5px; margin-left: 6px; font-family: ui-monospace, monospace; }

/* Case « traité » sur les chaînes incomplètes. La ligne cochée reste VISIBLE mais
   recule : masquer ferait perdre la trace des décisions et rendrait le compteur du
   haut inexplicable. */
.parc-incomplets li { display: flex; align-items: baseline; gap: 6px; }
.parc-chk { display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.parc-chk input { width: 13px; height: 13px; margin: 0; cursor: pointer; accent-color: var(--vert); }
.parc-fait { opacity: .5; }
.parc-fait .parc-lien, .parc-fait .parc-hote { text-decoration: line-through; }

/* --------------------------------------------------------------------------
   Fenêtre d'inspection d'un envoi. Le corps du mail est rendu en <pre> :
   c'est du texte brut, et le voir tel quel — retours à la ligne compris — est
   précisément l'intérêt. Toute mise en forme cacherait ce que le prospect a reçu.
   -------------------------------------------------------------------------- */
.camp-activity li[data-envoi] { cursor: pointer; border-radius: 6px; }
.camp-activity li[data-envoi]:hover { background: var(--gris-clair); }
.camp-activity li[data-envoi]:focus-visible { outline: 2px solid var(--bleu); outline-offset: 1px; }
.camp-act-ko { background: #fdf5f5; }
.camp-act-st { color: var(--rouge); font-size: 11.5px; font-weight: 600; }

.env-modal { position: fixed; inset: 0; background: rgba(16,24,40,.55);
             display: flex; align-items: flex-start; justify-content: center;
             padding: 4vh 16px; z-index: 1000; overflow-y: auto; }
.env-box { background: #fff; border-radius: var(--radius); box-shadow: var(--ombre);
           width: 100%; max-width: 760px; padding: 18px 20px 22px; }
.env-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.env-head h3 { margin: 0 0 10px; font-size: 17px; }
.env-x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer;
         color: var(--gris); padding: 0 4px; }
.env-warn { margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; font-size: 13px;
            background: #FBF1DE; border: 1px solid #EBD4A8; color: #8A5A12; }
.env-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 4px 18px; margin-bottom: 12px; }
.env-l { display: flex; gap: 8px; font-size: 12.5px; align-items: baseline; }
.env-l span { color: var(--gris); flex: 0 0 auto; }
.env-l b { word-break: break-all; font-weight: 600; }
.env-sujet { display: flex; gap: 8px; font-size: 13.5px; padding: 8px 10px;
             background: var(--gris-clair); border-radius: 6px; margin-bottom: 8px; }
.env-sujet span { color: var(--gris); flex: 0 0 auto; }
.env-corps { margin: 0; padding: 12px 14px; background: #FBFAF7;
             border: 1px solid var(--bordure); border-radius: 8px; font-size: 13px;
             line-height: 1.55; white-space: pre-wrap; word-break: break-word;
             max-height: 46vh; overflow-y: auto; font-family: inherit; }
.env-fil-t { margin: 14px 0 6px; font-size: 12.5px; color: var(--gris); font-weight: 600; }
.env-fil { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.env-fil th { text-align: left; color: var(--gris); font-weight: 600;
              border-bottom: 1px solid var(--bordure); padding: 5px 6px; }
.env-fil td { padding: 5px 6px; border-bottom: 1px solid #F1EFEA; vertical-align: top; }
.env-fil .env-ko td { background: #fdf5f5; }
.env-mono { font-family: ui-monospace, monospace; font-size: 11.5px; word-break: break-all; }
