/* ── Backdrop ── */
.admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ── Panel ── */
.admin-panel {
  background: #1e1e2e;
  border: 1px solid #3b3b52;
  border-radius: 0.75rem;
  width: min(95vw, 900px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── Header ── */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #3b3b52;
  flex-shrink: 0;
}

.admin-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e2e8f0;
}

.admin-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition:
    color 0.15s,
    background 0.15s;
}

.admin-close:hover {
  color: #e2e8f0;
  background: #2d2d44;
}

/* ── Body ── */
.admin-body {
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  flex: 1 1 auto;
}

.admin-loading,
.admin-error {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.admin-error {
  color: #f87171;
}

/* ── Table ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: #cbd5e1;
}

.admin-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #3b3b52;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #2d2d44;
  vertical-align: middle;
}

/* Row variants */
.admin-row-self td {
  background: rgba(99, 102, 241, 0.06);
}

.admin-row-banned td {
  opacity: 0.6;
}

.admin-self-badge {
  font-size: 0.75rem;
  color: #818cf8;
  margin-left: 0.25rem;
}

.admin-none {
  color: #475569;
}

.admin-email {
  color: #94a3b8;
  font-size: 0.8rem;
}

.admin-date {
  color: #64748b;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── Role badge ── */
.admin-role-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-role-badge.role-admin {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.admin-role-badge.role-user {
  background: rgba(71, 85, 105, 0.3);
  color: #94a3b8;
  border: 1px solid rgba(71, 85, 105, 0.4);
}

/* ── Status badge ── */
.admin-status-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-status-badge.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.admin-status-badge.status-banned {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Actions ── */
.admin-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.admin-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
  line-height: 1.2;
}

.admin-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Role button */
.admin-btn-role {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

.admin-btn-role:not(:disabled):hover {
  background: rgba(99, 102, 241, 0.28);
}

.admin-btn-role.is-admin {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* Ban button */
.admin-btn-ban {
  background: rgba(234, 179, 8, 0.12);
  color: #fbbf24;
  border-color: rgba(234, 179, 8, 0.25);
}

.admin-btn-ban:not(:disabled):hover {
  background: rgba(234, 179, 8, 0.22);
}

.admin-btn-ban.is-banned {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}

.admin-btn-ban.is-banned:not(:disabled):hover {
  background: rgba(34, 197, 94, 0.22);
}

/* Delete button */
.admin-btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.55rem;
}

.admin-btn-delete:not(:disabled):hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ── Page mode ── */
.admin-panel-page {
  width: 100%;
  max-height: none;
  box-shadow: none;
  border-radius: 0.75rem;
}

.admin-back-btn {
  font-size: 0.82rem;
  color: #818cf8;
}

.admin-back-btn:hover {
  color: #a5b4fc;
}
