/* LUCY-style industrial dashboard */
:root {
  --bg-deep: #12122c;
  --bg-base: #16163a;
  --bg-panel: rgba(28, 30, 68, 0.78);
  --bg-card: rgba(24, 26, 62, 0.82);
  --bg-elevated: rgba(36, 38, 82, 0.9);
  --line: rgba(160, 190, 255, 0.14);
  --line-strong: rgba(94, 231, 245, 0.38);
  --blue: #3dd6e8;
  --blue-bright: #5ee7f5;
  --blue-dim: #2aa8b8;
  --blue-glow: rgba(94, 231, 245, 0.22);
  --accent: #5ee7f5;
  --text: #f4f6ff;
  --text-muted: #9aa3c7;
  --text-dim: #6e7699;
  --ok: #5ee7f5;
  --danger: #f87171;
  --warning: #ff8a3d;
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  background: #1e2148;
  color: var(--text);
  overflow: hidden;
}

a { color: var(--blue-bright); text-decoration: none; transition: color .15s; }
a:hover { color: #fff; }

.layout {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(165deg, #2a2d58 0%, #1e2148 42%, #25284b 100%);
}
.lucy-app-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.lucy-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
}
.lucy-blob.b1 {
  width: 560px;
  height: 420px;
  right: -140px;
  top: -80px;
  background: radial-gradient(ellipse, rgba(80, 130, 255, 0.42), transparent 68%);
}
.lucy-blob.b2 {
  width: 520px;
  height: 460px;
  left: -160px;
  bottom: -120px;
  background: radial-gradient(ellipse, rgba(120, 70, 220, 0.38), transparent 70%);
}
.se-titlebar,
.main {
  position: relative;
  z-index: 1;
}

/* ===== TOP BAR (CONADE platform header) ===== */
.se-titlebar {
  height: 58px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 220px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}
.lucy-brand {
  display: flex;
  align-items: baseline;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1;
  animation: brand-glow 2.2s ease-in-out infinite;
}
.lucy-brand .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 0%, #5ee7f5 42%, #c4b5fd 78%, #67e8f9 100%);
  background-size: 100% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    brand-wave 1.35s ease-in-out infinite,
    brand-shine 2.6s linear infinite;
}
.lucy-brand .ch.sp {
  width: 0.35em;
  background: none;
}
@keyframes brand-wave {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.08); }
}
@keyframes brand-shine {
  0% { background-position: 0% 0%; filter: brightness(1); }
  50% { background-position: 0% 100%; filter: brightness(1.35); }
  100% { background-position: 0% 0%; filter: brightness(1); }
}
@keyframes brand-glow {
  0%, 100% {
    filter:
      drop-shadow(0 0 4px rgba(94, 231, 245, 0.45))
      drop-shadow(0 0 10px rgba(167, 139, 250, 0.25));
  }
  50% {
    filter:
      drop-shadow(0 0 10px rgba(94, 231, 245, 0.95))
      drop-shadow(0 0 22px rgba(196, 181, 253, 0.65));
  }
}
@media (prefers-reduced-motion: reduce) {
  .lucy-brand,
  .lucy-brand .ch { animation: none; color: #fff; background: none; filter: none; }
}
.lucy-logout {
  background: #5ee7f5;
  color: #1a1b3a !important;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.lucy-logout:hover { filter: brightness(1.08); color: #1a1b3a !important; }
.se-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  font-size: 12px;
  color: var(--blue-bright);
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(59, 130, 246, 0.08);
}
.se-logo::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
}
.se-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  line-height: 1.25;
}
.se-title strong { display: block; font-size: 16px; font-weight: 700; color: #fff; }
.se-title span { color: var(--text-muted); font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.se-clock {
  color: #dfe4ff;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-family: "Segoe UI", Consolas, monospace;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  text-shadow: none;
}
.se-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}
.se-menu a {
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.se-menu a.on {
  color: #fff;
  background: rgba(94, 231, 245, 0.16);
  border-color: rgba(94, 231, 245, 0.35);
}
.se-menu a:hover:not(.on) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.is-monitor .content { flex: 1; min-height: 0; padding: 6px 10px 10px; overflow: hidden; }
.is-page .content { flex: 1; overflow: auto; padding: 20px 24px; }
.content { transition: opacity 0.08s ease; }
.content.nav-loading { opacity: 0.92; pointer-events: none; }
.cam-live-grid-sm .thumb img.cam-thumb-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lucy-dash {
  height: 100%;
  display: grid;
  /* width enough for landscape CCTV scene (ref conveyor) */
  grid-template-columns: minmax(280px, 0.32fr) minmax(270px, 0.34fr) minmax(270px, 0.34fr);
  gap: 14px;
  min-height: 0;
}
.lucy-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.lucy-col-mal, .lucy-col-img {
  min-height: 0;
}
.lucy-col-img .lucy-est {
  flex: 0 0 auto;
}
.lucy-col-img .lucy-rec {
  flex: 1 1 0;
  min-height: 0;
}
.lucy-card {
  background: rgba(28, 30, 72, 0.52);
  border: 1px solid rgba(180, 200, 255, 0.16);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(8, 10, 40, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lucy-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.lucy-plant-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.lucy-ring {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 9px solid transparent;
  background:
    linear-gradient(#1c1e4a, #1c1e4a) padding-box,
    conic-gradient(#c084fc, #60a5fa, #22d3ee, #a78bfa, #c084fc) border-box;
  box-shadow:
    0 0 22px rgba(167, 139, 250, 0.55),
    0 0 28px rgba(34, 211, 238, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}
.lucy-ring > span {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 4.2em;
}
.lucy-hbars { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lucy-hbar, .lucy-est-grid > div {
  display: grid;
  grid-template-columns: 88px 1fr 52px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.lucy-hbar > span,
.lucy-est-grid > div > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.lucy-hbar > span small,
.lucy-est-grid > div > span small {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0;
}
.lucy-hbar i, .lucy-pbar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.lucy-hbar i b, .lucy-pbar b {
  display: block;
  height: 100%;
  background: #5ee7f5;
  border-radius: 99px;
}
.lucy-pbar.warn b { background: #ff8a3d; }
.lucy-hbar em, .lucy-est-grid em {
  font-style: normal;
  color: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.lucy-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 8px 14px !important;
  min-height: 0;
}
.lucy-rate-num small { display: block; color: var(--text-muted); font-size: 11px; }
.lucy-rate-num strong { font-size: 26px; color: #fff; letter-spacing: -0.03em; line-height: 1.1; }
.lucy-donut {
  --p: 0;
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(#5ee7f5 calc(var(--p) * 1%), #2a2d5c 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.lucy-donut::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #1c1e48;
}
.lucy-donut span {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
}
.lucy-donut small { display: block; font-size: 8px; font-weight: 600; color: var(--text-muted); }
.lucy-live {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lucy-live h3 { margin: 0 0 6px; font-size: 14px; flex: 0 0 auto; }
.lucy-plant { flex: 0 0 auto; padding: 12px 14px !important; }
.lucy-est { flex: 0 0 auto; padding: 10px 14px !important; }
.lucy-est h3 { margin: 0 0 8px; font-size: 14px; }
.lucy-est-grid { gap: 8px 16px; }
.lucy-cctv {
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  align-items: stretch;
}
.lucy-cctv.lucy-cctv-2 {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
  align-content: start;
  flex: 0 1 auto;
  min-height: 0;
}
.lucy-cctv .cctv-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 0;
}
.lucy-cctv .thumb {
  flex: none;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  /* match conveyor landscape reference */
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #050810;
}
.lucy-cctv .cctv-badge {
  z-index: 5;
  bottom: 8px !important;
  left: 10px !important;
}
/*
 * Main Live CCTV — 16:9 like ref conveyor shot; JS crops to video pane.
 */
.lucy-live .lucy-cctv.lucy-cctv-2 {
  flex: 1 1 0;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  align-content: stretch;
  overflow: hidden;
}
.lucy-live .cctv-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.lucy-live .cctv-slot .cctv-cell {
  flex: 1 1 0;
  min-height: 0;
}
.lucy-live .thumb {
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  flex: 1 1 0;
}
.lucy-live .thumb img.cctv-stream {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050810;
  object-fit: cover;
}
.lucy-live .thumb iframe.cctv-web {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  max-width: none;
  border: 0;
  background: #050810;
  transform-origin: 0 0;
  pointer-events: auto;
}
.lucy-live .dash-cam-card {
  flex: 0 0 auto;
  display: block;
  padding: 7px 10px 6px 12px;
}
.dash-cam-card {
  position: relative;
  padding: 7px 10px 6px 12px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(36, 48, 78, 0.92), rgba(18, 24, 44, 0.88));
  border: 1px solid rgba(148, 180, 220, 0.18);
  box-shadow: 0 4px 12px rgba(4, 10, 28, 0.22);
  overflow: hidden;
}
.dash-cam-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #5ee7f5, #60a5fa 55%, #818cf8);
  opacity: 0.45;
}
.dash-cam-card.on::before { opacity: 1; }
.dash-cam-card.off {
  opacity: 0.78;
}
.dash-cam-card.off::before {
  background: #64748b;
  opacity: 0.7;
}
.dash-cam-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.dash-cam-slot {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #9beff8;
  white-space: nowrap;
}
.dash-cam-status {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  white-space: nowrap;
}
.dash-cam-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: none;
}
.dash-cam-status.st-success {
  color: #86efac;
  border-color: rgba(52, 211, 153, 0.35);
}
.dash-cam-status.st-success i {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.dash-cam-status.st-connecting {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.dash-cam-status.st-connecting i {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.75);
}
.dash-cam-status.st-nosignal {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}
.dash-cam-status.st-nosignal i {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.7);
}
.dash-cam-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cam-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  margin: 0 0 4px;
}
.dash-cam-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  line-height: 1.25;
}
.dash-cam-meta dt {
  margin: 0;
  color: #7c8aa5;
  font-weight: 600;
}
.dash-cam-meta dd {
  margin: 0;
  color: #e2e8f0;
  font-weight: 700;
  text-align: right;
  max-width: 68%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-cam-url-block {
  display: block;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 180, 220, 0.12);
}
.dash-cam-url-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7dd3fc;
  margin-bottom: 2px;
}
.dash-cam-url {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  color: #cbd5e1;
  font-family: Consolas, "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lucy-est-h { display: flex; justify-content: space-between; align-items: baseline; }
.lucy-est-h h3 { margin: 0; }
.lucy-est-h small { color: var(--text-muted); font-size: 11px; }
.lucy-est-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.lucy-mal, .lucy-rec {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.lucy-mal-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.lucy-mal-title > span {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.lucy-site-grad {
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(105deg, #c084fc 0%, #60a5fa 35%, #22d3ee 70%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(94, 231, 245, 0.35));
}
.lucy-mal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lucy-mal-hbars {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  border-bottom: none;
}
.lucy-mal-hbars .lucy-hbar {
  grid-template-columns: 96px 1fr 56px;
}
.lucy-mal-plant {
  flex: 0 0 auto;
  justify-content: flex-start;
  width: 100%;
  padding: 4px 2px 12px;
  border-bottom: 1px solid rgba(180, 200, 255, 0.12);
}
.lucy-mal-plant .lucy-ring {
  width: 88px;
  height: 88px;
}
.lucy-live .cctv-slot.lucy-live-mal {
  border: 1px solid rgba(94, 231, 245, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  padding: 14px 16px;
  gap: 10px;
}
.lucy-live-mal .lucy-mal-title { margin: 0; flex: 0 0 auto; }
.lucy-live-mal .lucy-mal-plant {
  flex: 1 1 auto;
  align-items: center;
  gap: 24px;
  padding: 0;
  border-bottom: none;
}
.lucy-live-mal .lucy-mal-plant .lucy-ring {
  width: 128px;
  height: 128px;
  border-width: 10px;
}
.lucy-live-mal .lucy-ring > span { font-size: 16px; }
.lucy-live-mal .lucy-mal-hbars { gap: 22px; }
.lucy-mal-alarm-slot {
  flex: 0 0 56px;
  display: flex;
  align-items: center;
}
.lucy-mal-alarm-slot .dash-alarm {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.lucy-status {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-shrink: 0;
}
.lucy-st {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #3a3d66;
  color: #8b90b5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
}
.lucy-st span { font-size: 22px; font-weight: 800; line-height: 1; }
.lucy-st small { font-size: 10px; margin-top: 4px; }
.lucy-st.on.warn {
  opacity: 1;
  color: #ff8a3d;
  border-color: #ff8a3d;
  box-shadow: 0 0 20px rgba(255, 138, 61, 0.55);
}
.lucy-st.on.fault {
  opacity: 1;
  color: #f87171;
  border-color: #f87171;
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.45);
}
.lucy-fault { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.lucy-fault-h { margin-bottom: 6px; flex-shrink: 0; }
.lucy-fault .se-log { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.lucy-fault .se-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.lucy-rec-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.lucy-rec .se-shot { flex: 1; min-height: 0; background: transparent; border: none; display: flex; flex-direction: column; }
.lucy-rec .stage { flex: 1; min-height: 0; border-radius: 12px; overflow: hidden; }
.lucy-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex-shrink: 0;
}
.lucy-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(94, 231, 245, 0.28), rgba(94, 231, 245, 0.08));
  border: 1px solid rgba(94, 231, 245, 0.35);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.lucy-step em { font-style: normal; font-size: 10px; font-weight: 600; color: #9beff8; margin-bottom: 2px; }
.lucy-step.off { opacity: 0.35; pointer-events: none; }

/* ===== MONITOR (legacy 3-col, unused on lucy dash) ===== */
.se-monitor {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.2fr) minmax(300px, 0.92fr);
  gap: 10px;
  min-height: 0;
}
.hg-col-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 2px 6px;
  flex-shrink: 0;
}
.hg-col-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
}
.hg-col-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.hg-on {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #041018;
  background: #00e5ff;
  border-radius: 999px;
  padding: 3px 10px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}
.se-left, .se-center, .se-inspect {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 8px;
}
.se-site {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: #fff;
}
.se-cams {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.se-cam {
  background: var(--bg-panel);
  color: var(--text-muted);
  text-align: center;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.se-cam small { font-size: 9px; letter-spacing: .08em; font-weight: 700; }
.se-cam.live { color: #b8f3ff; border-color: var(--line-strong); }
.se-cam.demo { color: #ffe9a3; border-color: rgba(255, 204, 0, 0.35); }

.hg-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.hg-gauge {
  --p: 0;
  aspect-ratio: 1;
  max-height: 148px;
  margin: 0 auto;
  width: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--g, #00e5ff) calc(var(--p) * 1%), rgba(255,255,255,0.06) 0);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}
.hg-gauge.teal { --g: #00e5ff; }
.hg-gauge.amber { --g: #ffcc00; box-shadow: 0 0 18px rgba(255, 204, 0, 0.12); }
.hg-gauge::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #0a1220;
  border: 1px solid rgba(0, 229, 255, 0.12);
}
.hg-gauge-in {
  position: relative;
  z-index: 1;
  text-align: center;
}
.hg-gauge-in strong {
  display: block;
  font-size: 20px;
  font-family: Consolas, monospace;
  color: #fff;
}
.hg-gauge-in em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.hg-bars { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.hg-bar {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}
.hg-bar i {
  display: block;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.hg-bar i b {
  display: block;
  height: 100%;
  background: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
}
.hg-bar.amber i b { background: #ffcc00; box-shadow: 0 0 8px rgba(255, 204, 0, 0.45); }
.hg-bar em { font-style: normal; font-family: Consolas, monospace; color: #fff; min-width: 48px; text-align: right; }

.se-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.kpi-l, .kpi-n {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.kpi-l {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.35;
}
.kpi-n {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-bright);
  font-family: Consolas, "Courier New", monospace;
}

.se-events { flex: 1; min-height: 0; }
.se-inspect .se-shot { flex: 1; min-height: 0; }
.se-center .se-right { flex: 1; min-height: 0; }
.dt-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dt-panel-h {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}
.se-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.se-list-head > span:first-child { flex: 1; }
.se-list-head .ev-live.dash-live {
  padding: 3px 8px;
  font-size: 10px;
  gap: 5px;
  flex-shrink: 0;
}
.se-list-head .ev-live.dash-live .ev-live-dot {
  width: 6px;
  height: 6px;
}
.se-list-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
}
.se-list-limit select {
  min-width: 58px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
}
.se-list-limit select:focus {
  outline: none;
  border-color: var(--accent);
}
.se-log { min-height: 0; overflow: auto; flex: 1; }
.se-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.se-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #102033;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.se-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
  text-align: center;
  background: transparent;
}
.se-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.se-table td.sz {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-family: Consolas, monospace;
  font-size: 10px;
  color: var(--text-muted);
}
.se-table tr { cursor: pointer; transition: background .12s; }
.se-table tr:hover td { background: rgba(0, 229, 255, 0.08); }
.se-table tr.on td {
  background: rgba(0, 229, 255, 0.16);
  color: var(--blue-bright);
  border-bottom-color: rgba(0, 229, 255, 0.28);
}

.se-shot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.se-res {
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
  padding: 6px 10px;
  font-family: Consolas, monospace;
}
.se-ts {
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 10px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.stage, .detect-stage, .thumb {
  position: relative;
  background: #050810;
  border: 1px solid var(--line);
  overflow: hidden;
}
.stage, .detect-stage {
  overflow: visible;
}
.stage { flex: 1; min-height: 0; }
.stage.img-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(5, 8, 16, 0.35);
}
.detect-stage.img-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(5, 8, 16, 0.35);
}
.stage.img-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: dvg-spin 0.7s linear infinite;
  pointer-events: none;
}
.detect-stage.img-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: dvg-spin 0.7s linear infinite;
  pointer-events: none;
}
@keyframes dvg-spin { to { transform: rotate(360deg); } }
.stage img, .detect-stage img, .thumb img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}
.stage img.surface-demo,
.detect-stage img.surface-demo {
  object-fit: contain;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06), transparent 42%),
    #0b1018;
}
.boxes { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.bbox {
  position: absolute;
  border: 2px solid #00ff00;
  background: rgba(0, 255, 0, 0.06);
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.45);
  box-sizing: border-box;
}
.bbox::after { content: none; }
.bbox-label {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 2px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 2px #000,
    0 1px 2px #000,
    1px 0 2px #000,
    -1px 0 2px #000,
    0 -1px 2px #000;
}

.se-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.se-btn {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 14px 8px;
  font-weight: 700;
  letter-spacing: .06em;
  font-size: 12px;
  transition: all .15s;
}
.se-btn:hover {
  color: #041018;
  background: linear-gradient(180deg, #5ff7ff, #00c6d8);
  border-color: #7effff;
}
.se-btn.disabled, .se-btn.ghost {
  opacity: .35;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
}

/* Right: multi-viewer (3D/4D viewer style) */
.se-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.45fr 0.7fr;
  gap: 8px;
  min-height: 0;
}
.se-right .thumb.main { grid-column: 1 / -1; }
.thumb {
  display: block;
  min-height: 0;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.08) 0%, transparent 40%);
  z-index: 1;
}
.thumb span {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 2;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(8, 13, 20, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
}
.cctv-badge {
  letter-spacing: .06em;
  bottom: 8px !important;
  left: 10px !important;
}
.cctv-url {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: block;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 1;
  font-size: 10px !important;
  font-weight: 600;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0 !important;
  line-height: 1.35;
  padding: 6px 8px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #9beff8 !important;
  background: rgba(12, 16, 40, 0.92) !important;
  border: 1px solid rgba(94, 231, 245, 0.28) !important;
  border-radius: 8px !important;
  backdrop-filter: none;
}
.cctv-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #050810;
  border: 0;
}
iframe.cctv-youtube,
iframe.cctv-web {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: unset;
  background: #050810;
}
.cctv-cell.is-live .cctv-nosignal:not(.on) {
  display: none;
}
.cctv-nosignal {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(8, 12, 20, 0.96),
      rgba(8, 12, 20, 0.96) 10px,
      rgba(14, 20, 32, 0.96) 10px,
      rgba(14, 20, 32, 0.96) 20px
    );
  color: #c7d2e0;
  text-align: center;
  pointer-events: none;
}
.cctv-nosignal.on,
.cctv-cell.is-nosignal .cctv-nosignal,
.cctv-cell.is-connecting .cctv-nosignal {
  display: flex;
}
.cctv-cell.is-live .cctv-nosignal {
  display: none !important;
}
.cctv-nosignal strong {
  font-size: 15px;
  letter-spacing: 0.12em;
  color: #f8fafc;
}
.cctv-nosignal span {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #94a3b8;
}
.cctv-nosignal em {
  font-style: normal;
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
}
.cctv-nosignal.connecting strong { color: #fbbf24; }
.cctv-cell.is-nosignal .cctv-nosignal strong,
.cctv-nosignal:not(.connecting).on strong { color: #f87171; }
.cctv-live-dot.off {
  background: #f87171;
  box-shadow: none;
  opacity: 0.85;
}
.cam-viewer-stage .cctv-nosignal {
  border-radius: 8px;
}
video.cctv-stream { object-fit: cover; }
.cctv-badge em {
  margin-left: 6px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: .08em;
  color: #86efac;
}
.cctv-badge em.st-success { color: #86efac; }
.cctv-badge em.st-connecting { color: #fbbf24; }
.cctv-badge em.st-nosignal { color: #f87171; }
.cctv-live-dot.demo {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
}
.thumb > .cctv-live-dot {
  left: auto !important;
  bottom: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  backdrop-filter: none !important;
  font-size: 0 !important;
  letter-spacing: 0 !important;
  background: var(--ok) !important;
}
.thumb > .cctv-live-dot.off { background: #f87171 !important; box-shadow: none !important; }
.thumb > .cctv-live-dot.demo { background: #fbbf24 !important; }
.cctv-live-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
  animation: cctv-pulse 1.6s ease-in-out infinite;
}
@keyframes cctv-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}

/* ===== DETECT IMAGE (viewer detail) ===== */
.detect-win {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.detect-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.detect-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.detect-bar input {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  font-family: Consolas, monospace;
}
.detect-bar .grow { flex: 1; min-width: 0; }
.detect-bar .grow input,
.detect-size-select { width: 100%; }
.detect-size-select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  font-family: Consolas, monospace;
  max-width: 100%;
}
.detect-objects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 10px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.detect-objects:empty { display: none; }
.detect-obj {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: Consolas, "Courier New", monospace;
  cursor: pointer;
  line-height: 1.3;
}
.detect-obj:hover { border-color: #00ff00; color: #fff; }
.detect-obj.on {
  border-color: #00ff00;
  color: #fff;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.35);
}
.detect-stage { flex: 1; min-height: 0; border: none; }

/* ===== SUB PAGES (card-based admin) ===== */
.page-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.page-desc {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-h {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--bg-elevated);
}
.card-b { padding: 16px; }
.stat {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.stat .lbl { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .val { font-size: 26px; font-weight: 800; color: var(--blue-bright); margin-top: 6px; font-family: Consolas, monospace; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.data td { padding: 10px 14px; border-top: 1px solid var(--line); }
table.data tbody tr:hover { background: rgba(59, 130, 246, 0.06); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.muted { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.badge.info { background: rgba(59, 130, 246, 0.15); color: var(--blue-bright); }
.badge.warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.badge.danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.28), rgba(0, 166, 184, 0.18));
  color: #fff;
  transition: all .15s;
}
.btn:hover {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.42), rgba(0, 166, 184, 0.28));
  border-color: var(--blue-bright);
}
.btn.outline { background: transparent; border-color: var(--line); color: var(--text-muted); }
.btn.outline:hover { color: #fff; border-color: var(--line-strong); }
.btn.danger { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.35); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  width: 100%;
  background: var(--bg-panel);
  color: var(--text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.alert {
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}
.pager { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 13px; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.right { text-align: right; }
.mt { margin-top: 14px; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.bars { display: flex; align-items: flex-end; gap: 12px; height: 140px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar span.col { width: 70%; background: linear-gradient(180deg, var(--blue-bright), var(--blue-dim)); min-height: 4px; border-radius: 3px 3px 0 0; }
.bar em { font-style: normal; font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ===== LOGIN (LUCY-style glass card) ===== */
.login-body {
  overflow: auto;
  background: #25284b;
}
.lucy-login {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #eef1ff;
  overflow: hidden;
}
.lucy-login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(165deg, #2a2d58 0%, #1e2148 45%, #25284b 100%);
}
.lucy-dia {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 36px;
  transform: rotate(45deg);
  pointer-events: none;
}
.lucy-dia.d1 {
  left: -40px;
  top: 18%;
  background: linear-gradient(135deg, #5edbd8, #3a7bd5);
  opacity: 0.85;
  box-shadow: 0 20px 50px rgba(58, 123, 213, 0.35);
}
.lucy-dia.d2 {
  left: 12%;
  bottom: 8%;
  width: 160px;
  height: 160px;
  background: repeating-linear-gradient(-45deg, rgba(94,231,245,.35) 0 8px, rgba(58,123,213,.2) 8px 16px);
  opacity: 0.55;
}
.lucy-dia.d3 {
  right: 8%;
  top: 12%;
  width: 190px;
  height: 190px;
  background: radial-gradient(circle at 30% 30%, #7dd3fc, #3a7bd5);
  opacity: 0.55;
}
.lucy-dia.d4 {
  right: -30px;
  bottom: 18%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,.22) 1.5px, transparent 2px);
  background-size: 12px 12px;
  background-color: rgba(90, 140, 220, 0.28);
  opacity: 0.7;
}
.lucy-dia.d5 {
  left: 42%;
  top: -60px;
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #67e8f9, #2563eb);
  opacity: 0.35;
}
.lucy-login-top,
.lucy-login-main,
.lucy-login-foot {
  position: relative;
  z-index: 1;
}
.lucy-login-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px 0;
}
.lucy-login-top .lucy-brand { font-size: 16px; }
.lucy-login-top .se-clock { color: #c5cbe8; font-size: 12px; }
.lucy-login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px 20px;
}
.lucy-login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px 32px;
  border-radius: 18px;
  background: rgba(40, 42, 88, 0.62);
  border: 1px solid rgba(180, 200, 255, 0.16);
  box-shadow: 0 24px 60px rgba(10, 12, 40, 0.4);
  backdrop-filter: blur(16px);
  text-align: center;
}
.lucy-login-card h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}
.lucy-login-card h1 small {
  font-size: 16px;
  font-weight: 700;
  margin-left: 4px;
  color: #d7dcf5;
}
.lucy-login-sub {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #b7bdd8;
}
.lucy-login-rule {
  height: 1px;
  margin: 22px 8px 22px;
  background: rgba(255,255,255,0.14);
}
.lucy-login-form { display: flex; flex-direction: column; gap: 12px; }
.lucy-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 0 12px;
  height: 46px;
  color: #7a8199;
}
.lucy-field svg { width: 18px; height: 18px; flex-shrink: 0; }
.lucy-field input {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 46px !important;
  color: #2a2d4a !important;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.lucy-field input::placeholder { color: #9aa0b8; font-weight: 700; }
.lucy-login-form button {
  margin-top: 6px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: #1b1e3a;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.42em;
  cursor: pointer;
}
.lucy-login-form button:hover { background: #12142c; }
.lucy-login-card.admin {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 24px 60px rgba(10, 12, 40, 0.4), 0 0 40px rgba(251, 191, 36, 0.12);
}
.lucy-admin-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.lucy-login-switch {
  margin: 16px 0 0;
  font-size: 12px;
}
.lucy-login-switch a {
  color: #9beff8;
  font-weight: 700;
}
.lucy-login-foot {
  padding: 0 28px 18px;
  font-size: 10px;
  line-height: 1.5;
  color: #9aa3c7;
}
.lucy-login-foot p { margin: 0 0 4px; }
.login-card h2 { margin: 8px 0 4px; text-align: center; font-size: 22px; color: #fff; }
.hint {
  background: var(--bg-panel);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  border: 1px solid var(--line);
  line-height: 1.5;
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.se-input {
  background: var(--bg-panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  height: 44px;
}
.se-input:focus {
  border-color: var(--line-strong) !important;
  box-shadow: 0 0 0 3px var(--blue-glow) !important;
}
.se-login-btn {
  width: 100%;
  margin-top: 4px;
  height: 44px;
  font-size: 14px;
  letter-spacing: .06em;
}
@media (max-width: 980px) {
  .lucy-login-card { margin: 0 8px; }
}

@media print {
  .se-titlebar, .se-left, .se-menu, .detect-objects { display: none !important; }
  .detect-stage, .stage { height: 90vh; }
}

@media (max-width: 1280px) {
  .lucy-dash { grid-template-columns: 1fr; height: auto; }
  .lucy-col { height: auto; overflow: visible; }
  .lucy-fault .se-log { max-height: 420px; }
  .lucy-rec .stage { min-height: 420px; }
  .lucy-cctv { min-height: 160px; }
  .se-monitor { grid-template-columns: 1fr; }
  .se-center { min-height: 420px; }
  .se-kpis { grid-template-columns: 1fr 1fr; }
  .se-right { grid-template-columns: 1fr; grid-template-rows: auto; }
  body { overflow: auto; }
  .layout { height: auto; min-height: 100vh; }
}

.lucy-admin { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.lucy-flash {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
}
.lucy-flash.ok {
  background: rgba(46, 230, 166, 0.12);
  border: 1px solid rgba(46, 230, 166, 0.35);
  color: #7df0c9;
}
.lucy-flash.err {
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.35);
  color: #ff8da3;
}
.lucy-admin-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.lucy-admin-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.lucy-admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.lucy-admin-kpis .lucy-card {
  padding: 14px 16px;
}
.lucy-admin-kpis small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lucy-admin-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  color: #5ee7f5;
  font-variant-numeric: tabular-nums;
}
.lucy-admin-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  min-height: 0;
}
.lucy-admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lucy-admin-list { min-width: 0; }
.lucy-admin-table-wrap { overflow: auto; }
.lucy-admin-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.lucy-admin-actions form { margin: 0; }
.lucy-admin table.data input,
.lucy-admin table.data select {
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
}
@media (max-width: 1100px) {
  .lucy-admin-grid, .lucy-admin-kpis { grid-template-columns: 1fr; }
}

/* ===== DETECTION EVENTS LOG (visual cards) ===== */
.ev-log { display: flex; flex-direction: column; gap: 14px; }
.ev-log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ev-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(46, 230, 166, 0.08);
  border: 1px solid rgba(46, 230, 166, 0.25);
  font-size: 11px;
  color: #7df0c9;
  white-space: nowrap;
}
.ev-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.ev-live-dot.on {
  background: #2ee6a6;
  box-shadow: 0 0 8px rgba(46, 230, 166, 0.65);
  animation: ev-live-pulse 1s ease-in-out infinite;
}
@keyframes ev-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.92); }
}
.ev-card.is-new {
  animation: ev-card-in 0.45s ease;
}
@keyframes ev-card-in {
  from { opacity: 0.35; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ev-log-stats {
  min-width: 120px;
  padding: 14px 18px !important;
  text-align: center;
}
.ev-log-stats small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ev-log-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  color: #5ee7f5;
}
.ev-filter {
  display: grid;
  grid-template-columns: minmax(110px, 1.6fr) repeat(3, minmax(88px, 0.7fr)) minmax(88px, 0.7fr) minmax(110px, 0.9fr);
  gap: 10px;
  align-items: end;
  padding: 16px 18px !important;
  width: 100%;
  box-sizing: border-box;
}
.ev-filter .field {
  min-width: 0;
}
.ev-filter .field select,
.ev-filter .field .btn {
  width: 100%;
}
.ev-cam-list {
  padding: 14px 16px 10px !important;
}
.ev-cam-list-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ev-cam-list-h h3 {
  margin: 0;
  font-size: 15px;
}
.ev-cam-list-h small {
  color: var(--text-muted);
  font-size: 11px;
}
.ev-cam-table-wrap {
  overflow-x: auto;
}
.ev-cam-table td,
.ev-cam-table th {
  white-space: nowrap;
}
.ev-cam-table tbody tr.on {
  background: rgba(59, 130, 246, 0.12);
}
.ev-cam-table .btn.sm {
  white-space: nowrap;
}
.ev-filter-btn .btn { width: 100%; }
.ev-insert { padding: 14px 18px !important; }
.ev-insert summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 13px;
}
.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.ev-card {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
}
.ev-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #050810;
  border-bottom: 1px solid rgba(160, 185, 255, 0.12);
  overflow: hidden;
}
.ev-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06), transparent 42%),
    #0b1018;
}
.ev-img-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.ev-img-badge.demo {
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.ev-img-badge.live {
  background: rgba(94, 231, 245, 0.2);
  color: #5ee7f5;
  border: 1px solid rgba(94, 231, 245, 0.4);
}
.ev-card .bbox-label { font-size: 10px; }
.ev-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-idline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ev-idline strong { font-size: 16px; color: #fff; }
.ev-idline em {
  font-style: normal;
  font-size: 12px;
  color: #5ee7f5;
  font-weight: 700;
}
.ev-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ev-coords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 72px;
  overflow: auto;
}
.ev-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 255, 0, 0.08);
  border: 1px solid rgba(0, 255, 0, 0.28);
  color: #bbf7d0;
  font-size: 10px;
  font-family: Consolas, monospace;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev-chip.muted {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}
.ev-raw {
  font-size: 10px;
  color: var(--text-dim);
  font-family: Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-actions { display: flex; gap: 8px; margin-top: 4px; }
.ev-empty {
  padding: 40px 20px !important;
  text-align: center;
  color: var(--text-muted);
}
.ev-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  .ev-filter { grid-template-columns: 1fr 1fr; }
  .ev-log-head { flex-direction: column; }
}

/* Camera page — Live CCTV status + viewer */
.cam-page .cam-live-card { margin-bottom: 16px; }
.cam-page .cam-live-card h3 { margin: 0 0 12px; }
.cam-live-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  max-width: 100%;
}
.cam-live-grid-sm {
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
  gap: 12px;
}
.cam-live-grid-sm .thumb {
  height: auto;
  min-height: 180px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #050810;
}
.cam-live-grid-sm .cctv-badge {
  font-size: 10px;
  bottom: 6px !important;
  left: 8px !important;
}
.cam-live-grid-sm .cctv-live-dot {
  width: 8px;
  height: 8px;
  top: 8px;
  right: 8px;
}
button.cam-live-tile {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
button.cam-live-tile .thumb {
  position: relative;
  transition: box-shadow .18s ease, transform .18s ease;
}
button.cam-live-tile:hover .thumb,
button.cam-live-tile:focus-visible .thumb {
  outline: none;
  box-shadow: 0 0 0 2px rgba(94, 231, 245, 0.55);
  transform: translateY(-1px);
}
button.cam-live-tile iframe,
button.cam-live-tile img,
button.cam-live-tile video {
  pointer-events: none;
}
.cam-tap-hint {
  position: absolute;
  right: 8px;
  bottom: 28px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(226, 232, 240, 0.92);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
  pointer-events: none;
}
.cam-viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1;
}
.cam-slot-list-card .card-h { margin-bottom: 10px; }
.cam-slot-table tbody tr {
  cursor: pointer;
}
.cam-slot-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}
.cam-status {
  display: inline-block;
  min-width: 48px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.cam-status.on {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
}
.cam-status.off {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.22);
}
body.cam-viewer-open,
body.ev-viewer-open { overflow: hidden; }
.cam-viewer[hidden],
.ev-viewer[hidden] { display: none !important; }
.ev-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.ev-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 18, 0.82);
  backdrop-filter: blur(4px);
}
.ev-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(1280px, 96vw);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0d1524;
  border: 1px solid rgba(94, 231, 245, 0.28);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 10px 10px 12px;
  overflow: hidden;
}
.ev-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.ev-viewer-meta { flex: 1; min-width: 0; }
.ev-viewer-meta h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #e8edf4;
}
.ev-viewer-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.ev-viewer-fields label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ev-viewer-fields input {
  background: #121a28;
  color: #e8edf4;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: Consolas, monospace;
  min-width: 7em;
}
.ev-viewer-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #e8edf4;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ev-viewer-close:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
}
.ev-viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 280px;
  height: min(72vh, 820px);
  max-height: calc(96vh - 160px);
  background: #050810;
  border-radius: 10px;
  overflow: hidden;
}
.ev-viewer-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ev-viewer-stage .boxes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ev-viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.ev-viewer-size {
  font-size: 11px;
  color: #7dd3fc;
  font-family: Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 75%;
}
.cam-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.cam-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 18, 0.78);
  backdrop-filter: blur(4px);
}
.cam-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(1400px, 98vw);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0d1524;
  border: 1px solid rgba(94, 231, 245, 0.28);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 10px 10px 12px;
}
.cam-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cam-viewer-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.cam-viewer-quality {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cam-q-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .04em;
}
.cam-q-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.cam-q-btn:hover { background: rgba(94, 231, 245, 0.1); border-color: rgba(94, 231, 245, 0.35); }
.cam-q-btn.on {
  color: #e8edf4;
  background: rgba(94, 231, 245, 0.18);
  border-color: rgba(94, 231, 245, 0.45);
}
.cam-viewer-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  transition: opacity 0.2s ease;
  background: #000;
}
.cam-viewer-live {
  z-index: 1;
}
.cam-viewer-head h3 {
  margin: 0;
  font-size: 16px;
  color: #e8edf4;
}
.cam-viewer-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #e8edf4;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.cam-viewer-close:hover { background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.45); }
.cam-viewer-stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  max-height: calc(96vh - 90px);
  background: #121212;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.cam-viewer-stage .cam-viewer-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
  background: #121212;
}
.cam-viewer-quality,
.cam-q-label,
.cam-q-btn {
  display: none !important;
}
.cam-viewer-url {
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
  color: #9beff8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(12, 16, 40, 0.92);
  border: 1px solid rgba(94, 231, 245, 0.22);
}
@media (max-width: 700px) {
  .cam-live-grid { grid-template-columns: 1fr 1fr; max-width: 100%; }
  .cam-viewer { padding: 10px; }
}
.log-alert {
  display: none;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(94, 231, 245, 0.45);
  background: rgba(94, 231, 245, 0.14);
  color: #e9fbff;
  font-weight: 700;
}
.log-alert.on { display: block; }
.log-alert.fail { border-color: rgba(248, 113, 113, 0.6); background: rgba(248, 113, 113, 0.16); color: #ffe4e4; }
tr.log-new td { background: rgba(94, 231, 245, 0.08); }
tr.log-fail td { background: rgba(248, 113, 113, 0.07); }
tr.log-fail td:last-child { color: #fecaca; }
.badge.success { background: rgba(52, 211, 153, 0.14); color: #34d399; }
.log-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.log-sum {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(15, 23, 42, 0.45);
  text-decoration: none; color: inherit;
}
.log-sum .lbl { font-size: 12px; color: var(--text-muted); }
.log-sum strong { font-size: 20px; }
.log-sum.ok strong, .log-sum .ok-txt { color: #34d399; }
.log-sum.fail strong, .log-sum .fail-txt { color: #f87171; }
.log-sum.ok.on { border-color: rgba(52, 211, 153, 0.7); }
.log-sum.fail.on { border-color: rgba(248, 113, 113, 0.7); }
.log-filter { display: flex; gap: 8px; max-width: 420px; margin-bottom: 16px; }
@media (max-width: 900px) { .log-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-alarm {
  display: none;
  margin: 8px 12px 0;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid #fecaca;
  background: #7f1d1d;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  font-size: 16px;
}
.dash-alarm.on {
  display: block;
  animation: dash-alarm-blink 0.55s steps(1, end) infinite;
}
.dash-alarm.on::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
  vertical-align: -1px;
}
@keyframes dash-alarm-blink {
  0%, 49% {
    background: #ef4444;
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.95);
  }
  50%, 100% {
    background: #3f0d0d;
    color: #fecaca;
    border-color: #ef4444;
    box-shadow: none;
  }
}
#dashEventTbody tr.is-new td {
  animation: dash-row-blink 0.55s steps(1, end) infinite;
}
@keyframes dash-row-blink {
  0%, 49% { background: rgba(239, 68, 68, 0.62); }
  50%, 100% { background: rgba(239, 68, 68, 0.08); }
}

