:root {
  /* Palette : anthracite, bordeaux profond, rouge vif, ambre, jaune (visuel transmis par Aymeric) */
  --fond: #1b1e22;
  --fond-2: #22262b;
  --fond-3: #2b3036;
  --trait: #3a4047;
  --encre: #eceef0;
  --encre-douce: #9aa3ad;
  --accent: #e5252a;
  --accent-2: #d9a441;
  --jaune: #f2e94e;
  --bordeaux: #4a1a1f;
  --bleu: #6f8fb0;
  --vert: #4caf8a;
  --rouge: #ff2a2a;
  --panneau: 440px;
  --police: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--police); font-size: 13.5px; color: var(--encre); background: var(--fond); display: flex; flex-direction: column; }
a { color: #8ab4ff; }
code { background: var(--fond-3); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
::-webkit-scrollbar { width: 9px; } ::-webkit-scrollbar-thumb { background: #2c3850; border-radius: 6px; }

/* ---------- en-tête ---------- */
.entete { background: linear-gradient(90deg, #17191d, #2a1518); color: #fff; display: flex; flex-direction: column; flex: 0 0 auto; border-bottom: 1px solid var(--trait); }
.entete-ligne { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; gap: 16px; }
.entete-nav { padding: 0 16px; border-top: 1px solid rgba(255,255,255,.06); background: rgba(0,0,0,.18); }
.entete-nav .onglets { border-bottom: 0; flex: 1 1 auto; }
.entete-nav .onglet { flex: 0 0 auto; padding: 9px 16px; font-size: 13px; }
.assistant { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.assistant-texte { display: flex; flex-direction: column; line-height: 1.1; } .assistant-texte b { font-size: 12px; } .assistant-texte span { font-size: 10.5px; color: var(--encre-douce); }
.reacteur { position: relative; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #f2e94e 0%, #e5252a 45%, #4a1a1f 72%, transparent 73%); box-shadow: 0 0 10px rgba(229,37,42,.6); flex: 0 0 auto; }
.reacteur span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(217,164,65,.55); animation: onde 2.4s linear infinite; opacity: 0; }
.reacteur span:nth-child(2) { animation-delay: .8s; } .reacteur span:nth-child(3) { animation-delay: 1.6s; }
.reacteur.parle { box-shadow: 0 0 22px rgba(242,233,78,.9); animation: coeur .6s ease-in-out infinite alternate; }
.reacteur.parle span { animation-duration: 1.1s; }
.reacteur.petit { width: 42px; height: 42px; }
@keyframes onde { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes coeur { from { transform: scale(1); } to { transform: scale(1.12); } }
.cloche { position: relative; font-size: 16px; }
.pastille-notif { position: absolute; top: -2px; right: -4px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 1px 5px; min-width: 16px; text-align: center; box-shadow: 0 0 8px rgba(229,37,42,.8); }
.pastille-notif.fort { animation: pulse 1s infinite; }
.panneau-notifs { position: fixed; top: 92px; right: 16px; width: min(440px, 94vw); max-height: 70vh; z-index: 1500; background: linear-gradient(180deg, #24272b, #1b1e22); border: 1px solid var(--trait); border-top: 3px solid var(--accent); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; }
.panneau-notifs-entete { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--trait); } .panneau-notifs-entete .mini { color: var(--encre-douce); font-size: 11px; } .panneau-notifs-entete a { margin-left: auto; font-size: 11px; } .panneau-notifs-entete .btn { font-size: 14px; }
.panneau-notifs .liste { overflow-y: auto; padding: 8px 10px; margin: 0; }
.panneau-notifs .liste li.nonlu { background: #2a1a1d; }
.toasts { position: fixed; right: 16px; bottom: 40px; z-index: 1600; display: flex; flex-direction: column; gap: 8px; width: min(380px, 90vw); }
.toast { background: linear-gradient(90deg, #2b3036, #24272b); border: 1px solid var(--trait); border-left: 5px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: glisse .3s ease-out; cursor: pointer; }
.toast b { display: block; font-size: 13px; } .toast .t { color: var(--encre-douce); font-size: 11px; }
@keyframes glisse { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.fenetre { position: fixed; inset: 0; z-index: 2000; background: rgba(8,9,11,.72); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.fenetre-boite { width: min(760px, 94vw); max-height: 88vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #24272b, #1b1e22); border: 1px solid var(--trait); border-top: 3px solid var(--accent); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.fenetre-entete { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--trait); } .fenetre-entete b { font-size: 16px; } .fenetre-entete .btn { margin-left: auto; font-size: 16px; }
.fenetre-corps { padding: 12px 16px; overflow-y: auto; }
.fenetre-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--trait); }
.briefing { background: var(--fond); border-left: 3px solid var(--accent-2); border-radius: 4px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.nouv-site { margin-bottom: 12px; } .nouv-site h4 { margin: 0 0 4px; font-size: 13px; display: flex; gap: 8px; align-items: center; } .nouv-site h4 .badge { margin-left: 0; }
@media (max-width: 900px) { .entete-nav { overflow-x: auto; } }
.marque { display: flex; align-items: center; gap: 12px; }
.logo { background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .5px; padding: 6px 9px; border-radius: 4px; font-size: 12px; }
.titre { font-weight: 700; font-size: 17px; }
.sous { font-size: 11.5px; color: var(--encre-douce); }
.kpis-globaux { display: flex; gap: 6px; }
.kpi { background: #2a1a1d; border: 1px solid var(--trait); border-radius: 6px; padding: 4px 12px; text-align: center; min-width: 86px; }
.kpi b { display: block; font-size: 17px; color: var(--accent-2); line-height: 1.1; }
.kpi span { font-size: 10.5px; color: var(--encre-douce); text-transform: uppercase; letter-spacing: .04em; }
.entete-droite { display: flex; align-items: center; gap: 14px; }
.collecte-etat { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--encre-douce); }
.collecte-etat .point { width: 9px; height: 9px; border-radius: 50%; background: #566274; }
.collecte-etat.ok .point { background: var(--vert); box-shadow: 0 0 8px var(--vert); }
.collecte-etat.en-cours .point { background: var(--accent-2); animation: pulse 1s infinite; }
.collecte-etat.erreur .point { background: var(--rouge); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- boutons ---------- */
.btn { border: 1px solid transparent; border-radius: 5px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; color: var(--encre); }
.btn-principal { background: var(--accent); color: #fff; font-weight: 600; }
.btn-principal:hover { background: #ff7f50; }
.btn-contour { background: transparent; border-color: #3b4860; }
.btn-contour:hover { background: var(--fond-3); }
.btn-lien { background: transparent; color: var(--encre-douce); }
.btn[disabled] { opacity: .5; cursor: wait; }

/* ---------- disposition ---------- */
.app { flex: 1 1 auto; display: grid; grid-template-columns: var(--panneau) 1fr; min-height: 0; }
.panneau { background: var(--fond-2); border-right: 1px solid var(--trait); display: flex; flex-direction: column; min-height: 0; }
.onglets { display: flex; border-bottom: 1px solid var(--trait); flex: 0 0 auto; }
.onglet { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 4px; font: inherit; font-weight: 600; color: var(--encre-douce); cursor: pointer; }
.onglet.actif { color: #fff; border-bottom-color: var(--accent-2); }
.vue { display: none; overflow-y: auto; padding: 12px 14px; flex: 1 1 auto; min-height: 0; }
.vue.actif { display: block; }
.bloc { margin-bottom: 14px; }
.bloc-titre { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--encre-douce); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.bloc-titre .mini { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: auto; }
.lien-mini { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { border: 1px solid #3b4860; background: transparent; color: var(--encre); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.puce.actif { background: var(--accent); color: #fff; border-color: var(--accent); }
.mini-puces .puce { padding: 2px 9px; font-size: 11px; }
.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; }
.cases label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.cases input { margin: 0; accent-color: var(--accent); }
.cases .lib { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cases .nb { margin-left: auto; font-size: 11px; color: var(--encre-douce); }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.pastille.creuse { background: transparent; border: 2px solid #9aa5b1; width: 8px; height: 8px; }
.pastille.client { background: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,53,.3); }
.compteur { font-size: 12px; color: var(--encre-douce); }
.ligne { display: flex; gap: 8px; align-items: flex-end; }
.ligne.deux > * { flex: 1; }
.ligne.boutons { flex-wrap: wrap; margin-top: 8px; align-items: center; }
input[type=text], input[type=search], input[type=number], select, textarea { width: 100%; font: inherit; padding: 8px 9px; border: 1px solid #3b4860; border-radius: 5px; background: var(--fond); color: var(--encre); }
input::placeholder { color: #6f7c91; }
input:focus, select:focus { outline: 2px solid rgba(58,134,255,.35); border-color: var(--bleu); }
.champ { display: block; font-size: 11.5px; font-weight: 600; color: var(--encre-douce); margin-bottom: 8px; }
.champ input, .champ select { margin-top: 3px; font-weight: 400; color: var(--encre); }
.case-simple { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; margin: 4px 0; color: var(--encre-douce); }
.case-simple input { accent-color: var(--accent); margin-top: 2px; }
.erreur { color: var(--rouge); font-size: 12.5px; margin-top: 6px; min-height: 1em; }
.aide { font-size: 12px; color: var(--encre-douce); }
.cache { display: none !important; }

/* ---------- v3 : site, météo, rejeu, médias ---------- */
.carte-site { background: linear-gradient(180deg, #2b3036, #24272b); border: 1px solid var(--trait); border-radius: 8px; padding: 12px; }
.statut-site { font-size: 12px; padding: 6px 10px; border-radius: 5px; background: rgba(217,164,65,.12); border: 1px solid rgba(217,164,65,.4); color: var(--accent-2); margin-bottom: 4px; }
.statut-site.enregistre { background: rgba(76,175,138,.12); border-color: rgba(76,175,138,.4); color: var(--vert); }
.etape { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-2); margin: 10px 0 6px; }
.etape .num { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-2); color: #111; align-items: center; justify-content: center; font-size: 11px; }
.etape .aide { text-transform: none; letter-spacing: 0; font-weight: 400; }
.btn-large { padding: 10px 18px; font-size: 14px; }
.meteo { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.meteo .jour { background: var(--fond); border: 1px solid var(--trait); border-radius: 6px; padding: 5px 2px; text-align: center; cursor: pointer; font-size: 10.5px; }
.meteo .jour:hover { border-color: var(--accent-2); }
.meteo .jour.actif { border-color: var(--accent); }
.meteo .jour .p { font-size: 18px; line-height: 1.1; }
.meteo .jour b { display: block; font-size: 13px; }
.meteo .jour .d { color: var(--encre-douce); }
.meteo .jour.majeure { background: #3a1216; } .meteo .jour.forte { background: #3a2a12; }
.rejeu { background: var(--fond); border: 1px solid var(--trait); border-radius: 6px; padding: 8px; }
.rejeu .ligne { gap: 6px; align-items: center; } .rejeu select { width: auto; padding: 3px 6px; font-size: 12px; }
.rejeu-heure { font-size: 22px; font-weight: 800; color: var(--accent-2); text-align: center; font-variant-numeric: tabular-nums; }
.rejeu-heure small { font-size: 11px; color: var(--encre-douce); display: block; font-weight: 400; }
.liste .medias { display: flex; gap: 4px; margin-top: 5px; } .liste .medias img { width: 54px; height: 40px; object-fit: cover; border-radius: 3px; border: 1px solid var(--trait); }
.popup-medias { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; } .popup-medias img { width: 96px; height: 68px; object-fit: cover; border-radius: 3px; }
.route { border-left-width: 5px !important; } .route.recommande { border-left-color: var(--vert) !important; }
.synthese p { margin: 0 0 8px; line-height: 1.45; } .synthese h5 { margin: 10px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-2); }
.synthese .sc { border-left: 3px solid var(--accent-2); padding-left: 8px; margin: 6px 0; } .synthese .sc b { color: var(--jaune); }
.marqueur-rejeu { animation: apparition .6s ease-out; } @keyframes apparition { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- pays ---------- */
.pays-chips { gap: 4px; }
.pays-chips .puce { padding: 3px 9px; font-size: 12px; }
.direct-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vert); box-shadow: 0 0 8px var(--vert); animation: pulse 1.4s infinite; margin-right: 6px; }

/* ---------- baromètre ---------- */
.barometre { display: flex; align-items: center; gap: 8px; background: var(--fond-3); border: 1px solid var(--trait); border-radius: 8px; padding: 2px 10px 2px 4px; cursor: pointer; }
.jauge-svg { width: 92px; height: 54px; }
.baro-titre { font-size: 9.5px; letter-spacing: .1em; color: var(--encre-douce); }
.baro-libelle { font-weight: 800; font-size: 14px; }
.baro-desc { font-size: 10px; color: var(--encre-douce); max-width: 190px; line-height: 1.2; }
.echelle { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 6px 0; }
.echelle div { padding: 5px 2px; text-align: center; font-size: 10px; border-radius: 4px; background: var(--fond); color: var(--encre-douce); border: 1px solid var(--trait); }
.echelle div.actif { color: #fff; font-weight: 700; border-color: transparent; }
.echelle div b { display: block; font-size: 14px; }

/* ---------- journée ---------- */
input[type=date] { width: auto; padding: 4px 8px; font-size: 12px; color-scheme: dark; }
.puce.journee { border-color: var(--accent); }
.puce.journee b { color: var(--accent-2); margin-left: 4px; }
.puce.journee.actif { background: var(--accent); border-color: var(--accent); }
.puce.journee.actif b { color: #fff; }
.focus { background: var(--fond); border: 1px solid var(--trait); border-radius: 6px; padding: 8px 10px; font-size: 12px; }
.focus .ligne-focus { display: flex; gap: 6px; align-items: center; margin: 3px 0; }
.focus .barre { flex: 1; height: 8px; background: var(--fond-3); border-radius: 4px; overflow: hidden; }
.focus .barre i { display: block; height: 100%; background: var(--bleu); }
.focus .lib { width: 128px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus .n { width: 30px; text-align: right; color: var(--encre-douce); }
.focus h5 { margin: 8px 0 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-douce); }
.focus .heures { display: flex; gap: 2px; align-items: flex-end; height: 36px; margin-top: 4px; }
.focus .heures div { flex: 1; background: var(--accent-2); border-radius: 2px 2px 0 0; position: relative; min-height: 1px; }
.focus .heures div span { position: absolute; bottom: -14px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--encre-douce); }
.chrono rect { cursor: pointer; }
.chrono rect.choisi { stroke: #fff; stroke-width: 1; }

/* ---------- chronologie ---------- */
.chrono { background: var(--fond); border: 1px solid var(--trait); border-radius: 6px; padding: 6px; height: 110px; }
.chrono svg { width: 100%; height: 100%; display: block; }
.chrono text { fill: var(--encre-douce); font-size: 9px; }
.chrono .auj { stroke: var(--accent); stroke-dasharray: 3 2; }

/* ---------- listes ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { border: 1px solid var(--trait); border-left: 4px solid var(--trait); border-radius: 5px; padding: 7px 9px; margin-bottom: 6px; background: var(--fond-3); cursor: pointer; }
.liste li:hover { border-color: var(--bleu); }
.liste .l1 { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--encre-douce); }
.liste .l1 .type { font-weight: 700; color: var(--encre); }
.liste .l2 { font-size: 13px; margin-top: 2px; line-height: 1.35; }
.liste .l3 { font-size: 11.5px; color: var(--encre-douce); margin-top: 3px; }
.liste .distance { margin-left: auto; font-weight: 700; color: #fff; white-space: nowrap; background: #4b5563; border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.liste .distance.proche { background: var(--rouge); }
.liste .distance.moyen { background: var(--accent); }
.liste .mots { color: var(--accent-2); font-weight: 600; }
.liste .passe { opacity: .6; }
.liste li.anterieure { opacity: .7; }
.badge { display: inline-block; background: var(--bordeaux); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }

/* ---------- résultat ---------- */
.carte-niveau { background: linear-gradient(180deg, #2b3036, #2a1a1d); border: 1px solid var(--trait); border-radius: 8px; padding: 12px; }
.jauge { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; }
.jauge span { height: 9px; border-radius: 3px; background: #2c3850; }
.jauge.n1 span:nth-child(-n+1) { background: var(--vert); }
.jauge.n2 span:nth-child(-n+2) { background: var(--accent-2); }
.jauge.n3 span:nth-child(-n+3) { background: var(--accent); }
.jauge.n4 span:nth-child(-n+4) { background: var(--rouge); box-shadow: 0 0 10px var(--rouge); }
.niveau-texte { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.niveau-texte.n1 { color: var(--vert); } .niveau-texte.n2 { color: var(--accent-2); } .niveau-texte.n3 { color: var(--accent); } .niveau-texte.n4 { color: var(--rouge); }
.raisons { margin: 8px 0 4px; padding-left: 18px; font-size: 12.5px; line-height: 1.4; }
.adresse-ban { font-size: 11.5px; color: var(--encre-douce); }
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.chiffre { background: var(--fond-3); border: 1px solid var(--trait); border-radius: 6px; padding: 7px 4px; text-align: center; }
.chiffre b { display: block; font-size: 20px; color: var(--accent-2); line-height: 1.1; }
.chiffre span { font-size: 10.5px; color: var(--encre-douce); }

/* ---------- tableau ---------- */
.tableau { width: 100%; border-collapse: collapse; font-size: 12px; }
.tableau th, .tableau td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-douce); }
.statut-ok { color: var(--vert); font-weight: 600; }
.statut-erreur { color: var(--rouge); font-weight: 600; }
.statut-en-cours { color: var(--accent-2); font-weight: 600; }

/* ---------- carte ---------- */
.carte-conteneur { position: relative; min-height: 0; background: #1b1e22; }
#carte { position: absolute; inset: 0; background: #1b1e22; }
.legende { position: absolute; right: 12px; bottom: 24px; z-index: 500; background: rgba(27,30,34,.94); border: 1px solid var(--trait); border-radius: 8px; padding: 8px 10px; font-size: 11px; max-width: 240px; color: var(--encre); }
.legende-titre { font-weight: 700; margin-bottom: 4px; }
.legende-ligne { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.bandeau-client { position: absolute; left: 12px; top: 12px; z-index: 500; background: rgba(27,30,34,.94); border: 1px solid var(--trait); border-left: 5px solid var(--accent); border-radius: 8px; padding: 8px 12px; color: var(--encre); font-size: 12.5px; max-width: 360px; }
.bandeau-client b { font-size: 14px; }
.leaflet-container { font-family: var(--police); }
.tuiles-sombres { filter: invert(100%) hue-rotate(180deg) brightness(82%) contrast(95%) saturate(25%); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #22262b; color: var(--encre); box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.leaflet-popup-content { font-size: 13px; line-height: 1.4; margin: 10px 12px; max-width: 320px; }
.popup-type { font-weight: 700; }
.popup-meta { color: var(--encre-douce); font-size: 12px; }
.popup-desc { margin-top: 4px; max-height: 160px; overflow: auto; }
.leaflet-bar a { background: #22262b; color: var(--encre); border-bottom-color: var(--trait); }
.leaflet-control-attribution { background: rgba(27,30,34,.7) !important; color: var(--encre-douce) !important; font-size: 10px; }
.leaflet-control-attribution a { color: #8ab4ff; }
.marqueur-client { background: var(--jaune); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(242,233,78,.35), 0 0 18px rgba(242,233,78,.8); animation: battement 1.6s infinite; }
@keyframes battement { 50% { box-shadow: 0 0 0 10px rgba(242,233,78,.05), 0 0 24px rgba(242,233,78,.9); } }
.etiquette-anneau { background: transparent; border: 0; box-shadow: none; color: var(--accent); font-size: 11px; font-weight: 700; text-shadow: 0 0 4px #000; }
.grappe { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 0 12px rgba(0,0,0,.6); }
.grappe.g1 { background: rgba(111,143,176,.85); } .grappe.g2 { background: rgba(217,164,65,.9); } .grappe.g3 { background: rgba(229,37,42,.9); } .grappe.g4 { background: rgba(74,26,31,.95); border-color: #ff2a2a; }
.etiquette-client { background: #1b1e22; color: #fff; border: 1px solid var(--accent); border-radius: 4px; padding: 2px 6px; font-weight: 700; font-size: 12px; box-shadow: none; }
.etiquette-client::before { display: none; }

@media (max-width: 1100px) { .kpis-globaux { display: none; } }
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .entete-ligne, .entete-ligne > *, .entete-nav .onglets { min-width: 0; }
  .entete-nav .onglets { overflow-x: auto; scrollbar-width: none; }
  .fenetre-boite { width: 96vw; max-height: 92vh; }
  .fenetre-corps { -webkit-overflow-scrolling: touch; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  body.onglet-carte .app { grid-template-rows: 46% 54%; }
  body:not(.onglet-carte) .carte-conteneur { display: none; }
  .panneau { border-right: 0; border-bottom: 1px solid var(--trait); }
  .entete .sous, .entete .assistant-texte, .kpis-globaux, .entete [title^="Pays affiché"], .entete a[href="/salle"], .collecte-etat .texte, .baro-desc { display: none; }
  .entete .marque img, .entete .logo-client img { max-height: 30px; max-width: 110px; }
  .entete .marque .logo { padding: 4px 6px; font-size: 11px; }
  #barometre { transform: scale(.85); transform-origin: left center; }
  .entete-droite { gap: 6px; }
  .entete-ligne { padding: 6px 10px; gap: 8px; }
  .entete-nav { padding: 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .entete-nav .onglet, .entete-nav .onglet-lien { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .vue { padding: 10px; }
  .ligne.deux { flex-direction: column; align-items: stretch; }
  .ligne.deux > * { flex: none; }
  .kpi-grille, .cc-chiffres { grid-template-columns: repeat(2, 1fr); }
  .panneau-notifs { right: 6px; left: 6px; width: auto; top: 110px; }
  .console-corps { padding: 10px; }
  .cartes-comptes { grid-template-columns: 1fr; }
  .tableau-console, .tableau { display: block; overflow-x: auto; }
  .utilisateur .u-nom { max-width: 90px; }
  .fenetre-corps.fiche { width: 100vw; max-height: 100vh; border-radius: 0; }
  .toasts { left: 8px; right: 8px; }
  .cal-cartes { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 480px) {
  .entete-ligne .marque .titre { font-size: 15px; }
  .utilisateur .u-role { display: none; }
  .kpi-grille, .cc-chiffres { grid-template-columns: repeat(2, 1fr); }
  .msg-social .l1 { flex-wrap: wrap; }
}

/* ---- calendrier des grandes journées (cartes par date) ---- */
.cal-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 8px; }
.carte-jour { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 1px; background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 0 0 8px; font: inherit; color: var(--encre); cursor: pointer; text-align: left; overflow: hidden; transition: border-color .15s, transform .15s; }
.carte-jour:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.carte-jour.actif { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(229, 37, 42, .35); }
.cj-tete { display: flex; justify-content: space-between; align-items: center; gap: 4px; background: var(--bordeaux); color: #fff; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; }
.carte-jour.fort .cj-tete { background: var(--accent); }
.carte-jour.auj .cj-tete { background: var(--accent-2); color: #1b1e22; }
.cj-j { font-weight: 700; white-space: nowrap; }
.cj-num { font-size: 30px; font-weight: 800; line-height: 1; padding: 8px 8px 0; color: var(--jaune); }
.cj-mois { font-size: 11px; color: var(--encre-douce); padding: 0 8px 4px; }
.cj-chiffres { font-size: 11px; padding: 0 8px; color: var(--encre-douce); line-height: 1.3; }
.cj-chiffres b { color: var(--encre); font-size: 13px; }
.cj-chiffres em { color: var(--accent); font-style: normal; font-weight: 700; }
.cj-barres { display: flex; height: 5px; margin: 5px 8px 3px; border-radius: 3px; overflow: hidden; background: var(--trait); }
.cj-barres i { display: block; height: 100%; }
.cj-communes { font-size: 10.5px; color: var(--encre-douce); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cj-nouveau { position: absolute; top: 28px; right: 6px; background: var(--jaune); color: #1b1e22; font-size: 9.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
#tableau-decouvertes tr.inactif td { opacity: .55; }
.lien-mini { font-size: 11px; color: var(--encre-douce); }

/* ---- édition en ligne : rôles, logo client, vue éditeur ---- */
body.role-client .admin-seul { display: none !important; }
.logo-client { height: 38px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 7px; }
.utilisateur { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); font-size: 12px; }
.utilisateur .u-nom { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utilisateur .u-role { background: var(--bordeaux); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.utilisateur .btn { font-size: 16px; padding: 2px 6px; }
.bandeau-voir { background: var(--accent-2); color: #1b1e22; padding: 6px 16px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.bandeau-voir a { color: #1b1e22; font-weight: 700; margin-left: auto; }
.onglet-editeur { border-color: var(--accent-2) !important; }
.kpi-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.kpi-carte { background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; }
.kpi-carte b { display: block; font-size: 22px; line-height: 1.1; color: var(--jaune); }
.kpi-carte span { font-size: 11px; color: var(--encre-douce); }
.kpi-carte.alerte b { color: var(--accent); }
.kpi-carte.ok b { color: var(--vert); }
.journal-logs { background: #121417; color: #c9ced4; font: 11px/1.45 Consolas, "Courier New", monospace; padding: 10px; border-radius: 8px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.logo-apercu { background: #fff; border-radius: 8px; min-height: 56px; display: flex; align-items: center; justify-content: center; padding: 6px; }
.logo-apercu img { max-height: 60px; max-width: 200px; object-fit: contain; }
.tableau .actions-mini a { margin-right: 8px; font-size: 11.5px; white-space: nowrap; }
.etat-inactif { color: var(--encre-douce); }

/* ------------------------------------------------------------ console éditeur (/editeur) */
.onglet-lien { flex: 0 0 auto; display: inline-flex; align-items: center; padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--accent-2); text-decoration: none; border-bottom: 3px solid transparent; }
.onglet-lien:hover { color: #fff; border-bottom-color: var(--accent-2); }
body.console { overflow: hidden; }
.console-titre { font-size: 12px; font-weight: 600; color: var(--accent-2); background: rgba(217,164,65,.12); border: 1px solid rgba(217,164,65,.4); border-radius: 999px; padding: 1px 9px; margin-left: 6px; vertical-align: middle; }
.kpi-bandeau { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; flex: 1 1 auto; }
.kpi-bandeau .kpi.ok b { color: var(--vert); } .kpi-bandeau .kpi.or b { color: #ffd166; } .kpi-bandeau .kpi.alerte b { color: var(--accent); }
.console-actions { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.console-corps { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 20px 32px; background: radial-gradient(1200px 400px at 20% -10%, rgba(229,37,42,.08), transparent), var(--fond); }
.cvue { display: none; } .cvue.actif { display: block; }
.console-filtres { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.console-filtres input[type=search] { flex: 1 1 260px; max-width: 420px; }
.console-filtres .aide { margin-left: auto; }
.cartes-comptes { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.carte-compte { background: linear-gradient(180deg, #262a2f, #1f2226); border: 1px solid var(--trait); border-top: 3px solid var(--vert); border-radius: 12px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; transition: transform .12s, box-shadow .12s; }
.carte-compte:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.carte-compte.suspendu { border-top-color: #6b7280; opacity: .8; }
.carte-compte.alerte { border-top-color: var(--accent); }
.cc-tete { display: flex; align-items: center; gap: 12px; }
.cc-logo { width: 54px; height: 42px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.cc-logo img { max-width: 50px; max-height: 38px; object-fit: contain; }
.cc-logo span { font-weight: 800; color: var(--bordeaux); font-size: 16px; }
.cc-nom { display: flex; flex-direction: column; min-width: 0; flex: 1; } .cc-nom b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-licence { border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.badge-licence.active { background: rgba(76,175,138,.18); color: var(--vert); border: 1px solid rgba(76,175,138,.5); }
.badge-licence.essai { background: rgba(217,164,65,.15); color: var(--accent-2); border: 1px solid rgba(217,164,65,.5); }
.badge-licence.suspendue { background: rgba(107,114,128,.2); color: #c3c8d0; border: 1px solid #6b7280; }
.badge-licence.resiliee { background: rgba(229,37,42,.15); color: var(--accent); border: 1px solid rgba(229,37,42,.5); }
.cc-chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cc-chiffres div { background: var(--fond); border: 1px solid var(--trait); border-radius: 8px; padding: 6px 4px; text-align: center; }
.cc-chiffres b { display: block; font-size: 18px; line-height: 1.1; color: #fff; } .cc-chiffres span { font-size: 10.5px; color: var(--encre-douce); text-transform: uppercase; letter-spacing: .03em; }
.cc-jauge { height: 6px; background: var(--fond); border-radius: 999px; overflow: hidden; border: 1px solid var(--trait); }
.cc-jauge i { display: block; height: 100%; background: var(--vert); border-radius: 999px; transition: width .3s; }
.cc-pied { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.cc-alerte { color: var(--accent-2); font-weight: 600; }
.cc-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--trait); padding-top: 10px; margin-top: 2px; }
.cc-actions .btn { padding: 5px 10px; font-size: 12px; }
.tableau-console { background: var(--fond-2); border: 1px solid var(--trait); border-radius: 10px; overflow: hidden; }
.tableau-console th { background: #17191d; padding: 8px 10px; } .tableau-console td { padding: 8px 10px; }
.tableau-console tr.inactif td { color: var(--encre-douce); }
.deux-colonnes { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.fenetre-corps.fiche { width: min(1100px, 96vw); max-height: 92vh; display: flex; flex-direction: column; padding: 0; background: linear-gradient(180deg, #24272b, #1b1e22); border: 1px solid var(--trait); border-top: 3px solid var(--accent-2); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.fenetre-corps.fiche.petite { width: min(640px, 96vw); }
.fenetre-corps.fiche .fenetre-entete .mini { color: var(--encre-douce); font-size: 11.5px; }
.fiche-logo { width: 64px; height: 46px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fiche-logo img { max-width: 60px; max-height: 42px; object-fit: contain; } .fiche-logo span { font-weight: 800; color: var(--bordeaux); }
.fiche-contenu { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px; overflow: auto; }
.fiche-contenu.colonne { display: flex; flex-direction: column; }
.fiche-contenu .colonne { display: flex; flex-direction: column; min-width: 0; }
.fiche-contenu textarea { width: 100%; margin-top: 3px; font: inherit; font-weight: 400; color: var(--encre); background: var(--fond); border: 1px solid var(--trait); border-radius: 5px; padding: 6px 8px; }
.fiche-contenu .liste li { cursor: default; } .fiche-contenu .liste li:hover { border-color: var(--trait); }
.fiche-contenu .liste .actions-mini a { margin-right: 10px; }
#form-fiche-util input, #form-fiche-logo input { flex: 1; }
@media (max-width: 1100px) { .deux-colonnes { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .fiche-contenu { grid-template-columns: 1fr; } .kpi-bandeau { display: none; } }
body.console input[type=email], body.console input[type=file] { width: 100%; font: inherit; padding: 8px 9px; border: 1px solid #3b4860; border-radius: 5px; background: var(--fond); color: var(--encre); }
body.console input[type=file] { padding: 5px 9px; font-size: 12px; }
body.console input[type=file]::file-selector-button { font: inherit; font-size: 12px; background: var(--fond-3); color: var(--encre); border: 1px solid #3b4860; border-radius: 4px; padding: 3px 9px; margin-right: 8px; cursor: pointer; }

/* ------------------------------------------------------------ veille par mots-clés / Telegram */
#bloc-veille.alerte-menace .bloc-titre { color: #ff5c8a; }
#bloc-veille.alerte-menace { border: 1px solid #c2185b; border-radius: 8px; padding: 8px; background: rgba(194,24,91,.08); }
.telegram-compte { font-size: 12px; margin-top: 8px; line-height: 1.45; }
#form-telegram input { flex: 1; }
#form-lexique textarea { width: 100%; font: inherit; background: var(--fond); color: var(--encre); border: 1px solid #3b4860; border-radius: 5px; padding: 6px 8px; }
.panneau-notifs .liste li .distance.proche { background: var(--rouge); }

/* ------------------------------------------------------------ onglet réseaux sociaux */
.msg-social { cursor: pointer; }
.msg-social.n3 { background: linear-gradient(90deg, rgba(194,24,91,.16), var(--fond-3)); }
.msg-social.n2 { background: linear-gradient(90deg, rgba(232,132,42,.12), var(--fond-3)); }
.msg-social .reseau { border-radius: 4px; padding: 0 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #4b5563; }
.msg-social .reseau-telegram { background: #2aabee; } .msg-social .reseau-x { background: #111; border: 1px solid #555; } .msg-social .reseau-bluesky { background: #0085ff; }
.msg-social .reseau-mastodon { background: #6364ff; } .msg-social .reseau-reddit { background: #ff4500; }
.pertinence { display: inline-block; width: 70px; height: 6px; background: var(--fond); border: 1px solid var(--trait); border-radius: 999px; vertical-align: middle; overflow: hidden; }
.pertinence i { display: block; height: 100%; background: linear-gradient(90deg, #6f8fb0, #e8842a, #c2185b); }
.onglet .badge { margin-left: 4px; font-size: 10px; padding: 0 6px; }

/* ------------------------------------------------------------ en-tête du site (client) et progression */
.site-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(90deg, #2b3036, #2a1a1d); border: 1px solid var(--trait); border-left: 4px solid var(--accent-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.site-entete b { font-size: 16px; }
body.role-client #form-client { display: none; }
.progression { margin: 6px 0 10px; }
.progression .barre { height: 8px; background: var(--fond); border: 1px solid var(--trait); border-radius: 999px; overflow: hidden; }
.progression .barre i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .6s; }
.progression span { display: block; margin-top: 4px; }
