/* =====================================================================
   Plateforme Mairie - Styles personnalisés
   Surcharge Bootstrap 5 avec l'identité visuelle "mairie"
   ===================================================================== */

:root {
  /* v2.9.6 — Palette officielle de la commune d'Ancy-Dornot
     Source : identité visuelle municipale (deux couleurs uniquement).
     Avant : bleu profond #1e3a5f + doré #d4a017.
     Apres : bleu fonce officiel #312783 + bleu clair officiel #63b9e9. */
  --mairie-primary:    #312783;   /* bleu fonce officiel (institutionnel) */
  --mairie-primary-2:  #63b9e9;   /* bleu clair officiel (mise en lumiere) */
  --mairie-accent:     #63b9e9;   /* bleu clair officiel utilise comme accent CTA */
  --mairie-accent-2:   #82c8ed;   /* version legerement plus claire pour hover */
  --mairie-bg:         #f8f9fb;   /* fond doux (inchange) */
  --mairie-surface:    #ffffff;
  --mairie-text:       #1a202c;
  --mairie-muted:      #6c757d;

  /* Statuts (avec versions claires pour les fonds) */
  --statut-attente:    #f59e0b;
  --statut-validee:    #16a34a;
  --statut-en-cours:   #2563eb;
  --statut-terminee:   #65a30d;
  --statut-refusee:    #dc2626;
  --statut-annulee:    #6b7280;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow:    0 1px 3px 0 rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
}

/* ----- Base ----- */
html, body {
  height: 100%;
}
body {
  background-color: var(--mairie-bg);
  color: var(--mairie-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main.main-container {
  flex: 1 0 auto;
  padding-top: 80px;
  padding-bottom: 3rem;
}

/* ----- Navbar ----- */
.navbar-mairie {
  background-color: var(--mairie-primary);
  box-shadow: var(--shadow-md);
}
.navbar-mairie .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.navbar-mairie .navbar-brand .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: var(--mairie-accent);
  color: var(--mairie-primary);
  border-radius: 8px;
  margin-right: 0.6rem;
  font-weight: 800;
}

/* Logo image (SVG/PNG) à la place du carré doré "M" */
.navbar-mairie .navbar-brand .brand-logo-img {
  height: 40px;
  width: auto;
  /* v2.53.1 : une image qui ne charge pas se dimensionne sinon sur son texte
     de remplacement -> large cadre blanc avec une icone cassee. */
  max-width: 150px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.navbar-mairie .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  position: relative;
  white-space: nowrap;   /* v0.6.0 : plus d'entrées dans le menu, aucune sur deux lignes */
}
.navbar-mairie .nav-link:hover,
.navbar-mairie .nav-link.active {
  color: #fff !important;
}
.navbar-mairie .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.5rem; right: 0.5rem;
  height: 2px;
  background: var(--mairie-accent);
  border-radius: 2px;
}
.navbar-mairie .dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: 0.5rem;
}
.navbar-role-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--mairie-accent);
  color: var(--mairie-primary);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-left: 0.4rem;
}
.cart-badge {
  position: absolute;
  top: 6px; right: 0;
  background: var(--mairie-accent);
  color: var(--mairie-primary);
  font-weight: 700;
  font-size: 0.65rem;
  border-radius: 999px;
  padding: 1px 6px;
}

/* ----- Séparateur visuel entre groupe gauche et groupe droit ----- */
.nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.2);
  margin: 0 0.6rem;
}

/* ----- Icônes seules (sans label) en mode desktop ----- */
.nav-icon-only {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}
.nav-icon-only i {
  font-size: 1.15rem;
}

/* ----- Bouton Gestion : mise en avant pour les agents/admins ----- */
.nav-gestion .nav-link {
  background: rgba(212, 160, 23, 0.12);
  border-radius: 6px;
  margin: 0 0.2rem;
}
.nav-gestion .nav-link:hover {
  background: rgba(212, 160, 23, 0.22);
}

