:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f4f6f8;
  color: #182230;
  --background: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #dde5ee;
  --border-strong: #c8d3df;
  --text: #182230;
  --muted: #5c6b7d;
  --accent: #1f6fb2;
  --accent-dark: #175488;
  --success: #1d8a5b;
  --warning: #b7791f;
  --shadow: 0 18px 48px rgb(24 34 48 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
}

.app-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
}

.topbar-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  background: var(--surface);
}

.access-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.access-primary,
.access-secondary,
.admin-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.access-primary {
  padding: 34px;
}

.access-secondary {
  padding: 22px;
  display: grid;
  grid-auto-rows: min-content;
  gap: 12px;
}

.access-heading {
  max-width: 560px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.access-heading p,
.section-heading p,
.workflow-step p,
.admin-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.access-heading p {
  margin-top: 12px;
  max-width: 520px;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.identity-row strong,
.identity-row span {
  display: block;
}

.identity-row strong {
  font-size: 15px;
}

.identity-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f0fa;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

.primary-action,
.ghost-action {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.ghost-action {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.admin-note {
  margin-top: 12px;
  text-align: center;
}

.status-box {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  border: 1px solid #cfe1d8;
  border-radius: 8px;
  padding: 11px 12px;
  color: #24543f;
  background: #f4fbf7;
  font-size: 14px;
  font-weight: 650;
}

.status-box.is-pending {
  border-color: #ead6ab;
  color: #76520f;
  background: #fff9eb;
}

.status-box.is-blocked {
  border-color: #f0c5c5;
  color: #8b2f2f;
  background: #fff6f6;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.workflow-step {
  min-height: 118px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-muted);
}

.workflow-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: #e9eef4;
  font-size: 13px;
  font-weight: 800;
}

.workflow-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.workflow-step.is-active span {
  color: #ffffff;
  background: var(--accent);
}

.admin-panel {
  margin-top: 18px;
  padding: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

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

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 24px 0 16px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 4px rgb(24 34 48 / 8%);
}

.auth-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: #ffffff;
}

input:focus,
select:focus {
  outline: 3px solid rgb(31 111 178 / 18%);
  border-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

output {
  display: block;
  min-height: 24px;
  margin-top: 16px;
  font-size: 14px;
  color: #314156;
}

.section-heading-secondary {
  margin-top: 24px;
}

.password-change-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #e6ebf0;
  padding: 11px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.row-action {
  min-height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .access-screen,
  .workspace {
    grid-template-columns: 1fr;
  }

  .access-primary {
    padding: 24px;
  }

  h1 {
    font-size: 31px;
  }
}

@media (max-width: 460px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-primary,
  .access-secondary,
  .panel,
  .admin-panel {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
