:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f7;
  color: #17191c;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, a { font: inherit; }

.auth-page { min-height: 100vh; background: #f5f6f7; }
.auth-shell { width: min(100% - 2rem, 34rem); margin: 0 auto; padding: 8vh 0 3rem; }
.auth-shell.wide { width: min(100% - 2rem, 64rem); }
.auth-card { background: #fff; border: 1px solid #d9dde2; border-radius: 1rem; padding: clamp(1.25rem, 4vw, 2rem); box-shadow: 0 0.6rem 2rem rgba(25, 31, 38, 0.07); }
.auth-kicker { margin: 0 0 .35rem; color: #5d646d; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 0 0 .5rem; font-size: clamp(1.75rem, 5vw, 2.4rem); }
h2 { margin: 0; font-size: 1.25rem; }
.auth-intro { margin: .35rem 0 1.5rem; color: #5d646d; line-height: 1.5; }
.auth-field { display: grid; gap: .45rem; min-width: 0; }
.auth-field label { font-weight: 650; }
.auth-field input, .auth-field select, .users-table select {
  min-height: 2.75rem; width: 100%; padding: .65rem .75rem; border: 1px solid #aeb5bd; border-radius: .55rem; background: #fff; color: inherit;
}
.auth-field input:focus-visible, .auth-field select:focus-visible, button:focus-visible, a:focus-visible, .users-table select:focus-visible {
  outline: 3px solid #007bc0; outline-offset: 2px;
}
.auth-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
button, .button-link {
  min-height: 2.75rem; min-width: 2.75rem; border: 1px solid #007bc0; border-radius: .55rem; padding: .65rem .9rem; background: #007bc0; color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
button.secondary, .button-link.secondary { background: #fff; color: #1f2933; border-color: #aeb5bd; }
button.danger { color: #9b1c1c; border-color: #d9a8a8; }
button:disabled { opacity: .55; cursor: not-allowed; }
.auth-code-panel { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #e3e6e9; display: grid; gap: .85rem; }
.auth-code-panel[hidden] { display: none; }
.auth-status { min-height: 1.5rem; margin: 1rem 0 0; color: #41474e; }
.auth-status.error { color: #a40000; }
.auth-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.role-badge { border-radius: 999px; background: #eef4f8; padding: .35rem .65rem; font-size: .85rem; font-weight: 700; text-transform: capitalize; }
.account-details { margin: 1.5rem 0 2rem; display: grid; gap: .75rem; }
.account-details div { display: grid; grid-template-columns: 7rem 1fr; gap: .75rem; }
.account-details dt { color: #5d646d; }
.account-details dd { margin: 0; overflow-wrap: anywhere; }
.passkey-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.passkey-list li { min-height: 3.5rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .8rem; border: 1px solid #e0e3e7; border-radius: .6rem; }
.passkey-list li div { display: grid; gap: .2rem; }
.passkey-list li span { color: #68707a; font-size: .85rem; }
.passkey-list .empty { color: #68707a; justify-content: flex-start; }
.account-actions { padding-top: 1.25rem; border-top: 1px solid #e3e6e9; }
.admin-create-form { display: grid; grid-template-columns: 1fr 1.3fr .7fr auto; align-items: end; gap: .75rem; margin: 1.5rem 0; }
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td { padding: .7rem .55rem; text-align: left; border-bottom: 1px solid #e2e5e8; vertical-align: middle; }
.users-table th { color: #555d66; font-size: .85rem; }
.users-table input[type="checkbox"] { width: 1.25rem; height: 1.25rem; }

@media (max-width: 760px) {
  .auth-shell { padding-top: 1rem; }
  .admin-create-form { grid-template-columns: 1fr; }
  .account-details div { grid-template-columns: 1fr; gap: .15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
