/* Emetrop Afrique — direction B « Cockpit nuit » (spec CRM v2 §2). Ordinateur uniquement. */
:root {
  --nuit: #0d1f4a;
  --nuit-2: #16295c;
  --bleu: #2B5AB4;
  --bleu-fonce: #1d3f80;
  --bleu-pale: #E8EEFA;
  --rouge: #C41E38;
  --rouge-pale: #FCE9EC;
  --vert: #1E7A4F;
  --vert-pale: #E3F4EA;
  --orange: #A85A00;
  --orange-pale: #FFF1DC;
  --fond: #EDF1F7;
  --carte: #fff;
  --bord: #DCE3EE;
  --bord-leger: #EEF1F5;
  --tete: #F5F7FB;
  --texte: #0d1f4a;
  --texte-2: #4A5568;
  --menu-texte: #C9D4EA;
  --rayon: 6px;
}

* { box-sizing: border-box; }
html { font-size: 13.5px; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: "Public Sans", system-ui, sans-serif; font-variant-numeric: tabular-nums; line-height: 1.45;
  min-width: 1280px;
}
a { color: var(--bleu); text-decoration: none; }
a:hover { color: var(--bleu-fonce); text-decoration: underline; }
h1, h2, h3 { margin: 0; }
small, .discret { color: var(--texte-2); }

