.session-checking {
  visibility: hidden;
}
.account-entry {
  display: grid;
  place-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.session-gate {
  max-width: 500px;
  margin: 15vh auto;
  padding: 24px;
}
.auth-page {
  min-height: 100svh;
  background: #f4f6fa;
}
.login-shell {
  width: min(100%, 460px);
  margin: auto;
  padding: 52px 20px 28px;
}
.auth-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  color: #1d2b3e;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--blue);
  color: white;
  font-size: 17px;
  border-radius: 14px;
  letter-spacing: -1px;
}
.auth-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  min-width: 0;
}
.auth-card h1,
.management-shell h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: -0.6px;
}
.auth-card h2,
.management-dialog h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  margin: 0 0 12px;
}
.auth-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0 20px;
  overflow-wrap: anywhere;
}
.auth-form {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}
.auth-form label:not(.access-toggle),
.auth-form legend {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 9px;
}
.auth-form input:not([type="radio"]):not([type="checkbox"]),
.admin-search input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border: 1px solid #b9c9e1;
  border-radius: 12px;
  padding: 13px 14px;
  background: white;
  color: #1d2b3e;
  font-size: 16px;
}
.auth-form input:focus {
  border-color: var(--blue);
}
.password-field {
  position: relative;
  display: flex;
  border: 1px solid #b9c9e1;
  border-radius: 12px;
  background: white;
}
.auth-form .password-field input {
  border: 0 !important;
  padding-right: 4px !important;
  min-width: 0;
}
.password-field:focus-within {
  outline: 3px solid #85a4ff;
  outline-offset: 2px;
}
.password-field input:focus-visible {
  outline: none;
}
.password-toggle {
  flex-shrink: 0;
  padding: 0 12px;
  min-height: 50px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  border-radius: 10px;
}
.field-help,
.session-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.session-note {
  text-align: center;
  margin: -4px 0 0;
}
.auth-form .primary,
.auth-form .secondary,
.management-heading > .primary,
.dialog-actions button {
  min-height: 52px;
}
.auth-error,
.auth-message {
  padding: 13px 14px;
  margin: 12px 0 0;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.auth-error {
  background: #fff0ef;
  color: #ac302b;
}
.auth-message {
  background: #eaf7f0;
  color: #17624c;
}
.auth-footnote {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 24px;
}
.management-shell {
  max-width: 1040px;
  margin: auto;
  padding: 0 32px 40px;
}
.management-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 88px;
}
.management-nav .back-link {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  color: #3c5577;
  text-decoration: none;
  font-size: 14px;
}
.auth-wordmark,
.admin-label {
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
}
.management-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 12px 0 24px;
}
.management-heading > div {
  flex: 1;
  min-width: 0;
}
.management-heading > .primary {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
}
.management-heading .auth-note {
  margin-bottom: 0;
}
.count-pill {
  display: inline-block;
  vertical-align: middle;
  font-size: 13px;
  padding: 6px 10px;
  color: var(--muted);
  background: #e9eef6;
  border-radius: 8px;
  letter-spacing: 0;
}
.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  background: white;
  padding-left: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
}
.admin-search input {
  border: 0;
  background: none;
}
.users-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.user-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  min-width: 0;
}
.user-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-identity > div:last-child {
  min-width: 0;
}
.user-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #edf2ff;
  color: var(--blue);
  border-radius: 50%;
  font-weight: 600;
}
.user-card h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.user-login {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.you-label {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 8px;
}
.user-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.role-badge {
  display: inline-block;
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #f0f3f8;
  color: #4c607c;
}
.user-access {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #26735b;
}
.user-access::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.user-access.blocked {
  color: #b3463b;
}
.user-card-footer {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.last-seen {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.user-card-footer button {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 13px;
}
.users-empty {
  grid-column: 1/-1;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.roles-note {
  max-width: 640px;
  margin-top: 24px;
}
.profile-shell {
  max-width: 600px;
}
.profile-shell > .auth-card {
  margin-top: 20px;
}
.profile-summary {
  text-align: center;
}
.profile-avatar {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  font-size: 20px;
}
.profile-summary h2 {
  overflow-wrap: anywhere;
}
.profile-summary .auth-note {
  margin: 7px 0 12px;
}
.profile-admin-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px;
  margin-top: 20px;
  color: #1d2b3e;
  text-decoration: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
}
.profile-admin-link strong {
  font-size: 16px;
  font-weight: 600;
}
.profile-admin-link small {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 5px;
}
.full-width {
  width: 100%;
  min-height: 48px;
}
.management-dialog {
  height: fit-content;
  width: min(520px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: #1d2b3e;
  overscroll-behavior: contain;
}
.management-dialog::backdrop {
  background: #14233f59;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dialog-heading h2 {
  min-width: 0;
}
.dialog-heading .icon-button {
  flex-shrink: 0;
}
.auth-form fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.role-options {
  display: grid;
  gap: 10px;
}
.auth-form .role-options label {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 14px;
  border: 1px solid #c7d3e7;
  border-radius: 12px;
  min-height: 64px;
  cursor: pointer;
}
.role-options label:has(:checked) {
  background: #f0f4ff;
  border-color: var(--blue);
}
.role-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.role-options strong,
.access-toggle strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.role-options small,
.access-toggle small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.access-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.access-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.dialog-actions button {
  flex: 1;
  min-width: 0;
}
.danger-button {
  border: 0;
  border-radius: 12px;
  color: white;
  background: #b63731;
  font-weight: 600;
  padding: 12px;
}
.danger-text {
  border: 0;
  background: none;
  color: #b63731;
  padding: 12px;
  border-radius: 12px;
}
.user-danger-actions {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.auth-form :disabled {
  opacity: 0.6;
  cursor: default;
}
@media (max-width: 600px) {
  .login-shell {
    padding: 32px 16px 24px;
  }
  .auth-card {
    padding: 22px 20px;
  }
  .auth-card h1,
  .management-shell h1 {
    font-size: 26px;
  }
  .management-shell {
    padding: 0 16px 32px;
  }
  .management-nav {
    min-height: 72px;
    gap: 8px;
  }
  .management-heading {
    display: block;
    margin-top: 10px;
  }
  .management-heading > .primary {
    width: 100%;
    margin-top: 20px;
  }
  .users-list {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 18px;
  }
  .user-card {
    padding: 18px;
  }
  .management-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    padding: 22px 20px max(24px, env(safe-area-inset-bottom));
  }
  .confirm-dialog {
    width: calc(100% - 32px);
    margin: auto;
    border-radius: 20px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .management-dialog[open] {
    animation: auth-enter 180ms ease-out;
  }
  @keyframes auth-enter {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
