:root {
  --bg: #f4f2ec;
  --surface: #fbfaf7;
  --surface-2: #f0ede5;
  --ink: #17160f;
  --ink-2: #4d4a40;
  --muted: #7a776b;
  --line: #e4e0d5;
  --line-2: #d3cebf;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --accent-soft: #dfeee7;
  --warn: #b35f10;
  --warn-soft: #f8ead8;
  --danger: #b0342c;
  --danger-soft: #f6e2df;
  --info-soft: #e6e9f1;
  --track: #e7e3d9;
  --shadow: 0 1px 1px rgba(63, 56, 36, 0.04), 0 10px 30px -18px rgba(63, 56, 36, 0.35);
  --shadow-lift: 0 2px 4px rgba(63, 56, 36, 0.05), 0 18px 40px -20px rgba(63, 56, 36, 0.4);
  --c-a: #0f6e56; --c-b: #c2410c; --c-c: #1d4ed8; --c-d: #7c3aed; --c-e: #b91c1c; --c-f: #a16207;
  --radius-l: 20px;
  --radius: 14px;
  --radius-s: 10px;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --nav-h: 64px;
  --z-nav: 20; --z-sticky: 10; --z-fab: 15; --z-toast: 50;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131412; --surface: #1b1c19; --surface-2: #232420; --ink: #f1efe8; --ink-2: #c9c6bb; --muted: #94917f;
    --line: #2a2c27; --line-2: #3a3c36; --accent: #3fb48e; --accent-ink: #0b1f18; --accent-soft: #1b322a;
    --warn: #e8a24a; --warn-soft: #35270f; --danger: #ef7066; --danger-soft: #3b1c19; --info-soft: #22263a; --track: #2a2c27;
    --shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 30px -18px rgba(0,0,0,.7); --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 18px 40px -20px rgba(0,0,0,.8);
    --c-a: #3fb48e; --c-b: #f1823f; --c-c: #6b94ff; --c-d: #b08cff; --c-e: #f36b63; --c-f: #e5b43c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131412; --surface: #1b1c19; --surface-2: #232420; --ink: #f1efe8; --ink-2: #c9c6bb; --muted: #94917f;
  --line: #2a2c27; --line-2: #3a3c36; --accent: #3fb48e; --accent-ink: #0b1f18; --accent-soft: #1b322a;
  --warn: #e8a24a; --warn-soft: #35270f; --danger: #ef7066; --danger-soft: #3b1c19; --info-soft: #22263a; --track: #2a2c27;
  --shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 30px -18px rgba(0,0,0,.7); --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 18px 40px -20px rgba(0,0,0,.8);
  --c-a: #3fb48e; --c-b: #f1823f; --c-c: #6b94ff; --c-d: #b08cff; --c-e: #f36b63; --c-f: #e5b43c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  font-feature-settings: "tnum" 1, "ss01" 1; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 28px; letter-spacing: -0.025em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.stack > *, .grid-2 > *, .list > * { min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; text-decoration: none; transition: top .15s; }
.skip:focus { top: 12px; }

/* ---------- Chargement ---------- */
.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 90; }
.loading .brand-mark { display: block; width: 28px; height: 28px; border-radius: 9px; background: var(--accent); box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 9px var(--accent); animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.86); opacity: .6; } }

