:root {
    --primary: #201f1d;
    --primary-dark: #3a3835;
    --primary-light: #f2f1f0;
    --danger: #e2131f;
    --danger-light: #fbe4e5;
    --ok: #16a34a;
    --ok-light: #dcfce7;
    --warn: #d97706;
    --warn-light: #fef3c7;
    --ink: #201f1d;
    --text: #201f1d;
    --muted: #6b7280;
    --bg: #f4f5f7;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.05), 0 1px 3px rgba(15,23,42,0.04);
    --shadow-md: 0 6px 16px rgba(15,23,42,0.09);
    --shadow-lg: 0 12px 32px rgba(15,23,42,0.14);
}

* { box-sizing: border-box; }

/* Leaflet suppose box-sizing: content-box sur ses propres éléments — le reset
   global ci-dessus casse sinon le positionnement des popups/marqueurs/tooltips. */
.leaflet-container, .leaflet-container * { box-sizing: content-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

/* ---------- App shell (sidebar + content) ---------- */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(190deg, #201f1d, #0d0c0b 65%);
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(0,0,0,0.18);
}

.sidebar .brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    padding: 0 20px 18px;
    display: block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 12px;
}
.sidebar-nav a {
    color: #9ca3af;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92em;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(32,31,29,0.45); }

.sidebar-event {
    margin: 16px 18px 4px;
    padding-top: 14px;
    border-top: 1px solid #374151;
}
.sidebar-event-name { color: #fff; font-weight: 600; font-size: 0.92em; }
.sidebar-event .muted { color: #9ca3af; }
.sidebar-event-carte { display: inline-block; margin-top: 8px; padding: 4px 9px; background: rgba(255,255,255,0.08); color: #e5e7eb; font-size: 0.78em; border-radius: 6px; text-decoration: none; }
.sidebar-event-carte:hover { background: rgba(255,255,255,0.16); }

.sidebar-footer {
    margin-top: auto;
    padding: 12px 18px 0;
}
.sidebar-footer a { color: #9ca3af; text-decoration: none; font-size: 0.85em; }
.sidebar-footer a:hover { color: #fff; }

.content {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

.container { max-width: 1100px; margin: 0 auto; }
.container-narrow { max-width: 640px; margin: 0 auto; }

h1 { font-size: 1.55rem; margin: 0 0 6px; color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 12px; color: var(--ink); font-weight: 700; }
h3 { font-size: 1rem; margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 0.9em; }
.page-subtitle { margin-bottom: 20px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.card-link { text-decoration: none; color: inherit; display: block; transition: box-shadow .15s, border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

/* ---------- Tuiles événements (tableau de bord) ---------- */
.evenements-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.evenement-tuile { border-left: 4px solid var(--primary); transition: box-shadow .15s, transform .15s; }
.evenement-tuile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.evenement-tuile-passe { border-left-color: var(--border); opacity: 0.72; }
.evenement-tuile-statut { font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ok); margin-bottom: 6px; }
.evenement-tuile-passe .evenement-tuile-statut { color: var(--muted); }
.evenement-tuile-nom { margin-bottom: 2px; font-size: 1.1em; }
.evenement-tuile-date { margin-bottom: 12px; }
.evenement-tuile-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85em; color: var(--text); padding-top: 10px; border-top: 1px solid var(--border); }
.evenement-tuile-vacant { color: var(--warn); }

.stats-row {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 20px;
    min-width: 130px;
    box-shadow: var(--shadow-sm);
}
.stat strong { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { font-size: 0.8em; color: var(--muted); }
.stat-warn strong { color: var(--warn); }
.stat-ok strong { color: var(--ok); }
.stat-live strong { color: var(--primary); }
.stats-row-compact .stat { padding: 8px 14px; min-width: 100px; box-shadow: none; background: var(--bg); }

.popup-poste { min-width: 250px; font-size: 17px; }
.popup-titre { font-size: 1.35em; font-weight: 800; color: #201f1d; margin-bottom: 6px; line-height: 1.2; }
.popup-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.popup-badge { color: #fff; font-size: 0.78em; font-weight: 700; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.02em; }
.popup-km { font-size: 0.85em; color: var(--muted); }
.popup-horaire { font-size: 0.95em; font-weight: 700; color: var(--primary); }
.popup-desc { margin: 8px 0; font-size: 0.92em; color: #374151; }
.popup-photo-annotee-link { display: block; cursor: zoom-in; }
.popup-photo-annotee-link .photo-annotee { margin: 8px 0; }
.popup-photo-annotee-link .photo-annotee-img { max-width: 200px; }
.popup-equipe { margin: 8px 0; padding-top: 7px; border-top: 1px solid var(--border); }
.popup-equipe strong { display: block; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 5px; }
.popup-equipe a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; text-decoration: none; color: #201f1d; font-weight: 700; font-size: 1.15em; }
.popup-equipe a span { color: var(--primary); font-weight: 500; font-size: 0.6em; white-space: nowrap; }
.itineraire-liens { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.btn-appli { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border-radius: 20px; text-decoration: none; font-size: 0.85em; font-weight: 700; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform .12s, box-shadow .12s; }
.btn-appli:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.3); }
.btn-appli-waze { background: #05c8f7; }
.btn-appli-gmaps { background: #4285f4; }
.btn-appli-streetview { background: #fbbc04; color: #201f1d; }

.critique-card { border-left: 4px solid var(--danger); background: var(--danger-light); border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0; }
.critique-poste { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid rgba(220,38,38,0.2); }
.critique-benevoles { display: flex; gap: 8px; flex-wrap: wrap; }

.pc-accordion summary { cursor: pointer; font-weight: 700; font-size: 1.15em; padding: 4px 0; }
.pc-accordion + .pc-accordion { margin-top: 16px; }
.pc-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 14px; }
@media (max-width: 960px) { .pc-columns { grid-template-columns: 1fr; } }
.pc-col { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; min-width: 0; }
.pc-col h3 { margin: 0 0 10px; font-size: 0.95em; }
.pc-col .chat-messages { max-height: 420px; }
.pc-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pc-list-item { padding: 9px 11px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.pc-list-header { display: flex; align-items: center; gap: 8px; }
.pc-list-header .muted { font-size: 0.78em; }
.pc-list-header form { margin-left: auto; }
.pc-list-motif { margin: 5px 0 2px; font-size: 0.92em; font-weight: 700; }
.pc-list-meta { margin: 0; font-size: 0.82em; }

.frise-suivi { margin-bottom: 20px; }
.frise-parcours { padding: 18px 0; border-top: 1px solid var(--border); }
.frise-parcours:first-child { border-top: none; padding-top: 0; }
.frise-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 30px; padding: 0 8px; flex-wrap: wrap; }
.frise-header strong { font-size: 1.05em; }
.frise-header .muted { font-size: 0.85em; }
.frise-track { position: relative; height: 4px; background: var(--border); border-radius: 2px; margin: 0 8px; }
.frise-tick { position: absolute; top: -4px; width: 2px; height: 12px; background: var(--muted); }
.frise-marqueur { position: absolute; top: -22px; transform: translateX(-50%); font-size: 17px; line-height: 1; cursor: default; }
.frise-marqueur-live { animation: frise-pulse 1.8s ease-in-out infinite; }
@keyframes frise-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.frise-echelle { display: flex; justify-content: space-between; margin: 6px 8px 0; font-size: 0.75em; color: var(--muted); }
.frise-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 8px 0; font-size: 0.82em; color: var(--muted); }
.chat-message-delete { float: right; font-size: 0.78em; color: var(--danger); background: none; border: none; cursor: pointer; padding: 0; }

.notif-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; background: var(--warn-light); border-radius: var(--radius-sm); text-decoration: none; color: #78350f; transition: box-shadow .12s, transform .12s; }
.notif-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.notif-card-icon { font-size: 1.3em; }
.notif-card-texte { flex: 1; }
.notif-card-fleche { font-weight: 700; }
.stats-row-compact .stat strong { font-size: 1.15rem; }

/* ---------- Grille d'accès rapide (page aperçu événement) ---------- */
.acces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.acces-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent, var(--border));
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}
.acces-card--rouge { --accent: var(--danger); --accent-light: var(--danger-light); }
.acces-card--orange { --accent: var(--warn); --accent-light: var(--warn-light); }
.acces-card--vert { --accent: var(--ok); --accent-light: var(--ok-light); }
.acces-card--violet { --accent: #7c3aed; --accent-light: #ede9fe; }
.acces-card--anthracite { --accent: var(--primary); --accent-light: var(--primary-light); }
.acces-card-header { display: flex; align-items: center; gap: 12px; }
.acces-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-light, var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15em;
    flex-shrink: 0;
}
.acces-card h2 { margin: 0; font-size: 1.02rem; }
.acces-card > .muted { margin: 0; line-height: 1.45; }
.acces-card .lien-partage { margin-top: 2px; }
.acces-card-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.parcours-couleur-case { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* ---------- Fiche poste (admin) : header compact avec photo en vignette ---------- */
.poste-header { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.poste-header-main { flex: 1 1 320px; min-width: 0; }
.poste-header-photo { flex: 0 0 220px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.poste-header-photo .photo-annotee { width: 100%; margin: 0; }
.poste-header-photo .photo-annotee-img { width: 100%; height: 150px; object-fit: cover; }
.poste-header-photo a { font-size: 0.82em; }
.poste-referent-zone { margin: 6px 0 0; font-size: 0.85em; color: var(--muted); }
.poste-description { margin: 10px 0 0; }
.poste-materiel { margin: 8px 0 0; font-size: 0.92em; }
.poste-liens { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.poste-liens .itineraire-liens { margin: 0; }
@media (max-width: 640px) {
    .poste-header-photo { flex-basis: 100%; }
}
.stat-danger strong { color: var(--danger); }
.stat-warn { border-left-color: var(--warn); }
.stat-ok { border-left-color: var(--ok); }
.stat-live { border-left-color: var(--primary); }
.stat-danger { border-left-color: var(--danger); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92em;
}
.table th { color: var(--muted); font-weight: 700; font-size: 0.76em; text-transform: uppercase; letter-spacing: 0.04em; background: #fafbfc; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover:not(:has(th)) { background: var(--primary-light); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.table-wrap .table { border: none; }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    background: #e5e7eb;
    font-size: 0.76em;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.badge-vacant { background: var(--danger-light); color: var(--danger); }
.badge-incomplet { background: var(--warn-light); color: var(--warn); }
.badge-couvert { background: var(--ok-light); color: var(--ok); }
.badge-present { background: var(--primary-light); color: var(--primary); }
.badge-attente { background: var(--warn-light); color: var(--warn); }
.badge-info { background: #e5e7eb; color: var(--muted); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-vertical { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.benevole-form { max-width: 640px; gap: 16px; }
.benevole-form .card { display: flex; flex-direction: column; gap: 12px; }
.form-section-titre { font-size: 0.95em; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-section-souslabel { font-size: 0.9em; font-weight: 500; margin-bottom: -4px; }
.chip-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-checkbox { flex-direction: row !important; align-items: center; gap: 5px !important; min-width: auto; font-weight: 500; font-size: 0.85em; padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px; cursor: pointer; transition: all .12s; }
.chip-checkbox input { width: auto; }
.chip-checkbox:hover { border-color: var(--primary); }
.chip-checkbox.checked { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.form-vertical label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9em; font-weight: 500; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 120px; }

input, select, textarea, button {
    font-family: inherit;
    font-size: 0.95em;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

button {
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 10px 18px;
    box-shadow: 0 1px 2px rgba(32,31,29,0.2);
    transition: background .15s, box-shadow .15s, transform .1s;
}
button:hover { background: var(--primary-dark); box-shadow: 0 3px 10px rgba(32,31,29,0.3); }
button:active { transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-secondary:hover { background: #f3f4f6; box-shadow: none; }
.btn-danger { background: var(--danger); box-shadow: 0 1px 2px rgba(220,38,38,0.2); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 3px 10px rgba(220,38,38,0.3); }
.btn-checkin { background: var(--ok); width: 100%; padding: 15px; font-size: 1.05em; border-radius: 10px; box-shadow: 0 2px 10px rgba(22,163,74,0.3); }
.btn-position.actif { background: var(--ok); }
.btn-checkin:hover { background: #15803d; box-shadow: 0 4px 14px rgba(22,163,74,0.4); }

.toggle-poste { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 16px; border-radius: 10px; font-weight: 700; }
.toggle-poste-on { background: var(--ok-light); color: #14532d; box-shadow: inset 0 0 0 2px var(--ok); }

.abandon-form { margin-top: 0; padding: 0; background: none; }
.abandon-form input[type="text"] { flex: 1 1 140px; }

.chat-terrain summary { font-weight: 600; }
.chat-messages { max-height: 260px; overflow-y: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.chat-message { padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.chat-message-canal { font-weight: 700; font-size: 0.85em; }
.chat-message-contenu { margin: 4px 0 2px; font-size: 0.92em; }
.chat-message-meta { font-size: 0.75em; }
.chat-form select { flex: 0 0 auto; }
.chat-form input[type="text"] { flex: 1 1 140px; }

.mission-date-alerte { margin: 4px 0 10px; padding: 6px 10px; background: #201f1d; color: #fff; border-radius: 6px; font-weight: 700; font-size: 0.88em; display: inline-block; }
.mission-date-alerte .muted { color: #9ca3af; font-weight: 500; }
.fiche-evenement-actif { margin: 14px 0 4px; }
.fiche-evenement-actif h2 { margin-bottom: 2px; }
.fiche-evenement-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fiche-evenement-switch a { text-decoration: none; }

.urgence-row { display: flex; gap: 8px; margin: 12px 0; }
.btn-urgence-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; text-decoration: none; background: var(--danger); color: #fff; font-weight: 700; font-size: 1.3em; padding: 10px 4px; border-radius: 10px; box-shadow: 0 2px 10px rgba(220,38,38,0.35); border: none; font-family: inherit; cursor: pointer; }
.btn-urgence-col span { font-size: 0.42em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.btn-urgence-col:hover { background: #b91c1c; }
.btn-urgence-col.actif { background: #7f1d1d; box-shadow: inset 0 0 0 2px #fff, 0 2px 10px rgba(220,38,38,0.35); }

.urgence-panel { margin: 0 0 12px; padding: 14px; background: #f3f4f6; border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.urgence-panel[hidden] { display: none; }
.urgence-panel-titre { margin: 0; font-size: 0.85em; font-weight: 700; color: #201f1d; }
.urgence-panel-separateur { text-align: center; margin: 0; font-size: 0.8em; color: var(--muted); }
.btn-panel-call { display: block; text-align: center; text-decoration: none; background: var(--danger); color: #fff; font-weight: 700; padding: 13px; border-radius: 8px; }
.btn-panel-call:hover { background: #b91c1c; }
.motif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-motif { display: block; text-align: center; text-decoration: none; background: var(--danger); color: #fff; font-weight: 700; padding: 11px 6px; border-radius: 8px; font-size: 0.88em; }
.btn-motif:hover { background: #b91c1c; }
.urgence-statut { display: block; min-height: 1.2em; }
.btn-sm { padding: 6px 11px; font-size: 0.82em; }

.link-input { width: 100%; font-size: 0.82em; color: var(--muted); }
.lien-partage { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lien-partage .link-input { flex: 1; min-width: 160px; }

.error { color: var(--danger); }
.flash-warn { background: var(--warn-light); color: #92400e; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 0.9em; }
.flash-ok { background: var(--ok-light); color: #14532d; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 0.9em; }

/* CRM des bénévoles : une colonne par événement, une coche par participation */
.crm-table th { white-space: nowrap; }
.crm-table .crm-evenement { text-align: center; font-size: 0.72em; line-height: 1.25; min-width: 78px; max-width: 96px; white-space: normal; }
.crm-table .crm-evenement small { display: block; color: var(--muted); font-weight: 500; }
.crm-ligne { cursor: pointer; }
.crm-case { text-align: center; font-weight: 700; font-size: 1.05em; }
.crm-case.crm-ok { color: var(--ok); background: var(--ok-light); }
.crm-case.crm-inscrit { color: var(--muted); }
.crm-case.crm-attente { color: var(--warn); }
.crm-detail td { background: #fafbfc; font-size: 0.9em; }
.crm-detail[hidden] { display: none; }
.crm-detail-ligne { padding: 2px 0; }

/* Feedback : débriefing de fin de mission (fiche bénévole) et onglet Feedback (admin) */
.fb-guide { border-left: 4px solid var(--primary); }
.feedback-card { border: 2px solid var(--primary); }
.feedback-card > summary { cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.feedback-form { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.fb-question { display: flex; flex-direction: column; gap: 8px; }
.fb-label { font-weight: 600; font-size: 0.95em; }
.fb-aide { margin: -4px 0 0; font-size: 0.82em; color: var(--muted); }
.fb-choix { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-choix-gros .fb-option { flex: 1; justify-content: center; padding: 16px 12px; font-size: 1.05em; font-weight: 700; letter-spacing: 0.04em; }
.fb-pourquoi { margin-top: 12px; padding: 12px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-sm); }
.fb-pourquoi-label { display: block; font-weight: 600; font-size: 0.92em; margin-bottom: 6px; color: #9a3412; }
.fb-pourquoi textarea { width: 100%; }
.fb-option-autre { gap: 8px; }
.fb-option-autre input[type=text] { flex: 1; min-width: 0; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 4px 2px; background: transparent; }
/* Débrief pas à pas : accueil puis une question par écran */
.fb-pas-a-pas [hidden] { display: none !important; }
.fb-accueil { text-align: center; padding: 18px 8px 8px; }
.fb-accueil h2 { margin: 0 0 8px; }
.fb-accueil p { color: var(--muted); max-width: 440px; margin: 0 auto 20px; }
.fb-commencer { padding: 14px 36px; font-size: 1em; font-weight: 700; letter-spacing: 0.06em; border-radius: 30px; }
.fb-pas-a-pas .fb-question { min-height: 180px; padding: 6px 0 0; }
.fb-pas-a-pas .fb-label { font-size: 1.2em; line-height: 1.35; }
.fb-pas-a-pas textarea { min-height: 130px; font-size: 1em; }
.fb-nav { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.fb-progression { display: flex; align-items: center; gap: 10px; font-size: 0.82em; color: var(--muted); }
.fb-progression-barre { flex: 1; height: 6px; border-radius: 4px; background: #eceff3; overflow: hidden; }
.fb-progression-remplie { height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width .25s; }
.fb-nav-boutons { display: flex; gap: 8px; }
.fb-nav-boutons .fb-suivant, .fb-nav-boutons .fb-envoyer { margin-left: auto; }
.fb-erreur { margin: 0; color: var(--danger); font-size: 0.88em; }
.feedback-form:not(.fb-pas-a-pas) .fb-accueil, .feedback-form:not(.fb-pas-a-pas) .fb-nav .fb-progression, .feedback-form:not(.fb-pas-a-pas) .fb-precedent, .feedback-form:not(.fb-pas-a-pas) .fb-suivant, .feedback-form:not(.fb-pas-a-pas) .fb-erreur, .feedback-form:not(.fb-pas-a-pas) .fb-commencer { display: none; }
.fb-choix-colonne { flex-direction: column; }
.fb-option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-size: 0.92em; }
.fb-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.fb-option input { width: auto; }
.fb-barre { display: flex; align-items: center; gap: 8px; font-size: 0.85em; }
.fb-barre-piste { flex: 1; height: 10px; background: #eceff3; border-radius: 6px; overflow: hidden; }
.fb-barre-remplie { height: 100%; background: var(--primary); border-radius: 6px; }
.fb-resume-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.fb-reponse { border-top: 1px solid var(--border); padding: 8px 0; }
.fb-reponse summary { cursor: pointer; }
.fb-reponse dl { margin: 10px 0 4px 18px; font-size: 0.9em; }
.fb-reponse dt { font-weight: 600; margin-top: 8px; color: var(--muted); font-size: 0.88em; }
.fb-reponse dd { margin: 2px 0 0; }
.fb-citation { padding: 8px 12px; margin: 6px 0; background: #fafbfc; border-left: 3px solid var(--border); border-radius: 0 6px 6px 0; font-size: 0.9em; }
.fb-citation small { display: block; color: var(--muted); margin-top: 2px; }
.feedback-onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.feedback-onglets a { text-decoration: none; padding: 9px 16px; border: 1.5px solid var(--border); border-radius: 20px; color: var(--text); font-weight: 600; font-size: 0.9em; background: #fff; }
.feedback-onglets a.actif { background: var(--primary); border-color: var(--primary); color: #fff; }
.fb-editeur-ligne { display: grid; grid-template-columns: auto minmax(180px, 2fr) minmax(130px, 1fr) minmax(150px, 1.2fr) auto auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fafbfc; margin-bottom: 8px; }
.fb-editeur-ligne textarea { min-height: 38px; }
.fb-extra { display: flex; flex-direction: column; gap: 6px; }
.fb-extra [hidden] { display: none; }
.fb-pourquoi-liste { margin-top: 12px; }
@media (max-width: 900px) { .fb-editeur-ligne { grid-template-columns: 1fr 1fr; } }

/* Aperçu du formulaire d'inscription (dans l'onglet Formulaire) */
.apercu-bandeau { position: sticky; top: 0; z-index: 30; background: #fef3c7; color: #92400e; text-align: center; font-size: 0.8em; padding: 5px 8px; border-bottom: 1px solid #fde68a; }
.formulaire-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.formulaire-apercu { position: sticky; top: 16px; padding: 12px; }
.formulaire-apercu-barre { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.formulaire-apercu-barre h2 { margin: 0; font-size: 1em; }
.apercu-cadre { display: block; margin: 0 auto; width: 100%; height: calc(100vh - 150px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); transition: width .2s; }
.apercu-cadre.mobile { width: 375px; max-width: 100%; }
.btn-actif { background: var(--primary); color: #fff; border-color: var(--primary); }
@media (max-width: 1250px) {
    .formulaire-grid { grid-template-columns: 1fr; }
    .formulaire-apercu { position: static; }
    .apercu-cadre { height: 620px; }
}

/* Liste des postes : bénévoles affectés directement dans le tableau */
.cellule-affectes { min-width: 220px; }
.affectes-liste { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.affecte-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 4px 3px 10px; background: var(--primary-light); border: 1px solid var(--border); border-radius: 20px; font-size: 0.85em; }
.affecte-retirer { padding: 0 6px; border: none; background: transparent; color: var(--muted); font-size: 0.9em; line-height: 1.4; cursor: pointer; border-radius: 50%; }
.affecte-retirer:hover { background: var(--danger-light); color: var(--danger); }
.affecte-ajout { margin: 0; }
.affecte-ajout select { padding: 4px 8px; font-size: 0.85em; border-radius: 20px; max-width: 170px; }
.ligne-flash { animation: ligne-flash 2.4s ease-out; }
@keyframes ligne-flash { 0% { background: #fef08a; } 100% { background: transparent; } }
.dialog-simple { border: none; border-radius: var(--radius); padding: 20px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.dialog-simple::backdrop { background: rgba(0,0,0,.45); }

/* Catégories de postes : champ icône + palette d'emojis flottante */
.cat-emoji-input { width: 64px; text-align: center; font-size: 1.2em; cursor: pointer; }
.dialog-emoji { border: none; border-radius: var(--radius); padding: 0; width: min(640px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 40px)); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.dialog-emoji[open] { display: flex; flex-direction: column; }
.dialog-emoji::backdrop { background: rgba(0,0,0,.45); }
.emoji-entete { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--border); }
.emoji-entete input { flex: 1; }
.emoji-corps { overflow-y: auto; padding: 4px 14px 10px; flex: 1; }
.emoji-groupe h4 { margin: 14px 0 6px; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.emoji-groupe[hidden], .emoji-grille button[hidden] { display: none; }
.emoji-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; }
.emoji-grille button { padding: 6px 0; font-size: 1.5em; line-height: 1.2; background: transparent; border: 1px solid transparent; border-radius: 8px; color: inherit; }
.emoji-grille button:hover { background: var(--primary-light); border-color: var(--border); transform: scale(1.12); }
.emoji-pied { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: #fafbfc; font-size: 0.9em; }

/* Communication (email / SMS / WhatsApp) : formulaire à gauche, aperçu par bénévole à droite */
.comm-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.comm-grid .form-vertical { max-width: none; }
.comm-grid [hidden] { display: none !important; }
.case-simple { flex-direction: row !important; align-items: center; gap: 8px !important; }
.case-simple input { width: auto; }
.canal-choix { display: flex; gap: 8px; flex-wrap: wrap; }
.canal-option { flex-direction: row !important; flex: 1; min-width: 110px; cursor: pointer; }
.canal-option input { position: absolute; opacity: 0; pointer-events: none; }
.canal-option span { flex: 1; text-align: center; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; transition: all .12s; }
.canal-option:hover span { border-color: var(--primary); }
.canal-option input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.canal-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-light); }
.chip-checkbox.indispo { opacity: 0.45; cursor: not-allowed; }
.comm-selecteur { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.comm-selecteur select { min-width: 280px; max-width: 100%; }
.comm-programmation { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fafbfc; }
.comm-programmation > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 0.92em; }
.comm-programmation-corps { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 0 12px 12px; }
.comm-programmation-corps label { display: flex; flex-direction: column; gap: 5px; }
.comm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.comm-actions #bouton-envoi { flex: 1; }
.apercu-card { position: sticky; top: 16px; }
.apercu-entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.apercu-entete label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9em; font-weight: 500; }
.apercu-email { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.apercu-ligne { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 0.88em; background: #fafbfc; }
.apercu-ligne .muted { display: inline-block; min-width: 44px; }
.apercu-corps { padding: 14px 16px; font-size: 0.92em; line-height: 1.5; word-break: break-word; }
.apercu-corps p { margin: 0 0 10px; }
.bulle-sms { background: #e9e9eb; color: #111; padding: 10px 14px; border-radius: 18px 18px 18px 4px; max-width: 92%; white-space: pre-wrap; word-break: break-word; font-size: 0.92em; line-height: 1.45; }
.apercu-card mark { background: #fef08a; color: inherit; padding: 0 2px; border-radius: 3px; }
.apercu-card mark.var-vide { background: #fed7aa; }
.apercu-card mark.var-inconnue { background: #fecaca; }
@media (max-width: 1000px) {
    .comm-grid { grid-template-columns: 1fr; }
    .apercu-card { position: static; }
}

.page-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }

.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--bg); }
.login-box {
    background: #fff;
    padding: 32px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.fiche-page { background: var(--bg); }
.poste-card { border-left: 4px solid var(--primary); box-shadow: var(--shadow-sm); }
.mini-map { height: 200px; border-radius: 8px; margin: 10px 0; }

.tab-sidebar { background: none; border: none; padding: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; box-shadow: none; transition: color .15s, border-color .15s; }
.tab-sidebar.active { color: var(--primary); border-bottom-color: var(--primary); }
.sidebar-list-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.sidebar-list-item:hover { background: var(--primary-light); }
.appel-carte-item { padding: 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.appel-carte-item .itineraire-liens { margin: 6px 0 0; }

.recruit-page { background: linear-gradient(180deg, var(--primary-light), var(--bg) 240px); min-height: 100vh; }
.recruit-hero { text-align: center; padding: 36px 20px 10px; }
.recruit-pitch { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; white-space: pre-line; }

.form-section { margin-bottom: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section:first-of-type { border-top: none; padding-top: 0; }
.form-section-title { font-weight: 700; font-size: 1.02em; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.required-star { color: var(--danger); }

.mission-choice { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.mission-choice.dragging { opacity: 0.4; }
.mission-drag-handle { flex-shrink: 0; color: var(--muted); font-size: 1.1em; cursor: grab; }
.mission-rang { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 0.85em; display: flex; align-items: center; justify-content: center; }
.mission-info { flex: 1; }
.mission-fleches { display: flex; flex-direction: column; gap: 2px; }
.mission-fleches button { padding: 2px 8px; font-size: 0.75em; line-height: 1.4; }

.dispo-row { align-items: flex-end; margin-bottom: 8px; }
.competences-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.competence-chip { flex-direction: row; align-items: center; gap: 6px; min-width: auto; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; font-size: 0.85em; }
.competence-chip input { width: auto; }

.poste-photo { max-width: 100%; border-radius: 8px; margin: 10px 0; display: block; }
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 3000; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox-overlay img { max-width: 100%; max-height: 100%; border-radius: 6px; cursor: default; }
.lightbox-close { position: absolute; top: 16px; right: 20px; background: rgba(255,255,255,0.15); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; z-index: 1; }
#lightbox-html { display: none; cursor: default; }
#lightbox-html .photo-annotee-img { max-height: 85vh; max-width: 85vw; width: auto; border-radius: 6px; }
.poste-photo-thumb { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }

/* ---------- Photo de poste annotée (repères, sens du parcours) ---------- */
.photo-annotee { position: relative; display: inline-block; max-width: 100%; margin: 10px 0; }
.photo-annotee-img { display: block; max-width: 100%; border-radius: 8px; }
.photo-annotee-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.photo-annotee-icone { position: absolute; transform: translate(-50%, -50%); line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.55)); }
.photo-annotee-overlay { position: absolute; transform: translate(-50%, -50%); height: auto; box-shadow: 0 2px 10px rgba(0,0,0,0.4); border-radius: 4px; border: 2px solid #fff; }
.photo-annotee-note, .editable-note {
    position: absolute; transform: translate(-50%, -50%); box-sizing: border-box;
    background: #fff; color: #201f1d; font-size: 0.8em; font-weight: 500; line-height: 1.3;
    padding: 7px 9px 7px 16px; border-radius: 4px; border-left: 4px solid var(--danger);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3); text-align: left; word-wrap: break-word;
}
.photo-annotee-note::before, .editable-note::before {
    content: '📌'; position: absolute; top: -11px; left: -9px; font-size: 14px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

#photo-canvas { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; user-select: none; }
#photo-canvas img { display: block; max-width: 100%; border-radius: 8px; }
.editable-icone { position: absolute; transform: translate(-50%, -50%); line-height: 1; cursor: grab; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.55)); }
.editable-icone:active { cursor: grabbing; }
.editable-note { cursor: grab; }
.editable-note:active { cursor: grabbing; }
.editable-note-texte { display: block; outline: none; min-height: 1.3em; }
.editable-note-texte[contenteditable="true"] { cursor: text; box-shadow: 0 0 0 2px var(--danger); border-radius: 2px; }
.editable-overlay { position: absolute; transform: translate(-50%, -50%); cursor: grab; }
.editable-overlay:active { cursor: grabbing; }
.editable-overlay img { display: block; width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,0.4); border-radius: 4px; border: 2px solid #fff; pointer-events: none; }
.icone-del { position: absolute; top: -8px; right: -10px; width: 16px; height: 16px; padding: 0; font-size: 9px; line-height: 16px; background: var(--danger); color: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.3); z-index: 3; }
.editable-note .icone-del, .editable-overlay .icone-del { top: -8px; right: -8px; }
.note-resize { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; background: #201f1d; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; box-shadow: 0 1px 3px rgba(0,0,0,0.4); z-index: 3; }
.fleche-poignee { position: absolute; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,0.4); z-index: 2; }
.fleche-poignee:active { cursor: grabbing; }
.fleche-del { position: absolute; width: 18px; height: 18px; margin: -9px; padding: 0; font-size: 10px; line-height: 18px; background: var(--danger); color: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.4); z-index: 2; }

/* ---------- Éditeur photo : toolbar dense, charte rouge/noir/blanc (logo NSE) ---------- */
.photo-editor-card { padding: 14px 16px; }
.photo-editor-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 2px solid #201f1d; }
.photo-editor-group { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.photo-editor-group-label { font-size: 0.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #201f1d; }
.photo-editor-hint { margin: 0 0 10px; font-size: 0.82em; }
.icone-picker { display: flex; gap: 3px; }
.icone-picker-btn { width: 34px; height: 34px; font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; background: #fff; border: 1.5px solid #201f1d; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.12s; }
.icone-picker-btn:hover { border-color: var(--danger); transform: translateY(-1px); }
.icone-picker-btn.active { border-color: var(--danger); background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.couleur-picker { display: flex; gap: 5px; align-items: center; }
.couleur-picker-btn { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #201f1d; cursor: pointer; padding: 0; }
.couleur-picker-btn.active { box-shadow: 0 0 0 2px var(--danger); }
.photo-editor-btn { background: #201f1d; color: #fff; border: 1px solid #201f1d; padding: 7px 12px; font-size: 0.82em; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; box-shadow: none; }
.photo-editor-btn:hover { background: var(--danger); border-color: var(--danger); }
.photo-editor-save { margin-left: auto; background: var(--danger); border-color: var(--danger); }
.photo-editor-save:hover { background: #b91c1c; }

.categorie-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px; font-size: 0.78em; font-weight: 600; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.12); }

.categorie-section { margin-bottom: 22px; }
.categorie-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }

/* ---------- Badges ---------- */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.badge-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: var(--shadow-sm);
}
.badge-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.badge-nom { font-weight: 700; font-size: 1.1em; }
.badge-event { font-size: 0.8em; color: var(--muted); }
.badge-qr { flex-shrink: 0; }
.badge-missions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.badge-mission { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge-materiel { font-size: 0.85em; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.badge-footer { font-size: 0.75em; text-align: center; margin-top: 10px; }

.badges-grid-perso { display: flex; flex-wrap: wrap; gap: 16px; }
.badge-perso {
    position: relative;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: hidden;
    flex-shrink: 0;
}
.badge-var { position: absolute; font-weight: 600; color: #111; background: rgba(255,255,255,0.85); padding: 2px 6px; border-radius: 4px; line-height: 1.25; word-break: break-word; overflow: hidden; }
.badge-qr-perso { background: #fff; padding: 4px; border-radius: 4px; line-height: 0; }
.badge-var-icon { margin-right: 2px; }

/* ---------- Éditeur de badge (blocs déplaçables/redimensionnables) ---------- */
.badge-block {
    position: absolute;
    border: 1px dashed rgba(32,31,29,0.6);
    background: rgba(255,255,255,0.75);
    border-radius: 4px;
    overflow: hidden;
    z-index: 2;
}
.badge-block[data-type="variable"] { background: rgba(32,31,29,0.12); }
.badge-block-content {
    width: 100%; height: 100%;
    padding: 3px 6px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    outline: none;
    cursor: text;
}
.badge-block[data-type="variable"] .badge-block-content { cursor: default; color: #1e3a8a; }
.badge-block-handle {
    position: absolute; top: 0; left: 0;
    width: 16px; height: 16px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    cursor: move;
    border-radius: 0 0 4px 0;
    z-index: 3;
}
.badge-block-del {
    position: absolute; top: 0; right: 0;
    width: 16px; height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    padding: 0;
    border-radius: 0 0 0 4px;
    z-index: 3;
}
.badge-block-align {
    position: absolute; top: 0; right: 16px;
    width: 16px; height: 16px;
    background: #4b5563;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    padding: 0;
    border-radius: 0;
    z-index: 3;
    cursor: pointer;
}
.badge-block-resize {
    position: absolute;
    right: 0; bottom: 0;
    width: 14px; height: 14px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(32,31,29,0.6) 50%);
    z-index: 3;
}

/* ---------- Planning Gantt ---------- */
.gantt-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.gantt { position: relative; width: 900px; }
.zoom-control { display: inline-flex; align-items: center; gap: 4px; }
.zoom-control input[type="range"] { width: 90px; padding: 0; }
.gantt-header { display: flex; border-bottom: 2px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 2; }
.gantt-header-label { width: 190px; flex-shrink: 0; }
.gantt-header-hours { flex: 1; position: relative; height: 28px; }
.gantt-hour-mark { position: absolute; top: 0; font-size: 0.75em; color: var(--muted); border-left: 1px solid var(--border); padding-left: 4px; height: 100%; }
.gantt-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); min-height: 44px; }
.gantt-row-label { width: 190px; flex-shrink: 0; padding: 6px 10px; font-size: 0.85em; font-weight: 600; position: relative; display: flex; align-items: center; gap: 6px; }
.gantt-label-bloc { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gantt-prefs { display: block; font-size: .72em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-compact .gantt-prefs { display: none; }
.gantt-label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.gantt-row-track { flex: 1; position: relative; height: 100%; min-height: 44px; }
.gantt-bar { position: absolute; top: 6px; bottom: 6px; border-radius: 7px; color: #fff; font-size: 0.75em; padding: 2px 8px; overflow: visible; white-space: nowrap; display: flex; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
/* Une pastille trop courte pour son texte le laisse déborder plutôt que de le couper (invisible à
   l'écran ET à l'impression sinon) — le texte garde le fond de la pastille pour rester lisible. */
.gantt-bar-text { flex: 0 1 auto; white-space: nowrap; background: inherit; border-radius: 4px; padding: 0 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.3); position: relative; z-index: 1; }
.gantt-bar-del { position: absolute; right: -2px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; padding: 0; font-size: 10px; line-height: 16px; background: rgba(0,0,0,0.55); color: #fff; border: 1px solid #fff; border-radius: 50%; cursor: pointer; z-index: 10; }
.gantt-bar-del:hover { background: rgba(0,0,0,0.8); }
/* Vue "par bénévole" : plusieurs missions peuvent partager la même ligne. Contrairement à la vue
   "par poste" (une seule barre par ligne, le débordement de texte est sans risque), ici un texte
   qui déborde peut recouvrir la barre voisine et rendre sa croix illisible/incliquable — donc on
   tronque avec "..." (titre complet au survol) plutôt que de laisser déborder. */
.gantt-bar-mission { overflow: hidden; min-width: 70px; }
.gantt-bar-mission .gantt-bar-text { overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 16px); }
.gantt-bar-mission .gantt-bar-del { right: 1px; }
/* Vue "par poste" : chaque ligne n'a qu'un seul poste (donc une seule plage horaire) — les
   pastilles des bénévoles qui s'y empilent peuvent sans risque être plus larges que leur créneau
   réel, il n'y a pas de ligne voisine avec laquelle elles pourraient entrer en collision. */
.gantt-bar-poste-pill { min-width: 110px; }
.gantt-conflit-badge { font-size: 0.9em; cursor: help; flex-shrink: 0; }
/* Infobulle agrandie (texte complet, bien plus lisible que le petit tooltip natif du navigateur) —
   surtout utile pour une mission trop courte pour afficher son nom même tronqué. */
.gantt-bar-mission[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--ink);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    z-index: 20;
    pointer-events: none;
}
.gantt-gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }

/* Mode compact : lignes fines, pour voir beaucoup de missions/bénévoles d'un coup d'œil. */
.gantt-compact .gantt-row { min-height: 24px; }
.gantt-compact .gantt-row-track { min-height: 24px; }
.gantt-compact .gantt-row-label { padding: 2px 8px; font-size: 0.76em; }
.gantt-compact .gantt-bar { top: 2px; bottom: 2px; font-size: 0.68em; padding: 1px 5px; }
.gantt-compact .gantt-header-hours { height: 20px; }

.gantt-add { position: relative; }
.gantt-add summary { cursor: pointer; list-style: none; font-size: 0.9em; color: var(--primary); }
.gantt-add summary::-webkit-details-marker { display: none; }
.gantt-add-form { position: absolute; top: 100%; left: 0; z-index: 5; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.12); display: flex; gap: 6px; white-space: nowrap; }
.gantt-add-form select { max-width: 160px; }

.gantt-bar-vacant {
    background: repeating-linear-gradient(45deg, rgba(107,114,128,0.12), rgba(107,114,128,0.12) 6px, rgba(107,114,128,0.03) 6px, rgba(107,114,128,0.03) 12px);
    border: 2px dashed #9ca3af;
    color: var(--muted);
    justify-content: center;
}
.gantt-bar-vacant .gantt-add summary { font-size: 0.82em; color: var(--muted); }
.gantt-add-onbar { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.gantt-add-onbar summary { color: #fff; }
/* Le popup "+ affecter" doit sortir de la barre pour rester cliquable : la barre a overflow:hidden
   (pour tronquer le texte trop long), donc on le laisse déborder dès qu'il est ouvert. */
.gantt-bar:has(.gantt-add[open]) { overflow: visible; z-index: 6; }
.gantt-row:has(.gantt-add[open]) { z-index: 7; position: relative; }
.gantt-bar-dispo {
    background: repeating-linear-gradient(45deg, rgba(32,31,29,0.10), rgba(32,31,29,0.10) 6px, transparent 6px, transparent 12px);
    border: 2px dashed var(--primary);
    top: 2px; bottom: 2px;
    z-index: 0;
}

/* ---------- Documents administratifs (exports imprimables) ---------- */
.doc-export { background: #fff; max-width: 800px; margin: 0 auto; font-size: 0.95em; line-height: 1.6; padding: 28px 34px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.doc-export p { margin: 6px 0; }
.doc-export h2 { margin-top: 22px; font-size: 1rem; }
.doc-letterhead { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.doc-letterhead img { width: 76px; height: auto; flex-shrink: 0; }
.doc-letterhead-text { font-size: 0.85em; line-height: 1.5; }
.doc-title { text-align: center; font-size: 1.35rem; font-weight: 700; margin: 20px 0 8px; letter-spacing: 0.01em; }
.doc-subtitle { text-align: center; margin-bottom: 20px; }
.doc-intro { text-align: center; max-width: 620px; margin: 8px auto; }
.doc-table, .doc-footer-table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.doc-table th, .doc-table td { border: 1px solid #333; padding: 7px 9px; font-size: 0.82em; text-align: left; vertical-align: top; }
.doc-table th { background: #f3f4f6; text-transform: uppercase; font-size: 0.72em; text-align: center; }
.doc-footer-table td { border: none; padding: 8px 0; font-size: 0.9em; }
.doc-section { margin-bottom: 20px; }
.doc-section-title { font-weight: 700; text-decoration: underline; margin-bottom: 7px; }
.doc-placeholder { color: var(--muted); font-style: italic; }
@media print {
    .doc-export { border: none; box-shadow: none; padding: 0; }
}

.only-print { display: none; }

@media print {
    @page { size: portrait; margin: 12mm; }
    @page paysage { size: landscape; margin: 10mm; }
    .print-landscape { page: paysage; }
    /* Les badges remplissent la page A4 à ras bord (4 x A6 = exactement 1 A4) — une marge de page
       non nulle les ferait déborder sur une page 2 après seulement 2 badges, d'où ces pages dédiées
       sans marge plutôt que de réutiliser les règles ci-dessus. */
    @page badges-portrait { size: portrait; margin: 0; }
    @page badges-paysage { size: landscape; margin: 0; }
    .badges-print-portrait { page: badges-portrait; }
    .badges-print-paysage { page: badges-paysage; }
    .doc-export { max-width: none; }
    .no-print { display: none !important; }
    .only-print { display: block; }
    body { background: #fff; }
    .card { border: none; box-shadow: none; }
    .app { display: block; }
    .sidebar { display: none; }
    .content { padding: 0; }
    .gantt-wrap { overflow: visible; border: none; }
    .gantt { width: 900px !important; }
    .gantt-add { display: none; }

    /* Badges : 4 par page A4 (2x2), taille réelle A6 — l'orientation de la page suit celle du
       badge (paysage/paysage ou portrait/portrait) puisque 4 A6 remplissent exactement 1 A4
       dans la même orientation. */
    .badges-grid-perso, .badges-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: min-content;
        gap: 0 !important;
        justify-content: center;
    }
    .badges-print-paysage .badge-perso, .badges-print-paysage .badge-card { width: 148mm !important; height: 105mm !important; }
    .badges-print-portrait .badge-perso, .badges-print-portrait .badge-card { width: 105mm !important; height: 148mm !important; }
    .badges-grid-perso > *, .badges-grid > * { margin: 0 auto; }
    .badges-grid-perso > *:nth-child(4n), .badges-grid > *:nth-child(4n) { break-after: page; }
}

/* Accès matériel par code PIN : barre fine à la place du menu d'administration */
.app-materiel { flex-direction: column; }
.materiel-barre { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 20px; background: linear-gradient(190deg, #201f1d, #0d0c0b); color: #fff; position: sticky; top: 0; z-index: 20; }
.materiel-barre nav { display: flex; gap: 6px; flex-wrap: wrap; }
.materiel-barre nav a { color: #d1d5db; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: 0.9em; font-weight: 600; background: rgba(255,255,255,0.08); }
.materiel-barre nav a.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 1.5px rgba(255,255,255,.5); }
.app-materiel .content { max-width: 960px; width: 100%; margin: 0 auto; }

@media (max-width: 800px) {
    .app { flex-direction: column; }
    .sidebar { position: static; height: auto; width: 100%; }
    .content { padding: 18px; }
}

/* ===== Chat terrain : mise à jour automatique, repère « nouveau », notifications ===== */
.chat-message-moi { background: var(--primary-light); border-left: 3px solid var(--ink); }
.chat-nouveau { margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.78em; font-weight: 700; }
.chat-terrain.chat-a-lire { box-shadow: 0 0 0 2px var(--danger); }
.chat-statut { font-size: 0.78em; margin: 8px 0 0; }
.chat-notif { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85em; }
.pc-live-barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px; margin: -4px 0 14px; font-size: 0.85em; }
.pc-live-son { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
/* ===== Modes d'emploi (aide.php) ===== */
.aide-page { background: #f4f5f7; margin: 0; color: var(--ink); font-size: 16px; line-height: 1.55; }
.aide-entete { background: linear-gradient(190deg, #201f1d, #0d0c0b); color: #fff; padding: 22px 16px 0; }
.aide-entete-interieur { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.aide-organisation { text-transform: uppercase; letter-spacing: .08em; font-size: .75em; opacity: .65; font-weight: 700; }
.aide-entete h1 { margin: 4px 0 4px; font-size: 1.7em; line-height: 1.2; color: #fff; }
.aide-entete p { margin: 0; opacity: .8; }
.aide-imprimer { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; font-size: .9em; }
.aide-imprimer:hover { background: rgba(255,255,255,.2); }
.aide-onglets { max-width: 1000px; margin: 20px auto 0; display: flex; gap: 6px; overflow-x: auto; }
.aide-onglets a { color: #d1d5db; text-decoration: none; padding: 11px 18px; border-radius: 12px 12px 0 0; font-weight: 700; font-size: .95em; background: rgba(255,255,255,.07); white-space: nowrap; }
.aide-onglets a.actif { background: #f4f5f7; color: var(--ink); }
.aide-contenu { max-width: 1000px; margin: 0 auto; padding: 24px 16px 10px; }

.aide-intro, .aide-bloc, .aide-etape { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 22px 24px; margin-bottom: 18px; }
.aide-intro > p:first-child { margin-top: 0; font-size: 1.05em; }
.aide-contenu h2 { margin: 0 0 12px; font-size: 1.25em; }
.aide-resume { margin: 0; padding-left: 0; list-style: none; counter-reset: resume; display: grid; gap: 8px; }
.aide-resume li { counter-increment: resume; position: relative; background: #f8f8f7; border-radius: 10px; padding: 10px 14px 10px 50px; }
.aide-resume li::before { content: counter(resume); position: absolute; left: 14px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: .85em; display: flex; align-items: center; justify-content: center; }

.aide-etape { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 22px 30px; align-items: start; }
.aide-etape:not(:has(.aide-etape-figure)) { grid-template-columns: minmax(0, 1fr); }
.aide-etape h3 { margin: 0 0 10px; font-size: 1.15em; display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.aide-etape p { margin: 0 0 10px; }
.aide-etape ul { margin: 0 0 10px; padding-left: 20px; }
.aide-etape li { margin-bottom: 6px; }
.aide-numero { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.aide-etape-figure { display: grid; gap: 16px; }

.aide-figure { margin: 0; }
.aide-capture { position: relative; width: 100%; background: #e5e7eb; border-radius: 14px; border: 1px solid #d1d5db; box-shadow: var(--shadow-md); }
.aide-capture-cadre { position: absolute; inset: 0; overflow: hidden; border-radius: 13px; }
.aide-capture-cadre img { position: absolute; left: 0; width: 100%; height: auto; display: block; }
.aide-pastille { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: #e2131f; color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.aide-legende { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; font-size: .88em; }
.aide-legende li { display: flex; gap: 8px; align-items: flex-start; }
.aide-legende b { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #e2131f; color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }

.aide-message { background: #f0f7ff; border-radius: 14px; padding: 14px; }
.aide-message-bulle { background: #fff; border-radius: 14px 14px 14px 4px; padding: 10px 14px; box-shadow: var(--shadow-sm); font-size: .92em; word-break: break-word; }
.aide-message small { display: block; margin-top: 8px; color: var(--muted); font-size: .78em; }
.aide-lien { color: #2563eb; text-decoration: underline; }

.aide-encadre { border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; }
.aide-encadre > strong { display: block; margin-bottom: 4px; }
.aide-encadre p { margin: 0; }
.aide-alerte { background: var(--danger-light); border: 1px solid #f5b5b8; }

.aide-points { margin: 0; padding-left: 20px; }
.aide-points li { margin-bottom: 8px; }
.aide-faq { border-top: 1px solid var(--border); padding: 10px 0; }
.aide-faq:first-of-type { border-top: 0; }
.aide-faq summary { cursor: pointer; font-weight: 700; }
.aide-faq p { margin: 8px 0 0; color: #374151; }
.aide-pied { max-width: 1000px; margin: 0 auto; padding: 10px 16px 40px; text-align: center; color: var(--muted); font-size: .9em; }
.aide-pied a { color: var(--ink); font-weight: 600; }
.aide-autres a { margin: 0 6px; white-space: nowrap; }

@media (max-width: 760px) {
    .aide-etape { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; }
    .aide-etape-figure { max-width: 360px; margin: 0 auto; width: 100%; }
    .aide-intro, .aide-bloc { padding: 18px 16px; }
    .aide-entete h1 { font-size: 1.4em; }
}
@media print {
    .aide-page { background: #fff; font-size: 12px; }
    .aide-entete { background: none; color: var(--ink); padding: 0 0 8px; border-bottom: 2px solid var(--ink); }
    .aide-entete h1 { color: var(--ink); }
    .aide-imprimer, .aide-onglets, .aide-autres { display: none; }
    .aide-intro, .aide-bloc, .aide-etape { box-shadow: none; border: 1px solid #d1d5db; break-inside: avoid; padding: 12px 14px; }
    .aide-etape { grid-template-columns: minmax(0, 1fr) 240px; }
    .aide-capture { box-shadow: none; }
    .aide-faq p { display: block; }
    .aide-pastille, .aide-legende b, .aide-numero, .aide-resume li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* ===== Manuel d'administration (admin/manuel.php) — complète les styles .aide-* ci-dessus ===== */
.aide-manuel { font-size: 15px; line-height: 1.55; }
.aide-manuel h2 { margin: 0 0 12px; font-size: 1.25em; }
.aide-phase { display: flex; align-items: flex-start; gap: 12px; margin: 38px 0 14px; scroll-margin-top: 16px; }
.aide-phase h2 { margin: 2px 0 2px; font-size: 1.5em; }
.aide-phase p { margin: 0; color: var(--muted); max-width: 68ch; }
.aide-phase .aide-numero { width: 36px; height: 36px; font-size: 1.1em; }
.aide-sommaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 16px 0 6px; }
.aide-sommaire a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92em; }
.aide-sommaire a:hover { box-shadow: var(--shadow-md); }
.aide-sommaire b { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8em; display: inline-flex; align-items: center; justify-content: center; }
.aide-etape--large { grid-template-columns: minmax(0, 1fr); }
.aide-etape--large .aide-etape-figure { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.aide-etape--large .aide-figure:only-child { max-width: 800px; }
.aide-etape--large .aide-capture a, .aide-figure > a { display: block; }
.aide-tableau { width: 100%; border-collapse: collapse; font-size: .92em; }
.aide-tableau th { text-align: left; padding: 10px 12px 6px; font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); }
.aide-tableau td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.aide-tableau td:first-child { white-space: nowrap; width: 1%; }
.aide-info { background: #eff6ff; border: 1px solid #bfdbfe; }
.aide-astuce { background: var(--warn-light); border: 1px solid #fcd34d; margin: 10px 0; }
.aide-astuce p { margin: 4px 0 0; }
.aide-encadre p + p { margin-top: 6px; }
@media print {
    .aide-sommaire { display: none; }
    .aide-etape--large .aide-etape-figure { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .aide-etape--large { grid-template-columns: minmax(0, 1fr); }
}
/* ===== Sélection multiple et actions groupées (bénévoles) ===== */
.col-case { width: 34px; text-align: center; }
.col-case input { width: 17px; height: 17px; cursor: pointer; }
.table tr.ligne-selectionnee td { background: #fff7e6; }
.barre-groupe { position: sticky; bottom: 14px; z-index: 30; margin: 14px 0 0; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); }
.barre-groupe[hidden] { display: none; }
.barre-groupe-titre { display: flex; align-items: center; gap: 12px; }
.barre-groupe .btn-lien { background: none; border: none; color: #d1d5db; text-decoration: underline; cursor: pointer; padding: 0; font-size: .85em; }
.barre-groupe-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.barre-groupe-affecter { display: inline-flex; gap: 6px; align-items: center; }
.barre-groupe-affecter select { max-width: 260px; padding: 6px 8px; border-radius: 8px; }
.barre-groupe .btn-secondary { background: #fff; color: var(--ink); }
/* ===== Import / export des POI d'un GPX ===== */
.poi-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; font-size: .9em; }
.poi-case { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.table tr.poi-existe td { background: #f9fafb; color: var(--muted); }
.export-options { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-start; }
.export-cases { display: grid; gap: 6px; font-size: .9em; }
.export-cases label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
/* =====================================================================================================
   Thème 2026 (v2) : rouge / blanc / noir — d'après les maquettes « mockup_portail_benevoles_v2_fidele » (admin)
   et « mockup_benevole_mobile » (fiche bénévole). Ce bloc surcharge les variables et les composants communs
   ci-dessus ; pour revenir à l'ancien rendu, il suffit de le supprimer (rien d'autre n'en dépend).
   ===================================================================================================== */
:root {
    --red: #cf152d; --red-dark: #a80f23; --black: #111214; --soft: #f4f5f7;
    --primary: #cf152d; --primary-dark: #a80f23; --primary-light: #fdecef;
    --danger: #b4141b; --danger-light: #fde9ec;
    --ok: #16845b; --ok-light: #e6f6ef;
    --warn: #a76400; --warn-light: #fff2da;
    --ink: #17181b; --text: #17181b; --muted: #68707d;
    --bg: #f4f5f7; --border: #e3e5e9;
    --radius: 14px; --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,0.04);
    --shadow-md: 0 10px 28px rgba(16,24,40,0.07);
    --shadow-lg: 0 18px 45px rgba(16,24,40,0.14);
}
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); }
h1 { font-size: 1.7rem; font-weight: 850; letter-spacing: -0.03em; }
h2 { font-weight: 800; letter-spacing: -0.01em; }
.page-subtitle { max-width: 760px; }

/* Barre latérale noire : repère actif blanc, icône rouge */
.sidebar { background: var(--black); box-shadow: none; padding: 18px 0; }
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 5px 20px 20px; margin-bottom: 4px; border-bottom: 1px solid #2b2d31; font-size: 0.95rem; font-weight: 800; line-height: 1.15; }
.sidebar .brandmark { flex: none; width: 37px; height: 37px; border-radius: 9px; background: var(--red); display: grid; place-items: center; font-weight: 900; font-size: 17px; }
.sidebar .brand > span:last-child > span { white-space: nowrap; font-size: 0.92rem; }
.sidebar .brand small { display: block; margin-top: 3px; color: #9da3ad; font-weight: 500; font-size: 0.78rem; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: #777e89; font-weight: 800; padding: 16px 24px 6px; }
.sidebar-nav { padding: 2px 12px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; color: #c4c8cf; border-radius: 8px; font-size: 0.88rem; font-weight: 620; padding: 10px; margin: 2px 0; }
.sidebar-nav a .ico { width: 18px; text-align: center; flex: none; font-size: 15px; line-height: 1; }
.sidebar-nav a:hover { background: #212328; color: #fff; }
.sidebar-nav a.active { background: #fff; color: #161719; font-weight: 800; box-shadow: none; }
.sidebar-nav a.active .ico { color: var(--red); }
.sidebar-event { margin: 10px 12px 4px; padding: 10px; border: 1px solid #2b2d31; border-radius: 10px; background: #1d1f22; }
.sidebar-event-name { font-weight: 800; }
.sidebar-footer { border-top: 1px solid #26282d; margin: 0 8px; padding: 14px 10px 0; color: #999da5; font-size: 0.8rem; }
.sidebar-footer strong { display: block; color: #e5e7eb; font-weight: 700; margin-bottom: 2px; }
.sidebar-footer .lien-deconnexion { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; color: #9ca3af; font-size: 0.85em; cursor: pointer; font-weight: 400; width: auto; }
.sidebar-footer .lien-deconnexion:hover { color: #fff; background: none; box-shadow: none; transform: none; }
.materiel-barre { background: var(--black); }
.materiel-barre nav a.active { background: #fff; color: var(--black); box-shadow: inset 0 -3px 0 var(--red); }

/* Barre du haut : fil d'Ariane + raccourcis */
.content { padding: 0 30px 50px; }
.topbar { position: sticky; top: 0; z-index: 1100; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; margin: 0 -30px 26px; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-crumb { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumb b { color: var(--ink); font-weight: 750; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar-actions a { text-decoration: none; }
.topbar-user { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #18191c; color: #fff; font-size: 12px; font-weight: 800; }
.btn-lien { display: inline-block; text-decoration: none; text-align: center; padding: 9px 13px; border-radius: 8px; font-weight: 750; font-size: 0.875rem; }

/* Cartes et indicateurs */
.card, .table-wrap, .acces-card { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.stat { border-left: 0; padding: 16px 18px; }
.stat strong { font-weight: 850; letter-spacing: -0.04em; font-size: 1.7rem; }
.stat span { font-weight: 600; color: var(--muted); font-size: 0.82rem; }
.stat-live strong { color: #3067b4; }
.stat-warn strong { color: var(--warn); }
.stat-ok strong { color: var(--ok); }
.stat-danger strong { color: var(--danger); }
.evenement-tuile { border-left-color: var(--red); }
.acces-card--anthracite { --accent: var(--black); --accent-light: #eceef0; }

/* Boutons : action principale rouge, secondaire blanche, destructive en contour rouge — à plat, 8 px */
button { border-radius: 8px; font-weight: 750; font-size: 0.875rem; background: var(--red); box-shadow: none; }
button:hover { background: var(--red-dark); box-shadow: none; }
.btn-sm { box-shadow: none; }
.btn-secondary { background: #fff; color: #292b2f; border: 1px solid #d7dae0; box-shadow: none; }
.btn-secondary:hover { background: var(--soft); box-shadow: none; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #efb7bb; box-shadow: none; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: none; }
.btn-checkin { background: var(--ok); box-shadow: none; }
.btn-checkin:hover { background: #0f6a4b; }
.btn-urgence-col:hover, .btn-panel-call:hover, .btn-motif:hover { background: #8f0f15; }
.btn-urgence-col, .btn-panel-call, .btn-motif { background: var(--danger); }
.btn-urgence-col.actif { background: #6d0b10; }
.tab-sidebar { background: none; box-shadow: none; }
.tab-sidebar:hover { background: none; box-shadow: none; }

/* Champs */
input, select, textarea { border-radius: 8px; border-color: #d8dbe0; }
button { border-color: transparent; }
.btn-secondary { border-color: #d7dae0; }
.btn-danger { border-color: #efb7bb; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(207,21,45,0.12); }

/* Tableaux et pastilles */
.table th { font-size: 11px; letter-spacing: 0.05em; color: #7b828d; background: #fff; }
.table td { border-bottom-color: #eef0f2; }
.table tr:hover:not(:has(th)) { background: var(--soft); }
.badge-present { background: #e9f0fb; color: #285b9a; }
.badge { padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.flash-ok, .flash-warn { border-radius: 10px; }

.recruit-page { background: linear-gradient(180deg, #fdecef, var(--bg) 240px); }
.login-box { box-shadow: var(--shadow-md); border: 1px solid var(--border); border-radius: var(--radius); }

/* =====================================================================================================
   Application bénévole (fiche.php) — carte-mission, barre d'en-tête et trois onglets en bas d'écran.
   Tout est limité à body.fiche-app : les autres pages publiques (carte, secours, matériel) ne changent pas.
   ===================================================================================================== */
body.fiche-app { background: var(--bg); padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.fiche-app .container { max-width: 560px; padding: 13px 13px 20px; }
.fiche-app .app-bar { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--border); padding: 15px max(17px, calc((100% - 560px) / 2 + 17px)); }
.fiche-app .app-bar .eyebrow { font-size: 10px; text-transform: uppercase; color: var(--red); font-weight: 900; letter-spacing: 0.08em; }
.fiche-app .app-bar h1 { font-size: 23px; margin: 4px 0 2px; letter-spacing: -0.03em; }
.fiche-app .app-bar p { font-size: 12px; color: var(--muted); margin: 0; }
.onglets-actifs .ecran { display: none; }
.onglets-actifs .ecran.actif { display: block; }

.fiche-app .fiche-evenement-actif { background: #17181b; color: #fff; border-radius: 14px; padding: 14px 15px; margin: 0 0 11px; }
.fiche-app .fiche-evenement-actif h2 { font-size: 16px; color: #fff; margin: 0; }
.fiche-app .fiche-evenement-actif p { color: #b9bdc4; margin: 3px 0 0; font-size: 13px; }
.fiche-app .fiche-evenement-switch { margin-bottom: 11px; font-size: 12px; }
.fiche-app .card { border-radius: 15px; border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0,0,0,0.035); padding: 13px; margin-bottom: 11px; }
.fiche-app .feedback-attente { background: #fff8e9; border-color: #f0d7a6; box-shadow: none; font-size: 12px; }
.fiche-app summary { cursor: pointer; font-weight: 800; }

/* Carte-mission */
.fiche-app .poste-card, .fiche-app .feedback-card { scroll-margin-top: 110px; }
.fiche-app .poste-card { padding: 0; border-left: 1px solid var(--border); overflow: hidden; margin-bottom: 12px; }
.fiche-app .poste-card > *:not(.mission-head) { margin-left: 14px; margin-right: 14px; }
.fiche-app .poste-card > :last-child { margin-bottom: 14px; }
.fiche-app .mission-head { padding: 14px 14px 11px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.fiche-app .mission-head .categorie-pill { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 850; padding: 4px 9px; box-shadow: none; }
.fiche-app .mission-head h3 { font-size: 19px; margin: 7px 0 3px; letter-spacing: -0.02em; }
.fiche-app .mission-head .meta { font-size: 12px; color: var(--muted); }
.fiche-app .mission-head .mission-date-alerte { margin: 8px 0 0; }
.fiche-app .referent { margin-top: 0; margin-bottom: 12px; padding: 9px 10px; background: #f4f6f8; border-radius: 9px; font-size: 11px; color: var(--ink); }
.fiche-app .urgence-row { gap: 7px; margin-top: 0; margin-bottom: 12px; }
.fiche-app .btn-urgence-col { background: #fff3f4; color: #a61226; border: 1px solid #edc1c7; box-shadow: none; border-radius: 10px; padding: 9px 3px; font-size: 1.1em; }
.fiche-app .btn-urgence-col span { font-size: 0.5em; font-weight: 850; }
.fiche-app .btn-urgence-col:hover { background: #ffe6e8; }
.fiche-app .btn-urgence-col.actif { background: #a61226; color: #fff; box-shadow: none; }
.fiche-app .poste-card > p, .fiche-app .poste-card li { font-size: 13px; line-height: 1.45; }
.fiche-app .poste-card > p { margin-top: 0; margin-bottom: 10px; }
.fiche-app .poste-card ul { margin: 4px 14px 10px; padding-left: 18px; }
.fiche-app .poste-card > p:has(> strong:only-child) { margin-bottom: 2px; }
.fiche-app .mission-actions { display: grid; gap: 8px; }
.fiche-app .mission-actions form, .fiche-app .mission-actions .partage-position { margin: 0 !important; }
.fiche-app .mission-actions button, .fiche-app .mission-actions .btn-checkin { width: 100%; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 850; }
.fiche-app .mission-actions .btn-sm { width: auto; padding: 6px 10px; font-size: 12px; }
.fiche-app .toggle-poste { width: auto; border-radius: 10px; }
.fiche-app .mini-map { border-radius: 10px; overflow: hidden; }
.fiche-app .poste-card .badge-couvert { display: inline-flex; }
.fiche-app button, .fiche-app .btn-secondary, .fiche-app .btn-lien { border-radius: 10px; }
.fiche-app .btn-lien { display: block; }

/* Onglets du bas */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid var(--border); padding: 7px 5px calc(8px + env(safe-area-inset-bottom)); }
.onglets[hidden] { display: none; }
.onglets button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; background: transparent; border: 0; box-shadow: none; border-radius: 10px; padding: 6px 2px; color: #656c76; font-size: 10px; font-weight: 600; }
.onglets button:hover { background: var(--soft); box-shadow: none; }
.onglets button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.onglets button.actif { color: var(--red); font-weight: 850; }
.onglets .pastille { position: absolute; top: 3px; left: calc(50% + 7px); width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.onglets-actifs .chat-terrain > summary { display: none; }
.onglets-actifs .chat-terrain { margin-top: 0; }
@media print {
    .fiche-app .app-bar, .onglets { display: none !important; }
    .onglets-actifs .ecran { display: block !important; }
    body.fiche-app { padding-bottom: 0; }
}
/* Formulaire d'inscription : texte de loi, information sur les données, page de confidentialité */
.texte-loi { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--red, #d71920); background: var(--soft, #f5f6f7); border-radius: 0 10px 10px 0; font-size: .85em; color: #4b5057; line-height: 1.5; }
.info-donnees { margin: 14px 0; padding: 10px 14px; background: var(--soft, #f5f6f7); border-radius: 10px; font-size: .85em; color: #4b5057; line-height: 1.5; }
.page-confidentialite h2 { font-size: 1.05rem; margin: 18px 0 6px; }
.page-confidentialite h2:first-child { margin-top: 0; }
.page-confidentialite ul { padding-left: 20px; margin: 6px 0; }
.page-confidentialite li { margin-bottom: 6px; }

/* =====================================================================================================
   Page « Carte & parcours » (admin/carte.php) — carte à gauche, panneau à onglets Parcours / Zones / Postes à droite.
   ===================================================================================================== */
.head-carte { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.head-carte h1 { margin-bottom: 4px; }
.head-carte-actions { display: flex; gap: 8px; flex: none; }
.carte-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) 380px; gap: 15px; align-items: start; }
.carte-cadre { padding: 8px; position: relative; }
.carte-cadre #map { height: 660px; border-radius: 10px; border: 1px solid #d9dde0; }
.carte-panneau { padding: 14px; max-height: 692px; overflow: auto; }
.panel-tabs { display: flex; gap: 4px; background: #f0f2f4; padding: 4px; border-radius: 9px; margin-bottom: 14px; }
.panel-tabs button { flex: 1; background: transparent; color: #59616c; border: 0; box-shadow: none; padding: 7px 8px; border-radius: 6px; font-weight: 700; font-size: .82rem; }
.panel-tabs button:hover { background: rgba(255,255,255,.6); box-shadow: none; }
.panel-tabs button.on { background: #fff; color: #161719; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.panel-tabs .compte { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: #e4e6ea; font-size: .72rem; font-weight: 800; }
.panneau { display: none; }
.panneau.on { display: block; }
.liste-carte { display: grid; gap: 8px; margin-bottom: 12px; }
.carte-bloc { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fff; }
.carte-item { display: flex; align-items: center; gap: 10px; }
.carte-item.carte-bloc { justify-content: space-between; }
.carte-item .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.carte-item-texte { flex: 1; min-width: 0; }
.carte-item-texte strong { display: block; font-size: .92rem; }
.carte-item-texte small { display: block; color: var(--muted); margin-top: 2px; font-size: .78rem; line-height: 1.35; }
.sans-gpx { color: var(--warn); font-weight: 600; }
.zone-ok { color: var(--ok); font-weight: 600; }
.btn-calque { cursor: pointer; border: 0; box-shadow: none; background: #eef0f3; color: #4a5059; padding: 4px 9px; }
.btn-calque.ok { background: #e6f6ef; color: #126943; }
.btn-calque:hover { box-shadow: none; filter: brightness(.96); background: #eef0f3; }
.btn-calque.ok:hover { background: #e6f6ef; }
.carte-poi { margin: 6px 0 0 22px; font-size: .8rem; }
.carte-edition, .carte-ajout { margin-top: 8px; }
.carte-edition summary, .carte-ajout summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--muted); }
.carte-ajout { border: 1px dashed #cfd3d9; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.carte-ajout summary { color: var(--ink); font-size: .88rem; }
.carte-edition .form-vertical, .carte-ajout .form-vertical { margin-top: 10px; gap: 10px; max-width: none; }
.carte-edition label, .carte-ajout label { font-size: .8rem; }
.carte-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.carte-trio label { min-width: 0; }
.requis { color: var(--red); font-weight: 800; }
.carte-outils { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.map-draw-bar { position: absolute; z-index: 1000; top: 18px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 40px); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; background: rgba(255,255,255,.97); border: 1px solid rgba(0,0,0,.1); border-radius: 12px; box-shadow: var(--shadow-md); }
.map-draw-bar[hidden] { display: none; }
.map-draw-boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.map-legende { position: absolute; z-index: 900; left: 18px; bottom: 18px; max-width: calc(100% - 36px); display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; background: rgba(255,255,255,.96); border: 1px solid rgba(0,0,0,.08); border-radius: 10px; box-shadow: var(--shadow-md); font-size: 11px; font-weight: 700; }
.map-legende-item { display: inline-flex; align-items: center; gap: 6px; }
.map-legende .trait { display: inline-block; width: 22px; height: 4px; border-radius: 99px; }
.map-legende .aplat { display: inline-block; width: 12px; height: 12px; border-radius: 3px; opacity: .6; }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.15); }
@media (max-width: 1100px) {
    .carte-layout { grid-template-columns: 1fr; }
    .carte-panneau { max-height: none; }
    .carte-cadre #map { height: 480px; }
    .head-carte { flex-direction: column; }
}

/* =====================================================================================================
   Carte interactive publique (carte_publique.php) — d'après « mockup_carte_benevoles_fidele_v2 » :
   panneau latéral blanc (marque, onglets noirs, recherche, liste à pastilles) et carte plein écran.
   ===================================================================================================== */
body.cp-body { margin: 0; overflow: hidden; background: #fff; }
.cp-app { height: 100vh; display: grid; grid-template-columns: 320px minmax(0, 1fr); overflow: hidden; }
.cp-sidebar { height: 100%; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; z-index: 1100; }
.cp-brand { display: flex; align-items: center; gap: 11px; padding: 19px 18px 15px; border-bottom: 1px solid var(--border); }
.cp-brandmark { flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 900; box-shadow: 0 5px 16px rgba(207,21,45,.22); }
.cp-brand h1 { font-size: 16px; line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -.2px; }
.cp-brand p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.cp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 12px 0; }
.cp-tab { height: 42px; border: 0; border-radius: 10px; background: transparent; color: #6a6f76; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: none; transition: .18s; }
.cp-tab:hover { background: #f7f7f8; box-shadow: none; }
.cp-tab.active { background: #111; color: #fff; }
.cp-panel { display: none; min-height: 0; flex: 1; overflow: auto; }
.cp-panel.active { display: flex; flex-direction: column; }
.cp-search { position: sticky; top: 0; z-index: 2; padding: 12px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.cp-search input { width: 100%; height: 42px; border: 1px solid #dfe2e6; border-radius: 10px; padding: 0 12px; background: #fafafa; font-size: 14px; }
.cp-search input:focus { background: #fff; }
.cp-section { padding: 14px 16px 7px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 800; color: #999; }
.cp-list { padding: 4px 8px 14px; }
.cp-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 10px; margin: 2px 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; box-shadow: none; font-weight: 400; transition: .15s; }
.cp-item:hover { background: #f6f6f7; box-shadow: none; }
.cp-item.actif { background: #fff1f1; box-shadow: inset 3px 0 0 var(--red); }
.cp-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #ededee; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #353535; }
.cp-mission-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: #171717; color: #fff; display: grid; place-items: center; font-size: 16px; }
.cp-item-main { min-width: 0; flex: 1; }
.cp-item-title { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-item-sub { display: block; margin-top: 3px; color: #7b7f84; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-chev { color: #bbb; font-size: 16px; }
.cp-vide { padding: 14px; color: var(--muted); font-size: 13px; }
.cp-map { position: relative; min-width: 0; height: 100%; }
.cp-map #map { height: 100%; width: 100%; background: #e9ecef; }
.cp-head { position: absolute; z-index: 900; top: 16px; left: 64px; right: 64px; display: flex; pointer-events: none; }
.cp-pill { pointer-events: auto; background: rgba(255,255,255,.96); border: 1px solid rgba(0,0,0,.08); box-shadow: var(--shadow-md); border-radius: 14px; padding: 11px 13px; font-size: 13px; line-height: 1.35; }
.cp-pill span { font-size: 11px; color: var(--muted); }
.cp-legend { position: absolute; z-index: 900; left: 16px; bottom: 16px; max-width: calc(100% - 32px); display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 12px; background: rgba(255,255,255,.96); border: 1px solid rgba(0,0,0,.08); box-shadow: var(--shadow-md); border-radius: 12px; }
.cp-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; }
.cp-line { display: inline-block; width: 22px; height: 4px; border-radius: 99px; }
.cp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.cp-map .popup-poste { min-width: 230px; font-size: 14px; }
.cp-map .popup-titre { font-size: 1.1em; font-weight: 900; }
.cp-map .leaflet-popup-content { margin: 14px 16px; }
@media (max-width: 760px) {
    .cp-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .cp-sidebar { height: auto; max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--border); }
    .cp-brand { padding: 12px 14px 9px; }
    .cp-brandmark { width: 32px; height: 32px; }
    .cp-brand h1 { font-size: 14px; }
    .cp-brand p { font-size: 11px; }
    .cp-tabs { padding: 7px 10px 0; }
    .cp-tab { height: 38px; }
    .cp-panel { max-height: 26vh; }
    .cp-search { padding: 9px 10px; }
    .cp-search input { height: 38px; }
    .cp-item { padding: 8px; }
    .cp-avatar, .cp-mission-icon { width: 32px; height: 32px; }
    .cp-map { min-height: 58vh; }
    .cp-head { top: 10px; left: 10px; right: 10px; }
    .cp-legend { left: 10px; right: 10px; bottom: 10px; gap: 8px; }
    .cp-legend-item { font-size: 10px; }
}

/* Fiche bénévole : message important épinglé et signalement d'empêchement */
.epingle { border-radius: 14px; padding: 12px 14px; margin: 0 0 11px; border: 1px solid #f0d7a6; background: #fff8e9; color: #5b3b00; }
.epingle[hidden] { display: none; }
.epingle strong { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.epingle p { margin: 6px 0 4px; font-size: 14px; line-height: 1.45; color: inherit; font-weight: 600; }
.epingle small { color: inherit; opacity: .7; font-size: 11px; }
.epingle-alerte { background: #fde9ec; border-color: #efb7bb; color: #8f0f15; }
.fiche-app .empechement { margin-top: 2px; }
.empechement-etat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; margin-bottom: 8px; border-radius: 10px; background: #fff2da; color: #6b4700; font-size: 12px; font-weight: 700; }
.empechement-etat form { margin: 0 !important; flex: none; }
.empechement-form summary { cursor: pointer; font-size: 12px; font-weight: 750; color: var(--muted); padding: 4px 0; }
.form-empechement { display: grid; gap: 9px; margin-top: 8px; padding: 12px; border: 1px dashed #d3d6db; border-radius: 10px; }
.form-empechement .choix { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.form-empechement .choix input { width: auto; }
.form-empechement .emp-delai { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-empechement .emp-delai select { width: auto; }
.form-empechement button { width: 100%; }

/* Scan du badge (distribution / retour de matériel) */
.scan-badge { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.scan-badge button { padding: 12px 18px; font-size: 1rem; }
.scan-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(17,18,20,.86); display: grid; place-items: center; padding: 14px; }
.scan-overlay[hidden] { display: none; }
.scan-boite { width: min(480px, 100%); background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow-lg); }
.scan-entete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.scan-video-cadre { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; }
.scan-video-cadre video { width: 100%; height: 100%; object-fit: cover; }
.scan-viseur { position: absolute; inset: 18%; border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.scan-message { margin: 10px 2px 2px; font-size: .9rem; color: var(--ink); min-height: 2.6em; }

/* Guide d'aide : vidéo de présentation */
.aide-video { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow-md); }
.aide-video h2 { margin: 0 0 10px; font-size: 1.1rem; }
.aide-video video { width: 100%; max-height: 70vh; border-radius: 10px; background: #111214; }

/* Fiche secours : panneau latéral repliable (flèche) */
.sec-app { --sec-w: 320px; position: relative; display: flex; height: 100vh; width: 100%; overflow: hidden; }
.sec-panneau { width: var(--sec-w); height: 100vh; flex: none; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; transition: margin-left .25s ease, transform .25s ease; z-index: 1100; }
.sec-carte { flex: 1; height: 100vh; position: relative; min-width: 0; }
.sec-app.replie .sec-panneau { margin-left: calc(-1 * var(--sec-w)); }
.sec-toggle { position: absolute; top: 50%; left: var(--sec-w); transform: translateY(-50%); z-index: 1200; width: 30px; height: 64px; padding: 0; display: grid; place-items: center; background: #fff; color: var(--ink); border: 1px solid var(--border); border-left: 0; border-radius: 0 12px 12px 0; box-shadow: 4px 2px 12px rgba(0,0,0,.18); transition: left .25s ease; font-size: 1.6rem; line-height: 1; }
.sec-toggle:hover { background: var(--soft); box-shadow: 4px 2px 12px rgba(0,0,0,.18); }
.sec-app.replie .sec-toggle { left: 0; }
.sec-pastille { position: absolute; top: 6px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.sec-pastille[hidden] { display: none; }
.sec-panneau .appel-carte-item[data-lat] { cursor: pointer; }
@media (max-width: 800px) {
    .sec-app { --sec-w: min(330px, 86vw); }
    .sec-panneau { position: absolute; left: 0; top: 0; box-shadow: 6px 0 24px rgba(0,0,0,.25); }
    .sec-app.replie .sec-panneau { margin-left: 0; transform: translateX(-100%); box-shadow: none; }
}
/* ---------- Logo de l'épreuve : petit, discret, dans un coin ---------- */
.logo-evt { display: block; object-fit: contain; max-width: 100%; }
.app-bar, .recruit-hero, .doc-export, .badge-card { position: relative; }
.logo-evt-coin { position: absolute; top: 12px; right: 12px; max-height: 40px; max-width: 86px; background: #fff; padding: 3px 7px; border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,.18); z-index: 2; }
.app-bar:has(.logo-evt-coin) { padding-right: 110px; }
.logo-evt-coin-clair { float: right; max-height: 38px; max-width: 80px; margin: 0 0 4px 10px; }
.logo-evt-marque { flex: none; height: 36px; width: auto; max-width: 64px; }
.logo-evt-centre { max-height: 56px; max-width: 150px; margin: 0 auto 12px; }
.logo-evt-lateral { max-height: 34px; max-width: 130px; margin-bottom: 8px; background: #fff; padding: 3px 7px; border-radius: 6px; }
.logo-evt-barre { max-height: 30px; max-width: 90px; background: #fff; padding: 2px 6px; border-radius: 6px; }
.logo-evt-cadre { display: inline-block; padding: 10px 14px; margin-bottom: 8px; border: 1px dashed var(--border); border-radius: 10px; background: #fff; }
.logo-evt-apercu { max-height: 80px; max-width: 220px; }
.logo-evt-doc { position: absolute; top: 16px; right: 20px; max-height: 56px; max-width: 120px; }
.logo-evt-badge { position: absolute; bottom: 8px; right: 8px; max-height: 28px; max-width: 64px; }
.badge-logo-bloc { position: absolute; display: flex; align-items: center; justify-content: center; }
.badge-logo-bloc img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 520px) {
    .recruit-hero .logo-evt-coin { position: static; margin: 0 auto 10px; }
}
@media print { .logo-evt-coin, .logo-evt-coin-clair { display: none; } }
/* ---------- Scan des objets du matériel ---------- */
.scan-journal { list-style: none; margin: 4px 0 0; padding: 0; max-height: 150px; overflow: auto; font-size: .88rem; }
.scan-journal li { padding: 4px 0; border-top: 1px solid var(--border); }
.scan-journal li.ok { color: #14532d; }
.scan-journal li.alerte { color: #92400e; }
tr.ligne-scan > td { background: #fff7d6; }
/* ---------- Paramètres : rubriques en onglets ---------- */
.onglets-parametres, .onglets-page { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.onglets-parametres[hidden], .onglet-panneau[hidden] { display: none !important; }
.onglets-parametres button { background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 999px; padding: 8px 15px; font-size: .9rem; font-weight: 700; box-shadow: none; cursor: pointer; }
.onglets-parametres button:hover { border-color: var(--red); }
.onglets-parametres button.actif { background: var(--black); color: #fff; border-color: var(--black); box-shadow: inset 0 -3px 0 var(--red); }
.onglets-parametres a.lien-action { text-decoration: none; background: var(--red); color: #fff; border: 1px solid var(--red); border-radius: 999px; padding: 8px 15px; font-size: .9rem; font-weight: 700; }
.onglets-parametres a.lien-action:hover { filter: brightness(.92); }
.onglets-parametres .separateur { width: 1px; background: var(--border); margin: 2px 6px; }

/* ---------- Calques des cartes de bénévoles ---------- */
.leaflet-control-layers-list { max-height: 55vh; overflow-y: auto; }
.leaflet-control-layers-overlays label span { font-size: .9rem; }

/* ---------- Badges : choix des badges à imprimer ---------- */
.badges-outils { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.badges-outils-ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badges-outils-ligne input[type=search] { width: 240px; }
.b-chip { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 700; color: var(--ink); box-shadow: none; cursor: pointer; }
.b-chip.actif { background: var(--black); color: #fff; border-color: var(--black); }
.badge-case { position: absolute; top: 6px; left: 6px; z-index: 5; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 3px 5px; line-height: 0; cursor: pointer; }
.badge-case input { width: 20px; height: 20px; margin: 0; }
.badge-desel { opacity: .35; }
@media screen { .badge-masque { display: none !important; } }
@media print { .badge-desel { display: none !important; } .badge-case { display: none !important; } }

/* ---------- Photos de terrain ---------- */
.pt-barre { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.pt-bouton { cursor: pointer; padding: 10px 16px; }
.pt-grille { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .pt-grille { grid-template-columns: 1fr; } }
#pt-carte { height: 560px; border-radius: 14px; border: 1px solid var(--border); }
.pt-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; }
.pt-vignette { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 2px solid var(--border); border-radius: 10px; background: #fff; box-shadow: none; font-size: .72rem; color: var(--ink); cursor: pointer; }
.pt-vignette img { width: 100%; height: 66px; object-fit: cover; border-radius: 7px; }
.pt-vignette.actif { border-color: var(--red); }
.pt-cadre { display: block; }
.pt-cadre .photo-annotee-img { width: 100%; height: auto; }
.pt-reglages { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pt-reglage { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; }
.pt-reglage input[type=range] { width: 100%; padding: 0; }
.pt-rattacher select { max-width: 100%; }
.pt-auto { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; margin: 0 0 10px; border: 1px dashed var(--border); border-radius: 12px; background: #f8fafc; max-width: 520px; }
.fleche-poignee.choisie { outline: 3px solid #fff; box-shadow: 0 0 0 5px #111; }
.pt-editeur #photo-canvas { display: block; width: 100%; }
.pt-editeur #photo-img { width: 100%; height: auto; }
.pt-editeur .photo-editor-toolbar { gap: 10px 14px; }
.pt-editeur .photo-editor-save { margin-left: 0; }
.pt-proposition { border-left: 4px solid #f59e0b; }
.pt-proposition-liste { display: flex; gap: 12px; flex-wrap: wrap; }
.pt-proposition-item { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.pt-proposition-item img { width: 160px; height: 110px; object-fit: cover; border-radius: 8px; }

/* Planning : boutons de jour (veille / jour J) et mission posée hors des disponibilités du bénévole */
.jours-planning { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.gantt-bar-horsdispo { outline: 2px solid #dc2626; outline-offset: 1px; }

/* Sélecteur de disponibilités sur frise (formulaire bénévole + fiche admin) */
.dp-carte { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.dp-carte.dp-off { background: #f9fafb; }
.dp-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; margin: 0; }
.dp-tete input { width: auto; margin: 0; }
.dp-besoin { font-size: .8em; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 10px; }
.dp-ligne { margin: 12px 0 6px; }
.dp-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dp-texte { font-weight: 600; }
.dp-piste { position: relative; height: 34px; margin-top: 4px; }
.dp-bande { position: absolute; top: 12px; height: 10px; border-radius: 5px; }
.dp-bande-besoin { background: #bbf7d0; }
.dp-bande-sel { background: var(--primary); opacity: .85; }
.dp-piste input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 34px; margin: 0; padding: 0; border: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.dp-piste input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 34px; }
.dp-piste input[type=range]::-moz-range-track { background: transparent; }
.dp-piste input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 22px; height: 22px; margin-top: 6px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.dp-piste input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); cursor: grab; }
.dp-grad { position: relative; height: 16px; font-size: .7em; color: var(--muted); }
.dp-grad span { position: absolute; transform: translateX(-50%); }
.dp-autre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dp-autre input[type=date] { width: auto; }
.dp-tete { text-align: left; }

/* Échange de postes : petit bouton ⇄ à côté de la croix sur chaque pastille */
.gantt-swap { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); z-index: 10; }
.gantt-swap summary { color: #fff; background: rgba(0,0,0,.55); border: 1px solid #fff; border-radius: 50%; width: 16px; height: 16px; line-height: 14px; text-align: center; font-size: 10px; }
.gantt-swap .gantt-add-form { left: auto; right: 0; }
.gantt-swap .gantt-add-form select { max-width: 240px; }
.gantt-bar-mission .gantt-bar-text { max-width: calc(100% - 38px); }