/* --- Structure --- */
.cockpit { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.menu {
  background: var(--nuit); padding: 22px 14px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu-logo { display: block; width: 128px; margin: 0 8px 26px; }
.menu a, .menu .inactif {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--rayon);
  color: var(--menu-texte); font-weight: 500;
}
.menu a:hover { background: var(--nuit-2); color: #fff; text-decoration: none; }
.menu a.actif { background: var(--bleu); color: #fff; font-weight: 700; }
.menu .inactif { color: #6F7FA3; cursor: default; }
.menu .inactif small { margin-left: auto; color: #6F7FA3; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.menu .compteur { margin-left: auto; background: var(--rouge); color: #fff; border-radius: var(--rayon); padding: 0 7px; font-size: 12px; font-weight: 700; }
.menu-separateur { height: 1px; background: var(--nuit-2); margin: 12px 4px; }
.menu-pied { margin-top: auto; padding: 12px 10px 0; color: var(--menu-texte); font-size: 12.5px; }
.menu-pied form { margin: 6px 0 0; }
.menu-pied button { background: none; border: 1px solid #3A4E80; color: var(--menu-texte); border-radius: var(--rayon); padding: 4px 10px; font: inherit; cursor: pointer; }
.menu-pied button:hover { color: #fff; border-color: #6F7FA3; }

.contenu { padding: 18px 32px 48px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.barre { display: flex; align-items: center; gap: 16px; }
.barre-recherche {
  flex: 1; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; cursor: text;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; color: var(--texte-2); font: inherit; text-align: left;
}
.barre-recherche:hover { border-color: #B9C5DA; }
.barre-recherche span { flex: 1; }
kbd { font: 12px/1.4 inherit; border: 1px solid var(--bord); border-radius: 4px; padding: 0 6px; color: var(--texte-2); background: var(--tete); }

/* --- En-tête de page --- */
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.ariane { color: var(--texte-2); font-size: 13px; }
.ariane a { color: var(--texte-2); }
.entete h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--texte-2); }
.actions { display: flex; gap: 10px; flex-shrink: 0; }

/* --- Boutons, badges --- */
.bouton {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid #C9D2E3; background: var(--carte); color: var(--texte); font: inherit; font-weight: 600;
}
.bouton:hover { border-color: var(--bleu); color: var(--bleu); text-decoration: none; }
.bouton-primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.bouton-primaire:hover { background: var(--bleu-fonce); color: #fff; }
.bouton-petit { height: 30px; padding: 0 10px; font-size: 12.5px; }
tr.version-precedente td { color: var(--texte-2); }
.note-devis { display: inline-block; margin-top: 4px; color: var(--texte); }
.badge { display: inline-block; border-radius: 4px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bleu-pale); color: var(--bleu-fonce); }
.badge-rouge { background: var(--rouge-pale); color: var(--rouge); }
.badge-vert { background: var(--vert-pale); color: var(--vert); }
.badge-orange { background: var(--orange-pale); color: var(--orange); }
.badge-gris { background: #EDEFF3; color: var(--texte-2); }
.rouge { color: var(--rouge); font-weight: 600; }
.vert { color: var(--vert); }

/* --- Tuiles de chiffres --- */
.tuiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tuiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tuile { background: var(--nuit); color: #fff; border-radius: var(--rayon); padding: 13px 16px; }
.tuile-label { color: #AFC0E0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.tuile-valeur { font-size: 25px; font-weight: 800; margin: 5px 0 1px; }
.tuile-alerte .tuile-valeur { color: #FF8A9A; }
.tuile-detail { color: var(--menu-texte); font-size: 12.5px; }

/* --- Onglets --- */
.onglets { display: flex; gap: 2px; border-bottom: 1px solid #E3E7EE; }
.onglets a { padding: 9px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--texte-2); }
.onglets a:hover { color: var(--texte); text-decoration: none; }
.onglets a.actif { border-bottom-color: var(--bleu); color: var(--bleu); font-weight: 600; }

/* --- Sections (cartes) --- */
.grille { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.colonne { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.section { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.section-defile { overflow-x: auto; }
.donnees .colle-droite {
  position: sticky; right: 0; z-index: 1; min-width: 11rem; background: var(--carte);
  box-shadow: -6px 0 8px -6px rgba(15, 23, 42, .18);
}
.donnees thead .colle-droite { background: var(--tete); }
.donnees tr:hover .colle-droite { background: #FAFBFD; }
.section-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 16px; background: var(--tete); border-bottom: 1px solid var(--bord-leger); }
.section-tete h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; font-weight: 800; }
.section-corps { padding: 12px 16px; }
.vide { padding: 14px 16px; margin: 0; color: var(--texte-2); }
.fiche-champs { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
.fiche-champs dt { color: var(--texte-2); }
.fiche-champs dd { margin: 0; }

/* --- Tableaux --- */
table.donnees { width: 100%; border-collapse: collapse; }
.donnees th { text-align: left; color: var(--texte-2); font-weight: 500; padding: 8px 10px; white-space: nowrap; }
.donnees td { padding: 8px 10px; border-top: 1px solid var(--bord-leger); vertical-align: top; }
.donnees th:first-child, .donnees td:first-child { padding-left: 16px; }
.donnees th:last-child, .donnees td:last-child { padding-right: 16px; }
.donnees tr:hover td { background: #FAFBFD; }
.donnees .nombre { text-align: right; white-space: nowrap; }
.donnees .ref { white-space: nowrap; }
.donnees .designation { min-width: 280px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.donnees tr.groupe td { background: var(--bleu-pale); color: var(--bleu-fonce); font-weight: 700; }
.donnees tr.total td { font-weight: 800; border-top: 2px solid var(--bord); }
.donnees tr.inclus td { color: var(--texte-2); }

/* --- Frise des étapes --- */
.affaire-ligne { padding: 10px 16px; border-top: 1px solid var(--bord-leger); display: flex; flex-direction: column; gap: 9px; }
.affaire-ligne:first-child { border-top: none; }
.affaire-haut { display: flex; justify-content: space-between; gap: 12px; }
.frise { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.frise-etape { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--texte-2); }
.frise-etape::before { content: ""; height: 7px; border-radius: 1px; background: var(--bord); }
.frise-etape.fait::before { background: var(--nuit); }
.frise-etape.actuelle::before { background: var(--rouge); }
.frise-etape.actuelle { color: var(--texte); font-weight: 700; }
.frise-etape.perdue::before { background: #C7CDD8; }
.frise-grande .frise-etape { font-size: 12.5px; }
.frise-grande .frise-etape::before { height: 10px; }
.frise-date { font-weight: 400; color: var(--texte-2); font-size: 11.5px; }
.frise-compacte { grid-template-columns: repeat(8, 14px); gap: 3px; }
.frise-compacte .frise-etape { font-size: 0; }

/* --- Chronologie --- */
.chrono { padding: 4px 16px 10px; }
.chrono-element { display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bord-leger); }
.chrono-element:first-child { border-top: none; }
.chrono-point { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--bleu); }
.genre-metier .chrono-point { background: var(--vert); }
.genre-activite .chrono-point { background: #8A94A6; }
.genre-suppression .chrono-point { background: var(--rouge); }
.chrono-quand { font-size: 12px; color: var(--texte-2); }
.chrono-texte { white-space: pre-line; margin-top: 2px; }
.diff { font-size: 12px; margin-top: 4px; background: #F4F6F9; border-radius: 4px; padding: 4px 8px; }
.diff del { color: var(--texte-2); }
.diff ins { text-decoration: none; font-weight: 600; }

/* --- Formulaires --- */
.formulaire-ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select, input[type=text], input[type=search], input[type=password], input[type=number] {
  height: 34px; border: 1px solid #C9D2E3; border-radius: 6px; padding: 0 10px; font: inherit; color: var(--texte); background: #fff;
}
.filtres { display: flex; gap: 8px; align-items: center; }
.filtres a { padding: 4px 10px; border-radius: 6px; color: var(--texte-2); }
.filtres a.actif { background: var(--nuit); color: #fff; }

/* --- Messages --- */
.message { padding: 10px 14px; border-radius: var(--rayon); background: var(--bleu-pale); color: var(--bleu-fonce); }
.message-error { background: var(--rouge-pale); color: var(--rouge); }

/* --- Palette Ctrl+K --- */
dialog.palette { width: 640px; max-width: 90vw; padding: 0; border: none; border-radius: 10px; box-shadow: 0 24px 60px rgba(13, 31, 74, .35); margin-top: 12vh; }
dialog.palette::backdrop { background: rgba(13, 31, 74, .45); }
.palette input { width: 100%; height: 52px; border: none; border-bottom: 1px solid var(--bord); border-radius: 0; padding: 0 18px; font-size: 16px; outline: none; }
.palette-resultats { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.palette-resultats li { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.palette-resultats li.sans-lien { cursor: default; }
.palette-resultats li.choisi { background: var(--bleu-pale); }
.palette-type { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--texte-2); padding-top: 2px; }
.palette-titre { font-weight: 600; }
.palette-detail { color: var(--texte-2); font-size: 12.5px; }
.palette-aide { padding: 8px 16px; border-top: 1px solid var(--bord); color: var(--texte-2); font-size: 12px; display: flex; gap: 14px; }
.palette-vide { padding: 18px; color: var(--texte-2); }

/* --- Pages simples (connexion) --- */
.page-simple { min-height: 100vh; display: grid; place-items: center; background: var(--nuit); min-width: 0; }
.carte-simple { width: 400px; background: var(--carte); border-radius: 10px; padding: 28px 30px; display: flex; flex-direction: column; gap: 14px; }
.carte-simple img { width: 150px; align-self: center; margin-bottom: 4px; }
.carte-simple label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.carte-simple input { width: 100%; height: 38px; }
.carte-simple .bouton { justify-content: center; height: 40px; }

/* --- Lot 4 : pilotage --- */
.barre-filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: var(--tete); border-bottom: 1px solid var(--bord-leger); }
.barre-filtres input[type=search] { width: 240px; }
.barre-filtres .total { margin-left: auto; color: var(--texte-2); }
.barres { padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.barre-etape { display: grid; grid-template-columns: 120px minmax(0, 1fr) 90px 40px; gap: 10px; align-items: center; }
.barre-etape .piste { height: 14px; background: var(--bord-leger); border-radius: 3px; overflow: hidden; }
.barre-etape .remplie { height: 100%; background: var(--bleu); border-radius: 3px; }
.barre-etape .nombre { text-align: right; }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { padding: 8px 16px; border-top: 1px solid var(--bord-leger); display: flex; justify-content: space-between; gap: 12px; }
.liste-simple li:first-child { border-top: none; }
.pagination { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--bord-leger); }
.formulaire-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 12px 16px; }
.formulaire-grille label { display: flex; flex-direction: column; gap: 4px; color: var(--texte-2); font-size: 12.5px; }
.formulaire-grille input, .formulaire-grille select { width: 100%; }
input[type=date], input[type=url] { height: 34px; border: 1px solid #C9D2E3; border-radius: 6px; padding: 0 10px; font: inherit; color: var(--texte); }
.boutons-ligne { display: flex; gap: 6px; }
.boutons-ligne form { margin: 0; }

/* Carte */
.carte-zone { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; gap: 0; height: calc(100vh - 150px); min-height: 560px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.carte-filtres, .carte-panneau { overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.carte-filtres { border-right: 1px solid var(--bord); }
.carte-panneau { border-left: 1px solid var(--bord); }
.carte-filtres fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.carte-filtres legend { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; margin-bottom: 4px; }
.carte-filtres select { width: 100%; }
.carte-filtres label { display: flex; align-items: center; gap: 6px; }
.pastille { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
#carte { height: 100%; background: #0b1328; }
.carte-resume { font-weight: 700; }
.carte-liste { list-style: none; margin: 0; padding: 0; }
.carte-liste li { padding: 7px 0; border-top: 1px solid var(--bord-leger); cursor: pointer; }
.carte-liste li:hover { color: var(--bleu); }
.carte-fiche { background: var(--tete); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px 12px; }
.carte-fiche h3 { font-size: 15px; margin-bottom: 4px; }
.leaflet-popup-content { font-family: "Public Sans", sans-serif; }
.groupe-points { background: rgba(43, 90, 180, .85); color: #fff; border: 2px solid #fff; border-radius: 50%; font-weight: 800; font-size: 12px; box-shadow: 0 0 0 4px rgba(43, 90, 180, .3); }
.groupe-points div { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fond-sombre { filter: invert(100%) hue-rotate(180deg) brightness(90%) contrast(85%) saturate(60%); }
textarea { border: 1px solid #C9D2E3; border-radius: 6px; padding: 6px 10px; font: inherit; color: var(--texte); width: 100%; }
input:disabled, textarea:disabled { background: var(--tete); color: var(--texte-2); }
details.section > summary { list-style: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2::before { content: "▸ "; color: var(--texte-2); }
details.section[open] > summary h2::before { content: "▾ "; }
input[type=email] { height: 34px; border: 1px solid #C9D2E3; border-radius: 6px; padding: 0 10px; font: inherit; color: var(--texte); background: #fff; width: 100%; }
.message-warning { background: var(--orange-pale); color: var(--orange); }
.message-success { background: var(--vert-pale); color: var(--vert); }
