/* NL Agents : interface d'administration.
   Fond brume froide, encre marine, accent cobalt. Le seul élément mis en scène :
   le champ de points des statuts, une pastille par URL. */

:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #14202b;
  --muted: #5b6875;
  --rule: #d3dae1;
  --accent: #2f4bd8;
  --accent-ink: #ffffff;
  --ok: #2e7d5b;
  --redirect: #c9a227;
  --client: #c23b4b;
  --server: #6b1e2a;
  --other: #8a96a3;
  --critique: #c23b4b;
  --important: #c9a227;
  --info: #5b6875;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-s: 6px;
  --radius-m: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b;
    --surface: #172029;
    --ink: #e6ebf0;
    --muted: #93a1ae;
    --rule: #2a3642;
    --accent: #7d93ff;
    --accent-ink: #0f151b;
    --ok: #4fb386;
    --redirect: #e0be4e;
    --client: #f06a78;
    --server: #c04a5c;
    --other: #6e7b88;
    --critique: #f06a78;
    --important: #e0be4e;
    --info: #93a1ae;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--text);
  font-feature-settings: "tnum" 1;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }

/* ---------------------------------------------------------------- barre */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font: 700 1.05rem/1 var(--display);
  letter-spacing: -0.01em;
}
.mark-dot {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0.55em 0.35em 0 -0.22em var(--ink);
}
.mark-large { font-size: 1.6rem; margin: 0 0 2rem; }

.bar nav { display: flex; gap: 0.25rem; }
.bar nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.bar nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------------------------------------------------------------- page */
.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.masthead { padding: 1rem 0 0.5rem; }
.masthead h1 {
  margin: 0;
  font: 700 clamp(2rem, 7vw, 3.4rem)/1.02 var(--display);
  letter-spacing: -0.025em;
}
.masthead h1.domain { font-size: clamp(2rem, 9vw, 4.4rem); word-break: break-word; }
.crumb { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.crumb a { color: var(--muted); }
.lede {
  max-width: 38rem;
  margin: 0.9rem 0 0;
  font-size: 1.15rem;
  line-height: 1.5;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: center;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.masthead form { margin-top: 1rem; }

.block { margin-top: 2.75rem; }
.block > h2 {
  margin: 0 0 1rem;
  font: 700 1.3rem/1.2 var(--display);
  letter-spacing: -0.01em;
}

.hint { color: var(--muted); font-size: 0.9rem; max-width: 40rem; }
.empty { color: var(--muted); }
.error { color: var(--critique); font-weight: 600; }

/* ---------------------------------------------------------------- statut */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--ink);
}
.status::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--other);
}
.status-running::before, .status-queued::before { background: var(--accent); }
.status-done::before { background: var(--ok); }
.status-error::before, .status-blocked::before, .status-interrupted::before { background: var(--client); }

/* ---------------------------------------------------------------- champ de points */
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-m);
}
.d {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--other);
}
.d-ok { background: var(--ink); }
.d-redirect { background: var(--redirect); }
.d-client { background: var(--client); }
.d-server { background: var(--server); outline: 2px solid var(--client); outline-offset: -1px; }
.d-other { background: transparent; box-shadow: inset 0 0 0 2px var(--other); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- problèmes */
.issues > h2 { display: flex; align-items: center; gap: 0.6rem; }
.issues > h2::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--sev);
}
.sev-critique { --sev: var(--critique); }
.sev-important { --sev: var(--important); }
.sev-info { --sev: var(--info); }

.issue-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.issue-list li { border-bottom: 1px solid var(--rule); }
.issue-list a {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
}
.issue-list a:hover .issue-label { text-decoration: underline; text-underline-offset: 0.18em; }
.issue-count {
  font: 700 1.9rem/1 var(--display);
  letter-spacing: -0.02em;
  text-align: right;
  color: var(--sev);
}
.sev-info .issue-count { color: var(--ink); font-size: 1.45rem; }
.issue-text { display: grid; gap: 0.2rem; }
.issue-label { font-weight: 600; font-size: 1.05rem; }
.issue-why { color: var(--muted); font-size: 0.93rem; line-height: 1.45; max-width: 36rem; }

