/* Soins OPAS — feuille de style (aucune ressource externe) */
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque-latin-ext-standard-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --ink: #0e1b3d;
  --muted: #5b6478;
  --line: #dfe3ea;
  --sky: #a9d8f7;
  --sky-ink: #0e1b3d;
  --navy: #0e2352;
  --navy-ink: #ffffff;
  --primary: #0e2352;
  --primary-ink: #ffffff;
  --link: #1d5fd0;
  --focus: #1d5fd0;
  --danger: #b3261e;
  --ok: #1e7a4c;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --lvl-a: #1d5fd0;
  --lvl-b: #b5650b;
  --lvl-c: #1e7a4c;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --radius: 22px;
  --radius-sm: 12px;
  --tabbar-h: 68px;
  --head: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1d; --surface: #131a2c; --surface-2: #1a2238; --ink: #e8edf7; --muted: #9aa5bd; --line: #27314b;
    --sky: #7fb9e3; --sky-ink: #0a0f1d; --navy: #22336a; --navy-ink: #ffffff; --primary: #9fd0f5; --primary-ink: #0a0f1d;
    --link: #8cc0f5; --focus: #8cc0f5; --danger: #f2837b; --ok: #6fcf9a; --warn: #f0c060; --warn-bg: #3a2c10;
    --lvl-a: #8cc0f5; --lvl-b: #f0b060; --lvl-c: #6fcf9a;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1d; --surface: #131a2c; --surface-2: #1a2238; --ink: #e8edf7; --muted: #9aa5bd; --line: #27314b;
  --sky: #7fb9e3; --sky-ink: #0a0f1d; --navy: #22336a; --navy-ink: #ffffff; --primary: #9fd0f5; --primary-ink: #0a0f1d;
  --link: #8cc0f5; --focus: #8cc0f5; --danger: #f2837b; --ok: #6fcf9a; --warn: #f0c060; --warn-bg: #3a2c10;
  --lvl-a: #8cc0f5; --lvl-b: #f0b060; --lvl-c: #6fcf9a;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--link); }
