:root {
  --bg: #0d0a16;
  --surface: #141020;
  --card: #0b0815;
  --border: #26203a;
  --text: #e8e6f3;
  --muted: #a9a3c0;
  --accent: #9c7cff;
  --accent-2: #7c6cff;
  --danger: #ff6b6b;
  --warn: #f5c542;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 120% at 20% 20%, #0b1220, #050910 60%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(10, 10, 15, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: 0 0 14px 14px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(156, 124, 255, 0.2), rgba(124, 108, 255, 0.2));
  box-shadow: var(--shadow);
}

.nav-button.logout {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.25));
  border-color: rgba(255, 107, 107, 0.4);
}

.nav-button.logout:hover {
  border-color: rgba(255, 107, 107, 0.7);
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

h1 {
  margin: 6px 0 10px;
  font-size: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--accent);
  margin: 0;
}

.lede {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.status-box {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 240px;
}

.status-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
}

.status-value {
  margin-top: 6px;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #06101d;
  font-weight: 700;
}

button.ghost {
  background: transparent;
}

.video-frame {
  position: relative;
  background: #050910;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hidden {
  display: none;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.list li {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 2px solid var(--border);
}

.microcopy {
  color: var(--muted);
  font-size: 13px;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
}

.log-table th,
.log-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.log-table th {
  color: var(--muted);
  font-weight: 600;
}

.roster-table {
  max-height: 420px;
  overflow: auto;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filters.row {
  flex-wrap: wrap;
  gap: 12px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.filters input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  min-width: 120px;
  width: 100%;
}

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.live-enroll {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.small-video {
  width: 220px;
  height: 160px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #050910;
  object-fit: cover;
  box-shadow: var(--shadow);
}

[data-tone="success"] {
  color: #34d399;
}

[data-tone="error"] {
  color: var(--danger);
}

[data-tone="warn"] {
  color: var(--warn);
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .topnav {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .nav-right {
    flex-wrap: wrap;
  }
  .filters.row {
    flex-direction: column;
    align-items: stretch;
  }
  .filters label {
    width: 100%;
  }
  .panel {
    padding: 14px;
  }
  .actions {
    flex-wrap: wrap;
  }
}
