/* Thème sombre "plan de métro" (24 juillet 2026, demande de Simon) : fond noir partout,
   accents colorés repris des 6 lignes de la carte d'accueil (rouge=Pilotage,
   jaune=Vue d'ensemble, bleu=Équipe & partenaires, violet=Moyens, vert=Communication/
   validé, orange=Compte). Remplace l'ancienne charte claire/bleu marine jugée trop
   austère. Les anciens noms de variables (--navy, --green, --card...) sont conservés en
   alias pour ne pas avoir à retoucher chaque règle qui les utilise. */
:root{
  --bg-page:#12131b; --bg-card:#1b1d29; --bg-card-alt:#20222f;
  --border:rgba(255,255,255,0.10); --border-strong:rgba(255,255,255,0.20);
  --text:#EDEFF5; --text-dim:#9aa0b4;

  --rouge:#E4483A; --rouge-bg:rgba(228,72,58,0.18);
  --jaune:#F0C93D; --jaune-bg:rgba(240,201,61,0.18);
  --bleu:#4FA8E0; --bleu-bg:rgba(79,168,224,0.18);
  --violet:#8B5FBF; --violet-bg:rgba(139,95,191,0.20);
  --vert:#3FBE72; --vert-bg:rgba(63,190,114,0.18);
  --orange:#F2994A; --orange-bg:rgba(242,153,74,0.18);

  /* alias de compatibilité */
  --navy:var(--rouge); --navy-light:#c73c30; --bg:var(--bg-page); --card:var(--bg-card);
  --green:var(--vert); --green-bg:var(--vert-bg);
  --yellow:var(--jaune); --yellow-bg:var(--jaune-bg);
  --red:var(--rouge); --red-bg:var(--rouge-bg);
  --blue:var(--bleu); --blue-bg:var(--bleu-bg);
  --grey:var(--text-dim); --border:var(--border);
}
*{box-sizing:border-box;}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg-page);color:var(--text);}
/* Liens génériques (24 juillet 2026, demande de Simon) : sans cette règle, les <a> sans
   classe dédiée reprennent le bleu/violet "visité" par défaut du navigateur, moche sur
   fond sombre et incohérent avec la charte. On fixe la même couleur avant/après clic. */
