/* Vigie — thème sombre repris de ui/theme/Theme.kt */
:root {
  --bg: #070A12;
  --surface: #0F1420;
  --surface2: #161D2C;
  --surface3: #1E2738;
  --stroke: rgba(255, 255, 255, .10);

  --violet: #8B5CF6;
  --violet-soft: #A78BFA;
  --cyan: #22D3EE;
  --blue: #3B82F6;
  --fr-blue: #2563EB;
  --fr-red: #EF4444;

  --critical: #FF3B5C;
  --high: #FF8A3D;
  --medium: #FACC15;
  --low: #34D399;
  --none: #64748B;

  --text-hi: #F1F5F9;
  --text-mid: #94A3B8;
  --text-lo: #64748B;

  --accent: var(--violet);
  --second: var(--cyan);
  --nav-h: 72px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-hi);
  font: 15px/1.45 Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; flex: none; }
.noscript { padding: 24px; text-align: center; }

/* Halo coloré propre à chaque onglet */
.app[data-tab="brief"]   { --accent: var(--violet);   --second: var(--cyan); }
.app[data-tab="cve"]     { --accent: var(--cyan);     --second: var(--violet); }
.app[data-tab="encours"] { --accent: var(--blue);     --second: var(--cyan); }
.app[data-tab="kev"]     { --accent: var(--critical); --second: var(--high); }
.app[data-tab="hackfr"]  { --accent: var(--fr-red);   --second: var(--fr-blue); }
.app::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70vmax 70vmax at 95% -10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(55vmax 55vmax at -10% 35%, color-mix(in srgb, var(--second) 14%, transparent), transparent 70%);
  transition: background .4s;
}

.main {
  max-width: 860px;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 0 calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  outline: none;
}

/* ───────────── Navigation ───────────── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 6px 4px env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--stroke);
}
.nav-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--text-lo); font-size: 11px; font-weight: 500; text-decoration: none;
}
.nav-pill {
  position: relative;
  display: grid; place-items: center;
  width: 64px; height: 32px; border-radius: 16px;
  transition: background .2s;
}
.nav-item[aria-current="page"] { color: var(--text-hi); font-weight: 700; }
.nav-item[aria-current="page"] .nav-pill { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.nav-item:hover .nav-pill { background: color-mix(in srgb, var(--c) 10%, transparent); }
.nav-item:focus-visible { outline: none; }
.nav-item:focus-visible .nav-pill { outline: 2px solid var(--c); outline-offset: 2px; }
.badge {
  position: absolute; top: -4px; left: 36px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--c); color: var(--bg);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav-brand { display: none; }

@media (min-width: 960px) {
  :root { --nav-h: 0px; }
  .nav {
    top: 0; right: auto; width: 104px; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 10px;
    padding: 20px 0; border-top: 0; border-right: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(12px);
  }
  .nav-item { flex: none; padding: 6px 0; }
  .nav-brand { display: grid; place-items: center; margin-bottom: 14px; }
  .main { padding-left: 104px; max-width: calc(860px + 104px); }
}

/* ───────────── En-têtes ───────────── */
.header { padding: 12px 20px 8px; }
.header-row { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.stripe { width: 22px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 40%, transparent)); }
.stripe.fr { background: linear-gradient(90deg, var(--fr-blue), #fff, var(--fr-red)); }
.kicker { color: var(--c); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; flex: 1; }
.title { margin: 6px 0 0; font-size: 32px; line-height: 1.15; font-weight: 900; letter-spacing: -.025em; }
.subtitle { margin: 2px 0 0; color: var(--text-mid); font-size: 14px; }

.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: none; color: var(--text-mid); cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text-hi); }
.icon-btn:disabled { color: var(--text-lo); cursor: default; background: none; }
.icon-btn:focus-visible, .chip:focus-visible, .btn:focus-visible, .link-btn:focus-visible, .card:focus-visible, .tile:focus-visible {
  outline: 2px solid var(--violet-soft); outline-offset: 2px;
}
.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-title { display: flex; align-items: center; padding: 22px 8px 6px 20px; }
.section-title h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; }
.link-btn { text-decoration: none; border: 0; background: none; color: var(--violet-soft); font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 20px; cursor: pointer; }
.link-btn:hover { background: color-mix(in srgb, var(--violet-soft) 12%, transparent); }