/* ---------- Mise en page ---------- */
.app { min-height: 100dvh; display: grid; grid-template-columns: 1fr; position: relative; z-index: 1; }
.sidebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.brand, .sidebar-foot, #deadline-side { display: none; }
.nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11px; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav a .nav-ico { width: 22px; height: 22px; transition: transform .25s var(--ease); }
.nav a.active { color: var(--accent); }
.nav a.active .nav-ico { transform: translateY(-1px); }
.main { min-width: 0; }
.view { padding: 12px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; outline: none; overflow-x: hidden; animation: view-in .32s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stack > .card, .grid-2 > .card, .list > .item { animation: rise-in .4s var(--ease) both; }
.stack > :nth-child(2), .grid-2 > :nth-child(2), .list > :nth-child(2) { animation-delay: .04s; }
.stack > :nth-child(3), .grid-2 > :nth-child(3), .list > :nth-child(3) { animation-delay: .08s; }
.stack > :nth-child(4), .grid-2 > :nth-child(4), .list > :nth-child(4) { animation-delay: .12s; }
.stack > :nth-child(n+5), .grid-2 > :nth-child(n+5), .list > :nth-child(n+5) { animation-delay: .16s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  .app { grid-template-columns: 240px 1fr; }
  .sidebar { position: sticky; top: 0; height: 100dvh; border-top: 0; border-right: 1px solid var(--line); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); backdrop-filter: none; }
  .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; padding: 4px 8px 10px; letter-spacing: -0.02em; }
  .brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 7px var(--accent); }
  #deadline-side { display: flex; }
  .nav { display: flex; flex-direction: column; height: auto; gap: 2px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
  .nav a .nav-ico { width: 19px; height: 19px; }
  .nav a.active { background: var(--accent-soft); color: var(--accent); }
  .nav a.active .nav-ico { transform: none; }
  .nav a:hover:not(.active) { background: var(--surface-2); color: var(--ink); }
  .sidebar-foot { display: block; margin-top: auto; font-size: 13px; color: var(--muted); padding: 0 8px; }
  .view { padding: 36px 40px 56px; }
  .deadline-top { display: none !important; }
}

/* ---------- Compte à rebours ---------- */
.deadline { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 9px 12px; cursor: pointer; transition: border-color .2s, background .2s, transform .15s var(--ease); color: var(--ink); }
.deadline:hover { border-color: var(--line-2); background: var(--surface); }
.deadline:active { transform: scale(.985); }
.deadline .ring { width: 30px; height: 30px; flex: none; transform: rotate(-90deg); }
.deadline .ring circle { fill: none; stroke-width: 3; }
.deadline .ring .t { stroke: var(--track); }
.deadline .ring .p { stroke: var(--c, var(--accent)); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.deadline .dl-title { font-size: 12px; color: var(--muted); line-height: 1.2; }
.deadline .dl-time { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.25; white-space: nowrap; }
.deadline .dl-time .sec { color: var(--muted); font-weight: 500; }
.deadline.late .dl-time { color: var(--danger); }
.deadline-top { position: sticky; top: 0; z-index: var(--z-sticky); width: auto; margin: 10px 16px 0; border-radius: 999px; padding: 6px 12px 6px 8px; box-shadow: var(--shadow); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); }
.deadline-top .ring { width: 26px; height: 26px; }
.deadline-top .dl-title { display: none; }
.deadline-top .dl-time { font-size: 13px; }
.deadline .chev { width: 16px; height: 16px; margin-left: auto; color: var(--muted); flex: none; }

/* ---------- Panneau d'échéances ---------- */
.sheet { border: 0; padding: 0; background: var(--surface); color: var(--ink); width: min(100vw, 560px); max-width: 100vw; max-height: 86dvh; margin: auto 0 0; border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.45); }
.sheet::backdrop { background: rgba(10, 10, 8, .45); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-up .32s var(--ease); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto; }
.sheet .hero { padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); display: grid; gap: 6px; }
.sheet .hero .big { font-family: var(--serif); font-size: 40px; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.sheet .hero .big small { font-family: var(--font); font-size: 14px; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.sheet .dl-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; transition: background .15s; }
.sheet .dl-item:hover { background: var(--surface-2); }
.sheet .dl-item .d { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (min-width: 900px) {
  .sheet { margin: auto; border-radius: var(--radius-l); max-height: 80dvh; }
  .sheet[open] { animation: modal-in .28s var(--ease); }
  .sheet .grip { display: none; }
}

/* ---------- En-têtes ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.page-head .eyebrow::first-letter { text-transform: uppercase; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.section-title h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; text-align: center; padding: 9px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; min-width: 0; max-width: 100%; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.card.dim { opacity: 0.68; }
.card .color-bar { position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.card-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 680px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Puces et états ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--ink-2); border-color: transparent; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; display: inline-block; }

/* ---------- Progression ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--accent)); transition: width .6s var(--ease); }
.bar > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); opacity: .55; }
.bar.thin { height: 5px; }
.hist { display: flex; gap: 4px; }
.hist i { width: 10px; height: 10px; border-radius: 3px; background: var(--track); }
.hist i.met { background: var(--accent); }
.hist i.miss { background: var(--danger); opacity: .5; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; line-height: 1; transition: transform .12s var(--ease), background .18s, border-color .18s, box-shadow .18s; touch-action: manipulation; user-select: none; text-decoration: none; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 16px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 20px -10px var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.icon { padding: 8px; width: 40px; }
.btn.quick { background: var(--surface-2); min-width: 56px; border-color: transparent; }
.btn.quick:hover { background: var(--accent-soft); color: var(--accent); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: var(--z-fab); width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 0; font-size: 26px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.4); cursor: pointer; }
@media (min-width: 900px) { .fab { display: none; } }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 680px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.warn .v { color: var(--warn); }
.stat.danger .v { color: var(--danger); }
.stat.ok .v { color: var(--accent); }

/* ---------- Listes ---------- */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s; }
.item:hover { border-color: var(--line-2); }
.item.done .t { text-decoration: line-through; color: var(--muted); }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--surface); flex: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: transparent; font-size: 14px; transition: background .2s, border-color .2s, transform .15s var(--ease); }
.check:hover { border-color: var(--accent); }
.check:active { transform: scale(.9); }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; }

