* {
  box-sizing: border-box;
}

:root {
  --bg: #0f1724;
  --bg-soft: #152033;
  --panel: rgba(20, 29, 45, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #eaf1ff;
  --muted: #98a8c3;
  --accent: #4da3ff;
  --accent-2: #7c5cff;
  --success: #1ecb7a;
  --warning: #ffb84d;
  --danger: #ff5f74;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(77, 163, 255, 0.14), transparent 25%),
    radial-gradient(circle at left bottom, rgba(124, 92, 255, 0.16), transparent 25%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  background: rgba(10, 16, 28, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topnav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted);
  transition: 0.2s ease;
}

.topnav a:hover {
  color: var(--text);
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-text,
.hero-stats {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.14);
  color: #a7d1ff;
  font-size: 13px;
  margin-bottom: 16px;
}

.hero-text h2 {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.1;
}

.hero-text p {
  margin: 0;
  max-width: 760px;
  line-height: 1.6;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.btn.full {
  width: 100%;
}

.hero-stats {
  display: grid;
  gap: 16px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}

.stat-title {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat-value.online {
  color: var(--success);
}

.stat-note {
  color: var(--muted);
  font-size: 13px;
}

.grid-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-bottom: 24px;
}

.grid-section.second {
  grid-template-columns: 1.3fr 0.7fr;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.wide-panel {
  min-height: 360px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header h3 {
  margin: 0;
  font-size: 22px;
}

.panel-status {
  color: var(--muted);
  font-size: 13px;
}

.camera-frame {
  position: relative;
  min-height: 380px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.03) 0,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 90px
    ),
    linear-gradient(135deg, #1b2942, #111827);
  border: 1px solid var(--panel-border);
}

.camera-label {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.65);
  font-size: 13px;
  color: #c6d5ed;
  z-index: 2;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.target-box {
  width: 220px;
  height: 260px;
  border: 2px solid rgba(77, 163, 255, 0.7);
  border-radius: 22px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.14);
}

.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 3px;
  top: 14%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #4dd8ff, transparent);
  box-shadow: 0 0 18px rgba(77, 216, 255, 0.7);
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% { top: 14%; }
  50% { top: 82%; }
  100% { top: 14%; }
}

.camera-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.face-list,
.event-list,
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.face-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(77,163,255,0.24), rgba(124,92,255,0.24));
}

.avatar.warning {
  background: rgba(255, 184, 77, 0.16);
  color: #ffd089;
}

.face-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.face-info strong {
  font-size: 16px;
}

.face-info span {
  color: var(--muted);
  font-size: 14px;
}

.face-time {
  color: #b8c8df;
  font-weight: 700;
}

.event-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}

.event-item.alert {
  border-color: rgba(255, 95, 116, 0.28);
  background: rgba(255, 95, 116, 0.08);
}

.event-time {
  color: #9ec7ff;
  font-weight: 700;
}

.event-text {
  color: var(--text);
}

.note-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .hero,
  .grid-section,
  .grid-section.second {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .container {
    padding: 18px;
  }

  .hero-text h2 {
    font-size: 30px;
  }

  .topnav {
    gap: 12px;
  }

  .camera-frame {
    min-height: 300px;
  }

  .target-box {
    width: 170px;
    height: 210px;
  }

  .face-item,
  .event-item {
    grid-template-columns: 1fr;
  }
}