:root {
  --fond: #f3f1ec;
  --texte: #1f2a24;
  --inactif: #0b4d2c;       /* vert foncé, comme Color.FromArgb(0,64,0) */
  --actif: #e8a317;         /* tuile d'un bénévole présent */
  --carte: #ffffff;
  --bord: #d9d4c7;
  --rouge: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); }

header { display: flex; align-items: center; gap: 1rem; padding: .5rem 1.25rem; background: var(--inactif); color: var(--texte-inactif, #fff); position: sticky; top: 0; z-index: 5; }
header h1 { margin: 0; font-size: 1.4rem; white-space: nowrap; }
#recherche { flex: 1; max-width: 420px; padding: .6rem .9rem; border-radius: 8px; border: 0; font-size: 1rem; }
.horloge { margin-left: auto; text-align: right; line-height: 1.2; }
#date { font-size: .85rem; opacity: .85; text-transform: capitalize; }
#heure { font-size: 1.6rem; font-variant-numeric: tabular-nums; font-weight: 600; }

main { display: grid; grid-template-columns: 1fr 300px; gap: .75rem; padding: var(--marge, .6rem); }
main.sans-panneau { grid-template-columns: 1fr; }
main.sans-panneau aside { display: none; }
.btn-panneau { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); padding: .45rem .8rem; border-radius: 6px; cursor: pointer; white-space: nowrap; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--espace, 6px); align-content: start; }
.tuile { position: relative; height: var(--h, auto); min-height: var(--h, 72px); padding: .3em 1.1em .3em .5em;
  border: var(--bordure, 0px) solid rgba(0,0,0,.35); border-radius: var(--rayon, 8px);
  background: var(--inactif); color: var(--texte-inactif, #fff); font-size: var(--fs, 1.05rem); line-height: 1.15; text-align: left; cursor: pointer;
  font-family: var(--police-tuile, inherit); font-weight: var(--poids-tuile, 400);
  overflow: hidden; transition: transform .08s, background .2s; }
.tuile .nom { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tuile:hover { transform: translateY(-1px); filter: brightness(1.1); }
.tuile:active { transform: scale(.98); }
.tuile.present { background: var(--actif); color: var(--texte-actif, #1f1600); font-weight: 700; }
.tuile .heure { position: absolute; right: .35em; bottom: .25em; font-size: .85em; background: rgba(255,255,255,.7); color: #1f1600; padding: 0 .4rem; border-radius: 4px; }
.tuile .cadenas { position: absolute; right: .35em; top: .2em; font-size: .65em; opacity: .7; }

aside { background: var(--carte); color: #1f2a24; border: 1px solid var(--bord); border-radius: 10px; padding: 1rem; align-self: start; position: sticky; top: 70px; max-height: calc(100vh - 85px); overflow: auto; }
aside h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.compteurs { margin: 0 0 .75rem; color: #555; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .35rem .3rem; border-bottom: 1px solid #eee; text-align: left; }
tr.encours td { background: #fff6e0; font-weight: 600; }
.lien-admin { display: inline-block; margin-top: 1rem; font-size: .85rem; color: #666; }

dialog { border: 0; border-radius: 12px; padding: 1.5rem; min-width: 320px; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h3 { margin-top: 0; }
dialog label { display: block; margin: .5rem 0 1rem; }
dialog input { display: block; width: 100%; margin-top: .3rem; padding: .6rem; font-size: 1.1rem; }
.actions { display: flex; justify-content: flex-end; gap: .5rem; }
button.principal, .btn { background: var(--inactif); color: #fff; border: 0; padding: .55rem 1rem; border-radius: 6px; cursor: pointer; }
.actions button:not(.principal) { padding: .55rem 1rem; border-radius: 6px; border: 1px solid var(--bord); background: #fff; cursor: pointer; }

#toast { position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 150%); background: #222; color: #fff; padding: 1rem 1.5rem;
  border-radius: 10px; font-size: 1.15rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .25s; max-width: 90vw; text-align: center; }
#toast.visible { transform: translate(-50%, 0); }
#toast small { display: block; font-size: .85rem; opacity: .8; margin-top: .3rem; }
#toast.entree { background: #1b6b3a; }
#toast.sortie { background: #8a5a00; }
#toast.annule { background: #555; }
#toast.erreur { background: var(--rouge); }

/* Admin */
.admin { max-width: 1360px; margin: 0 auto; padding: 1rem; }
.admin nav:not(.menu-admin) a { margin-right: 1rem; }
.admin form.ligne { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: 1rem 0; }
.admin form.ligne label { display: flex; flex-direction: column; font-size: .85rem; }
.admin input, .admin select { padding: .4rem; }
.admin table { background: #fff; }
.msg { padding: .6rem 1rem; background: #e6f4ea; border-radius: 6px; }
.msg.err { background: #fdecea; }

/* Historique (Gestion des bénévoles) */
.admin.large { max-width: none; }
.histo { display: grid; grid-template-columns: 250px 1fr; gap: 1rem; align-items: start; margin-top: .75rem; }
.filtres { background: #7a3f12; color: #fff; border-radius: 8px; padding: .5rem; position: sticky; top: .5rem; }
.filtres fieldset { border: 1px solid rgba(255,255,255,.45); border-radius: 6px; margin: 0 0 .6rem; padding: .4rem .6rem .6rem; }
.filtres legend { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: 0 .3rem; }
.filtres label { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin: .3rem 0; font-size: .9rem; }
.filtres input[type=date], .filtres select { width: 100%; padding: .3rem; border-radius: 4px; border: 0; }
.filtres label input[type=date] { width: auto; flex: 1; }
.filtres select { margin-bottom: .2rem; }
.btn-filtre { display: block; width: 100%; margin: .3rem 0; padding: .45rem .6rem; background: #fff; color: #222; border: 0; border-radius: 4px;
  text-align: center; text-decoration: none; font-size: .95rem; cursor: pointer; font-family: inherit; }
.btn-filtre:hover { background: #ffe9c7; }
.btn-filtre.actif { background: #e8a317; font-weight: 600; }
.btn-filtre.danger { background: #fdecea; color: #b3261e; }
.filtres form { margin: 0; }
.entete-liste { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.entete-liste h2 { margin: 0; }
details { margin: .5rem 0; }
details summary { cursor: pointer; color: #0b4d2c; font-weight: 600; }
.table-histo { font-size: 1rem; }
.table-histo tr:nth-child(even) td { background: #d8ecfb; }
.table-histo tr.edite td { background: #fff3a0; }
.table-histo td.anomalie { color: #b3261e; font-weight: 600; }
.table-histo a { color: inherit; }
.actions-ligne { white-space: nowrap; }
.actions-ligne form { display: inline; }
.imprime-le { color: #777; font-size: .85rem; }
@media (max-width: 800px) { .histo { grid-template-columns: 1fr; } .filtres { position: static; } }
@media print {
  .no-print, .filtres, details, nav { display: none !important; }
  .histo { display: block; }
  body { background: #fff; }
  .table-histo { font-size: 10pt; }
  .table-histo tr:nth-child(even) td { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Menu du clic droit sur une tuile */
.menu-tuile { position: fixed; display: none; min-width: 230px; background: #fff; border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.3); padding: .3rem 0; z-index: 50; }
.menu-tuile.visible { display: block; }
.menu-tuile .titre { padding: .45rem 1rem; font-weight: 700; border-bottom: 1px solid #eee; }
.menu-tuile a { display: block; padding: .55rem 1rem; color: #1f2a24; text-decoration: none; }
.menu-tuile a:hover { background: #fff3d6; }

/* Fenêtre « Modification des pointages » */
.saisie { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; margin-top: .75rem; }
.panneau-saisie { background: #f5deb3; border: 1px solid #d8bb85; border-radius: 8px; padding: .8rem 1rem; position: sticky; top: .5rem; }
.panneau-saisie h3 { margin: 0 0 .4rem; }
.panneau-saisie label { display: block; margin: .45rem 0; font-size: .9rem; }
.panneau-saisie input[type=date], .panneau-saisie input[type=time], .panneau-saisie input[type=number], .panneau-saisie input:not([type]) { display: block; width: 100%; padding: .4rem; font-size: 1rem; margin-top: .15rem; }
.panneau-saisie .deux { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.panneau-saisie .selection { font-size: .85rem; color: #5a4520; background: #fff8e8; padding: .4rem .5rem; border-radius: 4px; }
.panneau-saisie .boutons { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.panneau-saisie .boutons .btn { flex: 1; }
.btn.danger { background: #b3261e; }
.panneau-saisie fieldset.dup { border: 1px solid #d8bb85; border-radius: 6px; padding: .3rem .6rem .6rem; }
.panneau-saisie label.case { display: flex; gap: .4rem; align-items: center; }
.panneau-saisie .aide { font-size: .85rem; margin: .2rem 0 .5rem; }
.panneau-saisie #btnDup { width: 100%; }
.tableau-saisie { max-height: calc(100vh - 180px); overflow: auto; background: #fff; border-radius: 8px; }
#tablePointages th { position: sticky; top: 0; background: #fff; z-index: 1; }
#tablePointages tr.cliquable { cursor: pointer; }
#tablePointages tr.cliquable:hover td { background: #fff3d6; }
#tablePointages tr.choisi td { background: #1f6fd1 !important; color: #fff; }
.totaux { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: flex-end; padding: .6rem; background: #eef3e6; position: sticky; bottom: 0; }
.liens-bas { padding: 0 .6rem .6rem; }
@media (max-width: 800px) { .saisie { grid-template-columns: 1fr; } .panneau-saisie { position: static; } }

/* Fenêtre de modification de l'heure d'entrée */
.entree-nom { font-size: 1.15rem; display: flex; justify-content: space-between; gap: 1rem; }
.entree-actuelle { color: #555; font-size: 1rem; }
button.principal.orange { background: var(--actif); color: #1f1600; font-weight: 700; }
.erreur-dlg { color: var(--rouge); min-height: 1.2em; margin: 0 0 .5rem; }

button.principal.bleu { background: #0f7c80; font-weight: 700; }

/* Import des bénévoles */
.import-grille { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; align-items: start; }
.carte-import { background: #fff8d8; border: 1px solid #e6d79a; border-radius: 8px; padding: .8rem 1.1rem; margin-bottom: 1rem; }
.carte-import h3 { margin: .3rem 0 .5rem; }
.carte-import label.choix { display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0; font-size: .95rem; }
.carte-import label.choix input { margin-top: .25rem; }
.carte-import .btn { display: inline-block; text-decoration: none; margin: .3rem .3rem .3rem 0; }
.btn.secondaire { background: #fff; color: #0b4d2c; border: 1px solid #0b4d2c; }
.aide-colonnes ul { margin: .3rem 0 .6rem 1.2rem; padding: 0; }
.aide { font-size: .85rem; color: #666; }
.resume-import { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.pastille { padding: .3rem .7rem; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.pastille.vert { background: #d7f0dd; color: #14532d; }
.pastille.bleu { background: #dbeafe; color: #1e3a8a; }
.pastille.gris { background: #eee; color: #444; }
.pastille.orange { background: #ffe3b3; color: #8a4b00; }
.pastille.rouge { background: #fdecea; color: #b3261e; }
.liste-noms { line-height: 1.6; }
@media (max-width: 900px) { .import-grille { grid-template-columns: 1fr; } }

/* Plusieurs pointeuses */
.logo-entete { height: 40px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.entete-admin { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.entete-admin h1 { margin: .5em 0; }
.choix-pointeuses { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 1rem; background: #efe48f; }
.choix-pointeuses h1 { margin: 0; color: #0b4d2c; }
.cartes-pointeuses { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.carte-pointeuse { display: flex; flex-direction: column; align-items: center; gap: .6rem; width: 240px; padding: 1.2rem; background: #fff; border-radius: 12px;
  text-decoration: none; color: #1f2a24; box-shadow: 0 4px 14px rgba(0,0,0,.12); transition: transform .1s; }
.carte-pointeuse:hover { transform: translateY(-3px); }
.carte-pointeuse img { max-width: 180px; max-height: 140px; object-fit: contain; }
.carte-pointeuse strong { font-size: 1.3rem; }
.carte-pointeuse span { font-size: .9rem; color: #555; text-align: center; }
.carte-pointeuse.courante { outline: 3px solid #0b4d2c; }

/* Écran de démarrage (LoginForm1) */
.demarrage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: #2b2b2b; }
.fenetre-demarrage { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; background: #efe48f; border-radius: 12px; padding: 1.5rem; width: min(680px, 100%);
  box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.fenetre-demarrage .logo-zone { background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; min-height: 240px; overflow: hidden; }
.fenetre-demarrage .logo-zone img { max-width: 100%; max-height: 260px; object-fit: contain; }
.fenetre-demarrage .logo-zone .sans-logo { font-size: 4rem; }
.fenetre-demarrage h1 { font-size: 1.1rem; margin: .2rem 0 .8rem; color: #222; }
.fenetre-demarrage .ligne-choix { display: flex; gap: .5rem; }
.fenetre-demarrage select, .fenetre-demarrage input[type=password] { flex: 1; padding: .6rem; font-size: 1.1rem; border-radius: 6px; border: 1px solid #b9ad55; width: 100%; }
.fenetre-demarrage .btn-ok { background: #0f7c80; color: #fff; font-weight: 700; font-size: 1.1rem; border: 0; border-radius: 6px; padding: .6rem 1.2rem; cursor: pointer; }
.fenetre-demarrage label { display: block; margin-top: 1rem; font-weight: 600; }
.fenetre-demarrage .descriptif { margin-top: 1rem; color: #4a4520; white-space: pre-line; }
.fenetre-demarrage .erreur { color: #b3261e; font-weight: 600; margin-top: .6rem; }
.fenetre-demarrage .bas { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: .85rem; color: #5c5630; }
.fenetre-demarrage .bas a { color: #0b4d2c; }
@media (max-width: 640px) { .fenetre-demarrage { grid-template-columns: 1fr; } .fenetre-demarrage .logo-zone { min-height: 140px; } }
.zone-danger { margin-top: 2rem; border: 2px solid #b3261e; border-radius: 8px; padding: .8rem 1.1rem; background: #fdf3f2; }
.zone-danger h3 { margin-top: 0; color: #b3261e; }
.zone-danger input { padding: .4rem; }

/* Rapport des heures sur l'écran de pointage */
.dlg-rapport { width: min(900px, 95vw); }
.dlg-rapport .rap-entete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.dlg-rapport .rap-entete label { margin: 0; display: flex; align-items: center; gap: .4rem; }
.dlg-rapport .rap-entete select { padding: .3rem; font-size: 1rem; }
.dlg-rapport .rap-totaux { font-size: 1.1rem; }
.dlg-rapport table { margin-bottom: .8rem; }
.dlg-rapport .rap-annees tr.choisie td { background: #fff3d6; font-weight: 600; }
.dlg-rapport .rap-liste { max-height: 45vh; overflow: auto; border: 1px solid #eee; margin-bottom: .8rem; }
.dlg-rapport .rap-liste th { position: sticky; top: 0; background: #fff; }
.dlg-rapport .actions button:not(.principal) { padding: .55rem 1rem; border-radius: 6px; border: 1px solid var(--bord); background: #fff; cursor: pointer; }

/* Menu de l'admin avec icônes */
.menu-admin { display: flex; flex-wrap: wrap; gap: .15rem; margin: .4rem 0 1rem; padding: .4rem; background: #fff; border: 1px solid var(--bord); border-radius: 10px; }
.menu-admin a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .6rem; white-space: nowrap; border-radius: 7px; color: #1f2a24; text-decoration: none;
  font-size: .92rem; transition: background .15s; }
.menu-admin a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-admin a:hover { background: color-mix(in srgb, var(--c) 10%, #fff); }
.menu-admin a.actif { background: var(--c); color: #fff; font-weight: 600; }
.menu-admin a.actif svg { stroke: #fff; }
.menu-admin a.deconnexion { margin-left: auto; }
@media (max-width: 700px) { .menu-admin a { font-size: .85rem; padding: .4rem .55rem; } .menu-admin a.deconnexion { margin-left: 0; } }

/* Options des pointages */
.options-pointages { max-width: 920px; }
.options-pointages h2 { margin: 1.4rem 0 .4rem; }
.options-pointages fieldset { background: #fff; border: 1px solid var(--bord); border-radius: 8px; margin: 0 0 .9rem; padding: .5rem 1rem .8rem; }
.options-pointages legend { font-weight: 700; padding: 0 .4rem; color: #0b4d2c; }
.options-pointages .opt-ligne { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .45rem 0; font-weight: 600; }
.options-pointages .opt-ligne > span:first-child { min-width: 30em; }
.options-pointages input[type=number] { width: 5.5em; padding: .35rem; font-size: 1rem; font-weight: 700; text-align: center; }
.options-pointages input[type=time], .options-pointages select, .options-pointages input[name=nom_pointeuse] { padding: .35rem; font-size: 1rem; }
.options-pointages output { display: inline-block; min-width: 3.5em; padding: .2rem .5rem; background: #f3f1ec; border: 1px solid var(--bord); border-radius: 4px; font-weight: 700; text-align: center; }
.options-pointages .opt-total { color: #777; }
.options-pointages .opt-exemple { margin: .6rem 0 .2rem; }
.options-pointages .aide { font-weight: 400; }
@media (max-width: 800px) { .options-pointages .opt-ligne > span:first-child { min-width: 0; width: 100%; } }

/* Réglage écran : styles des tuiles */
.style-relief .tuile { box-shadow: inset 0 2px 0 rgba(255,255,255,.28), inset 0 -4px 0 rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.3); }
.style-ombre .tuile { box-shadow: 0 4px 10px rgba(0,0,0,.35); }

/* Réglage écran : page Paramètres */
.reglage-ecran { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; align-items: start; }
.reglage-colonnes fieldset { margin-bottom: .8rem; }
.reglage-ecran .opt-ligne > span:first-child { min-width: 13em; }
.reglage-ecran .groupe { display: flex; flex-direction: column; gap: .25rem; }
.reglage-ecran input[type=color] { width: 3.2rem; height: 2rem; padding: 0; border: 1px solid var(--bord); border-radius: 4px; background: none; cursor: pointer; }
.reglage-ecran input[type=range] { width: 160px; }
.reglage-ecran label.radio { font-weight: 400; display: inline-flex; align-items: center; gap: .3rem; margin-right: .6rem; }
.apercu-zone { position: sticky; top: .5rem; }
.apercu-zone .aide { margin: 0 0 .3rem; }
.apercu-ecran { background: var(--fond); color: var(--texte); border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; margin-bottom: .6rem; }
.apercu-entete { background: var(--inactif); color: var(--texte-inactif); padding: .4rem .7rem; font-weight: 700; }
.apercu-tuiles { grid-template-columns: repeat(3, 1fr) !important; padding: var(--marge); }
@media (max-width: 1000px) { .reglage-ecran { grid-template-columns: 1fr; } .apercu-zone { position: static; } }

/* Réglage écran : 3D en dégradé (comme les boutons de pointeuse.exe), formes et alignement */
.style-degrade .tuile {
  background-image: linear-gradient(to bottom,
    rgba(255,255,255,calc(var(--i3d, .5) * .55)) 0%, rgba(255,255,255,calc(var(--i3d, .5) * .12)) 48%,
    rgba(0,0,0,calc(var(--i3d, .5) * .18)) 52%, rgba(0,0,0,calc(var(--i3d, .5) * .6)) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,calc(var(--i3d, .5) * .7)), 0 2px 4px rgba(0,0,0,calc(var(--i3d, .5) * .6));
}
.forme-rectangle .tuile { border-radius: 0; }
.forme-pilule .tuile { border-radius: 999px; padding-left: 1.1em; padding-right: 1.1em; }
.forme-octogone .tuile { border-radius: 0;
  clip-path: polygon(var(--rayon) 0, calc(100% - var(--rayon)) 0, 100% var(--rayon), 100% calc(100% - var(--rayon)),
    calc(100% - var(--rayon)) 100%, var(--rayon) 100%, 0 calc(100% - var(--rayon)), 0 var(--rayon)); }
.align-centre .tuile { display: flex; align-items: center; justify-content: center; text-align: center; padding-left: 1.1em; }
.align-centre .tuile .nom { text-align: center; }
.forme-pilule .tuile .cadenas { right: .9em; }
.forme-pilule .tuile .heure, .forme-octogone .tuile .heure { right: 1em; }
.boutons-apercu { display: flex; gap: .5rem; flex-wrap: wrap; }
.reglage-ecran .formes { display: grid; grid-template-columns: auto auto; gap: .2rem .8rem; }
/* La pastille de l'heure ne doit pas cacher le nom */
.tuile.present { padding-bottom: 1.25em; }
.align-centre .tuile.present { padding-top: .1em; }

/* Icône de l'application */
.icone-appli { width: 40px; height: 40px; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.case-ligne { display: flex !important; flex-direction: row !important; align-items: center; gap: .3rem; }
.installation ul { margin: .3rem 0 .6rem 1.2rem; padding: 0; line-height: 1.7; }

/* Messages d'information */
.bandeau-message { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; padding: .55rem 1.25rem; background: #1f6fd1; color: #fff;
  font-size: 1.1rem; line-height: 1.35; white-space: pre-line; }
.bandeau-message[hidden] { display: none; }
.bandeau-message .m-titre { font-weight: 800; }
.bandeau-message .m-titre:empty { display: none; }
.bandeau-message .m-compteur { margin-left: auto; font-size: .8rem; opacity: .75; }
.bandeau-message.align-centre { justify-content: center; text-align: center; }
.bandeau-message.align-droite { justify-content: flex-end; text-align: right; }
.bandeau-message.taille-grand { font-size: 1.4rem; }
.bandeau-message.taille-tres_grand { font-size: 1.9rem; }
#bandeau { position: sticky; top: 58px; z-index: 4; animation: arrivee-message .4s ease-out; }
@keyframes arrivee-message { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dlg-messages { width: min(720px, 94vw); padding: 0; overflow: hidden; }
.dlg-messages .bandeau-message { display: block; padding: 1.4rem 1.6rem; font-size: 1.25rem; }
.dlg-messages .bandeau-message .m-titre { display: block; font-size: 1.4em; margin-bottom: .4rem; }
.dlg-messages .bandeau-message.taille-grand { font-size: 1.6rem; }
.dlg-messages .bandeau-message.taille-tres_grand { font-size: 2.1rem; }
.dlg-messages .actions { padding: .8rem 1rem; margin: 0; }
.messages-grille { display: grid; grid-template-columns: 520px 1fr; gap: 1.2rem; align-items: start; }
.carte-message { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .8rem 1.1rem; position: sticky; top: .5rem; }
.carte-message h3 { margin-top: .2rem; }
.carte-message > label { display: block; margin: .5rem 0; font-weight: 600; }
.carte-message > label input, .carte-message textarea { display: block; width: 100%; margin-top: .2rem; padding: .45rem; font-size: 1rem; font-family: inherit; }
.m-ligne { display: grid; grid-template-columns: 8em 1fr; align-items: center; gap: .3rem; margin: .55rem 0; }
.m-ligne > span:first-child { font-weight: 600; }
.m-choix { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; }
.m-ligne label.radio { display: inline-flex; align-items: center; gap: .3rem; }
.pastille-style span { background: var(--f); color: var(--t); padding: .1rem .5rem; border-radius: 4px; font-size: .9rem; }
.message-ligne { background: #fff; border: 1px solid var(--bord); border-radius: 8px; margin-bottom: .6rem; overflow: hidden; }
.bandeau-message.mini { font-size: .95rem; padding: .5rem .8rem; }
.message-infos { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; padding: .45rem .8rem; font-size: .88rem; color: #555; }
.message-infos .actions-ligne { margin-left: auto; }
.pastille.vert { background: #d7f0dd; color: #14532d; }
@media (max-width: 1000px) { .messages-grille { grid-template-columns: 1fr; } .carte-message { position: static; } }

.dlg-messages .pour-benevole { margin: 0; padding: .7rem 1.6rem; background: #f3f1ec; font-weight: 700; font-size: 1.1rem; }
.dlg-messages .pour-benevole:empty { display: none; }
.dlg-messages .bandeau-message + .bandeau-message { border-top: 2px solid rgba(255,255,255,.5); }
.dlg-messages .actions { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.dlg-messages .actions button { font-size: 1.1rem; padding: .6rem 1.4rem; }
.fermeture-auto { color: #777; font-size: .85rem; margin-right: auto; }

/* Sauvegarde */
.sauvegarde-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.carte-import ol { margin: .3rem 0 .6rem 1.2rem; padding: 0; line-height: 1.6; }
.url-secrete { word-break: break-all; }
@media (max-width: 900px) { .sauvegarde-grille { grid-template-columns: 1fr; } }

/* Valorisation / compte emploi des ressources */
.onglets { display: flex; gap: .3rem; border-bottom: 2px solid var(--bord); margin-bottom: 1rem; }
.onglets a { padding: .5rem .9rem; border-radius: 6px 6px 0 0; color: #1f2a24; text-decoration: none; }
.onglets a.actif { background: #0e7490; color: #fff; font-weight: 600; }
.rapport-cer { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 1rem 1.2rem; }
.cer-entete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding-bottom: .7rem; border-bottom: 2px solid #0e7490; margin-bottom: .9rem; }
.cer-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; margin-bottom: .9rem; }
.cer-carte { border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .8rem; background: #f7fbfc; }
.cer-carte h4 { margin: 0 0 .3rem; display: flex; justify-content: space-between; }
.cer-carte h4 span { font-weight: 400; color: #666; font-size: .85rem; }
.cer-carte p { margin: .2rem 0; }
.cer-carte .cer-montant { font-size: 1.5rem; font-weight: 800; color: #0e7490; }
.cer-carte.cerfa { background: #fff8e6; }
.cer-carte.cerfa .cer-montant { color: #8a5a00; }
.cer-total td { background: #eef6f8; font-size: 1rem; }
.table-cer { font-size: .9rem; }
.table-cer td:nth-child(n+3) { text-align: right; }
.table-cer tr.salarie td { color: #777; font-style: italic; }
.valo-grille { display: grid; grid-template-columns: 1fr 420px; gap: 1rem; align-items: start; }
.table-bareme td:nth-child(n+2):not(.actions-ligne) { text-align: right; }
.bareme-champs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; }
.bareme-champs label { display: flex; flex-direction: column; font-size: .88rem; }
.bareme-champs input { padding: .4rem; font-size: 1rem; width: 100%; min-width: 0; box-sizing: border-box; }
.valo-categories { max-width: 760px; }
.valo-categories input[type=number] { width: 6em; padding: .35rem; }
.valo-categories input:not([type]) { padding: .35rem; }
@media (max-width: 1000px) { .valo-grille { grid-template-columns: 1fr; } }
@media print { .onglets { display: none !important; } .rapport-cer { border: 0; padding: 0; } .table-cer { font-size: 8.5pt; } }
.smic-cell { text-align: right; }
.smic-val { display: inline-flex; align-items: center; gap: .2rem; margin-left: .4rem; white-space: nowrap; }
.smic-val small { color: #0e7490; font-weight: 600; }
.smic-val form { display: inline; }
.smic-val button { border: 0; background: none; color: #b42318; cursor: pointer; font-size: 1rem; padding: 0 .15rem; }
.carte-officielle { background: #e8f4f7 !important; border-color: #9fd0dc !important; }
.valo-grille { grid-template-columns: 1fr; }
.valo-grille > div:last-child { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; align-items: start; }
.valo-grille > div:last-child .carte-import { margin: 0; }
.table-bareme tr.groupes th { text-align: center; font-size: .8rem; color: #0e7490; border-bottom: 0; padding-bottom: 0; }
.table-bareme td.sep, .table-bareme tr:not(.groupes) th:nth-child(8) { border-left: 2px solid var(--bord); }
.cer-alerte { color: #b42318; font-size: .85rem; font-weight: 600; }
.cer-manque { background: #fef3f2; border: 1px solid #fecdca; border-radius: 8px; padding: .6rem .9rem; margin-bottom: .9rem; }
.cer-manque summary { cursor: pointer; }
.cer-manque p { margin: .4rem 0 0; line-height: 1.7; }
.table-cer tr.sans-cerfa td:nth-child(10) { color: #b42318; font-weight: 700; }
.carte-danger { background: #fef3f2 !important; border-color: #fecdca !important; }
.carte-danger h3 { color: #b42318; }
.btn.danger { background: #b42318; border-color: #b42318; color: #fff; }
.btn.danger:hover { background: #912018; }
.carte-sqlite { background: #eef6f8 !important; border-color: #9fd0dc !important; }
.carte-sqlite details { margin-top: .5rem; font-size: .9rem; }

/* Raccourcis Admin / Démarrage dans l'en-tête de la pointeuse */
.raccourcis { display: flex; gap: .4rem; }
.btn-icone { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-size: .95rem; }
.btn-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icone:hover, .btn-panneau:hover { background: rgba(255,255,255,.28); }
@media (max-width: 1100px) { .btn-icone span { display: none; } .btn-icone { padding: .45rem .55rem; } }
.btn-panneau { font: inherit; font-size: .95rem; line-height: 1.2; }

/* Rapport des heures */
.rapport-filtres { flex-wrap: wrap; align-items: flex-end; }
.choix-benevole { min-width: 300px; }
.rapport-actions { margin-left: auto; display: flex; gap: .4rem; }
.rapport-heures h2 { margin: .4rem 0 .2rem; }
.rapport-info { margin: .1rem 0; color: #555; }
.rapport-resume { display: flex; gap: .8rem; margin: .8rem 0; flex-wrap: wrap; }
.rapport-resume div { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .5rem 1rem; min-width: 120px; color: #555; }
.rapport-resume span { display: block; font-size: 1.6rem; font-weight: 800; color: #7a3fb0; }
.rapport-resume .en-cours span { color: #c2410c; }
.table-rapport .al-D { text-align: right; } .table-rapport .al-C { text-align: center; }
.table-rapport tr.grise td, .table-rapport tr.grise a { color: #999; }
.table-rapport tr.total th { background: #eef6f8; }
.table-rapport td a { color: inherit; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .rapport-pied { font-size: 8pt; color: #777; margin-top: 1rem; }
  .table-rapport { font-size: 9.5pt; }
  .table-rapport tr:nth-child(even) td { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rapport-resume div { border-color: #ccc; }
  .table-rapport td a { text-decoration: none; }
}
.rapport-actions .btn { text-decoration: none; font: inherit; font-size: .95rem; padding: .45rem 1rem; cursor: pointer; }

/* Fusion des doublons */
.lien-doublons a { font-weight: 600; color: #b45309; }
.groupe-doublon table { font-size: .92rem; margin-bottom: .4rem; }
.groupe-doublon .al-D { text-align: right; } .groupe-doublon .al-C { text-align: center; }
.groupe-doublon tr.gardee td { background: #e7f5ec; font-weight: 600; }
.badge-actif { background: #0b4d2c; color: #fff; border-radius: 4px; padding: .05rem .4rem; font-size: .8rem; }

/* ---------- Historique (version web) ---------- */
.histo2 { margin-top: .5rem; }
.histo2 svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.histo2 .btn svg { margin-right: .3rem; }
.h-barre { background: #fff; border: 1px solid var(--bord); border-radius: 12px; padding: .7rem .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.h-puces { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.h-puces a { padding: .35rem .85rem; border-radius: 999px; background: #f1f3f2; color: #24312a; text-decoration: none; font-size: .93rem; border: 1px solid transparent; }
.h-puces a:hover { border-color: #b9d9c6; }
.h-puces a.actif { background: #1f6fd0; color: #fff; }
.h-puces a.erreurs { margin-left: auto; }
.h-puces a.erreurs.actif { background: #b42318; }
.pastille { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: #b42318; color: #fff; font-size: .78rem; text-align: center; }
.h-puces a.actif .pastille { background: #fff; color: #b42318; }
.h-filtres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.h-filtres label { display: flex; flex-direction: column; font-size: .8rem; color: #555; gap: .15rem; }
.h-filtres input, .h-filtres select { padding: .4rem .5rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; font-size: .95rem; }
.h-ben select { min-width: 240px; }
.h-outils { margin-left: auto; display: flex; gap: .4rem; }
.h-outils .btn { display: inline-flex; align-items: center; text-decoration: none; }
.h-entete { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 .6rem; }
.h-entete h2 { margin: 0; }
.h-nom { color: #1f6fd0; }
.h-lien-ben { display: flex; gap: .4rem; flex-wrap: wrap; }
.h-lien-ben .btn { display: inline-flex; align-items: center; text-decoration: none; font-size: .9rem; }
.h-lien-ben form { margin: 0; }
.btn.danger-leger { background: #fff; color: #b42318; border: 1px solid #fecdca; }
.btn.danger-leger:hover { background: #fef3f2; }
.h-cartes { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; }
.h-cartes div { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: .45rem 1rem; color: #666; font-size: .88rem; min-width: 110px; }
.h-cartes span { display: block; font-size: 1.45rem; font-weight: 800; color: #1f2a24; }
.h-cartes .present { background: #ecfdf3; border-color: #a6e9c1; } .h-cartes .present span { color: #067647; }
.h-table { background: #fff; border: 1px solid var(--bord); border-radius: 12px; overflow-x: auto; }
.table-histo2 { width: 100%; border-collapse: collapse; margin: 0; }
.table-histo2 th { position: sticky; top: 0; background: #f8faf9; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: #5b6b62; padding: .55rem .7rem; border-bottom: 1px solid var(--bord); text-align: left; }
.table-histo2 td { padding: .45rem .7rem; border-bottom: 1px solid #eef1ef; }
.table-histo2 tr:hover td { background: #f6faff; }
.table-histo2 .al-D { text-align: right; }
.table-histo2 tr.h-jour td { background: #f1f6fd; color: #1f4f8f; font-size: .92rem; padding-top: .55rem; }
.table-histo2 tr.h-jour span { float: right; color: #5b6b62; font-size: .85rem; }
.table-histo2 tr.h-jour svg { margin-right: .4rem; }
.table-histo2 tr.edite td { background: #fff7e0; }
.h-benevole { display: inline-flex; align-items: center; gap: .5rem; color: #1f2a24; text-decoration: none; font-weight: 600; }
.h-benevole:hover { color: #1f6fd0; }
.initiales { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e3edf9; color: #1f4f8f; font-size: .72rem; font-weight: 700; flex: none; }
.etiquette { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.etiquette.vert { background: #dcfae6; color: #067647; } .etiquette.orange { background: #fef0c7; color: #93370d; } .etiquette.rouge { background: #fee4e2; color: #b42318; }
.h-obs { color: #555; font-size: .92rem; max-width: 280px; }
.h-actions { white-space: nowrap; text-align: right; }
.h-actions form { display: inline; }
.icone { background: none; border: 0; padding: .3rem; border-radius: 6px; color: #475467; cursor: pointer; }
.icone:hover { background: #eef2f6; color: #1f6fd0; }
.icone.rouge:hover { background: #fef3f2; color: #b42318; }
.h-vide { background: #fff; border: 1px dashed var(--bord); border-radius: 12px; padding: 2rem; text-align: center; color: #666; }
.h-pages { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: .8rem 0; }
.h-pages a { padding: .35rem .8rem; border: 1px solid var(--bord); border-radius: 6px; background: #fff; text-decoration: none; color: #1f2a24; }
.dlg-admin { border: 0; border-radius: 14px; padding: 1.2rem 1.4rem; width: min(560px, 94vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dlg-admin::backdrop { background: rgba(15,23,20,.45); }
.dlg-admin h3 { margin-top: 0; }
.dlg-admin label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: #555; margin-bottom: .6rem; }
.dlg-admin input, .dlg-admin select { padding: .45rem .5rem; border: 1px solid var(--bord); border-radius: 6px; font: inherit; }
.dlg-ligne { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: .5rem; }
.dlg-boutons { display: flex; justify-content: flex-end; gap: .5rem; }
@media (max-width: 800px) { .h-outils { margin-left: 0; } .h-puces a.erreurs { margin-left: 0; } .dlg-ligne { grid-template-columns: 1fr 1fr; } .h-obs { max-width: none; } }
@media print { .h-table { border: 0; } .table-histo2 th { position: static; } .h-cartes div { border-color: #ccc; } }
label[hidden] { display: none !important; }
.table-bareme td.smic { font-weight: 700; white-space: nowrap; }
.table-bareme th small { font-weight: 400; color: #666; }
.table-cer td.formule { font-size: .8rem; color: #555; text-align: left !important; white-space: nowrap; }
.lien-pdf { font-size: .75rem; font-weight: 700; color: #fff !important; background: #b42318; border-radius: 4px; padding: .05rem .35rem; text-decoration: none; margin-left: .2rem; }
.bareme-champs textarea { font: inherit; padding: .4rem; }

/* Mode hors connexion */
#etatReseau { padding: .35rem .8rem; border-radius: 999px; font-size: .9rem; white-space: nowrap; }
#etatReseau.hors { background: #b42318; color: #fff; animation: clignote 2s ease-in-out infinite; }
#etatReseau.envoi { background: #fef0c7; color: #93370d; }
@keyframes clignote { 50% { opacity: .75; } }
.hl-note { font-size: .8rem; color: #93370d; font-style: italic; }

/* Planning : pastille sur la tuile, planning du jour, fenêtre d'inscription */
.tuile .prevu { position: absolute; top: 4px; left: 6px; font-size: max(10px, calc(var(--fs, 16px) * .55)); line-height: 1.2; padding: .05em .45em; border-radius: 999px;
  background: var(--c, #1f6fd0); color: #fff; font-weight: 700; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.tuile { position: relative; }
#planningJour h2 { margin-top: 0; }
#listePlanning { list-style: none; margin: 0 0 .8rem; padding: 0; }
#listePlanning li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; padding: .35rem .5rem; margin-bottom: .3rem;
  border-left: 5px solid var(--c); background: rgba(255,255,255,.7); border-radius: 6px; font-size: .9rem; color: #1f2a24; }
.pl-heure { font-weight: 700; } .pl-places { font-size: .82rem; color: #555; } .pl-places.manque { color: #b42318; font-weight: 700; }
.dlg-planning { width: min(680px, 96vw); max-height: 90vh; }
.dlg-planning label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; }
.dlg-planning select, .dlg-planning input { font-size: 1.1rem; padding: .5rem; }
.plan-liste { max-height: 60vh; overflow-y: auto; padding-right: .3rem; }
.plan-liste h4 { margin: .8rem 0 .3rem; font-size: .95rem; color: #1f4f8f; }
.plan-seance { display: grid; grid-template-columns: 6.5em 1fr auto 7.5em; gap: .6rem; align-items: center; width: 100%; text-align: left; font: inherit;
  padding: .55rem .7rem; margin-bottom: .35rem; border: 1px solid #dfe5e2; border-left: 6px solid var(--c); border-radius: 8px; background: #fff; cursor: pointer; }
.plan-seance:hover:not([disabled]) { background: #f4f8ff; }
.plan-seance small { display: block; color: #666; font-size: .8rem; }
.plan-seance .ps-heure { font-weight: 700; } .plan-seance .ps-places { color: #555; font-size: .9rem; }
.plan-seance .ps-etat { text-align: center; font-size: .85rem; font-weight: 700; color: #1f6fd0; border: 1px solid currentColor; border-radius: 999px; padding: .15rem .4rem; }
.plan-seance.moi { background: #ecfdf3; } .plan-seance.moi .ps-etat { color: #fff; background: #067647; border-color: #067647; }
.plan-seance.complet, .plan-seance.annulee { opacity: .55; cursor: not-allowed; } .plan-seance.annulee .ps-nom { text-decoration: line-through; }
.plan-seance.complet .ps-etat, .plan-seance.annulee .ps-etat { color: #777; }
.plan-nom { margin-top: 0; }
@media (max-width: 600px) { .plan-seance { grid-template-columns: 5.5em 1fr; } .plan-seance .ps-places { display: none; } .plan-seance .ps-etat { grid-column: 1 / -1; } }

/* ---------- Planning (admin) ---------- */
.pl-entete { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .5rem; }
.pl-entete .onglets { margin-bottom: .6rem; border: 0; }
.pl-entete .onglets a.actif { background: #6d28d9; }
.pl-pastille { display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: var(--c); margin-right: .4rem; vertical-align: -1px; }
.table-activites { background: #fff; }
.table-activites tr.grise td { color: #999; }
.pl-activites { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.form-activite .fa-grille, .pl-modif .fa-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem .8rem; }
.form-activite label, .pl-modif label { display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; color: #444; }
.form-activite input, .form-activite select, .pl-modif input { padding: .4rem; font: inherit; border: 1px solid var(--bord); border-radius: 6px; }
.form-activite .fa-large { grid-column: span 2; }
.form-activite input[type=color] { padding: 0; height: 2.3rem; }
.fa-recurrence { border: 1px solid var(--bord); border-radius: 8px; margin: .8rem 0; padding: .5rem .8rem; }
.fa-recurrence .choix { flex-direction: row !important; }
.fa-jours { display: flex; gap: .35rem; margin: .3rem 0 .6rem; flex-wrap: wrap; }
.fa-jours label { flex-direction: row !important; }
.fa-jours input { display: none; }
.fa-jours span { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--bord); border-radius: 999px; cursor: pointer; background: #fff; }
.fa-jours input:checked + span { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.form-activite.unique .fa-jours, .form-activite.unique .lib-semaine { display: none !important; }
.form-activite:not(.unique) .lib-unique { display: none; }
.pl-cal-barre { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.pl-cal-barre strong { font-size: 1.25rem; min-width: 10em; text-align: center; }
.pl-cal-barre .btn { text-decoration: none; }
.pl-cal-zone { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.pl-cal-zone.avec-detail { grid-template-columns: 1fr 340px; }
.pl-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; }
.pl-jour-nom { background: #f5f3ff; color: #5b21b6; font-size: .8rem; font-weight: 700; text-transform: uppercase; padding: .4rem; text-align: center; border-bottom: 1px solid var(--bord); }
.pl-case { min-height: 96px; border-right: 1px solid #eee; border-bottom: 1px solid #eee; padding: .25rem; display: flex; flex-direction: column; gap: 3px; }
.pl-case:nth-child(7n) { border-right: 0; }
.pl-case.hors-mois { background: #fafafa; } .pl-case.hors-mois .pl-num { color: #bbb; }
.pl-case.aujourdhui { background: #f5f3ff; } .pl-case.aujourdhui .pl-num { background: #6d28d9; color: #fff; border-radius: 50%; }
.pl-num { font-size: .8rem; font-weight: 700; color: #555; width: 1.6em; height: 1.6em; display: inline-grid; place-items: center; }
.pl-chip { display: flex; gap: .25rem; align-items: center; font-size: .76rem; padding: .15rem .35rem; border-radius: 5px; text-decoration: none; color: #1f2a24;
  background: color-mix(in srgb, var(--c) 14%, white); border-left: 4px solid var(--c); overflow: hidden; white-space: nowrap; }
.pl-chip .c-h { font-weight: 700; } .pl-chip .c-n { overflow: hidden; text-overflow: ellipsis; flex: 1; } .pl-chip .c-p { font-weight: 700; }
.pl-chip.manque .c-p { color: #b42318; } .pl-chip.complet .c-p { color: #067647; }
.pl-chip.annulee { opacity: .5; text-decoration: line-through; }
.pl-chip.choisi { outline: 2px solid #6d28d9; }
.pl-detail { background: #fff; border: 1px solid var(--bord); border-radius: 12px; padding: .8rem 1rem; position: sticky; top: .5rem; }
.pl-detail h3 { margin: 0 1.5rem .3rem 0; border-left: 6px solid var(--c); padding-left: .5rem; }
.pl-detail h4 { margin: .9rem 0 .3rem; font-size: .9rem; color: #5b21b6; }
.pl-fermer { position: absolute; right: .7rem; top: .4rem; font-size: 1.5rem; text-decoration: none; color: #666; }
.pl-detail { position: relative; }
.pl-inscrits { list-style: none; margin: 0; padding: 0; }
.pl-inscrits li { display: flex; justify-content: space-between; align-items: center; padding: .25rem 0; border-bottom: 1px solid #f0f0f0; }
.pl-inscrits form { margin: 0; }
.pl-ajout { display: flex; gap: .4rem; margin-top: .5rem; } .pl-ajout select { flex: 1; min-width: 0; padding: .35rem; }
.pl-cmp { background: #f8faf9; border-radius: 8px; padding: .3rem .6rem; margin-top: .5rem; }
.pl-cmp p { margin: .35rem 0; font-size: .9rem; }
.pl-modif { margin-top: .8rem; } .pl-modif summary { cursor: pointer; color: #5b21b6; }
@media (max-width: 1000px) { .pl-cal-zone.avec-detail { grid-template-columns: 1fr; } .pl-chip .c-n { display: none; } .pl-case { min-height: 70px; } }
@media print { .pl-cal-zone.avec-detail { grid-template-columns: 1fr; } .pl-detail { display: none; } .pl-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.tuile:has(.prevu) { padding-top: calc(var(--fs, 16px) * .75); }
.tuile .prevu { top: 3px; left: 4px; font-size: max(9px, calc(var(--fs, 16px) * .5)); }
#listePlanning li { grid-template-columns: auto 1fr; }
#listePlanning .pl-heure { white-space: nowrap; font-size: .85rem; }
#listePlanning .pl-places { grid-column: 1 / -1; }
.plan-seance small.ps-conflit { color: #b45309; font-weight: 600; }
.pl-conflit { color: #b45309; font-weight: 600; }
.pl-cal-zone { grid-template-columns: minmax(0, 1fr); }
.pl-cal-zone.avec-detail { grid-template-columns: minmax(0, 1fr) 340px; }
.pl-chip { flex-direction: column; align-items: stretch; gap: 0; white-space: normal; }
.pl-chip .c-ligne { display: flex; gap: .25rem; align-items: center; white-space: nowrap; min-width: 0; }
.pl-chip .c-noms { font-size: .72rem; color: #333; line-height: 1.25; padding: .1rem 0 .05rem; }
.pl-cal-barre .pl-noms { margin-left: auto; flex-direction: row !important; }
@media (max-width: 1000px) { .pl-cal-zone.avec-detail { grid-template-columns: minmax(0, 1fr); } }
@media print { .pl-chip .c-n { display: inline; } .pl-cal-barre .pl-noms { display: none; } }

/* ---------- Page « Voir le planning » des bénévoles ---------- */
.page-planning { background: #f3f1ec; margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #1f2a24; }
.pp-entete { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; background: #0b4d2c; color: #fff; }
.pp-entete h1 { margin: 0; font-size: 1.3rem; flex: 1; }
.pp-entete a { color: #fff; text-decoration: none; padding: .45rem .9rem; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; white-space: nowrap; }
.pp-entete .pp-inscrire { background: #fff; color: #0b4d2c; font-weight: 700; }
.pp-barre { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; flex-wrap: wrap; }
.pp-barre strong { font-size: 1.15rem; min-width: 12em; text-align: center; }
.pp-btn { padding: .4rem .8rem; border: 1px solid #c9d3ce; border-radius: 8px; background: #fff; color: #1f2a24; text-decoration: none; }
.pp-vues { margin-left: auto; display: inline-flex; border: 1px solid #c9d3ce; border-radius: 8px; overflow: hidden; }
.pp-vues a { padding: .4rem .9rem; text-decoration: none; color: #1f2a24; background: #fff; }
.pp-vues a.actif { background: #6d28d9; color: #fff; }
.pp-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; padding: 0 1rem 1rem; }
.pp-jour { background: #fff; border: 1px solid #dfe5e2; border-radius: 10px; padding: .5rem; min-height: 120px; }
.pp-jour.aujourdhui { border: 2px solid #6d28d9; background: #faf8ff; }
.pp-jour h2 { margin: 0 0 .4rem; font-size: .95rem; color: #5b21b6; } .pp-jour h2 span { color: #666; font-weight: 400; }
.pp-seance { border-left: 5px solid var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 7px; padding: .4rem .5rem; margin-bottom: .45rem; }
.pp-seance.annulee { opacity: .5; } .pp-seance.annulee .pp-nom { text-decoration: line-through; }
.pp-tete { display: flex; justify-content: space-between; font-size: .85rem; } .pp-heure { font-weight: 700; }
.pp-places { font-weight: 700; color: #067647; } .pp-places.manque { color: #b42318; }
.pp-nom { font-weight: 600; margin: .1rem 0; }
.pp-note { font-size: .8rem; color: #555; font-style: italic; }
.pp-manque { font-size: .78rem; color: #b42318; font-weight: 600; }
.pp-inscrits { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
.pp-rien { color: #bbb; text-align: center; }
.pp-mois { margin: 0 1rem 1rem; } .pp-mois .pl-num { text-decoration: none; }
.pp-pied { text-align: center; color: #666; font-size: .85rem; padding-bottom: 1rem; }
.plan-tous { text-align: center; margin: .8rem 0 0; } .plan-tous a { color: #6d28d9; font-weight: 600; }
@media (max-width: 900px) { .pp-semaine { grid-template-columns: 1fr; } .pp-jour.vide { display: none; } .pp-entete h1 { font-size: 1.05rem; }
  .pp-mois .pl-chip .c-n, .pp-mois .c-noms { display: none; } }
@media print { .pp-entete a, .pp-barre .pp-btn, .pp-vues, .pp-pied { display: none; } }
@media (max-width: 600px) {
  .pp-entete { flex-wrap: wrap; gap: .5rem; }
  .pp-entete h1 { order: -1; flex-basis: 100%; }
  .pp-entete .pp-inscrire { margin-left: auto; }
  .pp-barre strong { min-width: 0; flex-basis: 100%; text-align: left; order: -1; }
  .pp-vues { margin-left: 0; }
}

/* Prévus du jour : venu / attendu / pas pointé */
.pl-alerte { font-size: .8rem; background: #b42318; color: #fff; border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; margin-left: .3rem; }
#listePlanning > li { grid-template-columns: auto 1fr; }
.pl-qui { grid-column: 1 / -1; list-style: none; margin: .2rem 0 0; padding: 0; font-size: .85rem; }
.pl-qui li { display: flex; gap: .35rem; align-items: baseline; padding: .05rem 0; }
.pl-qui b { width: 1.1em; text-align: center; }
.pl-qui em { margin-left: auto; font-style: normal; font-size: .72rem; color: #777; }
.pl-qui .st-present b, .pl-qui .st-venu b { color: #067647; }
.pl-qui .st-attendu { color: #555; }
.pl-qui .st-retard { color: #b45309; font-weight: 600; } .pl-qui .st-retard em { color: #b45309; }
.pl-qui .st-absent { color: #b42318; font-weight: 600; } .pl-qui .st-absent em { color: #b42318; }
.tuile .prevu.absent { background: #b42318 !important; animation: clignote 2s ease-in-out infinite; }
#listePlanning .pl-qui li { display: flex; gap: .35rem; align-items: baseline; border: 0; background: none; padding: .05rem 0; margin: 0; border-radius: 0; font-size: .85rem; }
#listePlanning .pl-qui li em { font-size: .72rem; }

/* ---------- Planning admin sur téléphone : agenda au lieu de la grille du mois ---------- */
.pl-date-longue { display: none; }
@media (max-width: 700px) {
  .pl-entete { display: block; }
  .pl-entete .onglets { overflow-x: auto; flex-wrap: nowrap; gap: .2rem; }
  .pl-entete .onglets a { white-space: nowrap; padding: .45rem .7rem; font-size: .95rem; }
  .pl-cal-barre { flex-wrap: wrap; }
  .pl-cal-barre strong { order: -1; flex-basis: 100%; text-align: left; min-width: 0; }
  .pl-cal-barre .pl-noms { margin-left: auto; }
  .pl-cal-barre .pl-noms span { white-space: nowrap; }
  .pl-cal-barre button[onclick] { display: none; }
  .pl-cal-zone, .pl-cal-zone.avec-detail { display: flex; flex-direction: column; }
  .pl-detail { order: -1; position: static; }
  .pl-cal { display: block; background: none; border: 0; }
  .pl-jour-nom, .pl-case.sans:not(.aujourdhui), .pl-case.hors-mois { display: none; }
  .pl-case { min-height: 0; background: #fff; border: 1px solid var(--bord); border-radius: 10px; margin-bottom: .5rem; padding: .5rem; gap: .35rem; }
  .pl-case.aujourdhui { border: 2px solid #6d28d9; }
  .pl-case .pl-num { display: none; }
  .pl-date-longue { display: block; font-weight: 700; color: #5b21b6; margin-bottom: .1rem; }
  .pl-case.sans.aujourdhui::after { content: "Aucune activité aujourd'hui"; color: #999; font-size: .9rem; }
  .pl-chip { font-size: .95rem; padding: .45rem .6rem; border-left-width: 6px; }
  .pl-chip .c-n { display: inline !important; }
  .pl-chip .c-noms { font-size: .85rem; }
  .pl-ajout { flex-wrap: wrap; } .pl-ajout select { flex-basis: 100%; }
  /* Tableaux d'activités en cartes */
  .table-activites, .table-activites tbody, .table-activites tr, .table-activites td { display: block; width: auto; }
  .table-activites tr:first-child { display: none; }
  .table-activites tr { background: #fff; border: 1px solid var(--bord); border-radius: 10px; margin-bottom: .5rem; padding: .5rem .7rem; }
  .table-activites td { border: 0; padding: .1rem 0; }
  .table-activites td[data-l]::before { content: attr(data-l) " : "; color: #777; font-size: .85rem; }
  .table-activites td.t-titre { font-size: 1.05rem; margin-bottom: .2rem; }
  .table-activites td.actions-ligne { margin-top: .35rem; display: flex; gap: .8rem; align-items: center; }
  .table-activites { background: none; }
  .form-activite .fa-large { grid-column: 1 / -1; }
  .form-activite .fa-grille { grid-template-columns: 1fr 1fr; }
  .fa-jours span { padding: .45rem .75rem; }
}
@media (max-width: 700px) {
  .pl-detail { position: relative; }
  .table-activites td[data-l]:empty { display: none; }
  .table-activites.compacte td[data-l] { display: inline; }
  .table-activites.compacte td[data-l]::before { content: ""; }
  .table-activites.compacte td[data-l="Jour"]::after { content: " · "; color: #999; }
  .table-activites.compacte td[data-l="Inscrits"]::before { content: " · inscrits "; color: #777; }
  .table-activites.compacte td[data-l="Manque"]::before { content: " manque "; color: #777; }
}

/* ---------- En-tête de la pointeuse sur téléphone / petite tablette ---------- */
@media (max-width: 1000px) {
  header { flex-wrap: wrap; gap: .45rem .5rem; padding: .45rem .7rem; }
  header h1 { font-size: 1.15rem; }
  .logo-entete { height: 36px; }
  #recherche { order: 20; flex: 1 1 100%; max-width: none; padding: .5rem .7rem; }
  .btn-panneau { padding: .4rem .6rem; font-size: .85rem; }
  .btn-icone span { display: none; }
  .raccourcis { gap: .3rem; }
  .horloge { margin-left: auto; }
  .horloge #date { font-size: .75rem; }
  .horloge #heure { font-size: 1.3rem; }
}
@media (max-width: 560px) {
  header h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .horloge #date { display: none; }
  .horloge { order: 1; margin-left: 0; }
  #btnPanneau { order: 2; margin-left: auto; }
  #btnPlanning { order: 3; } .raccourcis { order: 4; }
  #recherche { order: 20; }
}
@media (max-width: 560px) {
  header h1 { flex: 1 0 55%; }
  #btnPanneau { margin-left: 0; }
}

/* Télétravail */
.tuile.present.distance { background: var(--distance, #2563eb) !important; color: var(--texte-distance, #fff) !important; border-color: var(--distance, #2563eb); }
.tuile.distance .nom { color: var(--texte-distance, #fff); }
.tuile .maison { position: absolute; left: 6px; bottom: 4px; font-size: max(12px, calc(var(--fs, 16px) * .8)); line-height: 1; }
#listePresents tr.distance td { color: #1d4ed8; }
#bandeauPerso { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 1rem; background: var(--distance, #2563eb); color: #fff; font-size: 1rem; }
#bandeauPerso[hidden] { display: none; }
#bandeauPerso button { background: #fff; color: #1d4ed8; border: 0; border-radius: 8px; padding: .4rem .9rem; font-weight: 700; cursor: pointer; }
body.mode-perso #panneau, body.mode-perso #recherche, body.mode-perso #btnPanneau, body.mode-perso .raccourcis { display: none !important; }
body.mode-perso #tuiles { grid-template-columns: minmax(0, 520px) !important; justify-content: center; padding-top: 2rem; }
body.mode-perso .tuile { min-height: 160px; font-size: 1.6rem; }
body.mode-perso main { grid-template-columns: 1fr !important; }
.etiquette.bleu { background: #dbeafe; color: #1d4ed8; }

/* Bouton Télétravail : seulement sur téléphone / petite tablette (sur la pointeuse du local, le lien reste en bas du panneau) */
#btnTeletravail { display: none; }
@media (max-width: 1000px) { #btnTeletravail { display: inline-flex; } }
@media (max-width: 560px) { #btnTeletravail { order: 3; } }
body.mode-perso #btnTeletravail { display: none !important; }
.case-tele { flex-direction: row !important; align-items: center; gap: .35rem; white-space: nowrap; }
.aide-dlg { color: #555; font-size: .9rem; }
#formPerso label[hidden] { display: none; }
