/* Médiation · Laon — clair, calme, contrasté (AA), gros boutons au doigt.
   Une couleur d'action : le bleu. L'orange = quartier prioritaire. Pas de fond sombre, pas d'effet lumineux. */
:root {
  --fond: #F4F5F7; --surface: #fff; --surface-2: #EEF1F5; --encre: #17212F; --encre-2: #3F4B5C; --encre-3: #667185; --trait: #E1E5EB;
  --bleu: #2152A3; --bleu-fonce: #193F7E; --bleu-fond: #E8EFFA; --orange: #B45309; --orange-fond: #FDF1E1; --rouge: #B42318; --vert: #1F7A4D; --vert-fond: #E5F4EC;
  --ombre: 0 1px 2px rgba(23, 33, 47, .06), 0 2px 8px rgba(23, 33, 47, .04);
  --rayon: 14px; --menu: 236px;
  --texte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--encre); font: 16px/1.5 var(--texte); -webkit-font-smoothing: antialiased; }
a { color: var(--bleu); text-underline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 14px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 26px 0 10px; color: var(--encre-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; }
svg { flex: none; }

/* ---------- le cadre : menu à gauche (ordinateur), barre en bas (téléphone) ---------- */
.entete { position: fixed; inset: 0 auto 0 0; width: var(--menu); z-index: 1100; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--trait); }
.marque { display: flex; align-items: center; gap: 10px; font-weight: 750; text-decoration: none; color: var(--encre); font-size: 17px; padding: 2px 8px 14px; margin: 0; }
.marque small { display: block; font-weight: 500; color: var(--encre-3); font-size: 13px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--bleu); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.vite { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin: 0 0 12px; border-radius: 11px;
  background: var(--bleu); color: #fff; font-weight: 700; text-decoration: none; }
.vite:hover { background: var(--bleu-fonce); }
.vite svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--encre-2); text-decoration: none; font-size: 15px; font-weight: 600; }
.nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--surface-2); color: var(--encre); }
.nav a.actif { background: var(--bleu-fond); color: var(--bleu); }
.moi { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--trait); font-size: 14px; }
.moi .rond { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--encre-2); display: grid; place-items: center; font-weight: 700; }
.moi b { display: block; line-height: 1.2; } .moi small { color: var(--encre-3); }
.sortir { margin-left: auto; color: var(--encre-3); font-size: 14px; }
.cadre { margin-left: var(--menu); min-height: 100vh; display: flex; flex-direction: column; }
body:not(.connecte) .cadre { margin-left: 0; }
.bandeau-demo { margin: 0; background: var(--orange-fond); color: #7C2D12; text-align: center; font-size: 14px; font-weight: 600; padding: 7px 12px; }
.contenu { width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 32px 48px; flex: 1; }
.pied { text-align: center; color: var(--encre-3); font-size: 13px; padding: 12px 16px 24px; }
.pied a { color: var(--encre-3); }

/* ---------- boutons ---------- */
.principal, .bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: 11px; font-weight: 650; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.principal { background: var(--bleu); color: #fff; }
.principal:hover { background: var(--bleu-fonce); }
.bouton { background: var(--surface); color: var(--encre); border-color: var(--trait); box-shadow: var(--ombre); }
.bouton:hover { border-color: #C5CCD6; }
.bouton.principal { background: var(--bleu); color: #fff; border-color: transparent; }
.discret { background: none; border: 0; color: var(--encre-2); text-decoration: underline; cursor: pointer; padding: 10px 4px; }
.petit-bouton { background: var(--surface); border: 1px solid var(--trait); border-radius: 9px; padding: 6px 14px; font-size: 14px; font-weight: 650; cursor: pointer; min-height: 38px; }
.petit-bouton:hover { border-color: var(--vert); color: var(--vert); }
.lien { background: none; border: 0; padding: 0; color: var(--encre-3); text-decoration: underline; cursor: pointer; font-size: 13px; }
.principal.danger { background: var(--rouge); }

/* ---------- textes ---------- */
.erreur { color: var(--rouge); font-weight: 650; }
.message { background: var(--vert-fond); color: #14532D; padding: 11px 14px; border-radius: 11px; }
.aide { color: var(--encre-3); font-size: 14px; display: block; margin-top: 4px; }
.aide.petit, .petit { font-size: 13px; }
.vide { color: var(--encre-3); }
.attention { color: var(--orange); font-weight: 650; }
.badge { font-style: normal; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 9px; background: var(--surface-2); color: var(--encre-2); vertical-align: 2px; }
.badge.qpv { background: var(--orange-fond); color: var(--orange); }
.titre-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.titre-ligne h1 { margin: 4px 0; }
.fil { margin: 0 0 6px; font-size: 14px; } .fil a { color: var(--encre-3); text-decoration: none; } .fil a:hover { color: var(--bleu); }
.a-valider { display: inline-block; background: var(--orange-fond); color: #7C2D12; font-size: 13px; font-weight: 700; border-radius: 6px; padding: 0 6px; }

/* ---------- accueil ---------- */
.bonjour { font-size: 28px; margin-bottom: 2px; }
.date-du-jour { color: var(--encre-3); margin: 0 0 18px; }
.gros-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
.gros { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 18px; border-radius: var(--rayon); text-decoration: none;
  background: var(--surface); color: var(--encre); border: 1px solid var(--trait); box-shadow: var(--ombre); }
.gros b { display: block; font-size: 18px; } .gros small { display: block; color: var(--encre-3); font-size: 14px; font-weight: 500; }
.gros .pastille { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--bleu-fond); color: var(--bleu); }
.gros:hover { border-color: #C5CCD6; }
.gros.principal { background: var(--bleu); color: #fff; border-color: transparent; }
.gros.principal small { color: #DCE6F7; } .gros.principal .pastille { background: rgba(255, 255, 255, .16); color: #fff; }
.gros svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chercher { position: relative; }
.chercher svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--encre-3); stroke-width: 2; stroke-linecap: round; }
.chercher input { padding-left: 44px !important; }
.chercher input, .filtres input, .filtres select { width: 100%; min-height: 50px; border: 1px solid var(--trait); border-radius: 12px; padding: 10px 14px; background: var(--surface); font-size: 16px; box-shadow: var(--ombre); }
.filtres { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.compte { color: var(--encre-3); font-size: 14px; margin: 8px 0; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.premiers-pas { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px 20px; box-shadow: var(--ombre); }
.premiers-pas ol { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: pas; display: grid; gap: 10px; }
.premiers-pas li { counter-increment: pas; display: flex; gap: 12px; align-items: baseline; }
.premiers-pas li::before { content: counter(pas); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--bleu-fond); color: var(--bleu); font-weight: 750; font-size: 14px; display: grid; place-items: center; }

/* ---------- tuiles, listes ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--ombre); }
.tuile span { color: var(--encre-3); font-size: 13px; font-weight: 600; } .tuile b { font-size: 28px; letter-spacing: -.01em; } .tuile small { color: var(--encre-3); font-size: 13px; }
.liste { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; }
.liste > .vide { padding: 14px 16px; }
.ligne { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--trait); }
.ligne:first-child { border-top: 0; }
.ligne:hover { background: #FAFBFC; }
.ligne > a, .ligne > div { flex: 1; min-width: 0; display: grid; text-decoration: none; color: var(--encre); }
.ligne b { font-weight: 650; }
.ligne span { color: var(--encre-2); font-size: 15px; } .ligne small { color: var(--encre-3); font-size: 13px; }
.ligne.inactif { opacity: .55; }

/* ---------- fiche usager ---------- */
.carte-fiche { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre); }
.quartier { margin: 0 0 10px; font-weight: 650; }
.infos { margin: 0; display: grid; gap: 8px; }
.infos div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.infos dt { color: var(--encre-3); } .infos dd { margin: 0; }
.notes { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; }
.actions { margin: 8px 0 0; font-size: 14px; }
.frise { list-style: none; padding: 0 0 0 4px; margin: 0; border-left: 2px solid var(--trait); }
.frise li { position: relative; padding: 2px 0 18px 20px; }
.frise li::before { content: ""; position: absolute; left: -8px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--bleu); }
.frise p { margin: 2px 0; } .quand { color: var(--encre-3); font-size: 14px; } .quand b { color: var(--encre); }
.type { font-style: normal; background: var(--bleu-fond); color: var(--bleu); border-radius: 6px; padding: 1px 7px; font-size: 13px; font-weight: 650; }
.resume { white-space: pre-wrap; }
.orientation { color: var(--encre-2); font-size: 14px; }
.suite { color: var(--orange); font-weight: 600; font-size: 14px; } .suite.faite { color: var(--vert); text-decoration: line-through; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.photos figure { margin: 0; display: grid; gap: 2px; } .photos figure a { display: block; } .photos figure form { justify-self: start; }
.archiver { margin-top: 24px; }
.effacer { margin-top: 18px; border: 1px solid var(--trait); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.effacer summary { cursor: pointer; font-weight: 650; color: var(--rouge); }
.confidentialite h2 { font-size: 18px; margin: 22px 0 4px; text-transform: none; letter-spacing: 0; color: var(--encre); }
.confidentialite p, .confidentialite li { max-width: 70ch; }

/* ---------- formulaires ---------- */
.formulaire { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px 20px; box-shadow: var(--ombre); }
.formulaire label { display: grid; gap: 5px; font-weight: 600; font-size: 15px; }
.formulaire input:not([type=checkbox]):not([type=file]), .formulaire select, .formulaire textarea { width: 100%; min-height: 48px; border: 1px solid #D3D9E1; border-radius: 10px; padding: 10px 12px; background: var(--surface); font-size: 16px; font-weight: 400; }
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus { border-color: var(--bleu); outline: 3px solid var(--bleu-fond); outline-offset: 0; }
.formulaire textarea { min-height: 100px; resize: vertical; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .trois { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.case { display: flex !important; align-items: flex-start; gap: 8px; font-weight: 500 !important; }
.case input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--bleu); }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.champ-adresse { position: relative; }
.suggestions { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.suggestions button { width: 100%; text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.suggestions button:hover, .suggestions button:focus { background: var(--bleu-fond); }
.chrono { display: flex; align-items: center; gap: 14px; background: var(--bleu-fond); border-radius: 12px; padding: 12px 14px; }
.chrono span { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--bleu); }
.chrono.en-marche { background: #FDECEA; } .chrono.en-marche span { color: var(--rouge); }
.chrono.en-marche .bouton { background: var(--rouge); color: #fff; border: 0; }
fieldset { border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
legend { font-weight: 650; padding: 0 4px; }
.periode { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.periode select, .periode input { min-height: 42px; border: 1px solid var(--trait); border-radius: 10px; padding: 6px 10px; background: var(--surface); }
.periode .cachees { display: none; }
.du-au { color: var(--encre-3); font-size: 14px; }

/* ---------- chiffres, heures ---------- */
.barres { list-style: none; padding: 14px 16px; margin: 0; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.barres li { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 72px; gap: 10px; align-items: center; font-size: 14px; }
.barre { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; } .barre i { display: block; height: 100%; background: var(--bleu); border-radius: 99px; }
.barres b { text-align: right; font-variant-numeric: tabular-nums; }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; font-size: 14px; box-shadow: var(--ombre); }
.tableau th, .tableau td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-3); background: #FAFBFC; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr.jour td { background: var(--surface-2); }
.en-ligne { display: inline; }
.boutons-ligne { display: flex; gap: 8px; }
.ajout-activite { margin-top: 18px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 16px; }
.ajout-activite summary { cursor: pointer; font-weight: 650; }
.ajout-activite .formulaire { border: 0; box-shadow: none; padding: 12px 0 0; }

/* ---------- carte ---------- */
.carte-cadre { display: grid; grid-template-columns: 1fr 270px; gap: 14px; align-items: start; }
.carte { height: min(74vh, 680px); border-radius: var(--rayon); border: 1px solid var(--trait); box-shadow: var(--ombre); background: var(--surface-2); }
.panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); max-height: min(74vh, 680px); overflow: auto; }
.panneau h2 { margin: 0 0 8px; }
.panneau h2 + .legende-carte { margin-bottom: 14px; }
.quartiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.quartiers button { width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 14px; }
.quartiers button:hover, .quartiers button.actif { background: var(--bleu-fond); }
.quartiers .qpv-nom { color: var(--orange); font-weight: 650; }
.quartiers b { font-variant-numeric: tabular-nums; color: var(--encre-2); }
.legende-carte { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; color: var(--encre-2); }
.legende-carte i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.legende-carte .qpv { background: rgba(217, 119, 6, .30); border: 2px solid #B45309; } .legende-carte .peu { background: #E3EAF6; border: 1px solid #8C9BB0; } .legende-carte .beaucoup { background: #2152A3; }
.legende-carte .point { border-radius: 50%; background: var(--encre); width: 11px; height: 11px; }
.etiquette-qpv { background: #fff; border: 1px solid #B45309; color: #7C2D12; font-weight: 700; font-size: 12px; border-radius: 6px; padding: 1px 6px; box-shadow: none; }
.etiquette-qpv::before { display: none; }
.leaflet-container { font: 14px/1.4 var(--texte); }

/* ---------- connexion ---------- */
.entree { max-width: 420px; margin: 10vh auto 0; background: var(--surface); border: 1px solid var(--trait); border-radius: 18px; padding: 30px; box-shadow: var(--ombre); }
.entree .marque { padding: 0 0 18px; }
.entree form { display: grid; gap: 10px; }
.entree label { font-weight: 600; }
.entree input { min-height: 50px; border: 1px solid #D3D9E1; border-radius: 11px; padding: 10px 13px; font-size: 17px; }
.entree .principal { min-height: 50px; }
.seulement-impression { display: none; }

/* ---------- téléphone et tablette ---------- */
@media (max-width: 900px) {
  .entete { position: sticky; inset: auto; top: 0; width: auto; flex-direction: row; align-items: center; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--trait); }
  .marque { padding: 0; } .marque small { display: inline; margin-left: 4px; }
  .vite, .moi .rond, .moi div { display: none; }
  .moi { margin: 0 0 0 auto; padding: 0; border: 0; }
  .cadre { margin-left: 0; padding-bottom: 72px; }
  .nav { position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0; flex-direction: row; background: var(--surface); border-top: 1px solid var(--trait); justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; flex: 1; }
  .nav a.secondaire { display: none; }
  .contenu { padding: 16px 14px 28px; }
  .carte-cadre { grid-template-columns: 1fr; } .panneau { max-height: none; }
  .deux-colonnes { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .gros-boutons, .deux, .trois, .filtres { grid-template-columns: 1fr; }
  .gros { min-height: 70px; }
  .infos div { grid-template-columns: 1fr; gap: 0; }
  .barres li { grid-template-columns: 1fr 64px; } .barres .barre { grid-column: 1 / -1; grid-row: 2; }
  .tableau { font-size: 13px; } .tableau th:nth-child(2), .tableau td:nth-child(2) { display: none; }
  .formulaire { padding: 14px; }
}
@media print {
  .entete, .nav, .pied, .periode, .non-imprime, .bandeau-demo, .titre-ligne .boutons-ligne, .ajout-activite { display: none !important; }
  .cadre { margin: 0; padding: 0; }
  .seulement-impression { display: block; margin-bottom: 12px; }
  body { background: #fff; } .contenu { max-width: none; padding: 0; }
  .tuile, .tableau { border: 1px solid #999; box-shadow: none; }
}
