:root {
  --bg: #0b0d12;
  --surface: #131720;
  --surface-elevated: #1a202c;
  --border: #242c3b;
  --text: #eef1f6;
  --text-muted: #939eb2;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --ok: #2ea065;
  --warn: #e59a24;
  --critical: #e5484d;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(19, 23, 32, 0.92);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 12px;
  height: 32px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--ok));
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-tab:hover {
  color: var(--text);
  border-color: #39455c;
}

.nav-tab.active {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--accent);
}

.badge {
  background: var(--critical);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.view[hidden] {
  display: none;
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.player-stage:fullscreen {
  border: none;
  border-radius: 0;
}

#vaultVideo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.watermark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.interaction-shield {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: transparent;
}

.privacy-curtain {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #050608;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.privacy-curtain[hidden] {
  display: none;
}

.curtain-box {
  max-width: 420px;
}

.curtain-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.curtain-reason {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.controls-bar {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.ctrl-btn:hover {
  border-color: #465470;
}

.time-display {
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  direction: ltr;
  white-space: nowrap;
}

.seek-bar {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  direction: ltr;
}

.player-options {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}

.session-meta {
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--text-muted);
  direction: ltr;
}

.honest-box {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.honest-box h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
}

.honest-box p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.honest-box p:last-child {
  margin-bottom: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.panel-title {
  margin: 0 0 12px;
  font-size: 0.98rem;
  font-weight: 600;
}

.panel-header .panel-title {
  margin-bottom: 0;
}

.panel-desc {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.shield-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shield-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(36, 44, 59, 0.7);
}

.shield-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.status-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.active {
  background: rgba(46, 160, 101, 0.16);
  color: #56d38f;
  border: 1px solid rgba(46, 160, 101, 0.35);
}

.status-pill.pending {
  background: rgba(229, 154, 36, 0.15);
  color: #f4be5e;
  border: 1px solid rgba(229, 154, 36, 0.35);
}

.status-pill.critical {
  background: rgba(229, 72, 77, 0.16);
  color: #ff7c80;
  border: 1px solid rgba(229, 72, 77, 0.35);
}

.mini-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-alert-item {
  font-size: 0.83rem;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-elevated);
  border-right: 3px solid var(--warn);
}

.mini-alert-item.critical {
  border-right-color: var(--critical);
}

.mini-alert-item.info {
  border-right-color: var(--accent);
}

.mini-alert-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.empty-state {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn {
  border-radius: 7px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: #4a5a75;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
}

.btn-danger {
  background: rgba(229, 72, 77, 0.15);
  color: #ff8084;
  border-color: rgba(229, 72, 77, 0.4);
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-danger:hover {
  background: rgba(229, 72, 77, 0.28);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-value.critical {
  color: #ff7c80;
}

.stat-value.ok {
  color: #56d38f;
}

.alerts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.webhook-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.text-input,
.select-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.88rem;
}

.webhook-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.webhook-status {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-elevated);
  border-radius: 7px;
  font-size: 0.84rem;
}

.session-id {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

.alerts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.alerts-table th,
.alerts-table td {
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.alerts-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.empty-cell {
  text-align: center !important;
  color: var(--text-muted);
  padding: 24px !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  direction: ltr;
  display: inline-block;
}

@media (max-width: 960px) {
  .player-grid,
  .alerts-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

