/* Design issu de PIGU. Thème clair par défaut (tableau de bord PIGU), thème sombre (centre opérationnel PIGU) au choix. */
:root {
  --bg: #f4f6fa;
  --bg2: #ffffff;
  --bg3: #f7f9fc;
  --bg4: #e9eef6;
  --champ: #ffffff;
  --bord: #e2e8f0;
  --bord-fort: #c5cfdd;
  --texte: #1a2537;
  --texte-doux: #566579;
  --texte-inactif: #7a8698;
  --bleu: #0d3f8f;
  --bleu-vif: #1565c0;
  --bleu-clair: #0d4fa3;
  --bleu-fond: rgba(21, 101, 192, .1);
  --bleu-bord: rgba(21, 101, 192, .38);
  --vert: #00744c;
  --vert-fond: rgba(0, 135, 90, .11);
  --ambre: #a64b00;
  --ambre-fond: rgba(221, 107, 32, .13);
  --rouge: #c62828;
  --rouge-vif: #d32030;
  --rouge-fond: rgba(198, 40, 40, .1);
  --barre-fond: rgba(255, 255, 255, .92);
  --voile: rgba(10, 22, 40, .48);
  --defilement: #c5cfdd;
  --rail-fond: linear-gradient(180deg, #0a1628 0%, #0d2b5e 100%);
  --rail-bord: transparent;
  --rail-texte: rgba(255, 255, 255, .74);
  --rail-survol: rgba(255, 255, 255, .1);
  --rail-actif-fond: rgba(255, 255, 255, .16);
  --rail-actif-texte: #ffffff;
  --carte-fond: #dce6ef;
  --filtre-tuiles: none;
  --terre: #f2efe8;
  --terre-bord: #b9b4a8;
  --marqueur-dispo: #e2f5ee;
  --marqueur-engage: #fdf0e0;
  --marqueur-incident: #fdeaea;
  --attribution: rgba(255, 255, 255, .8);
  --compte: #0a1628;
  --compte-halo: rgba(255, 255, 255, .85);
  --ombre: 0 12px 32px rgba(10, 22, 40, .16);
  --titre: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --corps: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --rail: 84px;
  --barre: 60px;
  --rayon: 12px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #060a12;
  --bg2: #0b0f1a;
  --bg3: #101525;
  --bg4: #171e33;
  --champ: #060a12;
  --bord: rgba(255, 255, 255, .08);
  --bord-fort: rgba(255, 255, 255, .16);
  --texte: #e2e8f0;
  --texte-doux: #94a3b8;
  --texte-inactif: #7c8aa0;
  --bleu: #1565c0;
  --bleu-vif: #1e88e5;
  --bleu-clair: #42a5f5;
  --bleu-fond: rgba(30, 136, 229, .14);
  --bleu-bord: rgba(30, 136, 229, .42);
  --vert: #00e5a0;
  --vert-fond: rgba(0, 229, 160, .12);
  --ambre: #ffb300;
  --ambre-fond: rgba(255, 179, 0, .12);
  --rouge: #ef5350;
  --rouge-vif: #e8293a;
  --rouge-fond: rgba(239, 83, 80, .13);
  --barre-fond: rgba(11, 15, 26, .9);
  --voile: rgba(6, 10, 18, .82);
  --defilement: #232c44;
  --rail-fond: #0b0f1a;
  --rail-bord: rgba(255, 255, 255, .08);
  --rail-texte: #94a3b8;
  --rail-survol: #101525;
  --rail-actif-fond: rgba(30, 136, 229, .14);
  --rail-actif-texte: #42a5f5;
  --carte-fond: #0a1120;
  --filtre-tuiles: invert(1) hue-rotate(190deg) brightness(.82) contrast(.92) saturate(.45);
  --terre: #141b2d;
  --terre-bord: #33415c;
  --marqueur-dispo: #06291f;
  --marqueur-engage: #2c2204;
  --marqueur-incident: #331114;
  --attribution: rgba(11, 15, 26, .75);
  --compte: #ffffff;
  --compte-halo: rgba(0, 0, 0, .8);
  --ombre: 0 12px 32px rgba(0, 0, 0, .32);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--texte);
  font: 14px/1.5 var(--corps);
}
h1, h2, h3, p, dl, ul, ol { margin: 0; }
a { color: var(--bleu-clair); }
[hidden] { display: none !important; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--bleu-clair);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--defilement); border-radius: 8px; }