/* ---------- Minuteur ---------- */
.timerbar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--ink); color: var(--bg); padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.timerbar .pulse { width: 10px; height: 10px; border-radius: 50%; background: #3fb48e; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .5; transform: scale(.8);} }
.timerbar .clock { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timerbar .btn { background: transparent; color: inherit; border-color: rgba(255,255,255,.3); }
.timerbar .btn.primary { background: var(--bg); color: var(--ink); box-shadow: none; }

/* ---------- Bannière, toasts ---------- */
.banner { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: var(--z-toast); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lift); animation: rise .28s var(--ease); }
.toast.err { background: var(--danger); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* ---------- Formulaires, modale ---------- */
.modal { border: 0; border-radius: var(--radius-l); padding: 0; background: var(--surface); color: var(--ink); width: min(100vw - 24px, 520px); max-height: min(92dvh, 760px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.modal::backdrop { background: rgba(10, 10, 8, .5); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .26s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal form { display: grid; gap: 14px; padding: 22px; }
.modal h2 { font-size: 19px; }
.field { display: grid; gap: 6px; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.input:hover { border-color: var(--ink-2); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
textarea.input { min-height: 72px; resize: vertical; }
.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: var(--radius-s); padding: 3px; gap: 3px; }
.seg label { text-align: center; padding: 8px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); transition: background .2s, color .2s; }
.seg input { display: none; }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.days label { text-align: center; padding: 8px 0; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.days input { display: none; }
.days input:checked + label { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .btn { min-height: 30px; padding: 4px 10px; font-size: 12px; font-weight: 500; }
.colors { display: flex; gap: 8px; }
.colors label { width: 28px; height: 28px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid transparent; transition: transform .15s var(--ease); }
.colors label:hover { transform: scale(1.1); }
.colors input { display: none; }
.colors input:checked + label { border-color: var(--ink); }
.actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.actions .left { margin-right: auto; }
.form-error { color: var(--danger); font-size: 13px; }

/* ---------- Connexion ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth .card { width: min(100%, 400px); padding: 30px 26px; animation: rise-in .45s var(--ease); }
.auth .brand-big { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.02em; }
.auth .brand-big .brand-mark { display: block; width: 28px; height: 28px; border-radius: 9px; background: var(--accent); box-shadow: inset 0 0 0 6px var(--surface), inset 0 0 0 9px var(--accent); }

/* ---------- Graphiques ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .expected { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.chart .actual { stroke: var(--c, var(--accent)); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--c, var(--accent)); opacity: .12; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 110px; }
.bars .col { display: grid; align-content: end; justify-items: center; gap: 4px; height: 100%; }
.bars .col .b { width: 100%; max-width: 34px; background: var(--track); border-radius: 6px 6px 2px 2px; position: relative; transition: outline-color .2s; }
.bars .col .b > i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 6px 6px 2px 2px; }
.bars .col.current .b > i { background: var(--c-c); }
.bars .col .lab { font-size: 11px; color: var(--muted); }

.empty { text-align: center; padding: 36px 18px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius-l); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.empty h2 { color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: 24px; }
.empty .btn { margin-top: 14px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; padding: 6px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
