@font-face { font-family: Manrope; src: url(/fonts/manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #0a0a0b;
  --bg2: #101012;
  --bg3: #18181a;
  --line: #27272a;
  --line2: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #ff7e1d;
  --accent-bg: rgba(255, 126, 29, .12);
  --green: #34c27a;
  --green-bg: rgba(52, 194, 122, .12);
  --red: #ef5350;
  --red-bg: rgba(239, 83, 80, .12);
  --orange: #e5b13a;
  --orange-bg: rgba(229, 177, 58, .13);
  --grey: #52525b;
  --grey-bg: rgba(124, 124, 132, .12);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --nav: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 18px; }
h2 { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

.layout { display: grid; grid-template-columns: var(--nav) 1fr; min-height: 100%; }
.nav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 12px 12px; display: flex; flex-direction: column; gap: 1px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; font-size: 12px; color: #fff; }
.workspace { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.workspace b { display: block; font-size: 12px; font-weight: 600; }
.workspace span { display: block; font: 10px var(--mono); color: var(--muted); }
.ws-icon { min-width: 30px; height: 26px; padding: 0 5px; font-size: 10px; border-radius: 7px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.nav-title { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 9px; color: #cfcfd4;
}
.nav a > span:first-of-type { flex: 1; }
.nav a svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--bg2); color: var(--text); }
.nav a.active { background: var(--bg3); color: var(--text); }
.nav a.active svg { color: var(--text); }
.nav .pct { font: 10px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-foot { margin-top: auto; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--bg3); object-fit: cover; flex: none; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); flex: none; }
.live.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.topbar { display: none; }
.layout > div:last-child { min-width: 0; padding: 8px 8px 8px 0; }
.main { min-width: 0; min-height: calc(100vh - 16px); padding: 0 22px 60px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 24px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 -22px 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.page-head > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-head h1 { font-weight: 500; }
.progress-card { display: flex; align-items: center; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--bg3); overflow: hidden; display: flex; min-width: 160px; }
.bar > span { height: 100%; }
.bar .s-done { background: var(--green); }
.bar .s-test { background: var(--orange); }
.bar .s-fix { background: var(--red); }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 6px; font-size: 11px; white-space: nowrap; border: 1px solid transparent; }
.c-green { color: var(--green); background: var(--green-bg); }
.c-red { color: var(--red); background: var(--red-bg); }
.c-orange { color: var(--orange); background: var(--orange-bg); }
.c-grey { color: var(--muted); background: var(--grey-bg); }
.c-blue { color: var(--accent); background: var(--accent-bg); }
button.chip { border: 1px solid var(--line); background: var(--bg2); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; position: sticky; top: 0; z-index: 5; background: var(--bg2); padding: 8px 0; }
.filters input, .filters select { min-width: 0; }
.field, select, input[type=text], input[type=search], input[type=date], textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
.btn { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; color: var(--text); }
.btn:hover { border-color: #3a3a40; background: var(--bg3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.ghost { background: none; border-color: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.block { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: clip; }
.block-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; user-select: none; }
.block-head h2 { flex: 1; font-weight: 500; }
.block-head .bar { min-width: 0; }
.block-head .caret { transition: transform .15s; color: var(--muted); }
.block.closed .caret { transform: rotate(-90deg); }
.block.closed .rows { display: none; }

