/* ── Header ───────────────────────────────────────────────────────────────── */

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.adm-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.adm-loading {
  color: rgba(255,255,255,0.8);
  padding: 3rem;
  text-align: center;
  font-size: 0.95rem;
}

.adm-error {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  color: #dc2626;
  font-size: 1rem;
  font-weight: 500;
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.adm-table-wrap {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  overflow: hidden;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.adm-table thead th {
  background: #f9fafb;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.adm-row td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.adm-row:last-child td { border-bottom: none; }
.adm-row:hover { background: #f9fafb; }

.adm-row-self { background: #eff6ff; }
.adm-row-self:hover { background: #dbeafe; }

.adm-row-blocked { opacity: 0.6; }

/* ── Avatar ───────────────────────────────────────────────────────────────── */

.adm-td-avatar { width: 44px; }

.adm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0e7ff;
}

.adm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.adm-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ── Name / Email ─────────────────────────────────────────────────────────── */

.adm-td-name {
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
}

.adm-self-badge {
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}

.adm-td-email {
  color: #6b7280;
  font-size: 0.82rem;
}

.adm-td-login {
  color: #9ca3af;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ── Role dropdown ────────────────────────────────────────────────────────── */

.adm-role-select {
  font-family: inherit;
  font-size: 0.82rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 8px;
  background: white;
  color: #1f2937;
  cursor: pointer;
}

.adm-role-select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.adm-role-select:disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

/* ── Blocked toggle ───────────────────────────────────────────────────────── */

.adm-td-blocked {
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.adm-toggle input { opacity: 0; width: 0; height: 0; }

.adm-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.adm-toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.adm-toggle input:checked + .adm-toggle-slider { background: #ef4444; }
.adm-toggle input:checked + .adm-toggle-slider::before { transform: translateX(16px); }
.adm-toggle input:disabled + .adm-toggle-slider { cursor: not-allowed; opacity: 0.5; }

.adm-blocked-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: #fee2e2;
  color: #991b1b;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

/* ── Delete button ────────────────────────────────────────────────────────── */

.adm-td-del { width: 36px; text-align: center; }

.adm-del-btn {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.adm-del-btn:hover { color: #dc2626; background: #fee2e2; }

/* ── Toast ────────────────────────────────────────────────────────────────── */

.adm-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1f2937;
  color: white;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
}

.adm-toast.show { opacity: 1; transform: translateY(0); }
.adm-toast.adm-toast-error { background: #dc2626; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .adm-td-email, .adm-td-login { display: none; }
}
