:root {
  --bg: #0b1220;
  --panel: #111b2e;
  --panel-elev: #17243d;
  --border: rgba(244, 203, 107, 0.24);
  --gold: #f4cb6b;
  --emerald: #10b981;
  --rose: #f43f5e;
  --text: #f1f5f9;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #1e293b 0%, #090e1a 70%);
}
.login-card {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.login-brand img {
  border-radius: 50%;
}
.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.login-brand h1 {
  margin: 2px 0 0;
  font-size: 18px;
}
.login-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.back-3d-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold);
  font-size: 12.5px;
  text-decoration: none;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 20px;
  background: rgba(11, 18, 32, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-brand img {
  border-radius: 50%;
}
.topbar-brand strong {
  display: block;
  font-size: 13.5px;
  color: var(--gold);
}
.conn-badge {
  font-size: 11.5px;
  color: #86efac;
}

.admin-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nav-tab {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.nav-tab.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #111827;
  font-weight: 800;
}
.count-pill {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sec-head h2 {
  margin: 0;
  font-size: 19px;
  color: #fef08a;
}
.sec-head p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-card.is-highlight {
  border-color: var(--gold);
  background: linear-gradient(135deg, #172554, #111b2e);
}
.kpi-card.is-emerald {
  border-color: rgba(16, 185, 129, 0.45);
}
.kpi-card.is-rose {
  border-color: rgba(244, 63, 94, 0.45);
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}
.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.kpi-card small {
  font-size: 11.5px;
  color: var(--muted);
}

.analytics-two-col,
.stage-director-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
@media (max-width: 960px) {
  .analytics-two-col,
  .stage-director-grid {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #fde68a;
}

.zone-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.zone-bar-row {
  display: grid;
  grid-template-columns: 145px 1fr 56px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.zone-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.zone-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #34d399);
  transition: width 0.3s ease;
}
.zone-bar-num {
  text-align: right;
  font-weight: 700;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-elev);
  font-size: 13px;
}
.leader-row.is-top {
  border: 1px solid rgba(250, 204, 21, 0.5);
}

.pending-queue-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(146, 64, 14, 0.22);
  border: 1.5px solid #f59e0b;
}
.pending-queue-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #fde047;
}
.pending-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
}
.pending-card {
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.45);
  font-size: 12.5px;
}
.pending-card strong {
  color: #fef08a;
  font-size: 14px;
}
.pending-card p {
  margin: 4px 0 10px;
  color: #cbd5e1;
}

.table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.admin-table th,
.admin-table td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-table th {
  color: #fde68a;
  font-weight: 700;
  white-space: nowrap;
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-tag.online {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
.badge-tag.live {
  background: rgba(220, 38, 38, 0.28);
  color: #fca5a5;
}
.badge-tag.open {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}
.badge-tag.pending {
  background: rgba(245, 158, 11, 0.25);
  color: #fde047;
}

.director-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.director-left-stack,
.director-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.btc-webrtc-card {
  border-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.35), rgba(15, 23, 42, 0.92));
}
.btc-webrtc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.btc-webrtc-head h3 {
  margin: 0;
}
.btc-viewer-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fef08a;
  font-size: 12px;
  font-weight: 700;
}
.btc-cam-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-live-red {
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid #f87171;
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.btn-live-red:hover {
  filter: brightness(1.08);
}
.btc-env-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 12px;
}
.btc-cam-active-bar {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(9, 14, 26, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.45);
}
.btc-cam-preview-vid {
  width: 100%;
  height: 102px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
}
.btc-cam-live-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.stage-monitor-canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: #090d16;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}
.form-field input,
.form-field select {
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #0b1324;
  color: #fff;
  font-size: 13px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.checkbox-inline,
.switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.switch-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(244, 203, 107, 0.14);
  border: 1px solid var(--border);
  color: #fde68a;
}

.preset-chips,
.ccu-sim-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.preset-chips button,
.ccu-sim-group button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 11.5px;
  cursor: pointer;
}
.preset-chips button:hover,
.ccu-sim-group button:hover {
  background: var(--gold);
  color: #111827;
}

.btn-primary,
.btn-emerald,
.btn-amber,
.btn-danger,
.btn-ghost,
.btn-gold-link {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.btn-primary {
  background: var(--gold);
  color: #111827;
}
.btn-emerald {
  background: var(--emerald);
  color: #042f2e;
}
.btn-amber {
  background: #f59e0b;
  color: #1c1917;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
}
.btn-gold-link {
  background: rgba(244, 203, 107, 0.16);
  border: 1px solid var(--gold);
  color: var(--gold);
}
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
}
.full-w {
  width: 100%;
  margin-top: 12px;
}

.mod-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
}
.mod-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--panel-elev);
  font-size: 12.5px;
}
.mod-item strong {
  color: #fde68a;
}

.admin-toast {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: #065f46;
  border: 1px solid #34d399;
  color: #ecfdf5;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.admin-dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
}
.admin-dialog::backdrop {
  background: rgba(3, 7, 18, 0.72);
}
.dialog-card {
  width: min(460px, 92vw);
  padding: 20px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--gold);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--gold);
}
.close-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.status-msg.is-error {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #fca5a5;
}
