:root{--c:#1f6f43;--bg:#f6f7f5;--b:#d5d9d2;font-size:17px}
*{box-sizing:border-box}body{margin:0;font-family:system-ui,sans-serif;background:var(--bg);color:#1c1f1c}
header{background:var(--c);color:#fff;padding:.6rem 1rem;display:flex;flex-wrap:wrap;gap:.5rem 1.5rem;align-items:center}
#yearbar{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}#yearbar select{width:auto}
.logo{height:56px;width:56px;background:#fff;border-radius:10px;padding:2px}.flogo{height:90px;float:right}
.btn{display:inline-block;text-decoration:none}.btn.p{background:var(--c);color:#fff}
h1{font-size:1.2rem;margin:0}
button,.btn{font:inherit;padding:.45rem .8rem;border:1px solid var(--c);background:#fff;color:var(--c);border-radius:6px;cursor:pointer}
button.p{background:var(--c);color:#fff}button.d{border-color:#a32;color:#a32}
/* ---------- Mise en page connectée : en-tête collant + menu latéral ---------- */
.ic{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ib{display:inline-grid;place-items:center;padding:.4rem;border:0;background:transparent;color:inherit;border-radius:8px}
.ib:hover{background:#ffffff22}
#menu-btn,.scrim,#nav{display:none}
body.in{--nav:250px;--top:64px}
body.in header{position:sticky;top:0;z-index:1000;height:var(--top);flex-wrap:nowrap;gap:.8rem;padding:0 1.2rem;background:#fff;color:#1c1f1c;border-bottom:1px solid var(--b);box-shadow:0 1px 8px #0000000a}
body.in .logo{height:42px;width:42px;padding:0;border-radius:8px}
body.in h1{font-size:1.1rem;letter-spacing:-.01em;white-space:nowrap}
body.in #yearbar{margin-left:auto;flex-wrap:nowrap}
body.in #yearbar .yr{display:flex;align-items:center;gap:.4rem;background:#eef4ef;border:1px solid #cfe1d5;border-radius:999px;padding:.2rem .3rem .2rem .9rem}
body.in #yearbar label{margin:0;font-size:.8rem;font-weight:600;color:#4b5a50;text-transform:uppercase;letter-spacing:.05em}
body.in #yearbar select{border:0;background:#fff;border-radius:999px;padding:.25rem .5rem;font-weight:700;color:var(--c);cursor:pointer}
button.g{border-color:transparent;background:transparent;font-size:.9rem;white-space:nowrap}button.g:hover{background:#eef4ef}
#userbar .av{display:none}
/* z-index au-dessus des calques Leaflet (400 à 1000) */
body.in #nav{display:flex;flex-direction:column;gap:2px;position:fixed;z-index:1000;top:var(--top);left:0;bottom:0;width:var(--nav);padding:1rem .75rem;overflow-y:auto;
 background:linear-gradient(180deg,#1f6f43 0%,#174f31 100%);color:#e3efe7}
body.in main,body.in #msg{margin-left:var(--nav)}
body.in main{max-width:none;padding:1.5rem 2rem}
body.in main>*{max-width:1100px}
.nav-sec{font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;opacity:.6;padding:.2rem .75rem .5rem}
#nav>button{display:flex;align-items:center;gap:.75rem;width:100%;padding:.6rem .75rem;border:0;border-radius:10px;background:transparent;color:inherit;text-align:left;font-size:.97rem;transition:background .15s,color .15s}
#nav>button:hover{background:#ffffff14;color:#fff}
#nav>button[aria-current=page]{background:#fff;color:var(--c);font-weight:700;box-shadow:0 2px 10px #0003}
#nav>button span:first-of-type{flex:1}
.bdg{min-width:1.6rem;padding:.05rem .45rem;border-radius:999px;background:#ffffff26;font-size:.75rem;font-weight:700;text-align:center}
#nav>button[aria-current=page] .bdg{background:#e1f2e7}
#nav>button .bdg.al{background:#f5a300;color:#3a2a00}
.me{margin-top:auto;display:flex;align-items:center;gap:.6rem;padding:.9rem .5rem 0;border-top:1px solid #ffffff26}
.av{display:inline-grid;place-items:center;width:36px;height:36px;flex:none;border-radius:50%;background:#f5a300;color:#3a2a00;font-weight:800}
.who{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.2}.who strong{overflow:hidden;text-overflow:ellipsis}.who small{opacity:.7}
@media (max-width:900px){
 body.in{--nav:280px;--top:58px}
 body.in header{padding:0 .6rem;gap:.5rem}
 body.in #menu-btn{display:inline-grid}body.in #menu-btn:hover{background:#eef4ef}
 body.in h1{display:none}
 body.in #yearbar button.g{display:none}
 body.in #userbar .av{display:inline-grid;width:32px;height:32px}
 body.in #nav{top:0;z-index:1200;transform:translateX(-100%);transition:transform .25s ease;box-shadow:4px 0 24px #0000}
 body.menu-open #nav{transform:none;box-shadow:4px 0 24px #0005}
 body.in .scrim{display:block;position:fixed;inset:0;z-index:1100;background:#0008;opacity:0;pointer-events:none;transition:opacity .25s}
 body.menu-open .scrim{opacity:1;pointer-events:auto}
 body.in main,body.in #msg{margin-left:0}
 body.in main{padding:1rem}
}
@media (prefers-reduced-motion:reduce){#nav,.scrim,#nav>button{transition:none!important}}
:focus-visible{outline:3px solid #f5a300;outline-offset:2px}
.skip{position:absolute;left:-999px}.skip:focus{left:0;background:#fff;padding:.5rem}
main{max-width:1100px;margin:auto;padding:1rem}
.card{background:#fff;border:1px solid var(--b);border-radius:8px;padding:1rem;margin-bottom:1rem}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.8rem}
.stat{font-size:2rem;font-weight:700}
table{width:100%;border-collapse:collapse;background:#fff}th,td{border-bottom:1px solid var(--b);padding:.4rem;text-align:left;vertical-align:top}
.warn{background:#fff3cd;border:1px solid #e0b100;padding:.5rem;border-radius:6px;margin:.3rem 0}
.err{background:#fde2e0;border:1px solid #a32;padding:.5rem;border-radius:6px;margin:.3rem 0}
.map{height:320px;border:1px solid var(--b);border-radius:8px}.map.s{height:240px}
/* Lieux : lien carte ↔ tableau (marqueur Leaflet bleu teinté en vert) */
.plt tr[data-pid]{cursor:pointer;transition:background .15s}.plt tr[data-pid]:focus-visible{outline:2px solid var(--c);outline-offset:-2px}
.plt tr.hl td{background:#eef6f0}.plt tr.sel td{background:#dcefe3}.plt tr.sel td:first-child{box-shadow:inset 4px 0 var(--c)}
.leaflet-marker-icon.hl,.leaflet-marker-icon.sel{filter:hue-rotate(250deg) saturate(1.6) drop-shadow(0 0 4px #fff)}
#toast{position:fixed;z-index:1300;left:50%;bottom:1.2rem;transform:translate(-50%,150%);opacity:0;max-width:calc(100vw - 2rem);padding:.6rem 1rem;border-radius:999px;background:#1c1f1c;color:#fff;box-shadow:0 4px 18px #0004;pointer-events:none;transition:transform .25s ease,opacity .25s}
#toast.on{transform:translate(-50%,0);opacity:1}
@media (prefers-reduced-motion:reduce){.plt tr[data-pid],#toast{transition:none}}
label{display:block;margin:.6rem 0 .2rem;font-weight:600}input,select,textarea{font:inherit;width:100%;padding:.4rem;border:1px solid #888;border-radius:6px}
.pw{position:relative;display:block}.pw input{padding-right:2.6rem}
.pw-eye{position:absolute;right:2px;top:50%;transform:translateY(-50%);display:flex;padding:.3rem .45rem;border:0;background:transparent;color:#4b5a50}
.pw-eye:hover,.pw-eye[aria-pressed=true]{color:var(--c)}.pw-eye .ic{width:1.2rem;height:1.2rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
input[type=checkbox]{width:auto}.chk label{font-weight:400;display:flex;gap:.4rem;margin:.2rem 0}
.bar{display:flex;gap:.5rem;flex-wrap:wrap;align-items:end;margin:.6rem 0}.bar>*{flex:1;min-width:140px}.bar button{flex:0}
dialog{width:min(720px,96vw);max-height:92vh;overflow:auto;border:1px solid #666;border-radius:10px}
dialog::backdrop{background:#0006}.imgs img{max-width:200px;max-height:150px;margin:.3rem;border-radius:6px}
.actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:1rem}
/* Impression / « Enregistrer au format PDF » : même présentation que le PDF téléchargé (fiche de poste, fiche perso) */
@page{size:A4;margin:14mm 14mm 16mm;@bottom-right{content:"UTP Pons Trail — page " counter(page) "/" counter(pages);font:8pt Helvetica,Arial,sans-serif;color:#777}}
@media print{
html,body{background:#fff!important}
body>*:not(dialog){display:none!important}
dialog[open]{position:static!important;display:block!important;inset:auto!important;transform:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;overflow:visible!important;
 font-family:Helvetica,Arial,sans-serif;font-size:10.5pt;line-height:1.35;color:#000;background:#fff}
dialog h2{font-size:20pt;margin:0 0 6pt}.mission h3{font-size:15pt;margin:8pt 0 6pt}dialog h4{font-size:12pt;margin:8pt 0 2pt}dialog p{margin:0 0 6pt}
.flogo{height:62pt;width:auto}
.map.s{height:190pt;border-radius:0;break-inside:avoid}
.leaflet-control-zoom{display:none!important}
.imgs figure{display:inline-block;vertical-align:top;width:48%;margin:6pt 1% 0 0;break-inside:avoid}.imgs img{max-width:100%;max-height:170pt;margin:0;border-radius:0}
.actions,.noprint,#msg,#vmsg{display:none!important}
}

body.ro [data-w]{display:none}
#userbar{margin-left:auto;display:flex;gap:.5rem;align-items:center}
.login{max-width:420px;margin:2rem auto}
.plan{overflow-x:auto}.pl-row{display:flex;min-width:760px;border-bottom:1px solid var(--b);background:#fff}
.pl-name{width:150px;flex:none;padding:.4rem;font-weight:600}.pl-track{position:relative;flex:1;border-left:1px solid var(--b)}
.pl-head{height:28px;background:#eef1ec}.pl-head span{position:absolute;top:4px;font-size:.75rem;padding-left:3px}
.ev{position:absolute;height:42px;overflow:hidden;text-align:left;font-size:.72rem;line-height:1.2;padding:2px 4px;background:#e0f0e6;border-color:var(--c);color:#123}
.ev.w{background:#fff3cd;border-color:#e0b100}
@media print{body.pv>main{display:block!important;margin:0!important;padding:0!important}body.pv .noprint{display:none!important}body.pv .ev{border:1px solid #000;background:#fff!important}}

.sw{display:inline-block;width:14px;height:14px;border-radius:3px;vertical-align:middle;border:1px solid #0004}
.mission{border-top:2px solid var(--c);margin-top:1rem;padding-top:.3rem}h4{margin:.6rem 0 .1rem}
input[type=color]{height:2.4rem;padding:2px}
@media print{.mission+.mission{break-before:page}.mission{break-inside:auto}}

.ok{background:#e1f2e7;border:1px solid #1f6f43;padding:.5rem;border-radius:6px;margin:.3rem 0}