/* ---------------------------------------------------------------- listes */
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.row-link {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
}
.row-main { display: grid; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.row-side { display: grid; justify-items: end; text-align: right; white-space: nowrap; }
.row-link small { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

.sites { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.site {
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border-radius: var(--radius-m);
  border-left: 5px solid var(--ok);
}
.site.has-critical { border-left-color: var(--critique); }
.site-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  color: var(--ink);
  text-decoration: none;
}
.site-name { font: 700 1.35rem/1.15 var(--display); }
.site-date { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.site-issues { margin: 0.7rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; }
.site-issues a { color: var(--ink); text-decoration: none; }
.site-issues b { color: var(--critique); font-family: var(--display); font-size: 1.1rem; margin-right: 0.3rem; }
.site-foot { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }

.url-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.url-list li { padding: 0.9rem 0.25rem; border-bottom: 1px solid var(--rule); }
.url { font-weight: 600; overflow-wrap: anywhere; color: var(--ink); }
.url-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.4rem;
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}
.url-facts div { display: flex; gap: 0.4rem; }
.url-facts div.wide { flex-basis: 100%; }
.url-facts dt { color: var(--muted); }
.url-facts dd { margin: 0; overflow-wrap: anywhere; }

.pager { display: flex; justify-content: space-between; margin-top: 1rem; }

/* ---------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-m); }
.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.data th, .data td { padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.data thead th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.data tbody tr:last-child > * { border-bottom: 0; }
.data .num { text-align: right; }
.flag {
  display: inline-block;
  margin: 0 0.3rem 0.3rem 0;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--important) 22%, transparent);
  font-size: 0.85rem;
}
.ok { color: var(--muted); }

/* ---------------------------------------------------------------- formulaires */
.launch {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-m);
}
.field { display: grid; gap: 0.35rem; }
.field label, .checks legend { font-weight: 600; font-size: 0.93rem; }
input[type="text"], input[type="url"], input[type="number"], input[type="password"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.field-url input { font-size: 1.15rem; padding: 0.9rem; }
.checks { display: grid; gap: 0.55rem; margin: 0; padding: 0; border: 0; }
.checks legend { margin-bottom: 0.4rem; }
.checks label { display: flex; align-items: center; gap: 0.6rem; }
.checks input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.grid-2 { display: grid; gap: 1rem; margin-top: 1rem; }

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 1rem/1 var(--text);
  text-decoration: none;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.quiet { background: transparent; }
button.danger { color: var(--critique); border-color: color-mix(in srgb, var(--critique) 40%, transparent); }
.exports { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.login { max-width: 22rem; margin: 12vh auto 0; }
.stack { display: grid; gap: 0.6rem; }
.stack label { font-weight: 600; }
.stack button { margin-top: 0.6rem; }

@media (min-width: 40rem) {
  .page { padding: 2.5rem 1.5rem 5rem; }
  .launch { grid-template-columns: 1fr 1fr 9rem; padding: 1.5rem; }
  .field-url { grid-column: 1 / -1; }
  .checks, .advanced, .launch > button { grid-column: 1 / -1; }
  .launch > button { justify-self: start; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .issue-list a { grid-template-columns: 4.5rem 1fr; }
  .d { width: 12px; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- Search Console */
.up { color: var(--ok); }
.down { color: var(--critique); }
.muted { color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  margin: 0;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-m);
}
.kpis div { display: grid; gap: 0.2rem; }
.kpis dt { color: var(--muted); font-size: 0.9rem; }
.kpis dd { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.6rem; }
.kpis b { font: 700 clamp(1.7rem, 6vw, 2.4rem)/1 var(--display); letter-spacing: -0.02em; }
.trend { font-weight: 600; font-size: 0.95rem; }
.trend-note { color: var(--muted); font-size: 0.9rem; }

.block-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem 1rem;
  margin-bottom: 1rem;
}
.block-head h2 { margin: 0; font: 700 1.3rem/1.2 var(--display); letter-spacing: -0.01em; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tabs a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.93rem;
  border: 1px solid var(--rule);
}
.tabs a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tabs a.toggle { border-style: dashed; }

.chart-wrap { margin: 0; padding: 1rem 0.75rem 0.75rem; background: var(--surface); border-radius: var(--radius-m); }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 500 12px var(--text); }
.chart .line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.line-global { stroke: var(--ink); fill: var(--ink); }
.line-nonbrand { stroke: var(--accent); fill: var(--accent); }
.line-nonbrand-noblog { stroke: var(--redirect); fill: var(--redirect); }
.chart .line { fill: none; }
.chart-wrap figcaption .legend { margin: 0.6rem 0.4rem 0; }
.swatch { display: inline-block; width: 1.1rem; height: 3px; border-radius: 2px; background: currentColor; }
.swatch.line-global { background: var(--ink); }
.swatch.line-nonbrand { background: var(--accent); }
.swatch.line-nonbrand-noblog { background: var(--redirect); }

.url-cell { max-width: 22rem; overflow-wrap: anywhere; font-weight: 500; }
.url-cell a { color: var(--ink); }
.badge {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.inline-action { margin-top: 1rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (min-width: 40rem) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1.5rem; }
}

/* ---------------------------------------------------------------- ajustements téléphone */
.mark { white-space: nowrap; }
.url-cell { min-width: 9rem; }
.chart .tick { font-size: 12px; }
@media (max-width: 39.99rem) {
  .bar { padding: 0.6rem 0.75rem; }
  .bar nav a { padding: 0.4rem 0.6rem; font-size: 0.93rem; }
  .mark { font-size: 0.98rem; }
  .hide-sm { display: none; }
  .chart .tick { font-size: 24px; }
  .data th, .data td { padding: 0.65rem 0.6rem; }
}
@media (min-width: 40rem) {
  .launch.settings { grid-template-columns: 1fr 1fr; }
  .launch.settings > button { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- agents et validation */
.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 700;
}
.view-tabs { margin-top: 1.25rem; }

.hyps { display: grid; gap: 1rem; }
.hyp {
  padding: 1.2rem 1.25rem 1.1rem;
  background: var(--surface);
  border-radius: var(--radius-m);
  border-top: 4px solid var(--accent);
}
.hyp-en-debat { border-top-color: var(--redirect); }
.hyp-validee { border-top-color: var(--ok); }
.hyp-rejetee { border-top-color: var(--critique); }
.hyp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; }
.hyp-id { font: 700 1.5rem/1 var(--display); letter-spacing: -0.02em; color: var(--accent); }
.hyp-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.tag-debate { background: color-mix(in srgb, var(--redirect) 25%, transparent); color: var(--ink); }
.hyp-title { margin: 0.6rem 0 0; font: 700 1.2rem/1.25 var(--display); letter-spacing: -0.01em; }
.hyp-title a { color: var(--ink); text-decoration: none; }
.hyp-title a:hover { text-decoration: underline; }
.hyp-body { display: grid; gap: 0.9rem; margin-top: 0.9rem; }
.hyp-body h4 {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hyp-body p { margin: 0; max-width: 42rem; }
.facts { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.test { padding: 0.9rem 1rem; background: var(--bg); border-radius: var(--radius-s); }
.test-facts { display: grid; gap: 0.4rem; margin: 0.7rem 0 0; font-size: 0.93rem; }
.test-facts div { display: grid; gap: 0.1rem; }
.test-facts dt { color: var(--muted); font-size: 0.85rem; }
.test-facts dd { margin: 0; overflow-wrap: anywhere; }
.hyp-note { padding-left: 0.8rem; border-left: 3px solid var(--rule); color: var(--muted); }
.hyp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.hyp-actions form { margin: 0; }
.reject { flex-basis: 100%; }
.reject summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0 0.4rem;
  color: var(--critique);
  font-weight: 600;
  cursor: pointer;
}
.reject-form { display: grid; gap: 0.8rem; margin-top: 0.6rem; max-width: 28rem; }
.reject-form button { justify-self: start; }

.agent-state { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.synthese {
  padding: 1.2rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-m);
  border-left: 5px solid var(--ink);
}
.synthese p { margin: 0; max-width: 44rem; font-size: 1.05rem; }
.synthese .synthese-date { margin-bottom: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.synthese h3 { margin: 1.1rem 0 0.4rem; font: 700 1rem/1.2 var(--display); }
.synthese ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
h3.sub { margin: 2rem 0 0.8rem; font: 700 1.1rem/1.2 var(--display); }

textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (min-width: 40rem) {
  .launch.edit { grid-template-columns: 1fr 1fr; }
  .launch.edit .wide { grid-column: 1 / -1; }
}

.history { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; color: var(--muted); }
.history time { color: var(--ink); font-weight: 600; margin-right: 0.3rem; }

.budget-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  padding: 0.85rem 0.25rem;
}
.gauge { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--accent); }

.bar nav a { white-space: nowrap; }
@media (max-width: 29.99rem) {
  .mark-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bar { gap: 0.5rem; }
  .bar nav { gap: 0; }
  .bar nav a { padding: 0.4rem 0.5rem; font-size: 0.9rem; }
}
