:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --line: #334155;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}
.topbar, .summary, .grid, .login-card { max-width: 1400px; margin: 0 auto; }
.topbar {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0 0 8px 0; }
.topbar p { margin: 0; color: var(--muted); }
.top-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pill, .live-pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.live-pill { background: var(--accent); color: #052e16; font-weight: 700; }
.notif-pill { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.logout, button {
  background: var(--accent);
  color: #052e16;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button { width: 100%; margin-top: 16px; }
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  padding: 0 24px 24px;
}
.summary-card, .camera-card, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.summary-card.wide { grid-column: 1 / -1; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
  padding: 0 24px 32px;
}
.camera-card.active { border-color: var(--accent); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.card-pills { display: flex; gap: 8px; align-items: center; }
.gps-dot {
  color: #475569;
  font-size: 14px;
  transition: color 0.3s;
}
.gps-dot.active { color: var(--accent); }
video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  border-radius: 14px;
  margin-top: 14px;
}
.meta {
  margin-top: 14px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}
/* Notification banner */
.notif-banner {
  max-width: 1400px;
  margin: 0 auto 18px;
  padding: 0 24px;
}
.notif-content {
  background: var(--danger);
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: pulse 1.5s infinite;
}
.notif-actions { display: flex; gap: 8px; }
.btn-sm {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  width: auto;
  margin: 0;
  text-decoration: none;
  display: inline-block;
}
.btn-accent { background: var(--accent); color: #052e16; }
.btn-muted { background: rgba(255,255,255,0.2); color: #fff; }
/* Overlay toggles */
.overlay-toggles { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.overlay-toggle { cursor: pointer; transition: background 0.2s, color 0.2s; }
/* Camera links */
.cam-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.cam-link { font-size: 12px; }
/* Overlay links */
.overlay-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
/* Runner form */
.runner-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.runner-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 4px;
}
.runner-form input, .gpx-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b1220;
  color: var(--text);
}
/* Login */
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); }
.login-card form { display: grid; gap: 12px; }
input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b1220;
  color: var(--text);
}
