.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Never show legacy modal markup if an old cached HTML bundle is still served */
body.all-users-page dialog.user-detail-dialog {
  display: none !important;
}

body.all-users-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.all-users-main {
  flex: 1;
  width: 100%;
  max-width: min(56rem, 100%);
  margin: 0 auto;
  padding: calc(var(--nav-row-height) + 1rem) clamp(1rem, 4vw, 1.75rem) 2rem;
}

.all-users-main h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.all-users-lede {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 42em;
}

/* Table block, then detail block — vertical stack only (no overlay) */
.all-users-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  width: 100%;
}

.all-users-table-section {
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
}

.all-users-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.all-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.all-users-table th,
.all-users-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(104, 66, 47, 0.12);
  vertical-align: top;
}

.all-users-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(232, 238, 245, 0.55);
  font-weight: 600;
  white-space: nowrap;
}

.all-users-table tbody tr {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.all-users-table tbody tr:hover {
  background: rgba(104, 66, 47, 0.06);
}

.all-users-table tbody tr:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(104, 66, 47, 0.35);
}

.all-users-table tbody tr.is-selected {
  background: rgba(104, 66, 47, 0.1);
}

.all-users-table tbody tr:last-child td {
  border-bottom: none;
}

.all-users-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.all-users-error {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(180, 60, 60, 0.22);
  border: 1px solid rgba(255, 138, 138, 0.35);
  color: var(--danger);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.all-users-detail-panel {
  position: static;
  z-index: auto;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.all-users-detail-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(104, 66, 47, 0.15);
}

.all-users-detail-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.all-users-detail-placeholder {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.all-users-detail-body {
  padding: 1rem;
  max-height: min(42vh, 22rem);
  overflow-y: auto;
  font-size: 0.88rem;
}

.all-users-detail-meta {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem 1rem;
}

@media (min-width: 32rem) {
  .all-users-detail-meta {
    grid-template-columns: auto 1fr;
  }
}

.all-users-detail-meta dt {
  margin: 0;
  color: rgba(232, 238, 245, 0.48);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.all-users-detail-meta dd {
  margin: 0;
  color: rgba(232, 238, 245, 0.94);
}

.all-users-detail-section-title {
  margin: 1rem 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(104, 66, 47, 0.88);
}

.all-users-detail-section-title:first-of-type {
  margin-top: 0;
}

.all-users-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.all-users-detail-card {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(104, 66, 47, 0.18);
  background: var(--surface-inset);
}

.all-users-detail-card dl {
  margin: 0;
  display: grid;
  gap: 0.25rem 0.75rem;
  font-size: 0.82rem;
}

@media (min-width: 28rem) {
  .all-users-detail-card dl {
    grid-template-columns: 7rem 1fr;
  }
}

.all-users-detail-card dt {
  margin: 0;
  color: rgba(232, 238, 245, 0.45);
}

.all-users-detail-card dd {
  margin: 0;
  word-break: break-word;
}

.all-users-detail-muted {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.all-users-detail-loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