/* ───────────── Cartes ───────────── */
.card {
  position: relative; display: block; width: calc(100% - 32px);
  margin: 5px 16px; padding: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--stroke); border-radius: 20px;
  text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: rgba(255, 255, 255, .2); background: var(--surface); }
.card.accent::before {
  content: ""; position: absolute; left: -1px; top: 18px;
  width: 3px; height: 40px; border-radius: 0 3px 3px 0; background: var(--a);
}
.card-row { display: flex; align-items: flex-start; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; line-clamp: 3; }
.meta { color: var(--text-lo); font-size: 12px; white-space: nowrap; }
.desc { color: var(--text-mid); font-size: 14px; line-height: 20px; margin-top: 4px; }
.prod { font-size: 16px; font-weight: 700; }
.prod.unknown { color: var(--text-lo); }
.mono { font-family: var(--mono); }
.cve-id { color: var(--cyan); font: 600 12px/1.4 var(--mono); flex: 1; }
.kev-id { font: 700 15px/1.4 var(--mono); flex: 1; letter-spacing: .01em; }
.kev-vendor { color: var(--high); font-size: 13px; font-weight: 700; }
.cert-id { color: var(--blue); font: 700 12px/1.4 var(--mono); flex: 1; }
.card-title { font-size: 16px; font-weight: 700; margin-top: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--t) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--t) 35%, transparent);
  color: var(--t); font-size: 11px; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.tag.filled { background: var(--t); border-color: var(--t); color: var(--bg); }
a.tag:hover { background: color-mix(in srgb, var(--t) 25%, transparent); }

.score {
  width: 62px; flex: none; padding: 8px 0; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--s) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--s) 45%, transparent);
  color: var(--s);
}
.score.none { background: color-mix(in srgb, var(--s) 8%, transparent); color: var(--text-lo); }
.score b { display: block; font: 900 22px/1.2 var(--mono); }
.score small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .02em; }

.logo {
  position: relative;
  width: 48px; height: 48px; flex: none; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--fr-blue), var(--violet), var(--fr-red));
  color: var(--text-hi); font-weight: 900; font-size: 16px;
}
.logo.big { width: 56px; height: 56px; font-size: 18px; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--text-hi); }

/* ───────────── Brief ───────────── */
.threat {
  margin: 8px 16px; padding: 20px; border-radius: 26px;
  border: 1px solid color-mix(in srgb, var(--t) 35%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--t) 30%, transparent), color-mix(in srgb, var(--violet) 18%, transparent), var(--surface));
}
.threat-head { display: flex; align-items: center; gap: 12px; }
.threat-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--t) 20%, transparent); color: var(--t); }
.threat-level { color: var(--t); font-size: 28px; font-weight: 900; line-height: 1.1; }
.threat-label { color: var(--text-mid); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.threat p { margin: 10px 0 0; font-size: 15px; }
.threat .note { color: var(--text-lo); font-size: 11px; margin-top: 4px; }

.sevbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface2); margin-top: 14px; }
.sevbar span { height: 100%; }
.sevlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--text-mid); font-size: 12px; font-weight: 600; }
.sevlegend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s); }
.panel { margin: 5px 16px; padding: 16px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--stroke); }
.panel .sevbar { margin-top: 0; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 16px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  padding: 14px; border-radius: 20px; text-align: left; cursor: pointer; min-width: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--stroke);
}
.tile:hover { border-color: rgba(255, 255, 255, .2); }
.tile-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--t) 16%, transparent); color: var(--t); }
.tile-value { display: block; margin-top: 10px; font-size: 30px; font-weight: 900; line-height: 1.2; }
.tile-label { display: block; color: var(--text-mid); font-size: 12px; font-weight: 600; }
.tile-sub { display: block; color: var(--t); font-size: 11px; font-weight: 700; }