/* Structure */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  background: var(--rail-fond);
  border-right: 1px solid var(--rail-bord);
}
.rail-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rouge-vif), #9b1a24);
  color: #fff;
  font: 700 22px var(--titre);
  text-decoration: none;
}
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 8px; }
.rail-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  border-radius: 10px;
  color: var(--rail-texte);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.rail-nav i { font-size: 19px; }
.rail-nav a:hover { background: var(--rail-survol); color: var(--rail-actif-texte); }
.rail-nav a[aria-current] { background: var(--rail-actif-fond); color: var(--rail-actif-texte); }

.coque { margin-left: var(--rail); min-height: 100vh; display: flex; flex-direction: column; }
.barre {
  position: sticky;
  top: 0;
  z-index: 150;
  height: var(--barre);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--barre-fond);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.barre-titre { min-width: 0; }
.barre h1 { font: 700 21px/1.1 var(--titre); letter-spacing: .4px; }
.barre p { color: var(--texte-doux); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-droite { display: flex; align-items: center; gap: 16px; flex: none; }
.etat-systeme { display: inline-flex; align-items: center; gap: 7px; color: var(--vert); font-size: 12px; font-weight: 500; }
.point { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: clignote 1.6s infinite; }
@keyframes clignote { 50% { opacity: .25; } }
.horloge { color: var(--texte-doux); font: 500 13px var(--mono); }
.badge-demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--bord-fort);
  border-radius: 999px;
  color: var(--texte-doux);
  font-size: 12px;
  white-space: nowrap;
}
.contenu { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px; }
.coque-pleine { height: 100vh; }
.coque-pleine .contenu { max-width: none; padding: 0; min-height: 0; }

/* Composants */
.carte-bloc {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 20px;
}
.carte-bloc h2, .titre-section {
  font: 700 18px/1.2 var(--titre);
  letter-spacing: .4px;
  margin-bottom: 14px;
}
.carte-bloc h3 { font: 600 15px var(--titre); letter-spacing: .4px; color: var(--texte-doux); margin: 18px 0 8px; }
.discret { color: var(--texte-doux); font-size: 13px; font-weight: 400; }
.mono { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.grille-carte { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--bord-fort);
  border-radius: 9px;
  background: var(--bg3);
  color: var(--texte);
  font: 600 13.5px var(--corps);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.bouton:hover { background: var(--bg4); border-color: var(--bleu-bord); }
.bouton-discret { background: transparent; }
.bouton-principal {
  border: 0;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-vif));
  color: #fff;
  font: 700 16px var(--titre);
  letter-spacing: 1px;
  min-height: 48px;
}
.bouton-principal:hover { background: linear-gradient(135deg, var(--bleu), var(--bleu-vif)); box-shadow: 0 0 22px rgba(30, 136, 229, .42); }
.bouton-large { width: 100%; }

.pastille {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pastille-ok { background: var(--vert-fond); color: var(--vert); }
.pastille-attente { background: var(--ambre-fond); color: var(--ambre); }
.pastille-engage { background: var(--bleu-fond); color: var(--bleu-clair); }
.pastille-alerte { background: var(--rouge-fond); color: var(--rouge); }

.compteur {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--bleu-fond);
  color: var(--bleu-clair);
  font: 500 12px var(--mono);
  vertical-align: 2px;
}

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label, .etiquette { display: block; color: var(--texte-doux); font-size: 12.5px; font-weight: 500; }
input, select, textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  padding: 9px 12px;
  background: var(--champ);
  border: 1px solid var(--bord-fort);
  border-radius: 8px;
  color: var(--texte);
  font: 400 14px var(--corps);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--bleu-vif); outline: none; }
