:root{--navy:#071d3a;--blue:#123f72;--ice:#eef7ff;--red:#d51f2a;--red-dark:#a8141e;--gold:#ffb000;--text:#182231;--muted:#5b6878;--line:#dbe3ec;--bg:#f3f7fb;--radius:14px;--shadow:0 10px 28px rgba(4,22,44,.10)}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--text);background:var(--bg);line-height:1.5;min-height:100vh;display:flex;flex-direction:column}
a{color:#0d4f8f}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
h1{font-size:clamp(1.5rem,3vw,2rem);color:var(--navy);margin:0 0 .4rem}
h2{font-size:1.2rem;color:var(--navy);margin:0 0 .9rem}
.lead{color:var(--muted);margin:0 0 1.4rem;max-width:70ch}
.muted{color:var(--muted)}.small{font-size:.88rem}

/* Barre du haut */
.topbar{background:linear-gradient(135deg,#06172f,#123f72);color:#fff;border-bottom:4px solid var(--red)}
.topbar-inner{max-width:1120px;margin:auto;padding:.7rem 1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:.7rem;color:#fff;text-decoration:none}
.brand img{width:40px;height:40px;border-radius:50%;background:#fff;object-fit:contain;padding:2px}
.brand span{display:flex;flex-direction:column;line-height:1.15}.brand small{color:#bbdcff;font-size:.78rem}
.nav{display:flex;align-items:center;gap:.25rem;flex-wrap:wrap}
.nav a,.nav button{color:#e8f4ff;text-decoration:none;font:inherit;font-weight:650;font-size:.92rem;padding:.45rem .75rem;border-radius:999px;border:0;background:transparent;cursor:pointer}
.nav a:hover,.nav button:hover{background:rgba(255,255,255,.12)}
.nav a[aria-current="page"]{background:#fff;color:var(--navy)}
.nav-logout{margin:0}

.wrap{max-width:1120px;width:100%;margin:0 auto;padding:1.6rem 1rem 3rem;flex:1}
.layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:1.2rem;align-items:start;margin-bottom:1.2rem}
.card{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:1.35rem;margin-bottom:1.2rem}
.layout .card{margin-bottom:0}
.stack{display:grid;gap:1.2rem;align-content:start}
.login-card{max-width:440px;margin:2rem auto}

/* Formulaires */
.form{display:flex;flex-direction:column;gap:.35rem}
.form label,.form legend{font-weight:700;color:var(--navy);margin-top:.7rem;display:flex;align-items:center;gap:.5rem}
fieldset{border:0;padding:0;margin:0}
input[type=text],input[type=password],input[type=file],select{width:100%;font:inherit;padding:.7rem .8rem;border:1.5px solid var(--line);border-radius:10px;background:#fff;color:var(--text);min-height:46px}
input:focus,select:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 3px rgba(18,63,114,.18)}
input[type=file]{padding:.55rem;background:var(--ice)}
.hint{font-size:.85rem;color:var(--muted);margin:.1rem 0 0}
.step{display:inline-grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:50%;background:var(--navy);color:#fff;font-size:.85rem}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:.35rem}
.form .choice{display:block;position:relative;margin:0;cursor:pointer}
.choice input{position:absolute;opacity:0;inset:0}
.choice span{transition:none;display:flex;align-items:center;justify-content:center;text-align:center;min-height:62px;padding:.6rem;border:2px solid var(--line);border-radius:12px;font-weight:800;color:var(--navy);background:#fff;transition:.15s}
.choice-glace span:before{content:"❄";margin-right:.45rem;color:#2a8ad8}
.choice-physique span:before{content:"●";margin-right:.45rem;color:var(--red)}
.choice input:checked+span{border-color:var(--navy);background:var(--navy);color:#fff}
.choice input:checked+span:before{color:#fff}
.choice input:focus-visible+span{outline:3px solid var(--gold);outline-offset:2px}
.preview{max-width:100%;max-height:260px;object-fit:contain;border:1px solid var(--line);border-radius:10px;margin-top:.6rem;background:#fff}
.inline{display:flex;gap:.5rem;align-items:center}
.inline input{flex:1;min-width:0}

/* Boutons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:44px;padding:.6rem 1.1rem;border-radius:999px;border:0;font:inherit;font-weight:800;cursor:pointer;text-decoration:none;white-space:nowrap}
.btn-primary{background:var(--red);color:#fff;margin-top:.9rem}
.btn-primary:hover{background:var(--red-dark)}
.btn-block{width:100%}
.btn-danger{background:#fff;color:var(--red-dark);border:1.5px solid #f0b9bd}
.btn-danger:hover{background:#fdecee}
.btn-ghost{background:var(--ice);color:var(--navy)}
.btn-ghost:hover{background:#dcecfb}
.btn-sm{min-height:36px;padding:.35rem .8rem;font-size:.85rem;margin-top:0}
.inline .btn-primary{margin-top:0}

/* Alertes */
.alert{border-radius:12px;padding:.85rem 1rem;margin:0 0 1rem;font-weight:600;border-left:6px solid}
.alert-success{background:#e9f8ef;border-color:#1f9d55;color:#145c34}
.alert-error{background:#fdecee;border-color:var(--red);color:#8a111a}
.alert-info{background:var(--ice);border-color:var(--blue);color:var(--navy)}
.alert-warn{background:#fff6e0;border-color:var(--gold);color:#6b4a00;margin:.8rem 0 0}

/* Liste des plannings */
.plist{list-style:none;margin:0;padding:0;display:grid;gap:.8rem}
.pitem{display:grid;grid-template-columns:120px 1fr auto;gap:.9rem;align-items:center;padding:.7rem;border:1px solid var(--line);border-radius:12px}
.pthumb img{width:120px;height:85px;object-fit:cover;object-position:top left;border-radius:8px;border:1px solid var(--line);background:#fff}
.pinfo{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.pdelete{margin:0}
.tag{display:inline-block;align-self:flex-start;font-size:.75rem;font-weight:800;padding:.1rem .55rem;border-radius:999px;background:var(--ice);color:var(--navy)}
.tag-glace{background:#e1f0fd;color:#0d4f8f}
.tag-physique{background:#fde6e8;color:var(--red-dark)}
.tag-off{background:#eee;color:#666}
.empty{color:var(--muted);background:var(--bg);border-radius:10px;padding:1rem;text-align:center}

/* Tableaux */
.table-wrap{overflow-x:auto}
.table{width:100%;border-collapse:collapse;font-size:.93rem}
.table th{text-align:left;color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;padding:.5rem;border-bottom:2px solid var(--line)}
.table td{padding:.6rem .5rem;border-bottom:1px solid var(--line);vertical-align:middle}
.table tr.inactive td{opacity:.6}
.actions{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.actions form{margin:0}
.reset summary{list-style:none}
.reset summary::-webkit-details-marker{display:none}
.reset[open]{flex-basis:100%}
.reset[open] form{margin-top:.5rem}
.table-log td{font-size:.88rem}
code{background:var(--bg);padding:.1rem .35rem;border-radius:6px;font-size:.88em}
code.copy{display:block;padding:.7rem;overflow-wrap:anywhere;user-select:all}

.checks{list-style:none;padding:0;margin:1rem 0;display:grid;gap:.35rem}
.checks li{padding:.45rem .7rem;border-radius:8px;font-weight:600}
.checks .ok{background:#e9f8ef;color:#145c34}
.checks .ko{background:#fdecee;color:#8a111a}

.foot{text-align:center;color:var(--muted);font-size:.85rem;padding:1.2rem 1rem;border-top:1px solid var(--line);background:#fff}

@media (max-width:860px){.layout{grid-template-columns:1fr}}
@media (max-width:560px){
  .topbar-inner{justify-content:center}.nav{justify-content:center}
  .pitem{grid-template-columns:90px 1fr}.pthumb img{width:90px;height:68px}
  .pdelete{grid-column:1/-1}.pdelete .btn{width:100%}
  .table thead{display:none}.table tr{display:block;border-bottom:2px solid var(--line);padding:.4rem 0}
  .table td{display:flex;gap:.6rem;border:0;padding:.3rem 0}
  .table td:before{content:attr(data-label);font-weight:700;color:var(--muted);min-width:7.5rem;font-size:.82rem}
  .table td.actions:before{display:none}
}