/* ───────────── Filtres ───────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--stroke);
  color: var(--text-mid); font-size: 14px; font-weight: 600;
}
.chip:hover { border-color: rgba(255, 255, 255, .22); }
.chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
  color: var(--text-hi);
}
.chip[aria-pressed="true"] svg { color: var(--c); }

.search { position: relative; margin: 6px 16px; }
.search input {
  width: 100%; height: 56px; padding: 0 48px 0 52px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--stroke); color: var(--text-hi); font-size: 16px; outline: none;
}
.search input::placeholder { color: var(--text-lo); }
.search input:focus { border-color: color-mix(in srgb, var(--violet) 70%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search > svg { position: absolute; left: 16px; top: 16px; color: var(--text-mid); pointer-events: none; }
.search .icon-btn { position: absolute; right: 6px; top: 6px; }

/* ───────────── États ───────────── */
.status { padding: 2px 20px; color: var(--text-lo); font-size: 12px; }
.offline {
  display: flex; align-items: center; gap: 8px; margin: 4px 16px; padding: 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--high) 12%, transparent); color: var(--high); font-size: 12px; font-weight: 600;
}
.error-card { display: flex; gap: 10px; align-items: center; cursor: default; }
.error-card:hover { border-color: var(--stroke); }
.error-card strong { display: block; }
.error-card .desc { margin: 0; }
.errors { padding: 12px 20px; color: var(--high); font-size: 12px; white-space: pre-line; }
.empty { padding: 40px; text-align: center; color: var(--text-mid); }
.empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface2); }
.more { display: block; margin: 12px auto; }

.skeleton { cursor: default; }
.skeleton:hover { border-color: var(--stroke); }
.sk { background: var(--surface3); border-radius: 4px; animation: pulse .9s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: .75; } }