a{color:var(--bleu);}
a:visited{color:var(--bleu);}
a:hover{color:var(--text);}
.intervenant-link{text-decoration:underline;}
header{background:#0d0e15;color:var(--text);padding:20px 32px;border-bottom:1px solid var(--border);}
header h1{margin:0;font-size:20px;}
header p{margin:4px 0 0;font-size:12.5px;color:var(--text-dim);}
/* Nav "mini plan de métro" (24 juillet 2026, demande de Simon) : chaque page est une
   pastille aux bords arrondis, reliée à la suivante par un trait pointillé — reprend
   la charte graphique de la page d'accueil au lieu d'onglets alignés classiques.
   nav::before dessine le fil pointillé qui traverse toutes les pastilles. */
nav{position:relative;display:flex;gap:10px;align-items:center;background:#181a24;padding:14px 24px;flex-wrap:wrap;border-bottom:1px solid var(--border);}
nav::before{content:"";position:absolute;left:24px;right:24px;top:50%;border-top:2px dashed var(--border-strong);z-index:0;}
nav a{position:relative;z-index:1;color:var(--text-dim);padding:8px 16px;font-size:13px;text-decoration:none;
  background:var(--bg-card);border:2px solid var(--border-strong);border-radius:16px;font-weight:600;}
nav a:hover{color:var(--text);border-color:var(--text-dim);}
nav a.active{color:var(--text);font-weight:bold;background:var(--bg-card-alt);border-color:var(--text-dim);}
/* Accents par ligne du plan de métro, appliqués aux liens de nav correspondants
   (voir base.html) — purement décoratif, garde une cohérence visuelle avec la page
   d'accueil sans changer la logique de navigation. */
nav a.l-rouge{border-color:rgba(228,72,58,0.5);color:var(--rouge);}
nav a.l-bleu{border-color:rgba(79,168,224,0.5);color:var(--bleu);}
nav a.l-violet{border-color:rgba(139,95,191,0.5);color:var(--violet);}
nav a.l-vert{border-color:rgba(39,174,96,0.5);color:var(--vert);}
nav a.l-orange{border-color:rgba(242,153,74,0.5);color:var(--orange);}
nav a.l-rouge.active{background:var(--rouge-bg);border-color:var(--rouge);}
nav a.l-bleu.active{background:var(--bleu-bg);border-color:var(--bleu);}
nav a.l-violet.active{background:var(--violet-bg);border-color:var(--violet);}
nav a.l-vert.active{background:var(--vert-bg);border-color:var(--vert);}
nav a.l-orange.active{background:var(--orange-bg);border-color:var(--orange);}
main{padding:24px 32px;max-width:1200px;margin:0 auto;}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:24px;}
.kpi{background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:16px;}
.kpi .num{font-size:26px;font-weight:bold;color:var(--text);}
.kpi .lbl{font-size:12px;color:var(--text-dim);margin-top:4px;}
section.panel{background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:20px;margin-bottom:20px;}
.panel-head{display:flex;justify-content:space-between;align-items:center;}
h2{font-size:16px;color:var(--text);margin:0 0 14px;}
table{width:100%;border-collapse:collapse;font-size:13px;color:var(--text);}
th{background:var(--bg-card-alt);text-align:left;padding:8px 10px;font-size:12px;color:var(--text-dim);border-bottom:2px solid var(--border);}
td{padding:8px 10px;border-bottom:1px solid var(--border);vertical-align:top;}
.badge{display:inline-block;padding:3px 9px;border-radius:12px;font-size:11px;font-weight:bold;white-space:nowrap;}
/* 14 juillet 2026 : déroulant de statut de candidature, coloré comme les badges
   (.badge-pourvu etc. réutilisées ici via le filtre candidature_class) plutôt qu'un
   <select> HTML standard. */
.badge-select{border:none;border-radius:12px;padding:3px 8px;font-size:11px;font-weight:bold;cursor:pointer;}
.candidatures-table{width:100%;margin-bottom:2px;}
.candidatures-table th{font-size:11px;padding:4px 6px;}
.candidatures-table td{padding:4px 6px;font-size:12.5px;}
.badge-pourvu{background:var(--vert-bg);color:var(--vert);}
.badge-apourvoir{background:var(--jaune-bg);color:var(--jaune);}
.badge-conflit{background:var(--rouge-bg);color:var(--rouge);}
.badge-encours{background:var(--bleu-bg);color:var(--bleu);}
.badge-remplacement{background:var(--violet-bg);color:var(--violet);}
/* Charte couleur des modules Image : rouge = intervenant non confirmé, orange =
   intervenant confirmé mais matériel non confirmé, vert = tout confirmé. */
.badge-rouge{background:var(--rouge-bg);color:var(--rouge);}
.badge-orange{background:var(--orange-bg);color:var(--orange);}
.badge-vert{background:var(--vert-bg);color:var(--vert);}
.filters{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;}
select,input[type=text],input[type=number],input[type=password],input[type=email],input[type=date],textarea{
  padding:7px 10px;border:1px solid var(--border);border-radius:6px;font-size:13px;font-family:inherit;
  background:var(--bg-card-alt);color:var(--text);
}
select:focus,input:focus,textarea:focus{outline:none;border-color:var(--rouge);}
::placeholder{color:var(--text-dim);opacity:1;}
/* Nom de module cliquable dans la liste (24 juillet 2026, demande de Simon) : ouvre la
   pop-up de remplissage rapide directement, comme un clic sur la frise. */
.module-link{color:var(--text);text-decoration:none;}
.module-link:hover{color:var(--rouge);text-decoration:underline;}
.promo-group{margin-bottom:18px;}
.promo-group h3{font-size:13px;color:var(--text);border-bottom:1px solid var(--border);padding-bottom:6px;}
.note{font-size:11.5px;color:var(--text-dim);font-style:italic;}
.tag-section{display:inline-block;background:var(--bg-card-alt);color:var(--text-dim);padding:2px 8px;border-radius:10px;font-size:10.5px;margin:1px 3px 1px 0;}
.vigil{list-style:none;padding:0;margin:0 0 14px;}
.vigil li{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 12px;border-left:4px solid var(--rouge);background:var(--rouge-bg);border-radius:4px;margin-bottom:8px;font-size:13px;color:var(--text);}
.vigil li.ok{border-left-color:var(--vert);background:var(--vert-bg);color:var(--vert);}
.inline-form{display:flex;gap:8px;}
.inline-form input{flex:1;}
.btn, button{background:var(--rouge);color:#fff;border:none;padding:9px 16px;border-radius:6px;font-size:13px;cursor:pointer;text-decoration:none;display:inline-block;}
.btn:hover, button:hover{background:var(--navy-light);}
button.small{padding:5px 10px;font-size:11.5px;background:var(--bg-card-alt);color:var(--text);}
.btn-danger{background:#B00020;}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.form-grid label{display:flex;flex-direction:column;gap:5px;font-size:12.5px;color:var(--text-dim);}
.form-grid .full{grid-column:1 / -1;}
.form-actions{display:flex;gap:12px;align-items:center;}
.login-box{max-width:340px;margin:60px auto;background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:28px;}
.login-box form{display:flex;flex-direction:column;gap:10px;}
.flash{padding:10px 14px;border-radius:6px;margin-bottom:14px;font-size:13px;}
.flash-error{background:var(--rouge-bg);color:var(--rouge);}
.flash-success{background:var(--vert-bg);color:var(--vert);}
footer{text-align:center;padding:20px;font-size:11px;color:var(--text-dim);}

/* Calendrier */
.cal-mois{margin-bottom:22px;}
.cal-mois h3{font-size:14px;color:var(--text);text-transform:capitalize;border-bottom:1px solid var(--border);padding-bottom:6px;}
.cal-semaine{display:flex;gap:6px;margin-bottom:6px;flex-wrap:wrap;}
.cal-jour{
  flex:1;min-width:100px;max-width:150px;min-height:64px;
  border:1px solid var(--border);border-radius:6px;padding:6px 8px;
  text-decoration:none;color:var(--text);background:var(--bg-card);font-size:11.5px;
  display:flex;flex-direction:column;gap:3px;
}
.cal-jour:hover{border-color:var(--rouge);box-shadow:0 0 0 1px var(--rouge);}
.cal-jour-date{font-weight:bold;color:var(--rouge);font-size:11px;}
.cal-jour-nom{font-size:11px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;}
.cal-jour-context{margin-top:auto;display:flex;gap:2px;}
.cal-dot{width:6px;height:6px;border-radius:50%;background:var(--text-dim);display:inline-block;}
.cal-jour-module.badge-pourvu{background:var(--vert-bg);}
.cal-jour-module.badge-apourvoir{background:var(--jaune-bg);}
.cal-jour-module.badge-conflit{background:var(--rouge-bg);}
.cal-jour-module.badge-encours{background:var(--bleu-bg);}
.cal-jour-module.badge-remplacement{background:var(--violet-bg);}
.cal-jour-module.badge-rouge{background:var(--rouge-bg);}
.cal-jour-module.badge-orange{background:var(--orange-bg);}
.cal-jour-module.badge-vert{background:var(--vert-bg);}
.conflit-box{border-left:4px solid var(--rouge);background:var(--rouge-bg);border-radius:4px;padding:10px 12px;margin-bottom:10px;font-size:13px;color:var(--text);}
.contexte-box{border-left:4px solid var(--text-dim);background:var(--bg-card-alt);border-radius:4px;padding:10px 12px;margin-bottom:10px;font-size:13px;color:var(--text);}

/* Pop-up de remplissage rapide d'un module */
dialog#module-popup-dialog{
  border:none;border-radius:10px;padding:0;width:min(680px,92vw);
  background:var(--bg-card);color:var(--text);
  box-shadow:0 10px 40px rgba(0,0,0,0.55);
  /* 26 juillet 2026 : la pop-up n'avait ni max-height ni overflow définis — sur un
     écran pas assez haut, le bas du formulaire (dont les cases "Sections concernées"
     ajoutées ce jour) pouvait se retrouver hors champ, sans barre de défilement pour
     y accéder. Corrigé en forçant un défilement interne au-delà de 90% de la hauteur
     visible, quelle que soit la taille de l'écran. */
  max-height:90vh;overflow-y:auto;
}
dialog#module-popup-dialog::backdrop{background:rgba(5,6,10,0.7);}

/* Fiche de sortie matériel Lumière/Machinerie (26 juillet 2026) */
dialog#fiche-sortie-dialog{
  border:none;border-radius:10px;padding:0;width:min(760px,94vw);
  background:var(--bg-card);color:var(--text);
  box-shadow:0 10px 40px rgba(0,0,0,0.55);
  max-height:90vh;overflow-y:auto;
}
dialog#fiche-sortie-dialog::backdrop{background:rgba(5,6,10,0.7);}
#fiche-sortie-body{padding:22px 24px;}
#fiche-sortie-body table{margin-bottom:6px;}
/* 27 juillet 2026 (demande de Simon) : le "td{vertical-align:top}" global décale le
   champ input number (qui a sa propre hauteur de boîte) par rapport au texte simple
   des cellules Référence/Max sur la même ligne — on recentre verticalement juste pour
   ce tableau. */
.fiche-sortie-table td{vertical-align:middle;}
.fiche-sortie-table input[type="number"]{vertical-align:middle;}
/* 27 juillet 2026 (demande de Simon) : même principe que .qte-picker-popup, en version
   compacte inline directement dans chaque ligne de la fiche de sortie (voir le script
   dédié dans base.html) — l'article n'a pas besoin d'être "sélectionné" au préalable ici,
   la barre est donc affichée en permanence plutôt que dans un pop-up. */
.qte-bar-mini{position:relative;width:120px;height:24px;border-radius:5px;background:var(--bg-card-alt);cursor:pointer;user-select:none;}
.qte-bar-mini-fill{position:absolute;top:0;left:0;bottom:0;border-radius:5px;background:var(--rouge,#e6553f);transition:width .05s linear;}
.qte-bar-mini-notches{position:absolute;inset:0;}
.qte-bar-mini-notch{position:absolute;top:0;bottom:0;width:1px;background:rgba(255,255,255,0.28);}
.qte-bar-mini-valeur{position:relative;z-index:1;display:block;text-align:center;line-height:24px;font-size:11.5px;font-weight:600;color:#fff;}
/* 27 juillet 2026 (demande de Simon) : pop-up "barre de progression" pour choisir une
   quantité (déroulant Matériel nécessaire de la fiche complète) — voir module_form.html. */
.qte-picker-popup{
  position:absolute;z-index:80;width:260px;padding:14px 16px;border-radius:8px;
  background:var(--bg-card);border:1px solid var(--border);color:var(--text);
  box-shadow:0 10px 30px rgba(0,0,0,0.5);
}
.qte-picker-titre{font-size:13px;font-weight:600;margin-bottom:10px;}
.qte-picker-bar{
  position:relative;height:22px;border-radius:5px;background:var(--bg-card-alt);
  cursor:pointer;user-select:none;
}
.qte-picker-fill{
  position:absolute;top:0;left:0;bottom:0;border-radius:5px;
  background:var(--rouge,#e6553f);transition:width .05s linear;pointer-events:none;
}
.qte-picker-notches{position:absolute;inset:0;pointer-events:none;}
.qte-picker-notch{position:absolute;top:0;bottom:0;width:1px;background:rgba(255,255,255,0.28);}
.qte-picker-valeur{margin-top:8px;font-size:12.5px;color:var(--text-dim);text-align:right;}
/* Puces "article — quantité" sous le déroulant Matériel nécessaire : permettent de
   rouvrir le pop-up de quantité d'un article déjà sélectionné sans le désélectionner
   (voir module_form.html). */
.materiels-qte-resume{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.qte-chip{
  font-size:11.5px;padding:4px 9px;border-radius:12px;border:1px solid var(--border);
  background:var(--bg-card-alt);color:var(--text);cursor:pointer;
}
.qte-chip:hover{border-color:var(--rouge,#e6553f);color:var(--rouge,#e6553f);}
/* 28 juillet 2026 (demande de Simon) : pop-up de dates de réservation d'une salle de
   projection — même conteneur que .qte-picker-popup (voir base.html), mais avec deux
   champs date empilés au lieu d'une barre de quantité. */
.date-picker-popup{width:220px;}
.date-picker-champ{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--text-dim);margin-bottom:8px;}
.date-picker-champ input[type="date"]{width:100%;}
/* Ligne dont la quantité a été modifiée (et gardée en mémoire côté client entre deux
   ouvertures de la pop-up, voir base.html) : repère visuel rouge sur la référence. */
.fiche-sortie-table tr.fiche-sortie-modifiee td:first-child{
  color:var(--rouge,#ff6b6b);text-decoration:underline;font-weight:600;
}
dialog.lieux-gestion-dialog{
  border:none;border-radius:10px;padding:22px 24px;width:min(560px,92vw);
  background:var(--bg-card);color:var(--text);
  box-shadow:0 10px 40px rgba(0,0,0,0.55);
}
dialog.lieux-gestion-dialog::backdrop{background:rgba(5,6,10,0.7);}
dialog.lieux-gestion-dialog table{margin-top:8px;}
#module-popup-body{padding:22px 24px;}
.popup-head{text-align:center;}
/* Refonte du 24 juillet 2026 (demande de Simon) : titre centré, nom de l'intervenant·e
   juste à côté, coloré selon le statut (bleu = confirmé·e, violet = contacté·e / pas
   encore confirmé·e) — purement informatif, le champ éditable dans la section
   Candidatures reste la seule source de vérité à l'enregistrement. */
.popup-title-row{margin:0 0 4px;display:flex;justify-content:center;align-items:baseline;gap:10px;flex-wrap:wrap;}
.popup-title{color:var(--text);font-size:16px;font-weight:700;}
.popup-intervenant-badge{font-size:13px;font-weight:600;white-space:nowrap;}
.intervenant-confirme{color:var(--bleu);}
.intervenant-contacte{color:var(--violet);}
.popup-subline{text-align:center;color:var(--text-dim);}
.popup-form select[multiple]{min-height:70px;}
.materiel-groupes{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;}
.materiel-groupes label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--text-dim);}
.checkbox-inline{flex-direction:row !important;align-items:center;gap:8px !important;font-size:13px !important;color:var(--text) !important;}
.checkbox-inline input[type=checkbox]{width:17px;height:17px;accent-color:var(--rouge);cursor:pointer;}

/* Sections partenaires en cases à cocher (24 juillet 2026, demande de Simon) — remplace
   la liste déroulante multi-sélection, plus lisible d'un coup d'œil. */
.sections-cases{display:flex;flex-wrap:wrap;gap:10px 16px;}

/* Année + dates à côté du nom du module dans la page Intervenants (24 juillet 2026,
   demande de Simon) — voir _intervenant_modules.html. */
.module-meta{color:var(--text-dim);font-size:11px;}

/* Petite pop-up "Projection" (24 juillet 2026) : s'ouvre sous la case à cocher pour
   demander la salle (parmi les Lieu de type "Salle de projection") et une date
   optionnelle, avec un bouton Valider. Non modale (simple panneau positionné), pour
   éviter d'empiler un 2e <dialog> natif dans la pop-up module déjà modale.
   Bug corrigé le 24 juillet 2026 : `display:flex` posé directement sur la classe
   l'emportait sur la règle native `[hidden]{display:none}` (une feuille de style
   auteur passe toujours devant la feuille de style du navigateur), donc le panneau
   restait visible en permanence quel que soit l'état de la case à cocher. On ne pose
   `display:flex` que sur l'état :not([hidden]) — l'attribut hidden géré en JS
   (base.html) reprend alors la main normalement. */
.projection-popover{position:absolute;top:100%;left:0;z-index:5;margin-top:6px;background:var(--bg-card-alt);
  border:1px solid var(--border);border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,0.5);
  padding:12px;flex-direction:column;gap:8px;min-width:220px;color:var(--text);}
.projection-popover:not([hidden]){display:flex;}
.projection-popover label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text-dim);}

/* Étiquettes intervenants dans la pop-up module (13 juillet 2026) : remplacent la
   liste multi-sélection visible, gain de place. */
.chips-intervenants{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.chip-intervenant{display:inline-flex;align-items:center;background:var(--bg-card-alt);color:var(--text);border-radius:14px;padding:4px 6px 4px 10px;font-size:12.5px;}
.chip-intervenant-remove{background:none;border:none;color:var(--text-dim);font-size:15px;line-height:1;cursor:pointer;padding:0 2px;margin-left:2px;}
.chip-intervenant-remove:hover{color:var(--rouge);}

/* Galaxie d'accueil (24 juillet 2026, demande de Simon) — voir accueil.html. Carte
   navigable en pan/zoom (comme un logiciel 3D : molette = zoom, glisser = déplacer),
   le Calendrier est l'étoile centrale, chaque page du site est une "planète" en
   orbite ; un clic déclenche un zoom rapide dessus ("on est projeté à l'intérieur")
   avant la navigation réelle. Regroupé ici pour rester dans la même feuille de style
   que le reste du site. */
/* Plan de métro plein écran de la page d'accueil (24 juillet 2026, demande de Simon —
   retour au plan 2D après essai d'une galaxie 3D, gardée de côté pour un autre usage
   futur). Remplit toute la fenêtre sous le header/nav (voir accueil.html pour le
   calcul JS de --chrome-h). Hauteur en 100dvh quand le navigateur le supporte, pour
   éviter les sauts dus à la barre d'adresse mobile (repli en 100vh sinon). */
body.page-accueil main{padding:0;max-width:none;margin:0;}
.metro-wrap{position:relative;width:100%;height:calc(100vh - var(--chrome-h, 128px));overflow:hidden;background:#0d0e15;}
@supports (height: 100dvh){
  .metro-wrap{height:calc(100dvh - var(--chrome-h, 128px));}
}
/* Sur écrans étroits (téléphones en portrait), le plan reste à sa taille lisible
   d'origine et le conteneur devient défilable (glisser/pincer) plutôt que d'écraser
   les cases pour les faire tenir — voir la bascule "mobile-scroll" dans accueil.html. */
.metro-wrap.mobile-scroll{overflow:auto;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;}
.metro-wrap svg{display:block;}
.metro-wrap:not(.mobile-scroll) svg{width:100%;height:100%;}
.metro-line-path{stroke-dasharray:14 9;transition:filter .25s;}
.metro-line-group:hover .metro-line-path{filter:drop-shadow(0 0 5px var(--c));}
.metro-station{cursor:pointer;}
/* "Grandissement" au survol (24 juillet 2026, demande de Simon) — remplace l'ancien
   effet loupe, jugé superflu. */
.metro-box-wrap{transform-box:fill-box;transform-origin:center;transition:transform .18s ease-out;}
.metro-station:hover .metro-box-wrap{transform:scale(1.18);}
.metro-station:hover .metro-box-existing{filter:drop-shadow(0 0 7px var(--c));}
.metro-legend{font-size:12px;fill:var(--text-dim);}
.metro-hint{position:absolute;bottom:14px;right:18px;font-size:11px;color:var(--text-dim);pointer-events:none;background:rgba(10,11,18,0.6);padding:4px 9px;border-radius:6px;}
