:root {
  --bg: #071217;
  --panel: rgba(13, 26, 34, 0.85);
  --panel-strong: rgba(18, 34, 43, 0.95);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3faf8;
  --muted: rgba(243, 250, 248, 0.68);
  --mint: #00ddb8;
  --amber: #ffc14d;
  --danger: #ff7c57;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 221, 184, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 193, 77, 0.14), transparent 28%),
    linear-gradient(180deg, #09141b 0%, #071217 100%);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero-panel,
.metric-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(22px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 28px;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(0, 221, 184, 0.26), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  max-width: 860px;
}

.subtitle {
  max-width: 820px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

button {
  border: 0;
  border-radius: 18px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background-color 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary,
.secondary,
.ghost {
  padding: 14px 18px;
  font-weight: 800;
}

.primary {
  background: linear-gradient(135deg, var(--mint), #00a89b);
  color: #03211f;
}

.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.ghost,
.tiny-button {
  background: transparent;
  color: var(--amber);
  border: 1px solid rgba(255, 193, 77, 0.28);
}

.status-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.badge,
.count-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.badge.idle {
  background: rgba(255, 255, 255, 0.08);
}

.badge.live {
  background: rgba(0, 221, 184, 0.14);
  color: #9dffe5;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.metric-card {
  padding: 22px;
}

.speed-card,
.location-card {
  grid-column: span 6;
}

.alert-card,
.log-card {
  grid-column: span 12;
}

.card-label {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.metric-row,
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.metric-value {
  font-size: clamp(48px, 8vw, 78px);
  line-height: 0.92;
  font-weight: 800;
}

.metric-unit,
.metric-note,
.location-grid span {
  color: var(--muted);
}

.metric-note {
  margin: 14px 0 0;
  line-height: 1.5;
}

.mini-pill {
  background: rgba(255, 255, 255, 0.07);
}

.mini-pill strong {
  font-size: 22px;
  color: var(--amber);
}

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

.location-grid div {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.location-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.count-pill {
  background: rgba(255, 193, 77, 0.12);
  color: var(--amber);
}

.alert-list,
.event-log {
  display: grid;
  gap: 12px;
}

.alert-item,
.log-item,
.empty-state {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 16px;
}

.alert-top,
.log-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.alert-title,
.log-title {
  font-weight: 800;
}

.alert-distance,
.log-time {
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}

.alert-description,
.log-description,
.empty-state {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.tiny-button {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .speed-card,
  .location-card,
  .alert-card,
  .log-card {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero-panel,
  .metric-card {
    border-radius: 22px;
    padding: 18px;
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
