/* Echo Alert — Dark UI */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0d1117;
  --surface: #161b22;
  --border:  #30363d;
  --green:   #3fb950;
  --red:     #f85149;
  --yellow:  #d29922;
  --blue:    #58a6ff;
  --text:    #e6edf3;
  --muted:   #8b949e;
  --radius:  8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
}
.nav-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand::before { content: "🚨"; font-size: 18px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
nav a:hover, nav a.active { color: var(--text); border-bottom-color: var(--green); }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.card-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.card-sub   { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ── Status badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before { content: "●"; font-size: 8px; }
.badge.online  { background: rgba(63,185,80,.15); color: var(--green); }
.badge.offline { background: rgba(248,81,73,.15);  color: var(--red);   }
.badge.recording { background: rgba(248,81,73,.2); color: var(--red); animation: pulse 1s infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Device info ── */
.device-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.device-bar .label { color: var(--muted); font-size: 12px; }
.device-bar .value { font-size: 14px; font-weight: 500; }
.device-info { display: flex; flex-direction: column; gap: 2px; }

/* ── Section ── */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Event list ── */
.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color .15s;
}
.event-item:hover { border-color: var(--green); }
.event-item.new   { border-color: var(--yellow); animation: flash .6s ease; }

@keyframes flash {
  0%  { background: rgba(210,153,34,.2); }
  100%{ background: var(--surface); }
}

.conf-bar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), var(--border) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.conf-bar::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface);
}
.conf-bar span { position: relative; z-index: 1; }

.event-meta { flex: 1; min-width: 0; }
.event-time { color: var(--muted); font-size: 12px; }
.event-dur  { color: var(--text); font-size: 13px; }
.event-file { color: var(--blue); font-size: 12px; font-family: monospace; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s;
}
.btn:hover { opacity: .8; }
.btn-green { background: var(--green); color: #000; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }

/* ── Clips table ── */
.clip-table { width: 100%; border-collapse: collapse; }
.clip-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.clip-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.clip-table tr:last-child td { border-bottom: none; }
.clip-table tr:hover td { background: rgba(255,255,255,.02); }

audio { width: 100%; min-width: 180px; max-width: 280px; height: 32px; accent-color: var(--green); }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ── Conf color variants ── */
.conf-high { --c: var(--green); }
.conf-mid  { --c: var(--yellow); }
.conf-low  { --c: var(--red); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .device-bar { flex-direction: column; align-items: flex-start; }
  .clip-table audio { min-width: 120px; }
  nav { gap: 16px; padding: 0 16px; }
  .container { padding: 16px; }
}
