/* Parc Cour Vert — feuille de style
   Palette : vert feuillage (réalisé, actions), orange argile (au programme), gris pierre. */
:root {
  --encre: #1F2420;
  --encre-2: #3C433D;
  --gris: #5B635C;
  --gris-clair: #8A8F88;
  --ligne: #D5D9D4;
  --ligne-2: #ECEEEA;
  --fond: #FFFFFF;
  --fond-2: #F7F8F5;
  --pierre: #F3F4F1;
  --vert: #2F6B3A;
  --vert-fonce: #1F4A28;
  --vert-pale: #EEF4EE;
  --orange: #C2631A;
  --orange-fonce: #8A4B0F;
  --orange-pale: #FBEFE2;
  --bleu: #1F4466;
  --bleu-pale: #E6EEF6;
  --rouge: #A4291C;
  --rayon: 10px;
  --police: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--police); font-size: 16px; line-height: 1.5; color: var(--encre); background: var(--fond); }
img { max-width: 100%; height: auto; }
a { color: var(--vert); text-underline-offset: 2px; }
a:hover { color: var(--vert-fonce); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .75em; }
code { background: var(--pierre); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.muted { color: var(--gris); }
.nowrap { white-space: nowrap; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--encre); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.chapo { font-size: 1.06rem; color: var(--encre-2); max-width: 65ch; }
.vide { color: var(--gris); background: var(--pierre); padding: 14px 16px; border-radius: var(--rayon); }
.fil { font-size: .9rem; color: var(--gris); }

/* ------------------------------------------------------------ Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--vert); background: var(--fond); color: var(--vert); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--vert-pale); color: var(--vert-fonce); }
.btn-plein { background: var(--vert); color: #fff; }
.btn-plein:hover { background: var(--vert-fonce); color: #fff; }
.btn-petit { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-danger { border-color: var(--rouge); color: var(--rouge); margin-top: 24px; }
.btn-danger:hover { background: #FBEAE7; color: var(--rouge); }
button.link { background: none; border: 0; padding: 0; color: var(--vert); font: inherit; text-decoration: underline; cursor: pointer; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ Badges et pastilles */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--pierre); color: var(--encre-2); vertical-align: middle; }
.badge-f-a_trouver, .badge-d-question { background: var(--orange-pale); color: var(--orange-fonce); }
.badge-f-promis, .badge-d-envisagee, .badge-info, .badge-r-referent, .badge-c-en_cours { background: var(--bleu-pale); color: var(--bleu); }
.badge-f-acquis, .badge-f-sur_place, .badge-d-validee, .badge-d-realisee, .badge-r-coeur, .badge-c-termine { background: #E5F0E6; color: var(--vert-fonce); }
.badge-d-abandonnee { background: var(--pierre); color: var(--gris); text-decoration: line-through; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; vertical-align: middle; }
.dot-fait { background: var(--vert); }
.dot-prevu { background: var(--orange); }
.dot-plustard { background: var(--fond); border: 2px dashed var(--gris-clair); }
.num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: .8rem; font-weight: 700; margin-right: 8px; flex-shrink: 0; }
.num-fait { background: var(--vert); color: #fff; }
.num-prevu { background: var(--orange); color: #fff; }
.num-plustard { border: 2px dashed var(--gris-clair); color: var(--gris); }

/* ------------------------------------------------------------ Messages */
.flash { padding: 12px 16px; border-radius: var(--rayon); margin: 0 0 16px; font-weight: 700; }
.flash-ok { background: #E5F0E6; color: var(--vert-fonce); }
.flash-erreur { background: #FBEAE7; color: var(--rouge); }
.flash-info { background: var(--bleu-pale); color: var(--bleu); }
.alerte { background: var(--orange-pale); border: 1px solid #E2B98A; border-radius: var(--rayon); padding: 14px 18px; margin: 0 0 20px; }
.alerte h2 { font-size: 1.05rem; color: #6E3A0B; margin-bottom: 6px; }
.alerte ul { margin: 0; padding-left: 20px; }
.alerte-info { background: var(--bleu-pale); border-color: #A9C2DA; }
.alerte-info h2 { color: var(--bleu); }
.mdp code { font-size: 1.4rem; padding: 6px 12px; background: #fff; letter-spacing: .05em; }

/* ------------------------------------------------------------ Formulaires */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .95rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--encre); background: #fff; border: 1px solid #A9B0AA; border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 0; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--vert); flex-shrink: 0; }
input[type=file] { padding: 8px; }
label.check, .form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
fieldset.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 16px; }
fieldset.cases legend { font-weight: 700; padding: 0 6px; }
fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea { background: var(--pierre); }

/* ------------------------------------------------------------ Public */
.pub-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.pub-logo { display: flex; flex-direction: column; text-decoration: none; color: var(--encre); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.pub-logo span { font-size: .85rem; font-weight: 400; color: var(--gris); }
.pub-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.pub-nav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--encre); }
.pub-nav a[aria-current] { background: var(--vert-pale); color: var(--vert-fonce); font-weight: 700; }
.pub-main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
.pub-footer { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; padding: 20px 16px 32px; border-top: 1px solid var(--ligne); font-size: .95rem; }

.hero { background: var(--vert-pale); border: 2px solid var(--vert); border-radius: 14px; padding: 22px 20px; margin-bottom: 28px; }
.hero-kicker { color: var(--vert); font-weight: 700; margin-bottom: 4px; }
.hero h1 { font-size: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero-actions .btn { flex: 1 1 220px; }
.hero-participants { margin: 12px 0 0; font-weight: 700; color: var(--vert-fonce); }

.bloc { margin: 0 0 32px; }
.cartes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.carte { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--ligne); border-radius: var(--rayon); text-decoration: none; color: var(--encre); }
.carte:hover { border-color: var(--vert); color: var(--encre); background: var(--fond-2); }
.carte strong { display: flex; align-items: center; font-size: 1.05rem; }
.carte span { font-size: .93rem; color: var(--encre-2); }
.carte span.muted { color: var(--gris); }
.carte .num { font-size: .8rem; color: #fff; }
.carte .num-plustard { color: var(--gris); }

.deroule { margin: 0; border: 1px solid var(--ligne); border-radius: var(--rayon); }
.deroule div { display: flex; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--ligne-2); }
.deroule div:last-child { border-bottom: 0; }
.deroule dt { width: 60px; flex-shrink: 0; font-weight: 700; }
.deroule dd { margin: 0; }

.liste-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste-simple li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--pierre); border-radius: var(--rayon); }
.liste-simple li span.muted { font-size: .85rem; }

.entete-espace { margin-bottom: 20px; }
.taches { margin: 0; padding-left: 20px; }
.taches li { margin-bottom: 4px; }
.taches.grandes li { margin-bottom: 10px; font-size: 1.04rem; }
.fournitures { list-style: none; margin: 0 0 14px; padding: 0; }
.fournitures li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ligne-2); }
.fournitures li > div { display: flex; flex-direction: column; }
.fournitures .muted { font-size: .88rem; }
.puces { margin: 0; padding-left: 20px; }
.puces li { margin-bottom: 4px; }

.frise { list-style: none; margin: 0 0 12px; padding: 0; }
.frise > li { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.frise > li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--ligne); }
.frise > li > .dot { margin-top: 4px; position: relative; z-index: 1; }
.frise-prevu > .dot { box-shadow: 0 0 0 4px #F8E3D2; }
.frise > li > div { flex: 1; min-width: 0; }
.frise-titre { margin-bottom: 4px; }
.frise-plustard .frise-titre strong { color: var(--gris); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.photos figcaption { font-size: .82rem; color: var(--gris); margin-top: 4px; }

.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.filtres a { padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--ligne); border-radius: 999px; text-decoration: none; color: var(--encre); }
.filtres a[aria-current] { background: var(--vert); border-color: var(--vert); color: #fff; }
.manques { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.manques > li { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px; scroll-margin-top: 16px; }
.manque-entete { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.manque-entete > div { display: flex; flex-direction: column; }
.manque-entete .muted { font-size: .88rem; }
.manque-entete > .badge { align-self: flex-start; flex-shrink: 0; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.manques details > summary { width: 100%; }
.manques details[open] > summary { display: none; }
.manques details .form { margin-top: 4px; }

.connexion { max-width: 460px; margin: 40px auto; padding: 0 16px; }

/* ------------------------------------------------------------ Plan */
.choix-chantier { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.choix-chantier a { display: flex; flex-direction: column; padding: 8px 14px; min-height: 44px; border: 1px solid #A9B0AA; border-radius: var(--rayon); text-decoration: none; color: var(--encre); line-height: 1.3; }
.choix-chantier a span { font-size: .8rem; color: var(--gris); }
.choix-chantier a[aria-current] { background: var(--vert); border-color: var(--vert); color: #fff; }
.choix-chantier a[aria-current] span { color: #E5F0E6; }
.plan-scroll { overflow-x: auto; border-radius: var(--rayon); border: 1px solid var(--ligne); background: #FAFAF8; }
.plan { position: relative; min-width: 560px; line-height: 0; user-select: none; }
.plan-fond { width: 100%; display: block; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1; text-decoration: none; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.pin-fait { background: var(--vert); color: #fff; }
.pin-prevu { background: var(--orange); color: #fff; }
.pin-plustard { background: #fff; color: var(--gris); border: 2px dashed var(--gris-clair); }
.pin:hover, .pin:focus-visible { transform: translate(-50%, -50%) scale(1.12); color: inherit; }
.pin-fait:hover, .pin-prevu:hover { color: #fff; }
.pin-sel { box-shadow: 0 0 0 4px var(--encre); }
.plan-edition { cursor: crosshair; }
.legende { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 10px 0 0; font-size: .9rem; color: var(--encre-2); }
.legende li { display: flex; align-items: center; gap: 6px; }
.apercu-plan { max-width: 420px; border: 1px solid var(--ligne); border-radius: var(--rayon); }

/* ------------------------------------------------------------ Espace cœur */
.zone-admin { background: var(--fond-2); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-nav { width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--ligne); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-brand { font-weight: 700; font-size: 1.1rem; padding: 0 12px 16px; display: flex; flex-direction: column; line-height: 1.3; }
.admin-brand span { font-weight: 400; font-size: .85rem; color: var(--gris); }
.admin-nav > a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--encre); }
.admin-nav > a:hover { background: var(--pierre); }
.admin-nav > a[aria-current] { background: var(--vert-pale); color: var(--vert-fonce); font-weight: 700; }
.admin-user { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--ligne-2); display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.admin-main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.titre-page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.titre-page h1 { margin-bottom: 2px; }
.titre-page p { margin: 0; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.panneau { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.grille .panneau { margin-bottom: 0; }
.panneau h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.compte { display: inline-flex; min-width: 26px; height: 26px; padding: 0 8px; align-items: center; justify-content: center; border-radius: 999px; background: var(--pierre); font-size: .85rem; }
.lignes { list-style: none; margin: 0 0 8px; padding: 0; }
.lignes li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--ligne-2); }
.lignes li:last-child { border-bottom: 0; }
.lignes li > div { display: flex; flex-direction: column; min-width: 0; }
.lignes .muted { font-size: .88rem; }
.lignes .date { width: 88px; flex-shrink: 0; font-weight: 700; font-size: .9rem; }
.ligne-action { justify-content: space-between; }
.bloc-actions { margin-bottom: 28px; }
.bloc-actions h2 { display: flex; align-items: center; gap: 8px; }
.ligne-etat { flex-wrap: wrap; }
.ligne-etat > div { flex: 1 1 160px; }
.ligne-etat form { margin-left: auto; }
.ligne-etat select { min-height: 36px; font: inherit; font-size: .88rem; }
form.inline { display: flex; gap: 6px; flex-shrink: 0; }
.carte-form { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 20px; max-width: 820px; margin-bottom: 16px; }
.carte-form h2 { margin-top: 10px; }
.form-ligne { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form-ligne label { flex: 1 1 240px; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--ligne); border-radius: 12px; margin-bottom: 16px; }
.panneau .table-scroll { border: 0; border-radius: 0; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th { text-align: left; font-size: .85rem; color: var(--gris); background: var(--pierre); padding: 10px 14px; white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--ligne-2); vertical-align: top; }
tr.fait td { color: var(--gris); }
tr:target td { background: #FFF8E8; }
.table-fournitures { min-width: 960px; }
form.rapide { display: flex; gap: 6px; align-items: center; }
form.rapide input { min-width: 150px; min-height: 36px; padding: 6px 10px; }
form.rapide select { width: auto; min-height: 36px; padding: 6px 8px; }
.filtres-admin { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.filtres-admin label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--gris); }
.filtres-admin label.check { flex-direction: row; color: var(--encre); padding-bottom: 10px; }
.filtres-admin select, .filtres-admin input[type=search] { min-height: 40px; padding: 6px 10px; width: auto; }
.filtres-admin .grow { flex: 1 1 180px; }
.filtres-admin .grow input { width: 100%; }
.totaux { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.totaux a { text-decoration: none; color: var(--encre); }
.plan-admin { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.roles .panneau { border-top-width: 4px; }
.role-benevole { border-top-color: var(--gris-clair) !important; }
.role-referent { border-top-color: var(--bleu) !important; }
.role-coeur { border-top-color: var(--vert) !important; }
.chantier-bloc h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-nav { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--ligne); padding: 10px; }
  .admin-brand { width: 100%; padding: 4px 8px 8px; }
  .admin-user { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; border-top: 0; padding: 8px; margin: 0; }
  .admin-main { padding: 20px 16px 40px; }
  .plan-admin { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .pin { transition: transform .12s ease; }
}

@media print {
  .pub-header, .pub-footer, .no-print, .skip, .btn { display: none !important; }
  .pub-main { max-width: none; padding: 0; }
  body { font-size: 12pt; }
  a { color: inherit; text-decoration: none; }
}
