:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #090909;
  color: #f5f5f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #090909;
  color: #f5f5f5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(calc(100% - 32px), 520px);
  max-width: 100%;
  margin: 0 auto;
  padding: 88px 0;
}

.brand {
  margin-bottom: 48px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.7rem, 10vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2 {
  margin-bottom: 28px;
  font-size: 2rem;
  letter-spacing: -0.035em;
}

p {
  color: #a3a3a3;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.access-grid {
  display: grid;
  gap: 14px;
}

.access-card {
  width: 100%;
  padding: 22px;
  border: 1px solid #292929;
  border-radius: 16px;
  background: #111;
  color: inherit;
  text-align: left;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.access-card:hover {
  border-color: #4a4a4a;
  background: #151515;
}

.access-card strong,
.access-card span {
  display: block;
}

.access-card strong {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.access-card span {
  color: #999;
  line-height: 1.45;
}

.panel {
  padding: 28px;
  border: 1px solid #292929;
  border-radius: 18px;
  background: #111;
}

.eyebrow {
  margin-bottom: 8px;
  color: #777;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

form {
  display: grid;
  gap: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: #d4d4d4;
  font-size: 0.9rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #363636;
  border-radius: 10px;
  outline: none;
  background: #0a0a0a;
  color: #fff;
}

input:focus {
  border-color: #737373;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
}

.primary-button {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.primary-button:hover {
  background: #1d4ed8;
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.forgot-password-link {
  justify-self: center;
  margin: -6px 0 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.forgot-password-link:hover {
  color: #f5f5f5;
}

.secondary-button {
  border: 1px solid #3a3a3a;
  background: transparent;
  color: #f5f5f5;
}

.text-button {
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a3a3a3;
}

.error {
  margin: 0;
  color: #ff8a8a;
  font-size: 0.9rem;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(2px);
}

.overlay span {
  color: #d4d4d4;
  font-size: 0.9rem;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #444;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.organization-heading {
  margin-bottom: 8px;
  color: #f5f5f5;
  font-size: 1.2rem;
  font-weight: 700;
}

.organization-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.organization-option-main {
  display: flex !important;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.organization-identity {
  min-width: 0;
}

.organization-avatar {
  position: relative;
  display: block !important;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid #3a3a3a;
  border-radius: 50%;
  background: #242424;
}

.organization-avatar::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #555;
  border-radius: 50%;
  transform: translate(-50%, -68%);
}

.organization-avatar::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 25px;
  height: 13px;
  border: 2px solid #555;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  transform: translateX(-50%);
}

.organization-avatar:has(img)::before,
.organization-avatar:has(img)::after {
  display: none;
}

.organization-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.organization-option .organization-meta {
  color: #777;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.sign-out-link {
  margin-top: 24px;
  margin-bottom: 0;
}

#changeOrganizationButton {
  width: 100%;
  margin-top: 12px;
}

.staff-dashboard {
  width: 100%;
  min-width: 0;
}

.staff-dashboard-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 0 16px;
  background: #000;
}

.staff-dashboard-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.staff-dashboard-identity {
  min-width: 0;
}

.staff-dashboard-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.staff-dashboard-title {
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.dashboard-role {
  margin: 7px 0 0;
  color: #777;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.organization-select-label {
  flex: 0 1 180px;
  min-width: 0;
}

.organization-select {
  width: 100%;
  max-width: 180px;
  min-height: 38px;
  padding: 7px 32px 7px 10px;
  border: 1px solid #363636;
  border-radius: 9px;
  outline: none;
  background: #111;
  color: #f5f5f5;
  font-size: 0.9rem;
  font-weight: 650;
}

.organization-select:focus {
  border-color: #737373;
}

.organization-select:disabled {
  opacity: 0.8;
}

.staff-dashboard-sign-out {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 0;
}

.staff-check-in-button {
  width: auto;
  min-height: 42px;
  margin-top: 18px;
  padding: 10px 20px;
  border: 1px solid #444;
  border-radius: 10px;
  background: #f5f5f5;
  color: #080808;
  font-weight: 750;
}

.staff-check-in-button:hover {
  background: #dcdcdc;
}

.staff-view-tabs {
  display: flex;
  width: 100%;
  margin-top: 18px;
  border: 1px solid #292929;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0d0d;
}

.staff-view-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 9px 8px;
  border: 0;
  border-right: 1px solid #292929;
  border-radius: 0;
  background: transparent;
  color: #8f8f8f;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.staff-view-tab:last-child {
  border-right: 0;
}

.staff-view-tab:hover {
  background: #151515;
  color: #f5f5f5;
}

.staff-view-tab.is-active {
  background: #f5f5f5;
  color: #080808;
}

.staff-search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.staff-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  margin: 0;
}

.staff-search-clear {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #363636;
  border-radius: 9px;
  background: #111;
  color: #bdbdbd;
  font-weight: 700;
}

.staff-search-clear:hover {
  border-color: #555;
  color: #fff;
}

.staff-view-content {
  min-height: 240px;
  padding: 8px 0 48px;
}

.staff-results {
  display: grid;
  gap: 10px;
}

/* Staff dashboard mobile containment */
.staff-dashboard,
.staff-dashboard-sticky,
.staff-dashboard-top-row,
.staff-dashboard-identity,
.staff-dashboard-title-row,
.staff-view-tabs,
.staff-search-row,
.staff-view-content,
.staff-results {
  min-width: 0;
  max-width: 100%;
}

.staff-dashboard-top-row {
  align-items: flex-start;
}

.staff-dashboard-identity {
  flex: 1 1 auto;
  min-width: 0;
}

.staff-dashboard-title-row {
  flex-wrap: wrap;
}

.staff-dashboard-sign-out {
  flex: 0 0 auto;
  margin-left: 12px;
  white-space: nowrap;
}

.staff-view-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  overflow: hidden;
}

.staff-view-tab {
  min-width: 0;
  width: 100%;
  padding-left: 8px;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
}

.staff-search-input {
  min-width: 0;
  width: 100%;
}

.staff-search-clear {
  width: auto;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .staff-dashboard-title {
    font-size: 1.35rem;
  }

  .organization-select {
    max-width: 150px;
  }

  .staff-view-tab {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 0.72rem;
  }

  .staff-search-clear {
    padding-left: 14px;
    padding-right: 14px;
  }
}

.staff-result-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #252525;
  border-radius: 12px;
  background: #0d0d0d;
}

.staff-result-photo {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 9px;
  object-fit: cover;
  background: #181818;
}

.staff-result-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.staff-result-title,
.staff-result-subtitle,
.staff-result-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-result-title {
  color: #f5f5f5;
  font-size: 0.98rem;
}

.staff-result-subtitle {
  margin-top: 3px;
  color: #aaa;
  font-size: 0.82rem;
}

.staff-result-meta {
  margin-top: 5px;
  color: #666;
  font-size: 0.75rem;
  font-weight: 650;
}

.dashboard-message {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #292929;
  border-radius: 10px;
  background: #111;
  color: #a3a3a3;
  font-size: 0.9rem;
}

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


@media (max-width: 480px) {
  .shell {
    width: calc(100% - 32px);
    padding: 56px 0;
  }

  .panel {
    padding: 22px;
  }

  .staff-dashboard-sticky {
    padding-top: 12px;
  }

  .staff-dashboard-title-row {
    gap: 8px;
  }

  .staff-dashboard-title {
    font-size: 1.05rem;
  }

  .organization-select-label {
    flex-basis: 145px;
  }

  .organization-select {
    max-width: 145px;
    font-size: 0.82rem;
  }

  .staff-view-tab {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 0.76rem;
  }
}

/* Staff dashboard responsive layout correction */
.staff-view-tabs {
  display: flex;
  grid-template-columns: none;
}

.staff-view-tab {
  flex: 1 1 0;
}

@media (max-width: 480px) {
  .staff-dashboard-top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 8px;
    width: 100%;
  }

  .staff-dashboard-identity {
    display: contents;
  }

  .staff-dashboard-title-row {
    display: contents;
  }

  .staff-dashboard-title {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    min-width: 0;
  }

  .staff-dashboard-sign-out {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin-left: 0;
  }

  .organization-select-label {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }

  .organization-select {
    width: 100%;
    max-width: none;
  }

  .dashboard-role {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0;
  }

  .staff-search-row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }
}
