/* C'CLÔT Accès chantier — charte : gris #5C585C, or #DDAE04, vert #6EA12E, Poppins */
[hidden]{display:none !important}
:root{
  --gris:#5C585C; --gris-f:#46434A; --or:#DDAE04; --or-f:#B98F00; --vert:#6EA12E; --rouge:#B8322A;
  --encre:#2E2B2E; --fond:#F1F1EF; --papier:#FFFFFF; --trait:#DAD8D5; --doux:#77727A;
  --r:6px; --nav-h:64px;
  font-family:Poppins, "Century Gothic", "Segoe UI", system-ui, sans-serif;
  color:var(--encre); background:var(--fond);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0; font-size:15px; line-height:1.5; padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom))}
body.bare{padding-bottom:0}
a{color:var(--gris-f)}
h1{font-size:1.45rem; line-height:1.2; margin:0 0 .4rem; font-weight:700}
h2{font-size:1.1rem; margin:1.2rem 0 .6rem; font-weight:600}
h3{font-size:.95rem; margin:1rem 0 .3rem; font-weight:600; color:var(--gris)}
.muted{color:var(--doux)} .small{font-size:.82rem}
.mono{font-variant-numeric:tabular-nums; letter-spacing:.02em}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
code{background:#e8e7e4; padding:0 .3em; border-radius:3px}
:focus-visible{outline:3px solid var(--or); outline-offset:2px}

/* ---------- En-tête ---------- */
.top{position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:.8rem;
  background:#fff; color:var(--encre); border-bottom:3px solid var(--or); padding:calc(.5rem + env(safe-area-inset-top)) 1rem .5rem}
.brand{display:flex; align-items:center; gap:.6rem; color:var(--gris); text-decoration:none; flex:none}
.brand img{height:34px; width:auto; display:block}
.brand span{font-weight:500; font-size:.85rem; border-left:1px solid var(--trait); padding-left:.6rem}
.site-pick{flex:1; min-width:0}
.site-pick select, .site-name{width:100%; max-width:520px; background:var(--fond); color:var(--encre); border:1px solid var(--trait); border-radius:var(--r);
  padding:.45rem .6rem; font:inherit; font-size:.88rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
@media (max-width:560px){ .brand span{display:none} .brand img{height:28px} }
.site-name{flex:1; background:none; border:0; padding-left:0}
.me{margin-left:auto; flex:none; width:34px; height:34px; border-radius:50%; background:var(--or); color:var(--encre);
  display:grid; place-items:center; font-weight:700; text-decoration:none}

/* ---------- Navigation : barre basse sur mobile, onglets en haut sur grand écran ---------- */
.tabs{position:fixed; bottom:0; left:0; right:0; z-index:20; display:flex; background:var(--papier);
  border-top:1px solid var(--trait); padding-bottom:env(safe-area-inset-bottom)}
.tabs a{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  height:var(--nav-h); text-decoration:none; color:var(--doux); font-size:.72rem; font-weight:500}
.tabs svg{width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
.tabs a.on{color:var(--encre)}
.tabs a.on svg{stroke:var(--or-f)}
@media (min-width:900px){
  body{padding-bottom:2rem}
  .tabs{position:sticky; top:55px; bottom:auto; border-top:0; border-bottom:1px solid var(--trait); padding:0 1rem; justify-content:flex-start}
  .tabs a{flex:none; flex-direction:row; gap:.45rem; height:46px; padding:0 1rem; font-size:.88rem; border-bottom:3px solid transparent}
  .tabs a.on{border-bottom-color:var(--or)}
  .tabs svg{width:18px; height:18px}
}

main{max-width:1100px; margin:0 auto; padding:1rem}
.panel{background:var(--papier); border:1px solid var(--trait); border-radius:var(--r); padding:1rem 1.1rem; margin:0 0 1rem}
.panel.narrow, .narrow{max-width:680px; margin-left:auto; margin-right:auto}
.panel > h2:first-child{margin-top:0}

/* ---------- Le panneau d'effectif : l'élément signature, façon panneau de chantier ---------- */
.board{position:relative; display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:.6rem 1.5rem;
  background:var(--or); color:var(--encre); border-radius:var(--r); padding:1.1rem 1.2rem 1.1rem 2.4rem; margin-bottom:.8rem; overflow:hidden}
.board::before{content:""; position:absolute; inset:0 auto 0 0; width:14px;
  background:repeating-linear-gradient(-45deg, var(--encre) 0 9px, var(--or) 9px 18px)}
.board-count{display:flex; align-items:baseline; gap:.7rem; flex-wrap:wrap}
.board .num{font-size:clamp(3.6rem, 14vw, 6.5rem); font-weight:800; line-height:.9; font-variant-numeric:tabular-nums; letter-spacing:-.03em}
.board .lbl{font-size:1.15rem; font-weight:600}
.board-when{font-size:.9rem; text-align:right; margin-left:auto}
.board-when a{color:var(--encre)}
.board-sub{display:block; font-size:.8rem; opacity:.75}
@media (max-width:560px){ .board-when{text-align:left; margin-left:0} }

.fresh{font-size:.82rem; color:var(--doux); margin:.2rem 0 .8rem}
.facts{display:grid; grid-template-columns:repeat(4, 1fr); gap:1px; background:var(--trait); border:1px solid var(--trait);
  border-radius:var(--r); overflow:hidden; margin:0 0 1rem}
.facts > div{background:var(--papier); padding:.65rem .8rem}
.facts b{display:block; font-size:1.35rem; font-weight:700; font-variant-numeric:tabular-nums; line-height:1.2}
.facts span{font-size:.78rem; color:var(--doux)}
.facts .alert b{color:var(--rouge)}
@media (max-width:560px){ .facts{grid-template-columns:repeat(2, 1fr)} }

/* ---------- Messages ---------- */
.flash{border-radius:var(--r); padding:.7rem .9rem; margin:0 0 1rem; background:#eaf3df; border-left:4px solid var(--vert)}
.flash.err{background:#f8e4e2; border-left-color:var(--rouge)}
.flash.warn{background:#fdf3cf; border-left-color:var(--or-f)}
.flash-actions{display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.5rem}

/* ---------- Boutons et champs ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:.4rem; min-height:42px; padding:.5rem 1rem; border:0; border-radius:var(--r);
  background:var(--gris); color:#fff; font:inherit; font-weight:600; font-size:.9rem; text-decoration:none; cursor:pointer}
.btn:hover{background:var(--gris-f)}
.btn.small{min-height:36px; padding:.35rem .8rem; font-size:.84rem}
.btn.ghost{background:transparent; color:var(--encre); box-shadow:inset 0 0 0 1.5px var(--trait)}
.btn.ghost:hover{box-shadow:inset 0 0 0 1.5px var(--gris)}
.btn.danger{background:var(--rouge)}
input, select, textarea{font:inherit; font-size:16px; color:var(--encre); background:#fff; border:1.5px solid var(--trait); border-radius:var(--r);
  padding:.5rem .6rem; min-height:42px; max-width:100%}
input:focus, select:focus{border-color:var(--gris); outline:none}
.stack{display:flex; flex-direction:column; gap:.85rem}
.stack label{display:flex; flex-direction:column; gap:.3rem; font-weight:500; font-size:.9rem}
label.check{flex-direction:row !important; align-items:center; gap:.5rem !important; font-weight:400}
label.check input{min-height:auto; width:20px; height:20px}
.toolbar{display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin:0 0 .9rem}
.toolbar input[type=search]{flex:1 1 220px}
.at-form, .filters{display:flex; flex-wrap:wrap; gap:.5rem; align-items:center}
.sticky-bar{position:sticky; top:55px; z-index:5; background:var(--papier); padding:.5rem 0}

/* ---------- Liste des présents ---------- */
.people{list-style:none; margin:0 0 1rem; padding:0; background:var(--papier); border:1px solid var(--trait); border-radius:var(--r)}
.people li + li{border-top:1px solid var(--trait)}
.people a{display:grid; grid-template-columns:1fr auto; grid-template-areas:"who since" "co since" "via via"; gap:0 1rem;
  padding:.65rem .9rem; text-decoration:none; color:inherit}
.people a:hover{background:#faf9f7}
.people .who{grid-area:who; font-weight:600}
.people .co{grid-area:co; font-size:.84rem; color:var(--doux)}
.people .since{grid-area:since; text-align:right; font-weight:600; font-variant-numeric:tabular-nums; align-self:center}
.people .since small{display:block; font-weight:400; font-size:.78rem; color:var(--doux)}
.people .via{grid-area:via; font-size:.75rem; color:var(--doux)}
.people li{border-left:4px solid var(--vert)}
.people.dim li{border-left-color:var(--or)}
.people.dim .who{font-weight:500}
@media (min-width:900px){
  .people a{grid-template-columns:1.3fr 1fr 1fr auto; grid-template-areas:"who co via since"; align-items:center}
  .people .co, .people .via{font-size:.86rem}
}
.tag{font-style:normal; font-size:.7rem; font-weight:600; background:#ebe9e6; color:var(--gris-f); border-radius:3px; padding:.05rem .35rem; vertical-align:1px}
.stale{background:var(--papier); border:1px solid var(--trait); border-radius:var(--r); padding:.7rem .9rem; margin-bottom:1rem}
.stale summary{cursor:pointer; font-weight:600}
.stale .people{margin-top:.6rem}
.empty{text-align:center; padding:2.2rem 1rem; background:var(--papier); border:1px dashed var(--trait); border-radius:var(--r); margin-bottom:1rem}
.empty h2{margin-top:0}

/* ---------- Courbe ---------- */
.curve{width:100%; height:auto; display:block}
.curve rect{fill:var(--gris)}
.curve rect:hover{fill:var(--or-f)}
.curve text{font-size:11px; fill:var(--doux); font-family:inherit}
.curve line{stroke:var(--trait)}

/* ---------- Tableaux ---------- */
.table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch}
table{width:100%; border-collapse:collapse; font-size:.88rem}
th{text-align:left; font-weight:600; font-size:.78rem; color:var(--doux); border-bottom:1.5px solid var(--trait); padding:.45rem .5rem; white-space:nowrap}
td{border-bottom:1px solid #ecebe8; padding:.5rem; vertical-align:top}
td.r, th.r{text-align:right; font-variant-numeric:tabular-nums}
td.c, th.c{text-align:center; width:44px}
tr.hl td{background:#fdf3cf}
.warn-txt{color:var(--rouge); font-weight:600}
.st{display:inline-block; font-size:.76rem; font-weight:600; padding:.05rem .45rem; border-radius:3px; white-space:nowrap}
.st-sur-site{background:#e3efd4; color:#3f6a13}
.st-sorti{background:#ecebe8; color:var(--gris-f)}
.st-sortie-non-badgee{background:#f8e4e2; color:var(--rouge)}
.anom{display:block; color:var(--rouge); font-size:.74rem}

.day-nav{display:flex; align-items:center; gap:.5rem; margin-bottom:.4rem}
.subtabs{display:flex; gap:.3rem; overflow-x:auto; margin:0 0 1rem; padding-bottom:2px}
.subtabs a{flex:none; padding:.45rem .85rem; border-radius:var(--r); text-decoration:none; color:var(--encre); font-size:.88rem; font-weight:500; background:var(--papier); border:1px solid var(--trait)}
.subtabs a.on{background:var(--gris); color:#fff; border-color:var(--gris)}
.rows{list-style:none; padding:0; margin:0}
.rows li{display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; padding:.5rem 0; border-bottom:1px solid #ecebe8}
form.inline{display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:0}
.user-row{display:grid; grid-template-columns:1fr; gap:.5rem; padding:.8rem 0; border-bottom:1px solid #ecebe8}
@media (min-width:700px){ .user-row{grid-template-columns:1.4fr 1fr 1fr auto auto; align-items:center} }

/* ---------- Timeline personne ---------- */
.timeline{list-style:none; margin:0; padding:0 0 0 .2rem}
.timeline li{position:relative; padding:.2rem 0 .2rem 1.2rem; font-size:.9rem}
.timeline li::before{content:""; position:absolute; left:0; top:.65rem; width:9px; height:9px; border-radius:50%; background:var(--vert)}
.timeline li.out::before{background:var(--gris)}
.timeline li.ref::before{background:var(--rouge)}
.timeline li.ign::before{background:var(--trait)}
.timeline b{font-variant-numeric:tabular-nums; margin-right:.4rem}

/* ---------- Import ---------- */
.drop{position:relative; display:flex !important; flex-direction:column; align-items:center; justify-content:center; text-align:center;
  gap:.2rem !important; min-height:150px; border:2px dashed var(--trait); border-radius:var(--r); background:#faf9f7; cursor:pointer; padding:1rem}
.drop.over{border-color:var(--or-f); background:#fdf6dc}
.drop input{position:absolute; inset:0; opacity:0; cursor:pointer}
.drop-main{font-weight:600; font-size:1rem}
.drop-sub{font-size:.82rem; color:var(--doux); font-weight:400}

/* ---------- Connexion ---------- */
.auth{max-width:380px; margin:10vh auto 2rem; background:var(--papier); border:1px solid var(--trait); border-radius:var(--r); padding:1.6rem 1.4rem}
.auth-logo{display:block; width:100%; max-width:260px; height:auto; margin:0 0 1.2rem}

/* ---------- Évacuation ---------- */
.evac-head{margin-bottom:1rem}
.evac-total b{font-size:1.2rem}
.evac-table tbody tr{cursor:pointer}
.evac-table tr.doubt td{color:var(--doux)}
.evac-table .box{display:inline-block; width:22px; height:22px; border:2px solid var(--gris); border-radius:4px; vertical-align:middle}
.evac-table tr.ok .box{background:var(--vert); border-color:var(--vert); box-shadow:inset 0 0 0 3px #fff}
.evac-table tr.ok td:nth-child(2){text-decoration:line-through; text-decoration-color:var(--vert)}
.evac h2 small{font-weight:400; color:var(--doux)}

@media print{
  .top, .tabs, .no-print, .toolbar, .flash{display:none !important}
  body{background:#fff; padding:0; font-size:11pt}
  main{max-width:none; padding:0}
  .evac-table{page-break-inside:auto} .evac-table tr{page-break-inside:avoid}
  .evac-table .box{border-color:#000}
  .evac h2{page-break-after:avoid}
}
@media (prefers-reduced-motion:reduce){ *{scroll-behavior:auto !important; transition:none !important} }

/* ---------- Version sans base ---------- */
body{padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom))}
.tabs button{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; height:var(--nav-h);
  background:none; border:0; color:var(--doux); font:inherit; font-size:.72rem; font-weight:500; cursor:pointer}
.tabs button svg{width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
.tabs button.on{color:var(--encre)} .tabs button.on svg{stroke:var(--or-f)}
.tabs button:disabled{opacity:.35; cursor:default}
@media (min-width:900px){
  .tabs button{flex:none; flex-direction:row; gap:.45rem; height:46px; padding:0 1rem; font-size:.88rem; border-bottom:3px solid transparent}
  .tabs button.on{border-bottom-color:var(--or)} .tabs button svg{width:18px; height:18px}
}
.view[hidden]{display:none !important}
.hero-drop{max-width:680px; margin:6vh auto 1rem; text-align:center}
.hero-drop h1{font-size:1.6rem}
.hero-drop .drop{min-height:220px; margin:1.2rem 0}
.files{list-style:none; padding:0; margin:.6rem 0 0; font-size:.85rem}
.files li{display:flex; flex-wrap:wrap; gap:.4rem .8rem; align-items:center; padding:.45rem 0; border-top:1px solid #ecebe8}
.files li b{font-weight:600} .files input{min-height:34px; padding:.3rem .5rem; font-size:.85rem; flex:1 1 200px}
.privacy{font-size:.8rem; color:var(--doux); max-width:560px; margin:0 auto}
.top .btn{flex:none}
.people button.row{all:unset; box-sizing:border-box; display:grid; width:100%; cursor:pointer; grid-template-columns:1fr auto; grid-template-areas:"who since" "co since" "via via"; gap:0 1rem; padding:.65rem .9rem}
@media (min-width:900px){ .people button.row{grid-template-columns:1.3fr 1fr 1fr auto; grid-template-areas:"who co via since"; align-items:center} }
dialog{border:0; border-radius:var(--r); padding:0; width:min(560px, 94vw); max-height:86vh}
dialog::backdrop{background:rgba(46,43,46,.45)}
.dlg{padding:1.1rem 1.2rem}
.dlg-close{float:right}
@media print{
  body.print-evac main > *:not(#v-evac){display:none !important}
  body.print-evac #v-evac{display:block !important}
}
