﻿:root {
  color-scheme: dark;
  --bg: #050608;
  --bg-alt: #0b1117;
  --panel: rgba(14, 20, 28, 0.9);
  --panel-strong: rgba(15, 26, 35, 0.95);
  --line: rgba(120, 152, 176, 0.2);
  --accent: #42f2a1;
  --accent-warm: #f28f3b;
  --accent-cool: #4bc3ff;
  --danger: #ff4d4f;
  --warn: #ffb347;
  --text: #dfe6f3;
  --muted: rgba(223, 230, 243, 0.6);
  --glow: 0 0 18px rgba(66, 242, 161, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(66, 242, 161, 0.15), transparent 40%),
    linear-gradient(130deg, #050608 0%, #0a121b 45%, #0b0f14 100%);
  overflow-x: hidden;
}

.app.is-hidden {
  display: none;
}

.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 9, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.login__card {
  width: min(360px, 88vw);
  background: rgba(12, 18, 24, 0.95);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.login__card h2 {
  margin: 0;
  font-size: 22px;
}

.login__card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.field input {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 12, 0.9);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}

.login__button {
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login__error {
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
}

.ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(75, 195, 255, 0.15), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(242, 143, 59, 0.12), transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(66, 242, 161, 0.12), transparent 45%);
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 10px;
}

.title {
  margin: 0;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(66, 242, 161, 0.4);
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(12, 20, 20, 0.6);
}

.status-chip__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--glow);
  animation: pulse 1.6s ease-in-out infinite;
}

.time {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  letter-spacing: 1px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.8fr) minmax(320px, 1fr);
  gap: 24px;
  padding: 10px 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.video-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(5, 10, 20, 0.55);
}

.video-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.video-panel__header h2 {
  margin: 0;
  font-size: 24px;
}

.video-panel__header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.video-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  font-family: "Space Grotesk", sans-serif;
  border: none;
  cursor: pointer;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.logout {
  padding: 8px 12px;
}

.primary {
  background: var(--accent);
  color: #02110b;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
}

.danger {
  background: var(--danger);
  color: #1d0506;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
}

.video-frame {
  position: relative;
  min-height: clamp(360px, 62vh, 640px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(75, 195, 255, 0.3);
  background: #0a141d;
}

.video-frame__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.detections {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.detection-box {
  position: absolute;
  border: 2px solid rgba(66, 242, 161, 0.85);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(66, 242, 161, 0.35);
  background: rgba(66, 242, 161, 0.08);
}

.detection-label {
  position: absolute;
  top: -22px;
  left: 0;
  background: rgba(6, 10, 14, 0.9);
  border: 1px solid rgba(66, 242, 161, 0.6);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: "Space Mono", monospace;
}

.video-frame__stream {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(75, 195, 255, 0.1), transparent 50%),
    linear-gradient(125deg, rgba(18, 32, 48, 0.9), rgba(6, 8, 12, 0.95));
  animation: scan 5s linear infinite;
  z-index: 1;
  opacity: 0.25;
}

.video-frame__stream::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(66, 242, 161, 0.08),
    rgba(66, 242, 161, 0.08) 2px,
    transparent 2px,
    transparent 6px
  );
  mix-blend-mode: screen;
  opacity: 0.5;
}

.video-frame__stream::after {
  content: "";
  position: absolute;
  inset: -50% 0 0 -50%;
  background: radial-gradient(circle, rgba(66, 242, 161, 0.35), transparent 40%);
  opacity: 0.2;
  animation: drift 6s ease-in-out infinite;
}

.video-overlay {
  position: relative;
  z-index: 3;
  height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overlay__hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 10px;
  background: rgba(6, 12, 18, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.overlay__reticle {
  width: 160px;
  height: 160px;
  border: 1px solid rgba(66, 242, 161, 0.4);
  border-radius: 50%;
  margin: auto;
  position: relative;
}

.overlay__reticle::before,
.overlay__reticle::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px dashed rgba(66, 242, 161, 0.4);
  border-radius: 50%;
}

.overlay__reticle::after {
  inset: 48px;
}

.overlay__readout {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.readout__label {
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}

.readout__value {
  margin: 0;
  font-weight: 600;
}

.video-panel__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mini-title {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.meters {
  display: grid;
  gap: 10px;
}

.meter {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.meter__bar {
  width: 150px;
  height: 6px;
  background: rgba(8, 12, 18, 0.7);
  border-radius: 999px;
  overflow: hidden;
}

.meter__bar div {
  height: 100%;
  background: linear-gradient(90deg, rgba(66, 242, 161, 0.3), rgba(75, 195, 255, 0.9));
}

.panel-actions {
  display: flex;
  gap: 12px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}

.alert-stack,
.grid-panel,
.activity {
  background: var(--panel-strong);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--line);
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}

.alert__title {
  margin: 0 0 4px;
  font-weight: 600;
}

.alert__meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.alert__action {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(5, 8, 12, 0.6);
  color: var(--text);
  border: 1px solid var(--line);
}

.alert.critical {
  background: rgba(255, 77, 79, 0.1);
  border-color: rgba(255, 77, 79, 0.4);
}

.alert.warning {
  background: rgba(255, 179, 71, 0.12);
  border-color: rgba(255, 179, 71, 0.5);
}

.alert.info {
  background: rgba(75, 195, 255, 0.12);
  border-color: rgba(75, 195, 255, 0.4);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grid__item {
  padding: 18px 10px;
  text-align: center;
  border-radius: 14px;
  background: rgba(6, 10, 14, 0.8);
  border: 1px solid var(--line);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.grid__item.online {
  color: var(--accent);
  border-color: rgba(66, 242, 161, 0.4);
  box-shadow: inset 0 0 14px rgba(66, 242, 161, 0.15);
}

.grid__item.warning {
  color: var(--warn);
  border-color: rgba(255, 179, 71, 0.4);
}

.grid__item.offline {
  color: rgba(255, 77, 79, 0.8);
  border-color: rgba(255, 77, 79, 0.4);
}

.activity__list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: rgba(223, 230, 243, 0.7);
  display: grid;
  gap: 10px;
}

.admin-panel.is-hidden {
  display: none;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form select {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 12, 0.9);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: "Space Grotesk", sans-serif;
}

.admin-form__status {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
}

@keyframes scan {
  0% {
    transform: translateY(0);
    filter: hue-rotate(0deg);
  }
  50% {
    transform: translateY(-6px);
    filter: hue-rotate(25deg);
  }
  100% {
    transform: translateY(0);
    filter: hue-rotate(0deg);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(40px, -30px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .video-panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .video-panel__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .meter__bar {
    width: 200px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .layout {
    padding: 10px 20px 30px;
  }

  .video-frame {
    min-height: 280px;
  }

  .video-panel {
    padding: 18px;
  }
}

