:root {
  --bg: #060914;
  --panel: #0d1326;
  --card: #111a36;
  --muted: #8ca3cc;
  --text: #e8eeff;
  --accent: #ff4d6d;
  --accent-2: #ffd166;
  --success: #3ad9a5;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Barlow", "DM Sans", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(255, 77, 109, 0.08), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(255, 209, 102, 0.06), transparent 25%),
              linear-gradient(135deg, #050915 0%, #080f20 60%, #0c1021 100%);
  color: var(--text);
  min-height: 100vh;
}

.page {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto 48px auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(120deg, rgba(255, 77, 109, 0.12), rgba(255, 209, 102, 0.08) 70%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(160deg, #1d3b74, #2e5aa4);
  color: #e8eeff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 10px 30px rgba(0,0,0,0.35);
}

h1, h2, h3, h4 {
  margin: 4px 0;
}

.subhead {
  margin: 4px 0 0;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meta-block {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.value {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.value.accent {
  color: var(--accent-2);
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.pill.mild {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.pill.outline {
  background: transparent;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  grid-template-rows: auto auto;
  gap: 18px;
  margin-top: 18px;
}

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

.stage {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.tab {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  color: var(--text);
}

.tab.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.2), rgba(255, 209, 102, 0.15));
}

.panel.hidden {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 8px 0;
}

.form-row label {
  font-size: 12px;
  color: var(--muted);
}

.form-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.hidden {
  display: none !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  width: min(420px, 90vw);
  box-shadow: 0 16px 50px rgba(0,0,0,0.45);
}

.login-card h3 {
  margin: 0 0 4px;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.status-dot {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(58, 217, 165, 0.22), rgba(58, 217, 165, 0.08));
  border: 1px solid rgba(58, 217, 165, 0.5);
  color: #a9fce1;
}

.status-dot.pulsing {
  position: relative;
}

.status-dot.pulsing::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: rgba(58, 217, 165, 0.14);
  animation: pulse 1.8s ease-out infinite;
  z-index: -1;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}

.live-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0f1d;
  border: 1px solid var(--border);
  min-height: 360px;
}

.live-frame img, .live-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.alert-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 2;
}

.alert-overlay .flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 77, 109, 0.16), transparent 45%),
              radial-gradient(circle at 80% 10%, rgba(255, 209, 102, 0.12), transparent 40%);
  animation: breathe 2.6s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.alert-overlay .banner {
  margin: 18px;
  padding: 16px 18px;
  background: linear-gradient(120deg, rgba(255, 77, 109, 0.6), rgba(255, 209, 102, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  max-width: 360px;
  color: #0b0d14;
}

.alert-overlay h2 {
  margin: 6px 0;
}

.alert-overlay p {
  margin: 0;
}

.stats {
  position: absolute;
  inset: auto 12px 12px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.stats > div {
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  backdrop-filter: blur(6px);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tags, .filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  margin: 8px 0;
}

.muted.small {
  font-size: 12px;
  margin-top: 2px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.btn.danger {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.9), rgba(255, 77, 109, 0.6));
  border-color: rgba(255, 77, 109, 0.8);
  color: #0b0d14;
  box-shadow: 0 10px 30px rgba(255, 77, 109, 0.35);
}

.events {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.event {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center;
}

.event img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.event h4 {
  margin: 0 0 4px;
}

.event p {
  margin: 0;
  color: var(--muted);
}

.event .badge {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  min-width: 90px;
}

.badge.critical {
  background: rgba(255, 77, 109, 0.16);
  border-color: rgba(255, 77, 109, 0.4);
  color: #ffc2d1;
}

.badge.warning {
  background: rgba(255, 209, 102, 0.16);
  border-color: rgba(255, 209, 102, 0.4);
  color: #ffe9b2;
}

.gallery .thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb .stamp {
  position: absolute;
  inset: auto 8px 8px 8px;
  background: rgba(0, 0, 0, 0.58);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 200;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
