:root {
  --bg: #eef1f0; --surface: #ffffff; --ink: #14232b; --muted: #596a72; --line: #d3dbd9;
  --t1: #0e7c66; --t2: #c08a1e; --t3: #8795a0;
  --pleine: #1f4e6b; --absence: #8fb3c8; --incomplete: #c9d6de; --encours: #ffffff;
  --accent: #1f4e6b; --bad: #b3261e;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 650; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); background: var(--bg); }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
main { padding: 28px 20px 64px; }
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 40px 0 12px; }
.lead { max-width: 68ch; font-size: 17px; margin: 0 0 8px; color: #2c3d45; }
.sub { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; max-width: 70ch; }
.foot { margin-top: 48px; color: var(--muted); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* graphique */
.chart { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.chart .grid { stroke: #e6ebea; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .ref { stroke: var(--t2); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .reflabel { fill: #8a6414; font-size: 11px; font-weight: 600; }
.bar.pleine { fill: var(--pleine); } .bar.absence { fill: var(--absence); } .bar.incomplete { fill: var(--incomplete); }
.bar.en_cours { fill: var(--encours); stroke: var(--pleine); stroke-width: 1.5; stroke-dasharray: 3 2; }
.bar.vacances { fill: var(--line); }
.legend { list-style: none; display: flex; gap: 18px; flex-wrap: wrap; padding: 0; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw.pleine { background: var(--pleine); } .sw.absence { background: var(--absence); } .sw.incomplete { background: var(--incomplete); }
.sw.en_cours { background: #fff; border: 1.5px dashed var(--pleine); } .sw.vacances { background: var(--line); }
.sw.t1 { background: var(--t1); } .sw.t2 { background: var(--t2); } .sw.t3 { background: var(--t3); }

/* repères */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.kpis > div { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: -0.5px; }
.kpis dt { color: var(--muted); font-size: 13px; }
.kpis dd { margin: 2px 0 0; font-size: 22px; font-weight: 650; }
.kpis dd .sub { font-weight: 400; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 40px; }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } }

/* tableaux */
table.plain { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.plain th, table.plain td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain thead th { font-weight: 600; color: var(--muted); font-size: 13px; background: #f7f9f8; }
table.plain tfoot td { font-weight: 650; border-bottom: 0; background: #f7f9f8; }
table.plain tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; }
.barcell { width: 28%; vertical-align: middle !important; }
.hb { display: block; height: 8px; border-radius: 2px; background: var(--absence); }
.hb.ink { background: var(--pleine); }

/* délégation */
.split { display: flex; gap: 3px; height: 34px; margin-bottom: 14px; }
.seg { display: flex; align-items: center; padding: 0 10px; color: #fff; font-weight: 600; border-radius: 3px; min-width: 0; overflow: hidden; }
.seg.t1 { background: var(--t1); } .seg.t2 { background: var(--t2); } .seg.t3 { background: var(--t3); }
.progress { display: flex; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin-top: 14px; }
.progress .done { background: var(--t1); } .progress .wip { background: var(--t2); }

/* liste des tâches */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; cursor: pointer; color: var(--ink); }
.chip.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
select, input[type=text], input[type=search], input[type=number], input[type=password] {
  font: inherit; color: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); max-width: 100%;
}
input[type=search] { min-width: 200px; }
.btn { margin-left: auto; padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink); }
.saved { min-width: 150px; color: var(--t1); font-size: 13px; } .saved.bad { color: var(--bad); font-weight: 600; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table.tasks { width: 100%; border-collapse: collapse; min-width: 900px; }
table.tasks th, table.tasks td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tasks thead th { position: sticky; top: 0; background: #f7f9f8; font-size: 13px; color: var(--muted); z-index: 1; }
table.tasks tbody tr { box-shadow: inset 4px 0 0 var(--t3); }
table.tasks tbody tr.t1 { box-shadow: inset 4px 0 0 var(--t1); }
table.tasks tbody tr.t2 { box-shadow: inset 4px 0 0 var(--t2); }
table.tasks .act { padding-left: 16px; min-width: 280px; max-width: 420px; }
table.tasks .taux { width: 64px; text-align: right; }
table.tasks .note-in { width: 100%; min-width: 200px; }
table.tasks .gain { font-weight: 650; }
table.tasks tfoot td { position: sticky; bottom: 0; background: #f7f9f8; font-weight: 650; border-bottom: 0; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }

/* connexion */
.login { display: grid; place-items: center; min-height: 100vh; }
.login-box { width: min(360px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; display: grid; gap: 10px; }
.login-box h1 { font-size: 20px; }
.login-box button { font: inherit; padding: 9px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; margin-top: 6px; }
.err { color: var(--bad); margin: 0; }
@media (prefers-reduced-motion: no-preference) { .progress span { transition: width .3s; } }

/* mot de passe */
.pwform { display: grid; gap: 8px; max-width: 380px; margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.pwform label { font-weight: 600; font-size: 14px; margin-top: 6px; }
.pwform label:first-child { margin-top: 0; }
.pwform button { font: inherit; padding: 9px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; margin-top: 12px; }
.ok { color: var(--t1); font-weight: 600; margin: 14px 0 0; }
.pwform + .ok, .err { max-width: 380px; }
code { background: #e3e9e7; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* saisie des temps */
.btn.solid { margin-left: 0; background: var(--accent); color: #fff; border-color: var(--accent); display: inline-block; }
.daynav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 6px; }
.daynav .btn { margin-left: 0; }
.dayname { margin: 14px 0 12px; font-size: 22px; }
.absrow { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.absrow label { font-weight: 600; }
table.day td, table.day th { vertical-align: middle; }
table.day .hrs { width: 84px; text-align: right; }
table.day tfoot td { font-size: 17px; }
.rm { font: inherit; font-size: 13px; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
.rm:hover { color: var(--bad); }
.addrow input { width: 100%; max-width: 640px; }
.favs { margin: 6px 0 14px; }
.favs .chip { font-size: 13px; padding: 4px 11px; }
.newline { margin-top: 18px; }
.newline summary { cursor: pointer; color: var(--accent); }
.newline .pwform { margin-top: 12px; }
@media (max-width: 560px) { table.day .hrs { width: 70px; } }