h1, h2, h3, .head { font-family: var(--head); letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 .25rem; font-weight: 750; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; font-weight: 700; }
h3 { font-size: .78rem; margin: 1.4rem 0 .55rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: inherit; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Barre du haut ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar .back { display: inline-flex; align-items: center; gap: .2rem; color: var(--ink); text-decoration: none; font-weight: 600; min-height: 40px; }
.topbar .title { font-family: var(--head); font-weight: 700; font-size: 1.05rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo-btn {
  display: inline-flex; align-items: center; gap: .35rem; border-radius: 99px; padding: .45rem .85rem; min-height: 40px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.undo-btn svg.i { width: 18px; height: 18px; }
.undo-btn:disabled { opacity: .45; cursor: default; }

.imperso {
  display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap;
  background: var(--warn-bg); color: var(--ink); padding: .5rem 1rem; font-size: .9rem; border-bottom: 1px solid var(--line);
}
.imperso button { min-height: 34px; padding: .3rem .8rem; }

main { max-width: 1100px; margin: 0 auto; padding: .5rem 1rem calc(var(--tabbar-h) + 6rem); }
main.narrow { max-width: 760px; }

/* ── Barre d'onglets ───────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 500; position: relative;
}
.tabbar a.active { color: var(--link); }
.tabbar a.active svg.i { fill: color-mix(in srgb, var(--link) 18%, transparent); }
@media (min-width: 900px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 640px; bottom: 14px; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 30px rgba(14, 27, 61, .12); padding-bottom: 0; } }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 68px; height: 68px; border-radius: 22px; border: 0; cursor: pointer;
  background: var(--sky); color: var(--sky-ink); display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(14, 35, 82, .22);
}
.fab svg.i { width: 30px; height: 30px; stroke-width: 1.6; }
@media (min-width: 900px) { .fab { right: calc(50% - 540px); bottom: 100px; } }

/* ── Accueil ───────────────────────────────────────── */
.hello { margin: .75rem 0 1.1rem; }
.hello h1 { font-size: 2rem; }
.hero-cards { display: grid; gap: 14px; }
@media (min-width: 760px) { .hero-cards { grid-template-columns: 1fr 1fr; } }
.hero {
  position: relative; overflow: hidden; display: block; text-decoration: none;
  border-radius: var(--radius); padding: 18px 20px; min-height: 172px;
}
.hero.sky { background: var(--sky); color: var(--sky-ink); }
.hero.navy { background: var(--navy); color: var(--navy-ink); }
.hero .badge {
  width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #0e1b3d;
  display: grid; place-items: center; font-weight: 700; font-family: var(--head); font-size: 1.1rem; position: relative; z-index: 1;
}
.hero .badge svg.i { width: 24px; height: 24px; }
.hero .label { position: absolute; left: 20px; bottom: 18px; font-family: var(--head); font-weight: 750; font-size: 1.6rem; line-height: 1.05; max-width: 55%; z-index: 1; }
.hero .pill {
  position: absolute; right: 16px; bottom: 18px; z-index: 1; border: 1.5px solid currentColor; border-radius: 99px;
  padding: .2rem .7rem; font-size: .82rem; font-weight: 600; background: color-mix(in srgb, currentColor 0%, transparent);
  max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero.sky .pill { background: rgba(255, 255, 255, .55); }
.hero.navy .pill { background: rgba(255, 255, 255, .06); }
.hero .art { position: absolute; right: 10px; top: 6px; width: 62%; max-width: 280px; height: auto; pointer-events: none; }
.hero:active { transform: scale(.99); }

.panel { background: var(--surface-2); border-radius: var(--radius); padding: 18px 18px 8px; margin-top: 14px; }
.panel > h2 { margin-bottom: .6rem; }
.items { list-style: none; margin: 0; padding: 0; }
.items li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.item {
  display: flex; align-items: center; gap: 14px; padding: 10px 0; color: inherit; text-decoration: none; min-height: 64px; width: 100%;
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.item .thumb {
  width: 54px; height: 54px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font-family: var(--head); font-weight: 750; color: #fff; font-size: 1.05rem;
}
.item .thumb.icon { background: var(--surface); color: var(--ink); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.item .chev { color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 96px;
  display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: var(--ink);
}
.tile .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.tile .tl { font-weight: 650; margin-top: .6rem; }
.tile .ct { font-size: .8rem; color: var(--muted); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 1.6rem 0 .2rem; }
.section-title h2 { margin: 0; }

/* ── Cartes, listes, formulaires ───────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card.soft { background: var(--surface-2); border-color: transparent; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.banner { background: var(--warn-bg); border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .9rem; margin-bottom: 14px; }
.banner.info { background: color-mix(in srgb, var(--sky) 35%, var(--surface)); }

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.chip { font-size: .75rem; padding: .18rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; font-weight: 600; }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.off { text-decoration: line-through; }

.filters { display: flex; gap: .4rem; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.filters button { border-radius: 99px; min-height: 38px; padding: .35rem .9rem; font-weight: 600; font-size: .88rem; background: var(--surface); white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { position: relative; margin-bottom: 10px; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 40px; border-radius: 14px; }

label { display: block; font-size: .8rem; font-weight: 650; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: .6rem .75rem; min-height: 46px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:disabled { opacity: .6; }
.grid { display: grid; gap: .85rem 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid .wide { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.check {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .95rem; font-weight: 500; color: var(--ink);
  padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; margin: 0; min-height: 42px;
}
.check input { width: auto; min-height: 0; margin: 0; accent-color: var(--link); }
.check:has(input:checked) { background: color-mix(in srgb, var(--sky) 45%, var(--surface)); border-color: var(--link); }
.switch { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink); font-size: .95rem; cursor: pointer; }
.switch input { width: 44px; height: 26px; min-height: 0; appearance: none; -webkit-appearance: none; border-radius: 99px; background: var(--line); position: relative; border: 0; padding: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 21px; }

button, .btn {
  font: inherit; font-weight: 650; border-radius: 12px; padding: .6rem 1rem; min-height: 46px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
}
button svg.i, .btn svg.i { width: 19px; height: 19px; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
button.sky, .btn.sky { background: var(--sky); border-color: var(--sky); color: var(--sky-ink); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); background: transparent; }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; color: var(--link); padding: .4rem .5rem; min-height: 38px; }
button.icon { padding: 0; width: 42px; min-height: 42px; border-color: transparent; background: transparent; color: var(--muted); }
button:disabled { opacity: .45; cursor: default; }
.error { color: var(--danger); font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: .55rem .6rem .55rem 1rem; border-radius: 14px; font-weight: 500; z-index: 60;
  max-width: min(92vw, 520px); display: flex; align-items: center; gap: .75rem; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.err { background: var(--danger); color: #fff; padding-right: 1rem; }
.toast button { min-height: 36px; padding: .3rem .8rem; background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); }

/* ── Fenêtres ──────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(5, 10, 25, .45); z-index: 70; display: grid; place-items: end center; padding: 0; }
@media (min-width: 640px) { .overlay { place-items: center; padding: 1rem; } }
.modal {
  background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .modal { border-radius: 24px; } }
.modal h2 { margin-bottom: .4rem; }
.modal .actions { margin-top: 1.1rem; justify-content: flex-end; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem; background: var(--surface-2); border-radius: 12px; padding: .7rem 1rem; text-align: center; letter-spacing: .02em; user-select: all; }

/* ── Fiche OPAS ────────────────────────────────────── */
.plan-layout { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .plan-layout { grid-template-columns: 1fr 310px; align-items: start; } .summary { position: sticky; top: 74px; } }
.lignes { width: 100%; border-collapse: collapse; }
.lignes th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 650; padding: .4rem .35rem; border-bottom: 1px solid var(--line); }
.lignes td { padding: .4rem .35rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lignes td.num { text-align: right; white-space: nowrap; }
.lignes input, .lignes select { min-height: 42px; padding: .4rem .5rem; }
.lignes .w-num { width: 74px; }
.lignes .w-freq { width: 136px; }
.lignes tr.groupe td { background: var(--surface-2); font-weight: 650; font-size: .8rem; color: var(--ink); border-radius: 8px; }
.acte-lib { font-weight: 550; }
.acte-meta { font-size: .75rem; color: var(--muted); }
.lvl { display: inline-block; min-width: 1.45rem; text-align: center; font-weight: 750; font-size: .72rem; border-radius: 6px; padding: 0 .3rem; color: #fff; }
.lvl-A { background: var(--lvl-a); } .lvl-B { background: var(--lvl-b); } .lvl-C { background: var(--lvl-c); }
:root[data-theme="dark"] .lvl { color: #0a0f1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lvl { color: #0a0f1d; } }
@media (max-width: 700px) {
  .lignes thead { display: none; }
  .lignes .w-num, .lignes .w-freq { width: 100%; }
  .lignes tr:not(.groupe) { display: grid; grid-template-columns: 64px 1fr 56px 40px; gap: .35rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
  .lignes tr:not(.groupe) td { border: 0; padding: 0; }
  .lignes tr:not(.groupe) td:first-child { grid-column: 1 / -1; }
  .lignes tr:not(.groupe) td:nth-child(5) { grid-column: 1 / 4; grid-row: 3; text-align: left; }
  .lignes tr:not(.groupe) td:nth-child(5) br { display: none; }
  .lignes tr:not(.groupe) td:nth-child(6) { grid-column: 4; grid-row: 2; }
}
.summary .tot { display: grid; grid-template-columns: auto 1fr auto; gap: .4rem .6rem; align-items: baseline; }
.summary .tot .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.summary .big { font-family: var(--head); font-size: 1.6rem; font-weight: 750; }
.summary hr { border: 0; border-top: 1px solid var(--line); margin: .85rem 0; }
.summary .actions button { flex: 1 1 auto; }
.adder { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.adder input { flex: 1 1 240px; }
.picker { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; margin-top: .5rem; background: var(--surface); }
.picker button { display: flex; width: 100%; justify-content: space-between; gap: .75rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; font-weight: 450; }
.picker .grp { position: sticky; top: 0; background: var(--surface-2); font-size: .75rem; font-weight: 650; color: var(--muted); padding: .35rem .75rem; }
.proche { display: grid; grid-template-columns: 2fr 1fr 1.3fr auto; gap: .5rem; margin-bottom: .5rem; }
@media (max-width: 600px) { .proche { grid-template-columns: 1fr 1fr; } }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: .35rem; }
.progress > span { display: block; height: 100%; background: var(--link); border-radius: 99px; }
.abc { display: inline-flex; gap: .35rem; flex-wrap: wrap; }

/* ── Historique ────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.kpi .v { font-family: var(--head); font-size: 1.7rem; font-weight: 750; line-height: 1.1; }
.kpi .l { font-size: .8rem; color: var(--muted); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .sr-creations { fill: var(--series-1); } .chart .sr-modifications { fill: var(--series-2); } .chart .sr-pdf { fill: var(--series-3); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover, .chart .hit.on { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink); margin-bottom: .5rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: .5rem .7rem; font-size: .82rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 150px; z-index: 5; color: var(--ink);
}
.tip .r { display: flex; align-items: center; gap: .45rem; justify-content: space-between; }
.tip .r b { font-variant-numeric: tabular-nums; }
.tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
details.table-view summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: .9rem; margin-top: .6rem; }
table.simple { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.simple th, table.simple td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); }
table.simple th { font-size: .75rem; color: var(--muted); }
table.simple td.n, table.simple th.n { text-align: right; font-variant-numeric: tabular-nums; }

.day { font-size: .8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 1.2rem 0 .3rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 25px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.timeline .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; z-index: 1; border: 3px solid var(--bg); }
.timeline .dot svg.i { width: 18px; height: 18px; }
.k-create { background: color-mix(in srgb, var(--series-1) 18%, var(--surface)); color: var(--series-1); }
.k-update { background: color-mix(in srgb, var(--series-2) 18%, var(--surface)); color: var(--series-2); }
.k-pdf { background: color-mix(in srgb, var(--series-3) 20%, var(--surface)); color: var(--series-3); }
.k-delete { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--danger); }
.k-event { background: var(--surface-2); color: var(--muted); }
.timeline .tx { flex: 1; min-width: 0; padding-top: 2px; }
.timeline .tx .t { font-weight: 550; }
.timeline .tx .s { font-size: .82rem; color: var(--muted); }
.timeline .undone .t { text-decoration: line-through; color: var(--muted); }

/* ── Connexion ─────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: 100%; max-width: 400px; }
.login .hero { min-height: 140px; margin-bottom: 14px; }
.login form > * + * { margin-top: .9rem; }
.login button { width: 100%; }
.qr svg { width: 200px; height: 200px; display: block; background: #fff; border-radius: 12px; padding: 6px; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary.head { font-weight: 700; }
.imperso svg.i { width: 20px; height: 20px; }

.item.wrap .t, .item.wrap .s { white-space: normal; }
.item.wrap .body > div:last-child { margin-top: .3rem; }
.imperso { flex-wrap: nowrap; justify-content: space-between; padding-top: max(.5rem, env(safe-area-inset-top)); }

.toast > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .back:not([hidden]) + .title { display: none; } }

/* ── v0.3 : équipe, informations, statut, collaboration, administration ── */
.lvl { white-space: nowrap; }
.acte-lib .lvl { margin-right: .15rem; vertical-align: 1px; }
.team { display: grid; gap: .4rem; }
.team-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.team-row:first-child { border-color: color-mix(in srgb, var(--link) 45%, var(--line)); }
.team-rank { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--surface-2); }
.team-row:first-child .team-rank { background: var(--link); color: #fff; }
.team-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.team-name .muted { font-weight: 450; }
.team .adder select { flex: 1 1 240px; }
.infos { display: grid; gap: .5rem; }
.info-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: .5rem; }
@media (max-width: 600px) { .info-row { grid-template-columns: 1fr auto; } .info-row .info-val { grid-column: 1 / 2; } }
.infos > button.ghost { justify-self: start; }

.banner { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.banner > span:first-of-type { flex: 1 1 220px; }
.banner.draft { background: color-mix(in srgb, var(--series-2) 14%, var(--surface)); }
.banner.done { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.banner.link { color: var(--ink); text-decoration: none; margin-top: 14px; }
.banner .actions button { min-height: 38px; padding: .35rem .8rem; }
.chip { display: inline-flex; align-items: center; gap: .2rem; }
.chip svg.i { width: 13px; height: 13px; }
.chip.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.chip.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.panel > h2 .chip { margin-left: .4rem; vertical-align: middle; }

button.block { width: 100%; }
.finish { display: grid; gap: .5rem; margin-top: .85rem; padding: .8rem; border-radius: 16px; background: var(--surface-2); }
.finish-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.finish button { width: 100%; justify-content: flex-start; }
.actions.secondary { margin-top: .85rem; }
.actions.secondary button { flex: 1 1 auto; min-height: 40px; padding: .4rem .7rem; font-size: .9rem; }
.plan-layout.locked .check { cursor: default; }
.item .s.quote { white-space: normal; font-style: italic; }
.item .end svg.i { width: 15px; height: 15px; vertical-align: -3px; }

.env-banner { background: repeating-linear-gradient(135deg, #ffd24a 0 14px, #ffe48a 14px 28px); color: #3a2a00; text-align: center; font-weight: 700; font-size: .85rem; padding: .3rem 1rem; }

.kpis.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .kpis.four { grid-template-columns: repeat(2, 1fr); } }
.kpi.ok .v { color: var(--ok); } .kpi.bad .v { color: var(--danger); }
.mini-charts { display: grid; gap: 1rem; }
@media (min-width: 900px) { .mini-charts { grid-template-columns: 1fr 1fr; } }
.mini-chart h3 { margin-top: .2rem; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.simple tr.off td { color: var(--muted); }
table.simple td.warn-t { color: var(--danger); font-weight: 700; }
table.preview td { white-space: nowrap; font-size: .85rem; }
table.preview td:nth-child(2) { white-space: normal; min-width: 160px; }
table.preview tr.st-erreur td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
table.preview tr.st-doublon td { color: var(--muted); }
.t.barre { text-decoration: line-through; color: var(--muted); }
ol.steps { padding-left: 1.2rem; display: grid; gap: .6rem; }
ol.steps .secret { margin-top: .4rem; font-size: 1.05rem; word-break: break-all; }