input::placeholder, textarea::placeholder { color: #64748b; }
select option { background: var(--bg2); }
select option:disabled { color: #64748b; }
textarea { resize: vertical; }
.message-hors-ligne { background: var(--ambre-fond); border-radius: 8px; color: var(--ambre); font-weight: 600; padding: 10px 12px; }

/* Réseau simulé */
.reseau { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.reseau .bouton { margin-left: auto; min-height: 36px; }
.reseau-file { color: var(--ambre); font-weight: 600; font-size: 13px; }

/* Accueil */
.heros { padding: 18px 0 26px; }
.heros-tag { display: inline-flex; align-items: center; gap: 10px; color: var(--bleu-clair); font: 500 12px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
.heros-tag::before { content: ''; width: 26px; height: 1px; background: currentColor; }
.heros h2 { font: 700 clamp(38px, 5.5vw, 66px)/.98 var(--titre); letter-spacing: -.5px; }
.heros h2 span { color: var(--bleu-clair); }
.heros p { max-width: 640px; margin: 16px 0 22px; color: var(--texte-doux); font-size: 16px; }
.heros-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.indicateurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.indicateurs-6 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1181px) { .indicateurs-6 { grid-template-columns: repeat(6, 1fr); } }
.carte-bloc .indicateur { background: var(--bg3); }
.carte-bloc .indicateur-valeur { font-size: 26px; }
.indicateur { background: var(--bg2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; }
.indicateur-libelle { color: var(--texte-doux); font-size: 12.5px; }
.indicateur-valeur { display: block; font: 700 32px/1.15 var(--titre); margin-top: 2px; font-variant-numeric: tabular-nums; }
.v-vert { color: var(--vert); } .v-ambre { color: var(--ambre); } .v-rouge { color: var(--rouge); } .v-bleu { color: var(--bleu-clair); }

.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 16px; }
.module {
  display: block;
  padding: 20px;
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.module:hover { border-color: var(--bleu-bord); background: var(--bg3); transform: translateY(-2px); }
.module-icone { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 10px; background: var(--bleu-fond); color: var(--bleu-clair); font-size: 19px; }
.module h3 { font: 700 19px var(--titre); letter-spacing: .4px; margin-bottom: 4px; }
.module p { color: var(--texte-doux); font-size: 13.5px; }

.etapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; position: relative; list-style: none; padding: 0; }
.etapes::before { content: ''; position: absolute; top: 18px; left: 8%; right: 8%; height: 1px; background: var(--bleu-bord); }
.etapes li { position: relative; text-align: center; }
.etapes b { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 8px; border: 1px solid var(--bleu-bord); border-radius: 10px; background: var(--bg2); color: var(--bleu-clair); font: 500 13px var(--mono); }
.etapes strong { display: block; font: 700 15px var(--titre); letter-spacing: .3px; }
.etapes span { color: var(--texte-doux); font-size: 12.5px; }

/* Console BOT */
.console { display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; height: calc(100vh - var(--barre)); }
.panneau { display: flex; flex-direction: column; min-height: 0; background: var(--bg2); }
.panneau-gauche { border-right: 1px solid var(--bord); }
.panneau-droit { border-left: 1px solid var(--bord); }
.panneau-centre { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panneau-tete {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--bord);
}
.panneau-tete h2 { font: 700 15px var(--titre); letter-spacing: .6px; }
.mini-stats { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--bord); border-bottom: 1px solid var(--bord); }
.mini-stat { background: var(--bg2); padding: 12px 16px; }
.mini-stat span { color: var(--texte-doux); font-size: 12px; }
.mini-stat strong { display: block; font: 700 28px/1.1 var(--titre); }
.defilant { flex: 1; min-height: 0; overflow-y: auto; }

.incident { display: block; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--bord); border-left: 3px solid transparent; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.incident:hover { background: var(--bg3); }
.incident.actif { background: var(--bg3); border-left-color: var(--bleu-vif); }
.incident-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.incident-id { color: var(--texte-doux); font: 400 12px var(--mono); }
.incident-type { font: 600 16px/1.25 var(--titre); letter-spacing: .2px; }
.incident-lieu { color: var(--texte-doux); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vide { padding: 32px 20px; color: var(--texte-doux); text-align: center; }
.vide i { display: block; font-size: 26px; margin-bottom: 8px; opacity: .55; }

.outils-carte { flex: none; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; background: var(--bg3); border-bottom: 1px solid var(--bord); }
.outils-carte h2 { font: 700 15px var(--titre); letter-spacing: .6px; margin-right: 6px; }
.bascule { padding: 4px 10px; border: 1px solid var(--bord-fort); border-radius: 6px; background: transparent; color: var(--texte-doux); font: 500 12px var(--corps); cursor: pointer; }
.bascule[aria-pressed='true'] { border-color: var(--bleu-bord); background: var(--bleu-fond); color: var(--bleu-clair); }
.legende { display: flex; gap: 12px; margin-left: auto; color: var(--texte-doux); font-size: 12px; }
.legende span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legende i { width: 8px; height: 8px; border-radius: 50%; }
.carte-principale { flex: 1 1 58%; min-height: 200px; }

.journal { flex: 1 1 42%; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--bord); background: var(--bg2); }
.tableau { width: 100%; border-collapse: collapse; font-size: 13px; }
.tableau th { position: sticky; top: 0; z-index: 2; padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--bord); color: var(--texte-doux); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
.tableau td { padding: 9px 14px; border-bottom: 1px solid var(--bord); }
.tableau tbody tr:hover { background: var(--bg3); }
.table-defilante { overflow-x: auto; }
.table-rapports { max-height: 430px; overflow: auto; border: 1px solid var(--bord); border-radius: 8px; }
.table-rapports td { white-space: nowrap; }
.bouton-compact { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.bloc-espace { margin-bottom: 16px; }
.discret-lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.engin { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--bord); }
.engin i { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.engin strong { font: 500 13px var(--mono); }
.engin small { display: block; color: var(--texte-doux); font-size: 12px; }
.engin .pastille { margin-left: auto; }

.detail { padding: 16px; }
.detail h3 { font: 700 20px/1.2 var(--titre); margin: 2px 0 4px; }
.detail-ligne { display: flex; gap: 8px; color: var(--texte-doux); font-size: 13px; margin-top: 4px; }
.detail-ligne i { flex: none; color: var(--bleu-clair); }
.chrono { list-style: none; padding: 0; margin: 12px 0 0; }
.chrono li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 4px 0 4px 16px; font-size: 13px; }
.chrono li::before { content: ''; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--bleu-clair); }
.chrono li:not(:last-child)::after { content: ''; position: absolute; left: 3px; top: 18px; bottom: -11px; width: 1px; background: var(--bleu-bord); }
.chrono time { color: var(--texte-doux); font: 400 12px var(--mono); }
.detail .bouton { width: 100%; margin-top: 12px; }
.sms { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--ambre-fond); color: var(--ambre); font-size: 13px; overflow-wrap: anywhere; }
.action-pied { flex: none; padding: 14px 16px; border-top: 1px solid var(--bord); }