/* ───────────── Fiche détaillée ───────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .6);
  animation: fade .18s ease-out;
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  position: relative; width: 100%; max-width: 680px; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 28px 28px 0 0; border: 1px solid var(--stroke); border-bottom: 0;
  animation: rise .22s ease-out;
}
.sheet-handle { width: 32px; height: 4px; border-radius: 2px; background: var(--text-lo); margin: 14px auto 10px; flex: none; }
.sheet-close { position: absolute; right: 8px; top: 6px; z-index: 1; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 22px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 28px; border-bottom: 1px solid var(--stroke); max-height: 88vh; }
  .sheet-handle { visibility: hidden; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

.d-head { display: flex; align-items: center; gap: 16px; padding-right: 36px; }
.d-id { margin: 0; font: 900 22px/1.25 var(--mono); word-break: break-all; }
.d-id.big { font-size: 24px; }
.d-sev { font-weight: 700; color: var(--s); }
.d-prod { color: var(--cyan); font-size: 13px; font-weight: 600; }
.d-source { color: var(--a); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.d-title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.d-subtitle { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.d-label { margin: 18px 0 6px; color: var(--text-lo); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.d-text { margin: 0; font-size: 16px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.d-vector { padding: 10px; border-radius: 10px; background: var(--surface2); color: var(--text-mid); font: 12px/1.5 var(--mono); word-break: break-all; }
.d-small { margin-top: 4px; color: var(--text-lo); font-size: 11px; }
.d-meta { color: var(--text-lo); font-size: 12px; margin-top: 6px; }
.info { display: grid; grid-template-columns: 100px 1fr; gap: 6px 0; font-size: 13px; }
.info dt { color: var(--text-lo); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.banner { display: flex; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--b) 12%, transparent); }
.banner svg { color: var(--b); margin-top: 1px; }
.banner strong { display: block; color: var(--b); }
.banner span { font-size: 13px; }
.ref {
  display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 10px;
  color: var(--violet-soft); font-size: 13px; text-decoration: none; min-width: 0;
}
.ref svg { color: var(--text-lo); }
.ref:hover { background: rgba(255, 255, 255, .04); }
.ring { position: relative; width: 72px; height: 72px; flex: none; display: grid; place-items: center; color: var(--s); }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring b { font: 900 22px var(--mono); }
.ring.none b { color: var(--text-lo); }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.btn {
  height: 50px; padding: 0 18px; border-radius: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.btn.primary { flex: 1; min-width: 0; background: var(--a); color: var(--bg); border: 0; }
.btn.primary span { overflow: hidden; text-overflow: ellipsis; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.outline { background: none; border: 1px solid var(--stroke); color: var(--text-hi); }
.btn.outline:hover { background: rgba(255, 255, 255, .05); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--surface3); color: var(--text-hi); font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── Historique (graphique empilé) ───────────── */
.history { padding-bottom: 12px; }
.hhead { display: flex; align-items: flex-start; gap: 8px; }
.hhead > div { flex: 1; }
.hhead strong { display: block; font-size: 15px; }
.hhead span { color: var(--text-mid); font-size: 12px; }
.hhead .link-btn { margin: -8px -8px 0 0; }
.history .sevlegend { margin: 6px 0 12px; }
.hplot { position: relative; height: 150px; margin-left: 30px; }
.htick { position: absolute; left: -30px; right: 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.htick span { position: absolute; left: 0; top: -8px; width: 26px; text-align: right; color: var(--text-lo); font-size: 10px; line-height: 16px; }
.hcols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.hcol { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px; outline: none; cursor: default; }
.hcol:hover, .hcol:focus-visible { background: rgba(255, 255, 255, .05); }
.hcol:focus-visible { box-shadow: inset 0 0 0 2px var(--violet-soft); }
.hbar { width: 100%; max-width: 24px; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.hbar i { display: block; min-height: 1px; }
.haxis { display: flex; justify-content: space-between; margin: 6px 0 0 30px; color: var(--text-lo); font-size: 11px; }
.htip {
  position: absolute; z-index: 30; max-width: 260px; padding: 8px 10px; border-radius: 10px; pointer-events: none;
  background: var(--surface3); color: var(--text-hi); font-size: 12px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.htable-wrap { max-height: 260px; overflow: auto; border-radius: 10px; border: 1px solid var(--stroke); }
.htable { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.htable th, .htable td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
.htable th:first-child, .htable td:first-child { text-align: left; }
.htable th { position: sticky; top: 0; background: var(--surface2); color: var(--text-mid); font-weight: 600; }

/* ───────────── Renvois « Citée par » ───────────── */
.mention {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 4px; border: 0; border-radius: 10px;
  background: none; color: var(--text-hi); font-size: 13px; text-align: left; cursor: pointer;
}
.mention:hover { background: rgba(255, 255, 255, .04); }
.mention .ellipsis { flex: 1; min-width: 0; }
.mention-src { flex: none; color: var(--m); font: 700 12px var(--mono); }
button.tag { cursor: pointer; font-family: inherit; }
button.tag:hover { background: color-mix(in srgb, var(--t) 25%, transparent); }
a.icon-btn { text-decoration: none; }
.nav-brand { text-decoration: none; }

/* ───────────── Administration ───────────── */
.admin-body { background: radial-gradient(70vmax 70vmax at 95% -10%, color-mix(in srgb, var(--violet) 22%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.admin { max-width: 1100px; margin: 0 auto; padding: 16px 0 48px; }
.admin .header-row form { display: inline; }
.admin .panel { margin: 12px 16px; padding: 20px; }
.admin h2 { margin: 0 0 4px; font-size: 18px; }
.admin .meta { white-space: normal; }
.admin code { font: 12px var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--surface2); }
.flash { margin: 8px 16px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--low) 14%, transparent); color: var(--low); font-weight: 600; }
.flash.bad { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; color: var(--text-lo); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--stroke); }
.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .err { color: var(--high); }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell form { display: inline; }
.actions-cell .link-btn { padding: 6px 8px; font-size: 13px; }
.link-btn.danger { color: var(--critical); }
.link-btn.danger:hover { background: color-mix(in srgb, var(--critical) 12%, transparent); }
.link-btn:disabled { opacity: .6; cursor: progress; }
form.inline { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
form.inline input { width: 72px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.ok { background: color-mix(in srgb, var(--low) 16%, transparent); color: var(--low); }
.pill.bad { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical); }
.pill.off { background: var(--surface2); color: var(--text-mid); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.form-grid .wide { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .wide { grid-column: auto; } }
.admin label, .admin-login label { display: flex; flex-direction: column; gap: 6px; color: var(--text-mid); font-size: 12px; font-weight: 600; }
.admin input, .admin select, .admin textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--surface2);
  color: var(--text-hi); font-size: 14px; outline: none;
}
.admin input:focus, .admin select:focus, .admin textarea:focus { border-color: color-mix(in srgb, var(--violet) 70%, transparent); }
.admin textarea { resize: vertical; font-family: inherit; }
.admin .btn.primary { flex: none; }
.admin-login { max-width: 380px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.admin-login .title { margin: 0; }
.admin-login .flash { margin: 0; }