.grid-row {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 116px minmax(200px, 1.6fr) minmax(110px, .8fr) 34px 34px 112px 96px 118px minmax(90px, .7fr) 34px 104px;
  padding: 7px 14px; border-top: 1px solid var(--line);
}
.grid-head { position: sticky; top: 50px; z-index: 4; background: var(--bg); font-size: 11px; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.grid-row.data { cursor: pointer; }
.grid-row.data:hover { background: rgba(255, 255, 255, .018); }
.grid-row.selected { background: var(--accent-bg); }
.grid-row.flash { animation: flash 1.8s ease-out; }
@keyframes flash { from { background: rgba(255, 126, 29, .28); } to { background: transparent; } }
.cell-title { min-width: 0; }
.cell-title b { font-weight: 500; display: block; overflow-wrap: anywhere; }
.cell-title .tech { font: 11px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.cell-links { display: flex; flex-wrap: wrap; gap: 4px; }
.grid-row select, .grid-row input[type=text] { width: 100%; padding: 4px 7px; font-size: 12px; }
.who { font: 11px var(--mono); color: var(--muted); line-height: 1.35; }
.col-section { font-size: 11px; }
.m-label { display: none; }
.checks { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }

.check { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #3a3a40; background: var(--bg2); display: inline-grid; place-items: center; cursor: pointer; margin: 0; }
.check:hover { border-color: var(--muted); }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after { content: ""; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.retest:checked { background: var(--orange); border-color: var(--orange); }
.check.mini { width: 15px; height: 15px; border-radius: 4px; }
.check.mini:checked::after { width: 3px; height: 7px; }

.s-Terminé, .r-OK { color: var(--green); background: var(--green-bg); }
.s-À-corriger, .r-Bug { color: var(--red); background: var(--red-bg); }
.s-À-tester, .r-Partiel { color: var(--orange); background: var(--orange-bg); }
.s-À-configurer, .r-Non-testé { color: var(--muted); background: var(--grey-bg); }
select.r-OK, select.r-Bug, select.r-Partiel, select.r-Non-testé { border-color: transparent; }
.p-Bloquant { color: var(--red); }
.p-Majeur { color: var(--orange); }
.p-Mineur { color: var(--muted); }

.panel {
  position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(560px, calc(100% - 16px)); z-index: 30;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  transform: translateX(calc(100% + 16px)); transition: transform .2s ease; display: flex; flex-direction: column;
}
.panel.open { transform: none; }
.panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; font-weight: 500; font-size: 15px; }
.panel-body { overflow-y: auto; padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; align-items: center; }
.kv label { color: var(--muted); font-size: 12px; }
.kv input, .kv select { width: 100%; }
.section-title { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.note { background: var(--orange-bg); color: var(--orange); border-radius: 9px; padding: 8px 10px; white-space: pre-wrap; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--text); }
a.item:hover { border-color: #3a3a40; }
.history { font: 11px var(--mono); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 25; }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card h3 { font-size: 13px; font-weight: 500; }
.done-title { text-decoration: line-through; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 4px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { font-size: 11px; font-weight: 400; color: var(--muted); border-top: 0; }
table.data td.num { font: 12px var(--mono); text-align: right; }
table.data tr.link { cursor: pointer; }
table.data tr.link:hover td { background: rgba(255, 255, 255, .018); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.stat .big { display: block; }
.chart { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.chart svg { width: 100%; max-width: 960px; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend-keys { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend-keys i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast div { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.toast .warn { border-color: var(--orange); }
.toast .err { border-color: var(--red); }

.search-results { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.search-results button { text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; }
.empty { color: var(--muted); padding: 30px; text-align: center; }
.prose { max-width: 820px; display: flex; flex-direction: column; gap: 18px; }
.prose > h1 { margin: 0 -22px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.prose p, .prose ul { margin: 0; }
.prose li { margin: 4px 0; }

.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.login-card .brand { justify-content: center; padding: 0; font-size: 18px; }
.discord { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); color: #fff; border-radius: 10px; padding: 11px; font-weight: 600; }
.discord:hover { filter: brightness(1.08); }
code { font: 12px var(--mono); background: var(--bg3); padding: 2px 6px; border-radius: 6px; }

.main { container-type: inline-size; }

@container (max-width: 1250px) {
  .grid-row { grid-template-columns: 96px minmax(160px, 1.5fr) 30px 30px 104px 80px minmax(80px, .7fr) 30px 100px; gap: 8px; }
  .col-valeur, .col-who { display: none; }
}

@container (max-width: 820px) {
  .grid-head { display: none; }
  .grid-row {
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "title title status" "f g res" "links links prio";
    gap: 8px 12px; padding: 12px 14px;
  }
  .col-title { grid-area: title; }
  .col-status { grid-area: status; justify-self: end; align-self: start; }
  .col-f { grid-area: f; }
  .col-g { grid-area: g; }
  .col-res { grid-area: res; }
  .col-links { grid-area: links; }
  .col-prio { grid-area: prio; justify-self: end; }
  .col-section, .col-valeur, .col-who, .col-p { display: none; }
  .m-label { display: inline; font-size: 12px; color: var(--muted); margin-left: 6px; }
  .col-f, .col-g { display: flex; align-items: center; }
  .cards { grid-template-columns: 1fr; }
  table.data .hide-m { display: none; }
  .progress-card { width: 100%; }
  .bar { flex: 1; min-width: 0; }
  .block-head .bar { display: none; }
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 35; left: 0; width: min(290px, 85%); background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .topbar h1 { font-size: 15px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .layout > div:last-child { padding: 0; }
  .main { padding: 0 16px 80px; border: 0; border-radius: 0; min-height: calc(100vh - 53px); }
  .page-head, .prose > h1 { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .filters { position: static; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv label { margin-top: 6px; }
}

.progress-card .bar { flex: none; width: 100%; }
.kv input.check { width: 20px; }
.conflict { border-color: var(--orange) !important; box-shadow: 0 0 0 2px var(--orange-bg); }