/* Fenêtre de saisie */
.voile { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--voile); backdrop-filter: blur(5px); }
.fenetre { width: min(940px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg2); border: 1px solid var(--bleu-bord); border-radius: 14px; box-shadow: var(--ombre); }
.fenetre-tete { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; background: var(--bg3); border-bottom: 1px solid var(--bord); }
.fenetre-tete h2 { font: 700 21px var(--titre); }
.fermer { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--texte-doux); font-size: 16px; cursor: pointer; }
.fermer:hover { background: var(--bg4); color: var(--texte); }
.fenetre-corps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; }
.fenetre-corps .colonne-carte { display: flex; flex-direction: column; min-height: 320px; }
.carte-choix { flex: 1; min-height: 280px; margin-top: 6px; border: 1px solid var(--bord-fort); border-radius: 8px; cursor: crosshair; }
.fenetre-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--bord); }

/* Écran de remise */
.remise-outils { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 16px; }
.remise-compte { margin-right: auto; align-self: center; font: 700 22px var(--titre); color: var(--rouge); }
.remise-grille { display: grid; gap: 16px; align-items: start; }
.remise-bloc { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.remise-multiple { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.remise-multiple .remise-bloc { grid-template-columns: minmax(0, 1fr); }
.remise-multiple .remise-alerte { padding: clamp(20px, 2.4vw, 32px); }
.remise-multiple .remise-alerte h2 { font-size: clamp(34px, 4vw, 56px); margin: 4px 0 12px; }
.remise-multiple .remise-adresse { font-size: clamp(22px, 2.3vw, 30px); }
.remise-multiple .remise-repere { font-size: 18px; }
.remise-multiple .remise-pied { margin-top: 14px; font-size: 13px; }
.remise-alerte { padding: clamp(24px, 4vw, 52px); border-radius: 16px; background: linear-gradient(135deg, #b5202e, var(--rouge-vif)); color: #fff; }
.remise-engin { font: 700 clamp(20px, 2.6vw, 32px) var(--titre); letter-spacing: 1px; }
.remise-alerte h2 { font: 700 clamp(44px, 7vw, 92px)/1 var(--titre); margin: 6px 0 18px; }
.remise-adresse { font: 600 clamp(24px, 3.4vw, 42px)/1.15 var(--titre); }
.remise-repere { font-size: clamp(17px, 2vw, 24px); margin-top: 6px; }
.remise-pied { margin-top: 22px; font: 400 14px var(--mono); }
.remise-etat { display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: 8px; background: rgba(255, 255, 255, .95); color: #9b1a24; font-weight: 700; }
.remise-calme { padding: clamp(36px, 8vw, 96px) 16px; text-align: center; }
.remise-calme > i { color: var(--vert); font-size: 44px; }
.remise-calme h2 { font: 700 clamp(30px, 4.6vw, 54px) var(--titre); margin: 8px 0; }
.remise-calme p { color: var(--texte-doux); font-size: 16px; }
.remise-engins { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; list-style: none; margin-top: 32px; padding: 0; }
.remise-engins li { min-width: 190px; padding: 16px 20px; background: var(--bg2); border: 1px solid var(--bord); border-radius: var(--rayon); }
.remise-engins strong { display: block; font: 700 24px var(--titre); }
.remise-engins span { color: var(--texte-doux); }
.ticket { padding: 18px; border: 1px solid var(--bord-fort); border-radius: 6px; background: #fff; color: #000; font-family: 'Courier New', Courier, monospace; font-size: 14px; }
.ticket h2 { text-align: center; font-size: 19px; }
.ticket-mention { text-align: center; font-size: 12px; border-bottom: 1px dashed #000; padding-bottom: 8px; margin-bottom: 8px; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.ticket dt { font-weight: 700; }
.ticket dd { margin: 0; overflow-wrap: anywhere; }

/* Tablette */
.tablette { max-width: 980px; margin: 0 auto; }
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.onglets a { padding: 8px 14px; border: 1px solid var(--bord-fort); border-radius: 8px; color: var(--texte-doux); font: 500 13px var(--mono); text-decoration: none; }
.onglets a:hover { color: var(--texte); }
.onglets a[aria-current] { border-color: var(--bleu-bord); background: var(--bleu-fond); color: var(--bleu-clair); }
.mission { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; padding: 20px; background: var(--bg2); border: 1px solid var(--bord); border-radius: var(--rayon); }
.mission-nouvelle { border: 2px solid var(--rouge); box-shadow: 0 0 26px rgba(239, 83, 80, .22); }
.mission-numero { color: var(--texte-doux); font: 400 12.5px var(--mono); }
.mission h2 { font: 700 34px/1.1 var(--titre); margin: 4px 0 8px; }
.mission-adresse { font: 600 21px/1.25 var(--titre); }
.mission-repere { color: var(--texte-doux); font-size: 15px; margin-top: 4px; }
.mission-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mini-carte { min-height: 220px; height: 100%; border-radius: 10px; border: 1px solid var(--bord); }
.statuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.bouton-statut { width: 100%; min-height: 82px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--bleu), var(--bleu-vif)); color: #fff; font: 700 17px var(--titre); letter-spacing: .4px; cursor: pointer; }
.bouton-statut small { min-height: 1.2em; font: 400 12px var(--mono); }
.bouton-statut:disabled { background: var(--bg4); color: var(--texte-inactif); cursor: not-allowed; }
.statut-form.fait .bouton-statut { background: var(--vert-fond); color: var(--vert); }
.tablette-attente { margin-bottom: 16px; padding: 56px 20px; text-align: center; background: var(--bg2); border: 1px dashed var(--bord-fort); border-radius: var(--rayon); }
.tablette-attente i { color: var(--vert); font-size: 34px; }
.tablette-attente h2 { font: 700 28px var(--titre); margin: 6px 0; }
.tablette-attente p { color: var(--texte-doux); }

/* Listes et fiches */
.liste-simple { list-style: none; padding: 0; }
.liste-simple li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bord); }
.liste-simple li:first-child { border-top: 0; padding-top: 0; }
.liste-simple small { color: var(--texte-doux); font-size: 13px; }
.liste-simple .mono { display: block; }
.fiche { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 6px 14px; }
.fiche dt { color: var(--texte-doux); }
.fiche dd { margin: 0; font-weight: 500; }
.actions-liste { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.actions-liste form { margin: 0; }
.retour { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; text-decoration: none; }

/* Statistiques */
.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.filtres label { min-width: 210px; }
.filtres .bouton { margin-left: auto; }
.carte-densite { height: 340px; border-radius: 10px; border: 1px solid var(--bord); }
.carte-compte { color: var(--compte); font: 700 12px/16px var(--corps); text-align: center; text-shadow: 0 0 3px var(--compte-halo); }
.barres { list-style: none; padding: 0; }
.barres li { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 2.6em; align-items: center; gap: 10px; padding: 8px 0; }
.barre-nom { font-size: 13px; line-height: 1.25; }
.barre-piste { display: block; height: 12px; }
.barre-remplie { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--bleu-vif); }
.barre-valeur { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.colonnes { display: flex; align-items: stretch; gap: 8px; height: 200px; margin-bottom: 8px; }
.colonnes-serrees { gap: 2px; }
.colonne-case { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.colonne-case:hover .colonne, .colonne-case:focus .colonne { background: var(--bleu-clair); }
.colonne { display: block; width: 100%; max-width: 44px; min-height: 2px; flex-shrink: 1; border-radius: 4px 4px 0 0; background: var(--bleu-vif); }
.colonne-valeur { font-size: 12.5px; font-weight: 600; }
.colonne-nom { width: 100%; padding-top: 3px; border-top: 1px solid var(--bord-fort); color: var(--texte-doux); font-size: 12px; text-align: center; white-space: nowrap; }
.colonne-case[data-info]:hover::after, .colonne-case[data-info]:focus::after { content: attr(data-info); position: absolute; left: 50%; bottom: 100%; z-index: 5; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: var(--bg4); color: var(--texte); font-size: 12px; white-space: nowrap; }

.contour-terre { fill: var(--terre); stroke: var(--terre-bord); }
.bouton-theme { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid var(--bord-fort); border-radius: 9px; background: transparent; color: var(--texte-doux); font-size: 15px; cursor: pointer; transition: background .15s, color .15s; }
.bouton-theme:hover { background: var(--bg4); color: var(--texte); }

/* Notifications */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; background: var(--bg3); border: 1px solid var(--bord-fort); border-left: 3px solid var(--vert); border-radius: 10px; box-shadow: var(--ombre); animation: entree .25s ease; }
.toast i { color: var(--vert); }
.toast-erreur { border-left-color: var(--rouge); }
.toast-erreur i { color: var(--rouge); }
@keyframes entree { from { opacity: 0; transform: translateY(10px); } }

/* Marqueurs */
.marqueur { display: grid; place-items: center; border-radius: 50%; border: 2px solid; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.marqueur-dispo { border-color: var(--vert); background: var(--marqueur-dispo); color: var(--vert); }
.marqueur-engage { border-color: var(--ambre); background: var(--marqueur-engage); color: var(--ambre); }
.marqueur-incident { border-color: var(--rouge); background: var(--marqueur-incident); color: var(--rouge); animation: halo 1.8s infinite; }
@keyframes halo { 0% { box-shadow: 0 0 0 0 rgba(239, 83, 80, .55); } 100% { box-shadow: 0 0 0 16px rgba(239, 83, 80, 0); } }

/* Leaflet : règles indispensables, le CSS du plugin n'étant pas fourni dans PIGU */
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas, .leaflet-layer { position: absolute; left: 0; top: 0; }
.leaflet-container { position: relative; z-index: 0; isolation: isolate; overflow: hidden; background: var(--carte-fond); font: 12px var(--corps); outline: 0; -webkit-tap-highlight-color: transparent; }
.leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow { user-select: none; -webkit-user-drag: none; }
.leaflet-container img.leaflet-tile { max-width: none !important; max-height: none !important; }
.leaflet-tile { visibility: hidden; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-tile-pane { z-index: 200; filter: var(--filtre-tuiles); }
.leaflet-pane { z-index: 400; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-pane > svg path { pointer-events: none; }
.leaflet-pane > svg path.leaflet-interactive { pointer-events: auto; cursor: pointer; }
.leaflet-marker-icon.leaflet-interactive { cursor: pointer; }
.leaflet-grab { cursor: grab; }
.leaflet-dragging .leaflet-grab { cursor: grabbing; }
.carte-choix.leaflet-grab { cursor: crosshair; }
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition: transform .25s cubic-bezier(0, 0, .25, 1); }
.leaflet-zoom-anim .leaflet-tile, .leaflet-pan-anim .leaflet-tile { transition: none; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; } .leaflet-bottom { bottom: 0; } .leaflet-left { left: 0; } .leaflet-right { right: 0; }
.leaflet-control { position: relative; z-index: 800; float: left; clear: both; pointer-events: auto; }
.leaflet-right .leaflet-control { float: right; }
.leaflet-top .leaflet-control { margin-top: 10px; }
.leaflet-left .leaflet-control { margin-left: 10px; }
.leaflet-bar { border-radius: 8px; overflow: hidden; border: 1px solid var(--bord-fort); }
.leaflet-bar a { display: block; width: 30px; height: 30px; background: var(--bg2); color: var(--texte); font: 700 18px/30px var(--corps); text-align: center; text-decoration: none; }
.leaflet-bar a:hover { background: var(--bg4); }
.leaflet-control-attribution { padding: 0 6px; background: var(--attribution); color: var(--texte-doux); font-size: 11px; }
.leaflet-control-attribution a { color: var(--texte-doux); }
.leaflet-popup { position: absolute; margin-bottom: 20px; text-align: left; }
.leaflet-popup-content-wrapper { background: var(--bg3); color: var(--texte); border: 1px solid var(--bord-fort); border-radius: 10px; box-shadow: var(--ombre); }
.leaflet-popup-content { margin: 10px 14px; line-height: 1.4; font-size: 13px; }
.leaflet-popup-tip-container { position: absolute; left: 50%; width: 40px; height: 20px; margin-left: -20px; overflow: hidden; pointer-events: none; }
.leaflet-popup-tip { width: 17px; height: 17px; margin: -10px auto 0; padding: 1px; background: var(--bg3); transform: rotate(45deg); }
.leaflet-popup-close-button { position: absolute; top: 4px; right: 8px; color: var(--texte-doux); font-size: 16px; text-decoration: none; }
.leaflet-tooltip { position: absolute; padding: 4px 8px; background: var(--bg3); border: 1px solid var(--bord-fort); border-radius: 6px; color: var(--texte); font-size: 12.5px; white-space: nowrap; pointer-events: none; }

/* Adaptation aux écrans */
@media (max-width: 1180px) {
  .console { grid-template-columns: 1fr 1fr; height: auto; }
  .panneau-centre { grid-column: 1 / -1; order: -1; height: 620px; }
  .coque-pleine { height: auto; min-height: 100vh; }
  .defilant { max-height: 340px; }
}
@media (max-width: 900px) {
  .grille-2, .grille-3, .grille-carte, .mission, .remise-bloc { grid-template-columns: 1fr; }
  .indicateurs { grid-template-columns: 1fr 1fr; }
  .etapes { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .etapes::before { display: none; }
  .fenetre-corps { grid-template-columns: 1fr; }
  .badge-demo { display: none; }
}
@media (max-width: 640px) {
  :root { --rail: 0px; --barre: 56px; }
  .rail { position: sticky; top: 0; inset: auto; width: 100%; flex-direction: row; gap: 4px; padding: 6px 8px; border-right: 0; overflow-x: auto; }
  .rail-logo { width: 36px; height: 36px; }
  .rail-nav { flex-direction: row; padding: 0; }
  .rail-nav a { flex: 1; min-width: 62px; padding: 5px 2px; }
  .rail-nav i { font-size: 17px; }
  .barre { position: static; padding: 0 16px; }
  .etat-systeme { display: none; }
  .contenu { padding: 16px; }
  .console { grid-template-columns: 1fr; }
  .panneau-centre { height: 560px; }
  .legende { display: none; }
  .indicateurs, .champs-2 { grid-template-columns: 1fr; }
  .statuts, .etapes { grid-template-columns: 1fr 1fr; }
  .reseau .bouton { margin-left: 0; }
  .filtres .bouton { margin-left: 0; }
}

@media print {
  .no-print, .remise-alerte, .remise-outils { display: none !important; }
  .coque { margin: 0; }
  .contenu { padding: 0; }
  body { background: #fff; color: #000; }
  .remise-grille, .remise-bloc { display: block; }
  .remise-bloc:not(:last-child) .ticket { break-after: page; }
  .ticket { width: 80mm; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
