/* ── Search ── */

.search-wrap {
  position: relative;
}

.search-input {
  padding: 9px 36px 9px 14px;
  border-radius: 12px;
  border: none;
  font-size: 0.83rem;
  font-family: inherit;
  color: var(--neu-text);
  background: linear-gradient(145deg, var(--neu-bg-2), var(--neu-bg));
  box-shadow: inset 3px 3px 7px var(--neu-shadow-d), inset -2px -2px 5px var(--neu-shadow-l);
  outline: none;
  width: 220px;
  transition: box-shadow 0.2s, width 0.2s;
}

.search-input::placeholder {
  color: var(--neu-text-muted);
  opacity: 0.7;
}

.search-input:focus {
  box-shadow: inset 3px 3px 7px var(--neu-shadow-d), inset -2px -2px 5px var(--neu-shadow-l), 0 0 0 2px rgba(124,58,237,0.3);
  width: 260px;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neu-text-muted);
  opacity: 0.6;
  pointer-events: none;
}

/* ── Main content ── */

.main-content {
  flex: 1;
  padding: 28px;
  display: flex;
  justify-content: center;
}

/* ── Section card ── */

#usersContent {
  max-width: 1000px;
}

.section-card {
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--neu-bg), var(--neu-bg-2));
  box-shadow: 6px 6px 14px var(--neu-shadow-d), -6px -6px 14px var(--neu-shadow-l);
  margin-bottom: 28px;
  width: 100vw;
}

.section-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--neu-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-header h5 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0;
}

/* ── Table ── */

.neu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.neu-table thead tr {
  border-bottom: 1px solid var(--neu-border);
}

.neu-table thead th {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neu-text-muted);
  text-align: left;
}

.neu-table tbody tr {
  border-bottom: 1px solid var(--neu-border);
  transition: background 0.15s;
}

.neu-table tbody tr:last-child {
  border-bottom: none;
}

.neu-table tbody tr:hover {
  background: rgba(124,58,237,0.04);
}

.neu-table td {
  padding: 12px 16px;
  color: var(--neu-text);
  vertical-align: middle;
}

.neu-table td.muted {
  color: var(--neu-text-muted);
  font-size: 0.78rem;
}

/* ── Status badges ── */

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
}

.s-active {
  background: rgba(34,197,94,0.12);
  color: #16a34a;
}

.s-inactive {
  background: rgba(107,114,128,0.12);
  color: #6b7280;
}

.s-admin {
  background: rgba(124,58,237,0.12);
  color: #7c3aed;
}

.s-user {
  background: rgba(107,114,128,0.10);
  color: #6b7280;
}

.s-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  margin-left: 6px;
  flex-shrink: 0;
}

.dark .s-active {
  color: #4ade80;
}

.dark .s-admin {
  color: #a78bfa;
}

/* ── Avatar ── */

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--neu-text), var(--bs-secondary));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.user-avatar img {
  width: 100%;
  object-fit: cover;
  height: revert-layer;
}

/* ── Action buttons ── */

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: transform 0.15s, background 0.15s;
  background: linear-gradient(145deg, var(--neu-bg), var(--neu-bg-2));
  box-shadow: 2px 2px 5px var(--neu-shadow-d), -2px -2px 4px var(--neu-shadow-l);
  color: var(--neu-text-muted);
  text-decoration: none;
}

.action-btn:hover {
  transform: translateY(-1px);
  color: var(--neu-text);
}

.action-btn.danger:hover {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

.action-btn.success:hover {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
}

/* ── Loading ── */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 14px;
}

.loading-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--neu-border);
  border-top-color: var(--neu-primary);
  animation: spin 0.8s linear infinite;
}

/* ── Footer ── */

.page-footer {
  text-align: center;
  padding: 28px 20px;
  font-size: 0.75rem;
  color: var(--neu-text-muted);
  border-top: 1px solid var(--neu-border);
}

@media (max-width: 900px) {
  .topbar {
    padding: 12px 16px;
  }
}

@media (max-width: 900px) {
  .main-content {
    padding: 16px;
  }
}

@media (max-width: 900px) {
  .search-input {
    width: 160px;
  }
}

@media (max-width: 900px) {
  .search-input:focus {
    width: 200px;
  }
}

@media (max-width: 900px) {
  .neu-table thead th:nth-child(2), .neu-table td:nth-child(2) {
    display: none;
  }
}

@media (max-width: 900px) {
  .neu-table thead th:nth-child(3), .neu-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 900px) {
  .neu-table thead th:nth-child(4), .neu-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 900px) {
  .neu-table thead th:nth-child(6), .neu-table td:nth-child(6) {
    display: none;
  }
}

/* hide ID col on mobile */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.truncate {
  width: 57px;
  white-space: nowrap!important;
  overflow: hidden!important;
  text-overflow: ellipsis!important;
}

