:root {
  --bg: #081222;
  --bg2: #131f37;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --muted: #9fb1cc;
  --brand: #22d3ee;
  --brand2: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --off: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 15%, rgba(34, 211, 238, 0.25), transparent 26%),
    radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.18), transparent 30%),
    linear-gradient(140deg, var(--bg), var(--bg2));
}

.admin-shell {
  width: min(980px, 94%);
  margin: 30px auto;
}

.hero {
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 8px;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.lead {
  color: var(--muted);
  margin: 8px 0 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.session-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row,
.manual-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 12px;
  font-size: 0.95rem;
}

input,
select {
  background: rgba(7, 12, 26, 0.82);
  color: var(--text);
  min-width: 230px;
}

button {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #062130;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.28);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.message {
  min-height: 40px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 16px;
  display: none;
  font-size: 0.95rem;
}

.message.success {
  display: block;
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.message.error {
  display: block;
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.message.info {
  display: block;
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(255, 255, 255, 0.05);
}

th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 700;
  color: #cbd5e1;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  color: #e2e8f0;
}

tbody tr:hover {
  background: rgba(125, 211, 252, 0.08);
}

.user-id {
  font-family: 'Courier New', monospace;
  color: #7dd3fc;
  font-weight: 700;
}

.status-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.83rem;
}

.status-pending {
  background: rgba(245, 158, 11, 0.16);
  color: #facc15;
}

.status-active {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.status-inactive {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.action-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-activate,
.btn-deactivate {
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 8px 12px;
  font-weight: 700;
}

.btn-activate {
  background: #22c55e;
}

.btn-activate:hover {
  background: #16a34a;
}

.btn-deactivate {
  background: #ef4444;
}

.btn-deactivate:hover {
  background: #dc2626;
}

.btn-activate:disabled {
  background: #64748b;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  padding: 28px 0;
  color: #94a3b8;
}

.spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border: 4px solid rgba(139, 92, 246, 0.22);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: #94a3b8;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .row {
    flex-direction: column;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-actions {
    width: 100%;
  }

  .session-actions button {
    flex: 1;
    min-width: 130px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  table {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .action-cell {
    flex-direction: column;
    align-items: stretch;
  }
}
