:root {
  --bg: #07100f;
  --panel: #0d1917;
  --panel-2: #11211e;
  --line: #203630;
  --text: #edf6f1;
  --muted: #91a8a0;
  --mint: #57e3b4;
  --amber: #f2bb55;
  --red: #ff7a75;
  --blue: #78a9ff;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% -10%, #164b3d 0, transparent 32rem),
    linear-gradient(145deg, #07100f 0%, #091310 62%, #050b0a 100%);
  color: var(--text);
  font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.topbar, main { width: min(1480px, calc(100% - 40px)); margin-inline: auto; position: relative; }
.topbar { padding: 42px 0 28px; display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.back { color: var(--mint); font-size: 13px; text-decoration: none; }
h1 { font-size: clamp(30px, 5vw, 58px); letter-spacing: -.05em; margin: 9px 0 8px; }
.topbar p { margin: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; max-width: 520px; }
button { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); padding: 10px 14px; cursor: pointer; font: inherit; font-size: 13px; }
button:hover { border-color: var(--mint); }
button.accent { background: var(--mint); color: #062019; border-color: var(--mint); font-weight: 800; }
.updated { width: 100%; text-align: left; color: var(--muted); font-size: 12px; }

main { padding-bottom: 60px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { min-height: 130px; padding: 18px; background: linear-gradient(145deg, #12251f, #0c1816); border: 1px solid var(--line); border-radius: 15px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin-top: 25px; font-size: 34px; font-family: Consolas, monospace; }
.kpi.primary { border-color: #3c8d72; box-shadow: inset 0 3px var(--mint); }

.panel { background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.wide { margin-top: 14px; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-top: 14px; }
.alerts-panel { border-color: #4d4028; }
.panel-title { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-title h2 { margin: 3px 0 0; font-size: 17px; }
.eyebrow { color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.hint { color: var(--muted); font-size: 11px; max-width: 480px; }
.counter { background: #4c3516; color: var(--amber); min-width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font: 700 12px Consolas, monospace; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: right; padding: 12px 15px; border-bottom: 1px solid #182a25; font-size: 12px; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; background: #0a1513; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #10201c; }
.positive { color: var(--mint); }
.negative { color: var(--red); }
.unknown { color: var(--amber); }
.tag { display: inline-flex; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); }

.feed { max-height: 430px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #182a25; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .scanner { color: var(--mint); font: 700 11px Consolas, monospace; text-transform: uppercase; }
.feed-item strong { display: block; font-size: 15px; }
.feed-item small { color: var(--muted); font-size: 11px; }
.feed-item time { color: var(--muted); direction: ltr; font: 11px Consolas, monospace; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.warnings { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px; }
.warnings:not(:empty) { padding-top: 14px; }
.warning { color: var(--amber); background: #39290f; border: 1px solid #5d451c; padding: 6px 10px; border-radius: 7px; font-size: 11px; }
.health-meta { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 10px; padding: 14px 20px 0; }
.health-card { background: #0a1513; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.health-card strong { color: var(--text); display: block; font-size: 12px; }

@media (max-width: 900px) {
  .topbar { align-items: start; flex-direction: column; }
  .actions { justify-content: flex-start; max-width: none; }
  .updated { text-align: right; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:first-child { grid-column: span 2; }
  .split { grid-template-columns: 1fr; }
  .health-meta { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar, main { width: min(100% - 22px, 1480px); }
  .topbar { padding-top: 25px; }
  .actions button { flex: 1; }
  .kpi { min-height: 105px; }
  .kpi strong { margin-top: 17px; font-size: 28px; }
  .feed-item { grid-template-columns: 60px 1fr; }
  .feed-item time { grid-column: 2; }
  .panel-title { align-items: start; flex-direction: column; }
}
