:root {
  --fond: #f6f5f1;
  --carte: #ffffff;
  --texte: #1f2328;
  --muet: #6b7280;
  --bord: #e3e1da;
  --accent: #b4552d;
  --accent-fonce: #8f4222;
  --chaud: #c2410c;
  --tiede: #b7791f;
  --froid: #9ca3af;
  --exclu: #6b7280;
  --ok: #2f855a;
  --ko: #c53030;
  --bandeau: #fff7ed;
  --alerte: #fdecec;
  font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15171a;
    --carte: #1e2126;
    --texte: #e6e6e3;
    --muet: #9aa0a6;
    --bord: #2d3138;
    --accent: #e0774a;
    --accent-fonce: #f08c62;
    --bandeau: #2a2520;
    --alerte: #3a2020;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muet); text-transform: uppercase; letter-spacing: .04em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bord); padding: 0 .3em; border-radius: 3px; }
main { max-width: 1280px; margin: 0 auto; padding: 1.2rem 16px 3rem; }
.barre { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 16px; background: var(--carte); border-bottom: 1px solid var(--bord); flex-wrap: wrap; }
.barre .marque { font-weight: 700; font-size: 1.1rem; color: var(--texte); }
.barre .marque span { color: var(--accent); }
.barre nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.barre nav a { color: var(--muet); padding: .2rem 0; border-bottom: 2px solid transparent; }
.barre nav a.actif, .barre nav a:hover { color: var(--texte); border-color: var(--accent); text-decoration: none; }
.pied { text-align: center; color: var(--muet); font-size: .85rem; padding: 1rem; }
.live { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muet); max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live #live-barre.actif { color: var(--texte); }
.live #live-barre.actif::before { content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--chaud); margin-right: .35em; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.carte.inactive { opacity: .6; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tuile { display: flex; flex-direction: column; background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: .8rem 1rem; color: var(--texte); }
.tuile:hover { text-decoration: none; border-color: var(--accent); }
.tuile.attention { border-color: var(--tiede); }
.tuile .chiffre { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.tuile .libelle { color: var(--muet); font-size: .85rem; }
.muet { color: var(--muet); }
.petit { font-size: .85rem; }
.rouge { color: var(--ko); }
.accent { color: var(--accent); }
ul.collecte { margin: .2rem 0 .6rem; padding-left: 1.1rem; }
.compteur { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; text-align: center; font-weight: 700; }
.badge-email { display: inline-block; font-size: .72rem; padding: .02em .45em; border-radius: 4px; background: var(--bord); color: var(--texte); cursor: help; white-space: nowrap; }
.badge-email.verifie { background: #d7efdf; color: #1e5e3a; }
.badge-email.generique { background: #dde7f7; color: #27467a; }
.badge-email.risque { background: #fbeccd; color: #6b4a08; }
.badge-email.invalide { background: #f9d9d9; color: #7a1f1f; }
.vert { color: var(--ok); }
.actions-contacter { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: .2rem 0 .8rem; }
table.contacts tr.principal td { background: var(--bandeau); }
details.menu { position: relative; }
details.menu > summary { cursor: pointer; color: var(--accent); font-size: .85rem; list-style: none; }
details.menu[open] > .menu-corps { position: absolute; right: 0; z-index: 5; width: min(560px, 90vw); background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: .7rem; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.menu-corps form { margin: .2rem 0; }
.resultats { display: flex; flex-direction: column; gap: .15rem; }
input.court { width: 11em; padding: .25rem .4rem; font-size: .85rem; }
input.plein, textarea { width: 100%; }
button.danger { background: var(--ko); border-color: var(--ko); }
.preparer-lot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: -.3rem 0 1rem; }
.envoi { display: grid; grid-template-columns: 220px minmax(260px, 1fr) minmax(320px, 1.5fr); gap: 1rem; align-items: start; }
.rail { display: flex; flex-direction: column; gap: .3rem; max-height: 80vh; overflow: auto; }
.rail a { display: flex; flex-direction: column; padding: .45rem .6rem; border: 1px solid var(--bord); border-radius: 6px; background: var(--carte); color: var(--texte); }
.rail a.actif { border-color: var(--accent); background: var(--bandeau); }
.rail a:hover { text-decoration: none; border-color: var(--accent); }
.message label { display: block; margin-bottom: .6rem; font-size: .9rem; }
.message textarea { font-family: inherit; line-height: 1.5; }
.variantes { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: .6rem; }
ul.verifs { list-style: none; padding: 0; margin: 0 0 .6rem; font-size: .85rem; }
ul.verifs li { padding: .12rem 0; }
ul.verifs .pastille { display: inline-block; width: 1.3em; text-align: center; font-weight: 700; }
ul.verifs li.ok .pastille { color: var(--ok); }
ul.verifs li.avertissement { color: var(--tiede); }
ul.verifs li.bloquant { color: var(--ko); font-weight: 600; }
pre.apercu { white-space: pre-wrap; font-family: inherit; font-size: .9rem; background: var(--fond); border: 1px solid var(--bord); border-radius: 6px; padding: .8rem; }
.copier, .issue { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .6rem 0; }
.bouton.inactif { opacity: .45; pointer-events: none; }
main.document { max-width: 760px; }
main.document h2 { margin-top: 1.4rem; }
table.registre th { width: 28%; text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--texte); }
@media (max-width: 1000px) { .envoi { grid-template-columns: 1fr; } .rail { flex-direction: row; overflow-x: auto; max-height: none; } .rail a { min-width: 180px; } }
ul.collecte li { padding: .05rem 0; }
.bandeau.en-cours::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--chaud); margin-right: .5em; animation: pulse 1.2s infinite; }
.bandeau { background: var(--bandeau); border: 1px solid var(--bord); border-radius: 6px; padding: .6rem .9rem; }
.alerte { background: var(--alerte); border: 1px solid #e0a0a0; border-radius: 6px; padding: .6rem .9rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { color: var(--muet); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
table.compact th, table.compact td { padding: .3rem .4rem; }
tr.ignoree { opacity: .55; }
tr.muet td { color: var(--muet); }
.score { display: inline-block; min-width: 2.4em; text-align: center; padding: .15em .45em; border-radius: 999px; font-weight: 700; color: #fff; background: var(--froid); font-variant-numeric: tabular-nums; }
.score.chaud { background: var(--chaud); }
.score.tiede { background: var(--tiede); }
.score.exclu { background: var(--exclu); }
.score.grand { font-size: 1.5rem; min-width: 3em; }
.scores { display: flex; gap: 1rem; }
.score-bloc { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; }
.score-bloc .libelle { font-size: .8rem; color: var(--muet); }
.entete-fiche { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.entete-fiche p { margin: .2rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-block; font-size: .78rem; padding: .1em .55em; border-radius: 999px; background: var(--bord); color: var(--texte); white-space: nowrap; }
.chip b { color: var(--chaud); font-weight: 600; }
.chip.negatif b { color: var(--ko); }
a.chip:hover { text-decoration: none; outline: 1px solid var(--accent); }
.etat { display: inline-block; font-size: .75rem; padding: .05em .5em; border-radius: 4px; background: var(--bord); color: var(--texte); text-transform: lowercase; }
.etat.ok, .etat.confirme { background: #d7efdf; color: #1e5e3a; }
.etat.erreur, .etat.rejete { background: #f9d9d9; color: #7a1f1f; }
.etat.partiel, .etat.propose, .etat.en_cours { background: #fbeccd; color: #6b4a08; }
.etat.dds { background: #fde6d8; color: var(--accent-fonce); }
.etat.grafo { background: #dde7f7; color: #27467a; }
.point { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .4em; background: var(--froid); }
.point.ok { background: var(--ok); }
.point.ko { background: var(--ko); }
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { padding: .35rem 0; border-bottom: 1px solid var(--bord); display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.liste li:last-child { border-bottom: 0; }
.filtres { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin-bottom: 1rem; }
.filtres label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muet); gap: .2rem; }
.filtres label.case { flex-direction: row; align-items: center; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=search], input[type=number], input[type=password], select, textarea { padding: .4rem .5rem; border: 1px solid var(--bord); border-radius: 5px; background: var(--carte); color: var(--texte); }
textarea { width: 100%; }
button, .bouton { padding: .45rem .9rem; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: #fff; cursor: pointer; display: inline-block; }
button:hover, .bouton:hover { background: var(--accent-fonce); text-decoration: none; }
button.secondaire, .bouton.secondaire { background: transparent; color: var(--accent); }
button.lien { background: none; border: 0; color: var(--muet); padding: 0; cursor: pointer; }
button.lien:hover { color: var(--texte); text-decoration: underline; }
button.petit { padding: .2rem .55rem; font-size: .8rem; }
button:disabled { opacity: .5; cursor: default; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin: .2rem .4rem .2rem 0; flex-wrap: wrap; }
.actions form { margin: .1rem .2rem; }
.pagination { display: flex; gap: 1rem; justify-content: center; padding: 1rem; }
.poids { font-weight: 700; color: var(--chaud); white-space: nowrap; }
.poids.negatif { color: var(--ko); }
pre.journal { white-space: pre-wrap; font-size: .8rem; max-height: 60vh; overflow: auto; background: var(--fond); padding: .8rem; border-radius: 6px; }
details.carte summary { cursor: pointer; font-weight: 600; }
body.centre { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.connexion { width: 320px; display: flex; flex-direction: column; gap: .8rem; }
.connexion label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.signaux tr.statut-rejete { opacity: .55; }
.explication { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: .7rem 1rem; margin: 0 0 .8rem; line-height: 1.7; }
.explication .score { vertical-align: middle; }
.niveaux { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .8rem; }
.niveaux .niveau { padding: .35rem .8rem; border: 1px solid var(--bord); border-radius: 999px; color: var(--texte); background: var(--carte); }
.niveaux .niveau b { color: var(--accent); margin-left: .2em; }
.niveaux .niveau.actif { border-color: var(--accent); background: var(--bandeau); }
.niveaux .niveau:hover { text-decoration: none; border-color: var(--accent); }
.niveau-cellule { text-align: center; }
.etapes { margin: 0; padding-left: 1.2rem; }
.etapes li { padding: .25rem 0; }
.etapes li::marker { color: var(--muet); }
.etapes li.fait::marker { content: "✓ "; color: var(--ok); }
.etapes li.afaire::marker { content: "○ "; color: var(--ko); }
.etapes li.encours::marker { content: "… "; color: var(--tiede); }
.cible { border: 1px solid var(--bord); border-radius: 6px; padding: .6rem .8rem; margin-bottom: .6rem; }
.cible.inactive { opacity: .6; }
.cible-tete { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.formulaire-cible { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.formulaire-cible fieldset, .service { border: 1px solid var(--bord); border-radius: 6px; padding: .6rem .9rem; margin: .8rem 0; }
.formulaire-cible legend { font-weight: 600; padding: 0 .3rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1rem; align-items: end; margin-bottom: .6rem; }
.grille label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.grille label.case { flex-direction: row; align-items: center; gap: .4rem; color: var(--muet); }
.champ-cle { display: flex; flex-direction: column; gap: .3rem; }
.cases { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .4rem 0; }
.familles { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
button.chip { border: 1px solid var(--bord); cursor: pointer; }
button.chip:hover { border-color: var(--accent); background: var(--bandeau); color: var(--texte); }
button.chip.retirable { background: var(--bandeau); }
.recherche-naf { position: relative; margin-bottom: .5rem; }
.recherche-naf input { width: 100%; }
.resultats-naf { list-style: none; margin: 0; padding: .3rem 0; max-height: 240px; overflow: auto; border: 1px solid var(--bord); border-radius: 6px; background: var(--carte); }
.resultats-naf li { padding: .1rem .6rem; }
.resultats-naf button.lien { color: var(--texte); text-align: left; }
.resultats-naf button.lien:hover { color: var(--accent); }
.service h3 { margin-top: .2rem; text-transform: none; letter-spacing: 0; color: var(--texte); font-size: 1rem; }
@media (max-width: 700px) {
  .barre { gap: .6rem; }
  table.radar td:nth-child(4), table.radar th:nth-child(4), table.radar td:nth-child(5), table.radar th:nth-child(5) { display: none; }
}
