.users-directory-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem) auto;
  align-items: center;
  gap: 0.75rem;
}

.users-table th:first-child { width: 48%; }
.users-table th:last-child { width: 8.5rem; }
.users-table td { vertical-align: middle; }
.users-directory [hidden] { display: none !important; }

.user-editor {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(40rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: white;
  color: #111827;
  box-shadow: 0 24px 80px rgb(0 0 0 / 20%);
}

.user-editor::backdrop { background: rgb(17 24 39 / 45%); }
.user-editor-actions { position: sticky; bottom: 0; }

@media screen and (max-width: 767px) {
  .users-directory-filters { grid-template-columns: minmax(0, 1fr); }
  .users-table-wrapper { border: 0; background: transparent; overflow: visible; }
  .users-table, .users-table tbody { display: block; }
  .users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .users-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; margin-bottom: 0.75rem; padding: 1rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; }
  .users-table td { display: block; padding: 0; }
  .users-table td:first-child { grid-column: 1 / -1; }
  .users-role-cell { align-self: center; }
  .users-action-cell { align-self: end; }
}

@media screen and (max-width: 639px) {
  .user-editor { inset: auto 0 0; width: 100%; margin: 0; max-height: calc(100dvh - 1rem); border-radius: 1rem 1rem 0 0; }
  .user-editor-actions { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .user-editor-actions > * { flex: 1 1 auto; }
}
