:root {
  --bg: #07090c;
  --bg2: #0b0f14;
  --panel: #10161e;
  --panel2: #161e28;
  --line: #243041;
  --text: #e7eef6;
  --muted: #8b9aab;
  --teal: #3ee0c5;
  --red: #ff4d6d;
  --amber: #f0c14b;
  --green: #3dd68c;
  --blue: #7aa6ff;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
a { color: var(--teal); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.auth-body {
  min-height: 100%;
  display: grid;
  place-items: center;
  position: relative;
  background: #07090c;
}
.auth-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(720px 280px at 50% 0%, rgba(62,224,197,.1), transparent 55%),
    linear-gradient(rgba(36,48,65,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36,48,65,.35) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
.auth-card {
  width: min(420px, calc(100% - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px;
  position: relative;
  z-index: 1;
}
.auth-card-lg { padding: 32px 32px 24px; }
.auth-foot { margin-top: 18px; margin-bottom: 0; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.brand strong { display: block; letter-spacing: .12em; font-size: 13px; }
.brand span { color: var(--muted); font-size: 12px; }
.brand-mark {
  width: 34px; height: 34px; border: 2px solid var(--teal);
  border-radius: 50%; position: relative; flex: none;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: var(--teal);
}
.brand-mark::before { width: 2px; height: 14px; left: 14px; top: 8px; }
.brand-mark::after { height: 2px; width: 14px; top: 14px; left: 8px; }
.auth-card label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0; }
.auth-card input, .field input, .field textarea, .field select {
  width: 100%; margin-top: 6px; background: var(--bg); border: 1px solid var(--line);
  padding: 10px 12px; outline: none;
}
.auth-card input:focus, .field input:focus, .field textarea:focus { border-color: var(--teal); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 16px; }
.flash { padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); }
.flash.bad { border-color: var(--red); color: var(--red); }
.btn {
  border: 1px solid var(--line); background: var(--panel2); padding: 8px 12px;
  cursor: pointer; color: var(--text);
}
.btn.primary { background: var(--teal); color: #04110e; border-color: var(--teal); font-weight: 600; width: 100%; padding: 11px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.warn { border-color: var(--amber); color: var(--amber); }
.btn:disabled { opacity: .5; cursor: wait; }
.side {
  position: fixed; inset: 0 auto 0 0; width: 220px; background: var(--bg2);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px;
}
.side-brand { margin: 4px 8px 20px; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav a {
  color: var(--muted); padding: 9px 12px; border: 1px solid transparent;
}
.side nav a:hover, .side nav a.active { color: var(--text); background: var(--panel); border-color: var(--line); }
.side nav b {
  float: right; background: var(--red); color: #fff; font-size: 10px;
  padding: 1px 6px; min-width: 18px; text-align: center;
}
.side-foot { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; padding: 8px; }
.main { margin-left: 220px; min-height: 100%; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: 12px 22px; background: rgba(7,9,12,.92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.top-state { display: flex; align-items: center; gap: 10px; letter-spacing: .04em; }
.top-state strong { font-size: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(139,154,171,.15); }
.state-calm .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(61,214,140,.15); }
.state-suspicious .dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(240,193,75,.15); }
.state-attack .dot, .state-origin .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255,77,109,.2); }
.state-origin .top-state strong, .state-attack .top-state strong { color: var(--red); }
.top-meta { color: var(--muted); font-family: var(--mono); font-size: 12px; flex: 1; }
.view { padding: 18px 22px 40px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); padding: 12px 14px;
}
.kpi span { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.kpi b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 500; margin-top: 4px; }
.kpi.bad b { color: var(--red); }
.kpi.warn b { color: var(--amber); }
.panel { background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; }
.panel h2, .panel h3 {
  margin: 0; padding: 10px 14px; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 600;
}
.panel .body { padding: 12px 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.02); }
tr.click { cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.pill {
  display: inline-block; font-size: 11px; letter-spacing: .04em; padding: 2px 8px;
  border: 1px solid var(--line); color: var(--muted);
}
.pill.calm { color: var(--green); border-color: rgba(61,214,140,.4); }
.pill.suspicious { color: var(--amber); border-color: rgba(240,193,75,.4); }
.pill.attack, .pill.origin { color: var(--red); border-color: rgba(255,77,109,.45); }
.pill.fp { color: var(--amber); }
.row-origin td { box-shadow: inset 3px 0 0 var(--red); }
.row-attack td { box-shadow: inset 3px 0 0 var(--red); }
.row-suspicious td { box-shadow: inset 3px 0 0 var(--amber); }
.spark { width: 92px; height: 28px; display: block; }
.grid-2 { display: grid; grid-template-columns: 1.6fr .8fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { background: var(--bg); border: 1px solid var(--line); padding: 7px 10px; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.tall { height: 280px; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: var(--bg2); border-left: 1px solid var(--line); z-index: 20;
  overflow: auto; padding: 18px;
}
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13px; }
.kv span { color: var(--muted); }
.empty { color: var(--muted); padding: 28px 12px; text-align: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 18px; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline li::before {
  content: ""; width: 8px; height: 8px; background: var(--teal); position: absolute;
  left: -5px; top: 4px; border-radius: 50%;
}
.timeline .t { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.field { margin: 10px 0; }
.field span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a, .tabs button {
  background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; cursor: pointer;
}
.tabs a.active, .tabs button.active { color: var(--text); border-color: var(--teal); }
.site-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.site-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini { font-size: 12px; color: var(--muted); }
code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 5px; }
.banner {
  border: 1px solid var(--amber); color: var(--amber); padding: 10px 12px; margin-bottom: 14px;
}
.fp-row td { background: rgba(240,193,75,.06); }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-3, .grid-split { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .side { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
  .main { margin-left: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
