/* zlap-termin — Nordic NOC theme */
:root {
  --bg: #0a0d11;
  --bg-raised: #10151c;
  --bg-elev: #141a22;
  --bg-hover: #182030;
  --border: #1c242f;
  --border-strong: #2a3443;

  --fg: #e6ebf2;
  --fg-muted: #8a95a5;
  --fg-dim: #566273;

  --ok: #3ddc97;
  --warn: #f5b544;
  --err: #ff5c5c;
  --info: #7aa2ff;
  --hit: #ffb020;
  --hit-glow: rgba(255, 176, 32, 0.28);

  --sans: "Geist", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  --row-h: 32px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

/* subtle noise / grid so the bg isn't a dead void */
.app-bg::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

.mono { font-family: var(--mono); font-feature-settings: "tnum", "zero"; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

button { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2633; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2a3443; }

/* Pulsing live dot */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 5px transparent; opacity: 0.85; }
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.dot.pulse {
  animation: pulse-dot 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 currentColor;
}

/* HIT glow */
@keyframes hit-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--hit-glow), inset 0 0 0 1px rgba(255,176,32,0.5); }
  50% { box-shadow: 0 0 24px 0 var(--hit-glow), inset 0 0 0 1px rgba(255,176,32,0.9); }
}
.hit-pulse { animation: hit-glow 2.4s ease-in-out infinite; }

/* Fade-in for new log rows */
@keyframes row-in {
  from { background: rgba(122, 162, 255, 0.08); opacity: 0; transform: translateY(-2px); }
  to { background: transparent; opacity: 1; transform: translateY(0); }
}
.row-in { animation: row-in 600ms ease-out; }

/* Toast */
@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-in { animation: toast-in 280ms cubic-bezier(.2,.8,.2,1); }

/* Shake for critical */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-2px); }
  40%, 80% { transform: translateX(2px); }
}
.shake { animation: shake 320ms ease-in-out; }

/* Button baseline */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 80ms;
  line-height: 1;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { background: #ffffff; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: rgba(255,92,92,0.1); border-color: rgba(255,92,92,0.4); }
.btn.ghost { background: transparent; }

/* Input */
.input, .select, textarea.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms, background 120ms;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: #3a4a60;
  background: var(--bg-raised);
}
.input.mono { font-family: var(--mono); }

/* Card */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Table */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: sticky; top: 0;
  user-select: none;
}
.table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge.ok { color: var(--ok); background: rgba(61,220,151,0.08); border-color: rgba(61,220,151,0.2); }
.badge.warn { color: var(--warn); background: rgba(245,181,68,0.08); border-color: rgba(245,181,68,0.2); }
.badge.err { color: var(--err); background: rgba(255,92,92,0.08); border-color: rgba(255,92,92,0.22); }
.badge.info { color: var(--info); background: rgba(122,162,255,0.08); border-color: rgba(122,162,255,0.2); }
.badge.hit { color: var(--hit); background: rgba(255,176,32,0.1); border-color: rgba(255,176,32,0.3); }
.badge.muted { color: var(--fg-muted); background: rgba(255,255,255,0.03); border-color: var(--border); }

/* Section headings */
.section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  font-weight: 500;
}

/* Focus ring */
:focus-visible { outline: 1px solid var(--info); outline-offset: 1px; }

/* Kbd */
kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--fg-muted);
}

/* checkbox */
.chk {
  width: 14px; height: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chk.on { background: var(--info); border-color: var(--info); }
.chk.on::after { content: ""; width: 8px; height: 4px; border-left: 1.5px solid var(--bg); border-bottom: 1.5px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--fg); }

/* Sparkline-ish stripes for placeholder */
.stripe-bg {
  background-image: repeating-linear-gradient(135deg, var(--border) 0 1px, transparent 1px 8px);
}

/* Hide scrollbar for compact strips */
.no-scrollbar::-webkit-scrollbar { display: none; }

@media (max-width: 900px) {
  :root { --row-h: 36px; }
  body { font-size: 13.5px; }
}
