:root {
  --fond: #f5f6f4; --surface: #fff; --trait: #dfe3de; --texte: #1c2421; --doux: #5d6b66;
  --vert: #0f6b5c; --vert-fonce: #0a4d42; --vert-pale: #e3f1ee; --ambre: #b45309; --ambre-pale: #fdf0d9;
  --bleu: #1f5fbf; --rouge: #b3261e; --rouge-pale: #fbe9e7; --rayon: 10px; --ombre: 0 1px 3px rgba(20, 30, 25, .12);
  --barre: 56px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); display: flex; flex-direction: column; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 6px; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); margin: 0 0 8px; }
a { color: var(--vert); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--vert); outline-offset: 1px; }
label { display: block; font-size: .82rem; color: var(--doux); }
label > input, label > select, label > textarea { margin-top: 3px; color: var(--texte); font-size: .95rem; }

.barre { height: var(--barre); flex: none; display: flex; align-items: center; gap: 20px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--trait); z-index: 1100; }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--texte); text-decoration: none; }
#menu { display: flex; gap: 4px; flex: 1; }
#menu a { padding: 7px 12px; border-radius: 8px; color: var(--doux); text-decoration: none; font-weight: 500; white-space: nowrap; }
#menu a:hover { background: var(--fond); }
#menu a.actif { color: var(--vert-fonce); background: var(--vert-pale); }
.pastille { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--ambre); color: #fff; font-size: .75rem; text-align: center; }
#zone-compte { display: flex; gap: 6px; }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); color: var(--texte); text-decoration: none; cursor: pointer; font-weight: 500; }
.bouton:hover { border-color: #b9c2bc; }
.bouton.principal { background: var(--vert); border-color: var(--vert); color: #fff; }
.bouton.principal:hover { background: var(--vert-fonce); }
.bouton.discret { border-color: transparent; background: transparent; color: var(--doux); }
.bouton.discret:hover { background: var(--fond); }
.bouton.danger { color: var(--rouge); }
.bouton.large { width: 100%; margin-top: 6px; }
button.discret, button.lien, button.retour { border: 0; background: none; padding: 0; color: var(--vert); cursor: pointer; text-decoration: underline; font-size: inherit; }
button.retour { text-decoration: none; font-weight: 600; margin-bottom: 10px; }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#vue-carte { flex: 1; min-height: 0; display: flex; }
.panneau { width: 400px; flex: none; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--trait); min-height: 0; }
#recherche { padding: 12px 14px 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--trait); }
#recherche.replie { display: none; }
.ligne { display: flex; gap: 8px; align-items: end; }
.ligne > * { flex: 1; }
.ligne > button { flex: none; padding-bottom: 9px; }
.champ-adresse { position: relative; }
.suggestions { position: absolute; z-index: 1200; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; box-shadow: 0 6px 20px rgba(20, 30, 25, .16); max-height: 300px; overflow: auto; }
.suggestions button { display: block; width: 100%; text-align: left; padding: 7px 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.suggestions button:hover, .suggestions button:focus-visible { background: var(--vert-pale); }
.suggestions small { display: block; color: var(--doux); }
.bascule { display: flex; padding: 3px; background: var(--fond); border-radius: 9px; gap: 3px; }
.bascule button { flex: 1; padding: 7px 8px; border: 0; border-radius: 7px; background: none; cursor: pointer; color: var(--doux); font-weight: 600; }
.bascule button[aria-selected=true] { background: var(--surface); color: var(--vert-fonce); box-shadow: var(--ombre); }
.titre-liste { margin: 0; padding: 9px 14px 4px; font-size: .8rem; color: var(--doux); }
.resultats, .fiche { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px 14px; }
.fiche { padding: 14px 16px 24px; }
.carte { flex: 1; min-width: 0; background: #e8ece8; }
.vide, .aide { color: var(--doux); font-size: .88rem; }
.vide { padding: 18px 8px; }
.aide { margin: 6px 0; }
.erreur { color: var(--rouge); font-size: .88rem; }

.carte-resultat { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px; margin: 0 0 2px; border: 1px solid transparent; border-radius: var(--rayon); background: none; cursor: pointer; }
.carte-resultat:hover, .carte-resultat:focus-visible { background: var(--fond); border-color: var(--trait); }
.carte-resultat .titre { font-weight: 600; }
.sous { color: var(--doux); font-size: .9rem; margin: 0 0 10px; }
.carte-resultat .sous { margin: 0; }
.details { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 3px; font-size: .8rem; color: var(--doux); }
.details .droite { margin-left: auto; white-space: nowrap; }
.etiquette { display: inline-block; padding: 1px 8px; border-radius: 20px; background: var(--fond); border: 1px solid var(--trait); font-size: .76rem; color: var(--texte); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquette.fort { background: var(--vert-pale); border-color: #bcdcd5; color: var(--vert-fonce); font-weight: 600; }
[class*="statut-"] { font-weight: 600; }
.statut-a_postuler { color: var(--doux); }
.statut-postule, .statut-relance { color: var(--bleu); }
.statut-entretien, .statut-proposition { color: var(--vert-fonce); }
.statut-refuse, .statut-abandonne { color: #7a6f6c; }

.infos, .liens { margin: 0 0 12px; display: grid; gap: 5px; }
.info { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: .9rem; }
.info dt { color: var(--doux); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.liens dd { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fiche .actions { margin: 12px 0 4px; }
.bloc { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--trait); }
.description { white-space: pre-line; font-size: .92rem; margin: 0; }
.contact { flex-basis: 100%; margin: 4px 0 0; }

.leaflet-container { font: inherit; }
.groupe, .point, .domicile { display: grid; place-items: center; border-radius: 50%; }
.groupe span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; color: #fff; font-weight: 700; font-size: .78rem; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.groupe.offres span { background: var(--vert); }
.groupe.societes span { background: #56627a; }
.point span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); color: #fff; font-size: .7rem; font-weight: 700; }
.point.offres span { background: var(--vert); }
.point.societes span { background: #7b879c; }
.point.societes.avec span { background: var(--vert); }
.domicile span { width: 100%; height: 100%; border-radius: 50%; background: #ffc857; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ambre), 0 1px 5px rgba(0, 0, 0, .4); }
.cercle-rayon { stroke: var(--ambre); stroke-width: 1.5; stroke-dasharray: 6 5; fill: var(--ambre); fill-opacity: .05; }
.halo { stroke: var(--ambre); stroke-width: 3; fill: #ffc857; fill-opacity: .35; }

.page { width: 100%; max-width: 1060px; margin: 0 auto; padding: 24px 18px 40px; overflow: visible; }
main:has(.page:not([hidden])) { overflow: auto; }
.page ul { padding-left: 20px; }
.page li { margin-bottom: 6px; }
.page h2 { margin-top: 22px; }
.entete-page { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.invite, .encadre { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px; margin-bottom: 16px; }
.encadre h2 { margin-top: 0; }
.formulaire { display: grid; gap: 12px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.formulaire > .bouton { justify-self: start; }
.libelle { font-size: .82rem; color: var(--doux); }
.retenue { margin: 2px 0 0; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; display: grid; }
.tuile b { font-size: 1.6rem; line-height: 1.2; }
.tuile span { color: var(--doux); font-size: .85rem; }
.tuile.alerte { background: var(--ambre-pale); border-color: #f0cf94; }
.tuile.alerte b { color: var(--ambre); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.puce { padding: 5px 12px; border: 1px solid var(--trait); border-radius: 20px; background: var(--surface); cursor: pointer; color: var(--doux); }
.puce.active { background: var(--vert); border-color: var(--vert); color: #fff; }
.suivi { display: grid; gap: 8px; }
.candidature { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; }
.candidature.a-relancer { border-left: 4px solid var(--ambre); }
.ligne-suivi { display: grid; grid-template-columns: minmax(200px, 2.2fr) 150px 120px 130px auto; gap: 14px; align-items: center; }
.qui { display: grid; gap: 1px; min-width: 0; }
.qui > span { color: var(--doux); font-size: .88rem; }
.quand, .etat { display: grid; font-size: .78rem; color: var(--doux); }
.quand b { font-size: .92rem; color: var(--texte); font-weight: 600; }
.quand.alerte b, .quand.alerte span { color: var(--ambre); }
.etat select { padding: 5px 6px; }
.ligne-suivi .actions { justify-content: end; }
.ligne-suivi .bouton { padding: 6px 10px; font-size: .88rem; }
.detail-suivi { display: grid; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--trait); }
.detail-suivi > .bouton { justify-self: start; }
.historique ul { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.historique time { color: var(--doux); display: inline-block; min-width: 110px; }

.pied { flex: none; display: flex; justify-content: space-between; gap: 12px; padding: 5px 16px; font-size: .76rem; color: var(--doux); background: var(--surface); border-top: 1px solid var(--trait); }
.pied a { color: var(--doux); }
.dialogue { border: 0; border-radius: 14px; padding: 22px; width: min(400px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dialogue::backdrop { background: rgba(20, 30, 25, .45); }
.dialogue form:not(.fermer) { display: grid; gap: 12px; margin-top: 12px; }
.dialogue .fermer { position: absolute; top: 8px; right: 10px; }
.dialogue .fermer button { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--doux); }
.dialogue .bascule { margin-right: 26px; }
.piege { position: absolute; left: -5000px; }
.message { position: fixed; z-index: 3000; left: 50%; bottom: 44px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: #1c2421; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.message.erreur { background: var(--rouge); color: #fff; }
.message.ok { background: var(--vert-fonce); }

@media (max-width: 860px) {
  .barre { gap: 8px; padding: 0 10px; }
  .marque span { display: none; }
  #menu { overflow-x: auto; }
  #menu a { padding: 7px 9px; font-size: .9rem; }
  #vue-carte { flex-direction: column-reverse; }
  .panneau { width: auto; flex: 1; border-right: 0; border-top: 1px solid var(--trait); }
  .carte { flex: none; height: 38vh; }
  .ligne-suivi { grid-template-columns: 1fr 1fr; }
  .ligne-suivi .qui, .ligne-suivi .actions { grid-column: 1 / -1; justify-content: start; }
  .pied span { display: none; }
  .info { grid-template-columns: 110px 1fr; }
}

label.case { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--texte); }
label.case input { width: auto; margin: 0; }