/* ----- Avatar initiales ----- */
.avatar-initiales {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

/* ----- Cards / sections ----- */
.section-card {
  background: var(--mairie-surface);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.section-card h1, .section-card h2, .section-card h3 {
  margin-top: 0;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.section-title .icon-bubble {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--mairie-primary), var(--mairie-primary-2));
  color: #fff;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.section-subtitle {
  color: var(--mairie-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ----- Boutons ----- */
.btn-mairie {
  background-color: var(--mairie-primary);
  border-color: var(--mairie-primary);
  color: #fff;
}
.btn-mairie:hover, .btn-mairie:focus {
  background-color: var(--mairie-primary-2);
  border-color: var(--mairie-primary-2);
  color: #fff;
}
.btn-accent {
  background-color: var(--mairie-accent);
  border-color: var(--mairie-accent);
  color: var(--mairie-primary);
  font-weight: 600;
}
.btn-accent:hover, .btn-accent:focus {
  background-color: var(--mairie-accent-2);
  border-color: var(--mairie-accent-2);
  color: var(--mairie-primary);
}

/* ----- Badges statut ----- */
.badge-statut {
  font-size: 0.75rem;
  padding: 0.4em 0.7em;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.statut-en_attente { background: #fef3c7; color: #92400e; }
.statut-validee    { background: #d1fae5; color: #065f46; }
.statut-en_cours   { background: #dbeafe; color: #1e40af; }
.statut-terminee   { background: #ecfccb; color: #3f6212; }
.statut-refusee    { background: #fee2e2; color: #991b1b; }
.statut-annulee    { background: #e5e7eb; color: #374151; }

/* ----- Footer ----- */
footer.footer {
  flex-shrink: 0;
  background-color: var(--mairie-primary);
  color: rgba(255,255,255,0.8);
  padding: 1.5rem 0;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9rem;
}
footer.footer a { color: var(--mairie-accent); }
/* v0.6.2 : les blasons de la commune au-dessus du texte, comme la réservation */
.footer-blasons { margin-bottom: 0.9rem; }
.footer-blasons img { height: 52px; width: auto; }
.footer-feedback {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--mairie-accent);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.footer-feedback:hover {
  background: var(--mairie-accent);
  color: var(--mairie-primary) !important;
}
footer.footer .badge {
  vertical-align: middle;
  animation: pulse-beta 2s ease-in-out infinite;
}
@keyframes pulse-beta {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* ----- Timeline historique (qui a fait quoi) ----- */
.timeline-historique { margin: 0.5rem 0 0; }
.timeline-historique li {
  display: flex;
  gap: 0.7rem;
  padding-bottom: 0.85rem;
  position: relative;
}
.timeline-historique li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px; top: 28px; bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.timeline-historique .hist-icon {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--mairie-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 1;
}
.timeline-historique .hist-corps { padding-top: 3px; }

/* ----- Toasts ----- */
.toast-container-fixed {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1080;
}

/* ----- Empty states ----- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--mairie-muted);
}
.empty-state i {
  font-size: 3rem;
  opacity: 0.4;
  margin-bottom: 1rem;
}

/* ----- Bloc info "salle/matériel" sur les détails ----- */
.info-block {
  background: #f1f5f9;
  border-left: 4px solid var(--mairie-primary);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ----- Pills de compteurs (toutes_reservations) ----- */
.compteur-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--mairie-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: transform .1s, box-shadow .1s;
}
.compteur-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  color: var(--mairie-primary);
}
.compteur-pill.active {
  outline: 2px solid var(--mairie-primary);
  font-weight: 600;
}
.compteur-pill .compteur-nb {
  font-weight: 700;
  font-size: 1.05rem;
}
/* couleurs reprenant les statuts */
.compteur-pill.statut-en_attente { background:#fef3c7; }
.compteur-pill.statut-validee    { background:#d1fae5; }
.compteur-pill.statut-en_cours   { background:#dbeafe; }
.compteur-pill.statut-terminee   { background:#ecfccb; }
.compteur-pill.statut-refusee    { background:#fee2e2; }
.compteur-pill.statut-annulee    { background:#e5e7eb; }
.compteur-pill.compteur-alerte   { background:#fff7ed; border-color:#f59e0b; color:#b45309; }
.compteur-pill.compteur-alerte.active { outline-color:#f59e0b; }

/* ----- Fil de commentaires (chat) ----- */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fb;
  border-radius: 10px;
  max-height: 600px;
  overflow-y: auto;
}
.chat-message {
  display: flex;
  gap: 0.6rem;
  max-width: 85%;
}
.chat-message.chat-left {
  align-self: flex-start;
}
.chat-message.chat-right {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.chat-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.chat-message.chat-right .chat-content {
  align-items: flex-end;
}
.chat-meta {
  font-size: 0.82rem;
}
.chat-bubble {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}
.chat-bubble-user {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 4px;
}
.chat-bubble-mairie {
  background: var(--mairie-primary);
  color: #fff;
  border-top-right-radius: 4px;
}


/* v2.7.0 — Empty state v2 (composant render_empty_state) */
.empty-state-v2 {
  text-align: center;
  padding: 2.5rem 1rem;
  max-width: 480px;
  margin: 0 auto;
}
.empty-state-illu {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.empty-state-illu-primary   { background: #cfe2ff; color: #084298; }
.empty-state-illu-success   { background: #d1e7dd; color: #0f5132; }
.empty-state-illu-warning   { background: #fff3cd; color: #664d03; }
.empty-state-illu-danger    { background: #f8d7da; color: #842029; }
.empty-state-illu-info      { background: #cff4fc; color: #055160; }
.empty-state-illu-secondary { background: #e9ecef; color: #495057; }
.empty-state-title {
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.5rem;
}
.empty-state-desc {
  color: #6c757d;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.empty-state-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* v2.7.0 — Stepper de statut (fiche detail resa / manif) */
/* ----- Bandeau d'etat de la fiche reservation (v2.45.0) -----
   Porte la phrase (ou on en est), le prerequis bloquant et l'action.
   Le fil ci-dessous n'est plus qu'un repere de progression. */
.etat-bandeau {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border-left: 4px solid transparent;
  margin-bottom: 0.75rem;
}
.etat-bandeau .etat-icone { font-size: 1.35rem; line-height: 1.2; flex: 0 0 auto; }
.etat-bandeau .etat-corps { flex: 1 1 auto; min-width: 0; }
.etat-bandeau .etat-titre { font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.etat-bandeau .etat-sous  { font-size: 0.875rem; color: var(--mairie-muted); margin-top: 0.15rem; }
.etat-bandeau .etat-blocage { font-size: 0.875rem; color: #b45309; margin-top: 0.4rem; font-weight: 500; }
.etat-bandeau .etat-action { flex: 0 0 auto; align-self: center; margin: 0; white-space: nowrap; }

.etat-ton-action  { background: #f4f3fb; border-left-color: var(--mairie-primary); }
.etat-ton-action  .etat-titre { color: var(--mairie-primary); }
.etat-ton-attente { background: #fff8e6; border-left-color: #f59e0b; }
.etat-ton-attente .etat-titre { color: #b45309; }
.etat-ton-ok      { background: #e8f5ee; border-left-color: #198754; }
.etat-ton-ok      .etat-titre { color: #146c43; }
.etat-ton-alerte  { background: #fdecea; border-left-color: #dc3545; }
.etat-ton-alerte  .etat-titre { color: #b02a37; }
.etat-ton-neutre  { background: #f8f9fa; border-left-color: #adb5bd; }
.etat-ton-neutre  .etat-titre { color: #495057; }

@media (max-width: 575px) {
  .etat-bandeau { flex-wrap: wrap; }
  .etat-bandeau .etat-action { width: 100%; margin-top: 0.5rem; }
  .etat-bandeau .etat-action .btn { width: 100%; }
}

/* ----- Travail à plusieurs (v2.82.0) -----
   .etat-traite : « Validée par Sophie Martin aujourd'hui à 10h42 » — bandeau
   d'état de la fiche réservation, haut de la fiche manifestation. */
.etat-traite {
  display: flex; align-items: baseline; gap: 0.4rem;
  font-size: 0.85rem; color: var(--mairie-muted); margin: 0.4rem 0 0.6rem;
}
.etat-bandeau .etat-traite { margin-bottom: 0; }

/* Arrivée par l'e-mail de demande alors qu'un collègue l'a déjà traitée */
.deja-traitee { display: flex; gap: 0.75rem; align-items: flex-start; }
.deja-traitee > i { font-size: 1.5rem; line-height: 1.1; }

/* Fil « Activité de l'équipe » (gestion/activite.php + hub) */
.act-jour {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--mairie-primary); margin: 1rem 0 0.5rem; padding-bottom: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.act-jour:first-of-type { margin-top: 0; }
.act-fil { margin: 0; }
.act-ligne { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.45rem 0; }
.act-ligne + .act-ligne { border-top: 1px dashed #eef0f3; }
.act-heure { flex: 0 0 3.2rem; font-size: 0.8rem; color: var(--mairie-muted); padding-top: 0.35rem; font-variant-numeric: tabular-nums; }
.act-fil-compact .act-heure { flex-basis: 8.5rem; }
.act-avatar {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.75rem; font-weight: 700;
}
.act-avatar-auto { background: #94a3b8; font-size: 0.9rem; }
.act-corps { flex: 1 1 auto; min-width: 0; }
.act-phrase { line-height: 1.35; }
.act-icone { color: var(--mairie-muted); }
.act-icone.act-ok      { color: #198754; }
.act-icone.act-non     { color: #dc3545; }
.act-icone.act-terrain { color: var(--mairie-primary); }
.act-contexte { font-size: 0.82rem; color: var(--mairie-muted); }
.act-detail   { font-size: 0.82rem; color: #475569; font-style: italic; }
.act-filtres .form-select { width: auto; max-width: 100%; }
.hub-activite {
  background: #fff; border-radius: 0.7rem; box-shadow: var(--shadow);
  padding: 0.6rem 1rem; height: 100%;
}


.status-stepper {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 1rem 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 1rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.status-stepper .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* v2.47.0 : le fil peut monter a 8 etapes (etats des lieux compris) ->
     les etapes se compriment et les libelles passent sur deux lignes
     plutot que de forcer un defilement horizontal. */
  min-width: 74px;
  padding: 0 0.3rem;
  flex-shrink: 1;
}
.status-stepper .step-label { overflow-wrap: anywhere; hyphens: auto; }
.status-stepper .step-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dee2e6;
  color: #6c757d;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  border: 2px solid #dee2e6;
  transition: all 0.2s;
}
.status-stepper .step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6c757d;
  line-height: 1.15;
}
.status-stepper .step-meta {
  font-size: 0.68rem;
  color: #6c757d;
  opacity: 0.85;
  margin-top: 0.15rem;
  line-height: 1.1;
}
.status-stepper .step-connector {
  flex: 1 1 auto;
  height: 3px;
  background: #dee2e6;
  margin: 15px 0 0 0;  /* aligne avec le centre des icones */
  min-width: 24px;
  border-radius: 2px;
}

/* Etape franchie */
.status-stepper .step-done .step-icon {
  background: #198754;
  color: #fff;
  border-color: #198754;
}
.status-stepper .step-done .step-label { color: #198754; }
.status-stepper .step-connector-done { background: #198754; }

/* Etape courante */
.status-stepper .step-current .step-icon {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18);
}
.status-stepper .step-current .step-label {
  color: #0d6efd;
  font-weight: 700;
}

/* Etape « etat des lieux » : en attente = orange + cliquable (v2.45.0) */
.status-stepper .step-edl.step-current .step-icon {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px #fef3c7;
}
.status-stepper .step-edl.step-current .step-label,
.status-stepper .step-edl.step-current .step-meta { color: #b45309; }
a.step-edl { cursor: pointer; }
a.step-edl:hover .step-icon { filter: brightness(0.93); }

/* Etape courante, projet en pause (v0.3.0) */
.status-stepper .step-paused.step-current .step-icon {
  background: #fff;
  color: #b45309;
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px #fef3c7;
}
.status-stepper .step-paused.step-current .step-label,
.status-stepper .step-paused.step-current .step-meta { color: #b45309; }

/* Etape courante mais en retard (remise/retour non faits, date depassee) */
.status-stepper .step-late .step-icon {
  background: #dc3545;
  border-color: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.18);
}
.status-stepper .step-late .step-label,
.status-stepper .step-late .step-meta { color: #b02a37; }
.status-stepper .step-connector-late { background: #dc3545; opacity: 0.5; }

/* Etape morte (refusee / annulee) */
.status-stepper .step-failed .step-icon {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.18);
}
.status-stepper .step-failed .step-label {
  color: #dc3545;
  font-weight: 700;
}
.status-stepper .step-connector-dead {
  background: #dc3545;
  opacity: 0.35;
}

/* Etape sautee (vue post-mortem) */
.status-stepper .step-skipped { opacity: 0.4; }
.status-stepper .step-skipped .step-icon {
  background: #fff;
  border-style: dashed;
}

@media (max-width: 575px) {
  /* v2.45.0 : 4 etapes doivent tenir sans scroll sur un telephone */
  .status-stepper { padding: 0.85rem 0.25rem; }
  .status-stepper .step { min-width: 0; flex-shrink: 1; padding: 0 0.15rem; }
  .status-stepper .step-label { overflow-wrap: anywhere; }
  .status-stepper .step-label { font-size: 0.7rem; }
  .status-stepper .step-meta  { font-size: 0.62rem; }
  .status-stepper .step-connector { min-width: 5px; }
  .status-stepper .step-icon { width: 26px; height: 26px; font-size: 0.95rem; }
}

/* ----- Responsive tweaks ----- */
@media (max-width: 768px) {
  main.main-container {
    padding-top: 70px;
  }
  .section-card { padding: 1rem; }
  .section-title .icon-bubble { width: 40px; height: 40px; font-size: 1.1rem; }
}

/* ============================================================ */
/* ----- @media print : version impression ----- */
/* ============================================================ */
@media print {
  /* Masquer tout le chrome (nav, footer, boutons d'action) */
  .navbar, footer.footer, .btn, .dropdown,
  .no-print, [data-bs-toggle], .form-check, .nav, .nav-pills,
  .pagination, .toast-container-fixed, .modal {
    display: none !important;
  }

  /* Fond et couleurs simples pour économiser l'encre */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  main.main-container {
    padding-top: 0 !important;
    max-width: 100% !important;
  }

  /* Cards : pas d'ombre, bordure simple */
  .section-card, .card, .info-block, .alert {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }

  /* Pas de couleurs de fond gourmandes en encre */
  .section-card { background: #fff !important; }
  .icon-bubble { display: none !important; }

  /* Tableaux : grille noire pour la lisibilité */
  table { border-collapse: collapse !important; width: 100%; }
  table th, table td { border: 1px solid #999 !important; padding: 4px 6px !important; }
  thead { background: #eee !important; }

  /* Badges en noir pour l'impression */
  .badge { border: 1px solid #000; background: #fff !important; color: #000 !important; }

  /* Lien : pas de soulignement bleu */
  a { color: #000 !important; text-decoration: none !important; }

  /* En-tête imprimable */
  .print-header {
    display: block !important;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
  }
  .print-only { display: block !important; }
}
.print-header, .print-only { display: none; }

/* =====================================================================
   CAP — styles propres aux projets, tâches et devis (v0.1.0)
   ===================================================================== */

/* ----- Statuts des projets (badges) ----- */
.statut-projet-consultation { background: #e0e7ff; color: #312783; }
.statut-projet-decision     { background: #fef3c7; color: #92400e; }
.statut-projet-signature    { background: #fde2f3; color: #9d174d; }
.statut-projet-execution    { background: #dbeafe; color: #1e40af; }
.statut-projet-termine      { background: #d1fae5; color: #065f46; }
.statut-projet-abandonne    { background: #e5e7eb; color: #374151; }
.statut-projet-actif        { background: #e0f2fe; color: #075985; }
.statut-projet-pause        { background: #fff3cd; color: #8a5a00; }   /* v0.3.0 */

/* ----- Statuts des devis ----- */
.statut-devis-attente  { background: #eef2f7; color: #334155; }
.statut-devis-propose  { background: #fef3c7; color: #92400e; }
.statut-devis-valide   { background: #fde2f3; color: #9d174d; }
.statut-devis-a_signer { background: #fde2f3; color: #9d174d; }
.statut-devis-signe    { background: #d1fae5; color: #065f46; }
.statut-devis-rejete   { background: #fee2e2; color: #991b1b; }

/* ----- Vérification ----- */
.badge-verif {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; font-weight: 600; padding: 0.3em 0.6em; border-radius: 999px;
}
.verif-conforme    { background: #e8f5ee; color: #146c43; }
.verif-a_completer { background: #fff3cd; color: #8a5a00; }
.verif-non_verifie { background: #f1f5f9; color: #64748b; }

/* ----- En-tête de projet ----- */
.projet-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem; font-weight: 700; color: var(--mairie-primary);
  background: #eef0fb; padding: 0.15rem 0.5rem; border-radius: 6px; white-space: nowrap;
}
/* Historique d'un projet : il s'allonge à chaque geste, il défile */
.historique-defilant { max-height: 720px; overflow-y: auto; padding-right: 0.25rem; }
@media print { .historique-defilant { max-height: none; overflow: visible; } }
.projet-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; color: var(--mairie-muted); font-size: 0.9rem; }
.projet-meta i { color: var(--mairie-primary-2); }
.cahier-des-charges {
  white-space: pre-wrap; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 0.5rem; padding: 0.85rem 1rem; font-size: 0.95rem; line-height: 1.5;
}

/* ----- Bandeau des seuils (mise en concurrence) ----- */
.seuil-bandeau {
  display: flex; gap: 0.75rem; align-items: flex-start;
  border-radius: 0.6rem; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.92rem;
  border: 1px solid #e2e8f0; background: #fff;
}
.seuil-bandeau > i { font-size: 1.3rem; line-height: 1.1; }
.seuil-simple      { border-left: 4px solid #16a34a; }
.seuil-simple > i  { color: #16a34a; }
.seuil-concurrence { border-left: 4px solid var(--mairie-primary); }
.seuil-concurrence > i { color: var(--mairie-primary); }
.seuil-formalisee  { border-left: 4px solid #dc2626; background: #fef2f2; }
.seuil-formalisee > i { color: #dc2626; }
.compteur-devis { font-weight: 700; font-variant-numeric: tabular-nums; }
.compteur-devis.ok { color: #16a34a; }
.compteur-devis.manque { color: #b45309; }

/* ----- Carte d'un devis ----- */
.devis-carte {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 0.75rem;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem; overflow: hidden;
}
.devis-carte.devis-retenu { border: 2px solid #16a34a; box-shadow: 0 0 0 4px #e8f5ee; }
.devis-carte.devis-propose { border: 2px solid #f59e0b; }
.devis-carte.devis-ecarte { opacity: 0.72; }
.devis-carte-tete {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem; border-bottom: 1px solid #eef0f3; background: #fbfcfe;
}
.devis-fournisseur { font-weight: 700; font-size: 1.05rem; }
.devis-fournisseur a { color: inherit; text-decoration: none; }
.devis-fournisseur a:hover { color: var(--mairie-primary); text-decoration: underline; }
.devis-montant { text-align: right; line-height: 1.15; }
.devis-montant .ht { font-size: 1.25rem; font-weight: 800; color: var(--mairie-primary); font-variant-numeric: tabular-nums; }
.devis-montant .ttc { font-size: 0.8rem; color: var(--mairie-muted); }
.devis-corps { padding: 0.85rem 1rem; }
.devis-infos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.35rem 1rem; font-size: 0.88rem; }
.devis-infos dt { font-weight: 600; color: var(--mairie-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.3px; margin: 0; }
.devis-infos dd { margin: 0 0 0.3rem; }
.devis-nom-fichier {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem;
  color: #475569; background: #f1f5f9; padding: 0.1rem 0.4rem; border-radius: 4px; word-break: break-all;
}
/* Versions remplacées d'un devis (v0.2.1) */
.versions-historique { border: 1px dashed #d8dee8; border-radius: 6px; padding: 0.4rem 0.6rem; background: #fafbfd; }
.versions-historique summary { cursor: pointer; font-weight: 600; color: var(--mairie-muted); }
.versions-historique .version-ligne { padding: 0.45rem 0; border-top: 1px dashed #e5e9f0; }
.versions-historique .version-ligne:first-child { border-top: 0; }
.versions-historique .avis-pour { color: #16a34a; }
.versions-historique .avis-contre { color: #dc2626; }
.devis-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.75rem 1rem; border-top: 1px solid #eef0f3; background: #fbfcfe; }
.devis-moins-cher {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: #065f46; background: #d1fae5; padding: 0.15rem 0.45rem; border-radius: 4px;
}

/* ----- Fournisseurs sollicités (v0.3.0) ----- */
.sollicitation-a_contacter { background: #eef2f7; color: #334155; }
.sollicitation-contacte    { background: #e0e7ff; color: #312783; }
.sollicitation-a_relancer  { background: #fef3c7; color: #92400e; }
.sollicitation-recu        { background: #d1fae5; color: #065f46; }
.sollicitation-sans_suite  { background: #e5e7eb; color: #4b5563; }
.sollicitations-liste { list-style: none; padding: 0; margin: 0; }
.sollicitation-ligne { padding: 0.65rem 0; border-top: 1px solid #eef0f3; }
.sollicitation-ligne:first-child { border-top: 0; }
.sollicitation-ligne.etape-a_relancer { border-left: 3px solid #f59e0b; padding-left: 0.6rem; }
.sollicitation-ligne.etape-recu, .sollicitation-ligne.etape-sans_suite { opacity: 0.8; }
.sollicitation-fournisseur { font-weight: 700; color: var(--mairie-text); text-decoration: none; margin-right: 0.35rem; }
.sollicitation-fournisseur:hover { color: var(--mairie-primary); text-decoration: underline; }
.sollicitation-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.45rem; }
.sollicitation-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.6rem; padding: 0.85rem; }

/* ----- Avis (pour / contre) ----- */
.avis-barre { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.5rem 0; }
.avis-compte { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 700; font-size: 0.9rem; }
.avis-compte.pour { color: #16a34a; }
.avis-compte.contre { color: #dc2626; }
.avis-liste { list-style: none; padding: 0; margin: 0.25rem 0 0; font-size: 0.88rem; }
.avis-liste li { padding: 0.3rem 0; border-top: 1px dashed #eef0f3; }
.avis-liste .avis-pour { color: #16a34a; }
.avis-liste .avis-contre { color: #dc2626; }
.btn-avis.active-pour { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-avis.active-contre { background: #dc2626; border-color: #dc2626; color: #fff; }

/* ----- Fil de commentaires compact (sous un devis) ----- */
.notes-fil { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.notes-fil li { display: flex; gap: 0.55rem; padding: 0.45rem 0; border-top: 1px dashed #eef0f3; font-size: 0.9rem; }
.notes-fil .note-avatar {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; color: #fff;
  font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.notes-fil .note-meta { font-size: 0.78rem; color: var(--mairie-muted); }
.notes-fil .note-texte { white-space: pre-wrap; word-wrap: break-word; }

/* ----- Membres du projet ----- */
.membre-puce {
  display: inline-flex; align-items: center; gap: 0.35rem; background: #f1f5f9;
  border-radius: 999px; padding: 0.15rem 0.6rem 0.15rem 0.15rem; font-size: 0.85rem; margin: 0 0.3rem 0.3rem 0;
}
.membre-puce .avatar-initiales { width: 24px; height: 24px; font-size: 0.62rem; box-shadow: none; }
.membre-puce.porteur { background: #eef0fb; font-weight: 600; }
.membres-choix { max-height: 260px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.5rem 0.75rem; }

/* ----- Tableau de bord ----- */
.kpi-tuile {
  background: #fff; border-radius: 0.75rem; box-shadow: var(--shadow); padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--mairie-text);
  height: 100%; transition: transform .12s, box-shadow .12s;
}
a.kpi-tuile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--mairie-text); }
.kpi-tuile .kpi-icone {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem; background: #eef0fb; color: var(--mairie-primary); flex-shrink: 0;
}
.kpi-tuile .kpi-nombre { font-size: 1.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-tuile .kpi-libelle { font-size: 0.85rem; color: var(--mairie-muted); }
.alerte-groupe { margin-bottom: 1rem; }
.alerte-groupe-titre {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--mairie-primary); margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.4rem;
}
.alerte-ligne {
  display: flex; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0.6rem; border-radius: 0.4rem;
  text-decoration: none; color: var(--mairie-text); font-size: 0.92rem;
}
.alerte-ligne:hover { background: #f1f5f9; color: var(--mairie-primary); }
.alerte-ligne.retard { background: #fef2f2; }
.alerte-ligne.retard:hover { background: #fee2e2; }
.alerte-ligne .alerte-retard { color: #dc2626; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; }

/* ----- Liste des projets ----- */
.table-projets td, .table-projets th { vertical-align: middle; }
.table-projets .projet-titre { font-weight: 600; color: var(--mairie-text); text-decoration: none; }
.table-projets .projet-titre:hover { color: var(--mairie-primary); text-decoration: underline; }
.table-projets .projet-resume { font-size: 0.82rem; color: var(--mairie-muted); }
.montant { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Vue par étape (colonnes) */
.colonnes-projets { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 0.85rem; overflow-x: auto; padding-bottom: 0.5rem; }
.colonne-projets { background: #eef1f6; border-radius: 0.75rem; padding: 0.6rem; min-height: 120px; }
.colonne-titre {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--mairie-primary); padding: 0.2rem 0.3rem 0.5rem;
}
.carte-projet {
  display: block; background: #fff; border-radius: 0.6rem; box-shadow: var(--shadow-sm); padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem; text-decoration: none; color: var(--mairie-text); border-left: 3px solid var(--mairie-primary-2);
}
.carte-projet:hover { box-shadow: var(--shadow-md); color: var(--mairie-text); }
.carte-projet .carte-titre { font-weight: 600; font-size: 0.92rem; line-height: 1.25; }
.carte-projet .carte-meta { font-size: 0.78rem; color: var(--mairie-muted); margin-top: 0.3rem; }
.carte-projet.carte-pause { border-left-color: #f59e0b; background: #fffdf5; }
.carte-projet .badge-statut { margin-left: 0.3rem; font-size: 0.68rem; display: inline-block; white-space: nowrap; }
@media (max-width: 991px) {
  .colonnes-projets { grid-template-columns: repeat(6, 240px); }
}

/* ----- Formulaire devis ----- */
.montants-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 575px) { .montants-grille { grid-template-columns: 1fr; } }
.nouveau-fournisseur { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 0.6rem; padding: 0.85rem; }
.aide-champ { font-size: 0.8rem; color: var(--mairie-muted); }
/* « Plus de détails » (v0.4.0) : le facultatif, replié tant qu'on n'en a pas besoin */
.plus-de-details > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap;
  font-weight: 600; color: var(--mairie-primary); padding: 0.35rem 0; margin-bottom: 0.5rem;
}
.plus-de-details > summary::-webkit-details-marker { display: none; }
.plus-de-details > summary .bi { transition: transform .15s; }
.plus-de-details[open] > summary .bi { transform: rotate(45deg); }

/* ----- Arborescence (aperçu des exports) ----- */
.arbo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem;
  background: #0f172a; color: #e2e8f0; border-radius: 0.6rem; padding: 0.85rem 1rem; white-space: pre; overflow-x: auto;
}


/* =====================================================================
   TÂCHES — v0.6.0 : une ligne par tâche, une case à cocher
   ===================================================================== */
.statut-tache-a_faire  { background: #eef2f7; color: #334155; }
.statut-tache-en_cours { background: #dbeafe; color: #1e40af; }
.statut-tache-bloquee  { background: #fef3c7; color: #92400e; }
.statut-tache-faite    { background: #d1fae5; color: #065f46; }
.statut-tache-annulee  { background: #e5e7eb; color: #374151; }
.statut-tache-retard   { background: #fee2e2; color: #991b1b; }
.min-w-0 { min-width: 0; }

/* Pastilles des personnes */
.avatar-mini { width: 24px; height: 24px; font-size: 0.62rem; letter-spacing: 0; box-shadow: none; }
.tache-avatars { display: inline-flex; align-items: center; }
.tache-avatars .avatar-mini + .avatar-mini { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.tache-noms { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tache-personne-vide { font-size: 0.78rem; color: #b45309; white-space: nowrap; }

/* Une ligne */
.tache-ligne { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.55rem 0.45rem; border-radius: 0.5rem; }
.tache-ligne + .tache-ligne { border-top: 1px solid #f1f3f6; }
.tache-ligne:hover { background: #f8fafc; }
.tache-ligne.tache-retard { background: #fef6f6; }
.tache-coche-form { margin: 0; flex: 0 0 auto; }
.tache-coche {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #94a3b8; background: #fff;
  color: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  font-size: 0.95rem; line-height: 1; cursor: pointer; transition: background .12s, border-color .12s, color .12s; margin-top: 1px;
}
.tache-coche:hover, .tache-coche:focus-visible { border-color: #16a34a; color: #16a34a; }
.tache-coche.cochee { background: #16a34a; border-color: #16a34a; color: #fff; }
.tache-coche.inactive { cursor: default; opacity: 0.55; }
.tache-annulee .tache-coche.inactive { color: #6b7280; }
.tache-coche-grande { width: 42px; height: 42px; font-size: 1.45rem; }
.tache-corps { flex: 1 1 auto; min-width: 0; }
.tache-titre { font-weight: 600; color: var(--mairie-text); text-decoration: none; overflow-wrap: anywhere; }
.tache-titre:hover { color: var(--mairie-primary); text-decoration: underline; }
.tache-fermee .tache-titre { text-decoration: line-through; color: var(--mairie-muted); font-weight: 500; }
.tache-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.8rem; font-size: 0.8rem; color: var(--mairie-muted); margin-top: 0.15rem; }
.tache-meta .badge-statut { font-size: 0.68rem; padding: 0.25em 0.55em; }
.tache-echeance.retard { color: #dc2626; font-weight: 700; }
.tache-projet { color: var(--mairie-primary); text-decoration: none; }
.tache-projet:hover { text-decoration: underline; }
.tache-motif { color: #92400e; font-style: italic; }
.tache-devis { text-decoration: none; font-weight: 600; border-radius: 999px; padding: 0.05rem 0.55rem; display: inline-flex; gap: 0.3rem; align-items: center; }
.tache-devis-attente { background: #fff7ed; color: #b45309; }
.tache-devis-ok      { background: #e8f5ee; color: #146c43; }
.tache-devis-neutre  { background: #f1f5f9; color: #475569; }
.tache-devis:hover { filter: brightness(0.96); text-decoration: underline; }
.tache-qui { flex: 0 1 auto; display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--mairie-muted); max-width: 40%; min-width: 0; padding-top: 1px; }
@media (max-width: 575px) { .tache-noms { display: none; } }

/* Les groupes (en retard, cette semaine…) */
.tache-groupe { margin-bottom: 0.9rem; }
.tache-groupe:last-child { margin-bottom: 0; }
.tache-groupe-titre {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--mairie-primary); margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.4rem;
}
.tache-groupe-retard .tache-groupe-titre { color: #dc2626; }
.tache-groupe-fermee .tache-groupe-titre { color: var(--mairie-muted); }
details.tache-groupe > summary.tache-groupe-titre { display: list-item; cursor: pointer; }

/* « Quoi ? » : une ligne pour ajouter une tâche */
.tache-rapide-grille { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto; gap: 0.5rem; align-items: end; }
.tache-rapide-grille.avec-projet { grid-template-columns: minmax(0, 3fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1.4fr) auto; }
@media (max-width: 767px) {
  .tache-rapide-grille, .tache-rapide-grille.avec-projet { grid-template-columns: 1fr 1fr; }
  .tache-rapide-quoi, .tache-rapide-bouton { grid-column: 1 / -1; }
}

/* Avancement (tâches faites / total) */
.avancement { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--mairie-muted); min-width: 150px; }
.avancement-barre { flex: 1 1 auto; height: 8px; background: #e9edf3; border-radius: 999px; overflow: hidden; min-width: 60px; }
.avancement-barre span { display: block; height: 100%; background: #16a34a; border-radius: 999px; }
.avancement-texte { white-space: nowrap; font-variant-numeric: tabular-nums; }
.avancement-compact { min-width: 120px; max-width: 220px; }
.col-avancement { min-width: 150px; }

/* Fiche d'une tâche */
.tache-entete.tache-retard { border-left: 4px solid #dc2626; }
.etapes-liste { list-style: none; padding: 0; margin: 0; }
.etapes-liste li { display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0; border-top: 1px dashed #eef0f3; }
.etapes-liste li:first-child { border-top: 0; }
.etapes-liste li.faite .etape-texte { text-decoration: line-through; color: var(--mairie-muted); }
.etape-coche {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid #94a3b8; background: #fff; color: transparent;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 0.85rem; line-height: 1; flex: 0 0 auto;
}
.etape-coche:hover { border-color: #16a34a; color: #16a34a; }
.etape-coche.cochee { background: #16a34a; border-color: #16a34a; color: #fff; }
.etape-coche.inactive { opacity: 0.6; }
.etape-texte { overflow-wrap: anywhere; }
.etape-qui { font-size: 0.75rem; color: var(--mairie-muted); white-space: nowrap; }
.fichiers-liste li, .faites-liste li { padding: 0.35rem 0; border-top: 1px dashed #eef0f3; font-size: 0.92rem; overflow-wrap: anywhere; }
.fichiers-liste li:first-child, .faites-liste li:first-child { border-top: 0; }
.fil-tache li { display: flex; gap: 0.55rem; padding: 0.45rem 0; border-top: 1px dashed #eef0f3; font-size: 0.9rem; }
.fil-tache li:first-child { border-top: 0; }
.fil-tache .note-avatar {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; color: #fff;
  font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.fil-tache .note-meta { font-size: 0.78rem; color: var(--mairie-muted); }
.fil-tache .note-texte { white-space: pre-wrap; word-wrap: break-word; }
.fil-tache .fil-journal { font-size: 0.82rem; color: #475569; align-items: baseline; }
.fil-tache .fil-journal .hist-icon { flex: 0 0 26px; text-align: center; color: var(--mairie-muted); }
.personnes-tache li { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; }

/* Tâches en colonnes */
.colonnes-taches { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
.colonnes-taches .tache-ligne { background: #fff; border-radius: 0.6rem; box-shadow: var(--shadow-sm); margin-bottom: 0.5rem; flex-wrap: wrap; border-top: 0; }
.colonnes-taches .tache-ligne.tache-retard { background: #fef6f6; }
.colonnes-taches .tache-qui { max-width: 100%; margin-left: 33px; }
@media (max-width: 991px) { .colonnes-taches { grid-template-columns: repeat(4, 260px); } }

/* Qui fait quoi */
.table-charge td, .table-charge th { vertical-align: middle; }
.col-barre { min-width: 180px; width: 26%; }
.charge-barre { display: flex; height: 12px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.charge-barre span { display: block; height: 100%; }
.seg-retard  { background: #dc2626; }
.seg-semaine { background: #f59e0b; }
.seg-autres  { background: #63b9e9; }
.seg-devis   { background: #8b85c9; }
.legende { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.ligne-moi > td { background: #f4f3fb; }
.lien-personne { color: var(--mairie-text); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.lien-personne:hover { color: var(--mairie-primary); text-decoration: underline; }
.kpi-tuile .kpi-icone.kpi-icone-alerte { background: #fee2e2; color: #dc2626; }
.kpi-tuile .kpi-icone.kpi-icone-ok { background: #d1fae5; color: #16a34a; }

/* Nouveau projet : avec ou sans devis */
.choix-type-projet { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 767px) { .choix-type-projet { grid-template-columns: 1fr; } }
.choix-type { display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid #e2e8f0; border-radius: 0.6rem; padding: 0.75rem 0.85rem; cursor: pointer; margin: 0; }
.choix-type:has(input:checked) { border-color: var(--mairie-primary); background: #f4f3fb; box-shadow: 0 0 0 2px #e0e7ff; }
.choix-type input { margin-top: 0.3rem; flex: 0 0 auto; }
.form-sans-devis .si-devis { display: none !important; }

@media print {
  .tache-coche-form, .tache-rapide { display: none !important; }
}

/* =====================================================================
   CAP — Collaborer, Avancer, Piloter (v0.6.0) : la boussole

   v0.6.1 : la barre du haut de la réservation (v2.113.0) et de la vitrine :
   logo horizontal de la commune (blanc, ou couleur sur pastille s'il n'y a
   que celui-là), un trait fin, puis la boussole au trait et « Cap / projets,
   tâches et devis ». Les trois premières règles sont celles de la réservation.
   ===================================================================== */
.navbar-mairie .navbar-brand .brand-logo-horizontal {
  height: 34px;
  width: auto;
}
.navbar-mairie .navbar-brand .brand-logo-pastille {
  height: 40px;
  background: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.navbar-mairie .navbar-brand .brand-titre {
  flex-direction: column;
  line-height: 1.2;
  letter-spacing: 0;
}
.navbar-mairie .navbar-brand .brand-titre-1 { font-size: 0.98rem; font-weight: 700; }
.navbar-mairie .navbar-brand .brand-titre-2 { font-size: 0.8rem; font-weight: 400; color: #b8c8ee; }
/* Le trait fin passe avant la boussole : elle fait partie du nom de l'appli */
.navbar-mairie .navbar-brand .brand-cap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.9rem;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255,255,255,0.45);
}
.navbar-mairie .navbar-brand .brand-cap-seul { margin-left: 0; padding-left: 0; border-left: 0; }
.navbar-mairie .navbar-brand .brand-boussole { width: 30px; height: 30px; flex-shrink: 0; }
@media (max-width: 380px) {
  .navbar-mairie .navbar-brand .brand-logo-horizontal { height: 28px; }
  .navbar-mairie .navbar-brand .brand-cap { margin-left: 0.6rem; padding-left: 0.6rem; }
  .navbar-mairie .navbar-brand .brand-boussole { width: 26px; height: 26px; }
}
/* ============================================================
   Page de connexion — LA MÊME dans les quatre applis de la mairie
   (réservation v2.115.7, Cap v0.6.4, Vigie v1.7.2, démarches v1.2.2) :
   celle de la réservation, choisie par Loric le 10/11/2026. Le logo de la
   commune au-dessus de la carte, juste dessous le picto et le nom de
   l'appli (proposition B : le picto au trait blanc dans un rond bleu
   foncé, le nom sur deux lignes comme dans la barre) ; dans la carte, la
   bulle « Connexion » (.section-title et .icon-bubble, déjà les mêmes
   partout), les champs, « Mot de passe oublié ? » à droite, les boutons,
   une note.
   Bloc identique dans les quatre style.css : le recopier s'il change.
   ============================================================ */
.connexion-logo { text-align: center; margin-bottom: 0.75rem; }
.connexion-logo img { width: auto; height: auto; max-width: 200px; max-height: 150px; }
.connexion-appli { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.connexion-appli-rond {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 50px; height: 50px; border-radius: 50%; background: var(--mairie-primary);
}
.connexion-appli-rond img { width: 32px; height: 32px; }
.connexion-appli-nom { font-size: 1.3rem; font-weight: 800; line-height: 1.15; color: var(--mairie-primary); }
.connexion-appli-ligne2 { font-size: 0.9rem; line-height: 1.25; color: var(--mairie-muted, #6c757d); }
.connexion-oubli { text-align: right; margin-bottom: 1rem; font-size: 0.875rem; }
.connexion-oubli a { color: var(--bs-link-color, #0d6efd); text-decoration: none; }
.connexion-oubli a:hover, .connexion-oubli a:focus { text-decoration: underline; }
.connexion-note { margin: 1rem 0 0; text-align: center; font-size: 0.875rem; color: var(--mairie-muted, #6c757d); }
/* Edge ajoute son propre œil dans les champs de mot de passe : masqué là où
   l'appli a déjà le sien (bouton bi-eye dans le même .input-group), sinon il y
   en a deux côte à côte. Ailleurs, celui d'Edge reste. */
.input-group:has(.bi-eye, .bi-eye-slash) input::-ms-reveal { display: none; }

/* ---------- Connexion par MyAD (v0.7.0) ---------- */
/* Le trait « ou » entre le bouton MyAD et le formulaire habituel */
.connexion-ou { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; font-size: 0.8rem; color: var(--mairie-muted, #6c757d); }
.connexion-ou::before, .connexion-ou::after { content: ""; flex: 1; border-top: 1px solid #dee2e6; }

/* ----- Pages légales (inc/ui/page_legale.php) et leurs liens du pied de page.
   Bloc identique dans les cinq applis de la mairie. ----- */
.footer-legal {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.4rem;
  margin-top: 0.9rem; font-size: 0.85rem;
}
footer.footer .footer-legal a { color: rgba(255,255,255,0.85); }
footer.footer .footer-legal a:hover { color: #fff; }
.page-legale { max-width: 48rem; margin: 0 auto; padding: 1rem 0 2rem; }
.page-legale-rubrique {
  margin: 0 0 0.3rem; font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: #5b6478;
}
.page-legale h1 { font-size: 1.9rem; font-weight: 700; color: var(--mairie-primary); margin-bottom: 1rem; }
.page-legale h2 { font-size: 1.2rem; font-weight: 700; color: var(--mairie-primary); margin: 2rem 0 0.5rem; }
.page-legale .lead { font-size: 1.1rem; }
.page-legale a { color: var(--mairie-primary); }
.page-legale-tableau { font-size: 0.92rem; }
.page-legale-tableau th { font-weight: 600; }
.page-legale-tableau tbody th { width: 36%; }
.page-legale-tableau td:last-child { width: 28%; }
.page-legale-voir { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid #dde3ee; }

/* =====================================================================
   RECHERCHE GLOBALE (v0.10.0) — le champ de la barre du haut
   ===================================================================== */
.nav-recherche {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0 0.25rem 0 0.5rem;
}
.nav-recherche:focus-within {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.6);
}
.nav-recherche .form-control {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #fff;
  padding-left: 0.25rem;
  min-width: 0;
}
.nav-recherche .form-control::placeholder { color: rgba(255,255,255,0.7); }
.nav-recherche .form-control::-webkit-search-cancel-button { filter: invert(1); }
.nav-recherche .btn { color: #fff; border: 0; padding: 0.2rem 0.45rem; }
@media (min-width: 1200px) {
  .nav-recherche { margin: 0 0.5rem 0 0; }
  .nav-recherche .form-control { width: 10.5rem; }
}
/* De 1200 à 1599 px, le menu complet d'un administrateur prend toute la barre
   (1522 px avec le champ) : la loupe seule, qui ouvre la page de recherche */
@media (min-width: 1200px) and (max-width: 1599.98px) {
  .nav-recherche { background: transparent; border-color: transparent; padding: 0; }
  .nav-recherche .form-control { display: none; }
  .nav-recherche .btn { font-size: 1rem; }
}
.recherche-rubrique { background: var(--bs-light, #f8f9fa); border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* De 1200 à 1299 px, la barre d'un administrateur débordait déjà de 19 px
   (avant la loupe) : entrées un peu plus serrées, et tout tient */
@media (min-width: 1200px) and (max-width: 1299.98px) {
  .navbar-mairie .navbar-nav .nav-link { padding-left: 0.25rem; padding-right: 0.25rem; }
  .nav-recherche { margin-right: 0; }
  .nav-gestion .nav-link { margin: 0; }
}

/* « + Tâche » dans la barre (v0.11.0) : ouvre la fenêtre « Nouvelle tâche » */
.nav-plus-tache {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  margin: 0.5rem 0;
}
.nav-plus-tache:hover, .nav-plus-tache:focus { color: #fff; background: rgba(255,255,255,0.18); border-color: #fff; }
@media (min-width: 1200px) { .nav-plus-tache { margin: 0 0.4rem 0 0; } }
@media (min-width: 1200px) and (max-width: 1299.98px) {
  .nav-plus-tache { margin-right: 0.15rem; }
  .navbar-mairie .navbar-brand { margin-right: 0.5rem; }
}
