:root {
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  --ink: #071c3b;
  --muted: #52657f;
  --paper: #f4f8fe;
  --surface: #ffffff;
  --line: #cbdcf4;
  --primary: #0b63ce;
  --primary-dark: #062f75;
  --accent: #22a9ff;
  --tint: #eaf3ff;
  --danger: #a63f3f;
  --shadow: 0 18px 45px rgba(6, 47, 117, 0.1);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  max-width: 100%;
  overflow-x: hidden;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  background:
    radial-gradient(
      circle at 80% 12%,
      rgba(34, 169, 255, 0.5),
      transparent 30%
    ),
    linear-gradient(145deg, #062f75 0%, #071c3b 100%);
}
.login-story {
  color: white;
  padding: clamp(48px, 9vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-story h1 {
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  max-width: 740px;
  margin: 24px 0;
}
.login-story p {
  color: #dceaff;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.65;
}
.login-eyebrow {
  color: #8dd7ff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}
.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(1, 20, 60, 0.28);
}
.brand-copy {
  display: grid;
  gap: 1px;
}
.brand-copy strong {
  font-size: 17px;
  font-weight: 800;
}
.brand-copy span {
  color: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  opacity: 0.74;
  text-transform: uppercase;
}
.login-panel {
  background: var(--paper);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 34px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  min-width: 0;
}
.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
}
h2 {
  font-size: 34px;
  letter-spacing: -0.035em;
  margin: 10px 0 8px;
}
.muted {
  color: var(--muted);
  line-height: 1.55;
}
.field {
  display: grid;
  gap: 7px;
  margin: 18px 0;
}
.field label {
  font-size: 13px;
  font-weight: 750;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  background: white;
  color: var(--ink);
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(34, 169, 255, 0.28);
  outline-offset: 2px;
}
.primary,
.secondary,
.danger,
.nav-button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
  padding: 11px 15px;
}
.primary {
  background: var(--primary);
  color: white;
}
.primary:hover {
  background: var(--primary-dark);
}
.primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.secondary {
  background: var(--tint);
  color: var(--primary-dark);
}
.danger {
  background: #f9e7e7;
  color: var(--danger);
}
.full {
  width: 100%;
}
.error {
  color: var(--danger);
  background: #fff0f0;
  border: 1px solid #f0caca;
  border-radius: 10px;
  padding: 11px 13px;
  margin-top: 16px;
}

.redeem-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  background:
    radial-gradient(
      circle at 80% 12%,
      rgba(34, 169, 255, 0.5),
      transparent 30%
    ),
    linear-gradient(145deg, #062f75 0%, #071c3b 100%);
}
.redeem-story {
  color: white;
  padding: clamp(40px, 8vw, 100px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.redeem-story h1 {
  max-width: 680px;
  margin: 20px 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.redeem-story p {
  max-width: 620px;
  color: #dceaff;
  font-size: 17px;
  line-height: 1.65;
}
.redeem-story .redeem-footnote {
  margin: 0;
  font-size: 14px;
}
.redeem-eyebrow {
  color: #8dd7ff;
}
.redeem-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  background: var(--paper);
}
.redeem-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.field-help {
  color: var(--muted);
  font-size: 12px;
}
.redeem-status {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid;
  border-radius: 12px;
  outline: none;
}
.redeem-status[hidden] {
  display: none;
}
.redeem-status h3,
.redeem-status p {
  margin: 0;
}
.redeem-status p {
  margin-top: 6px;
  line-height: 1.5;
}
.redeem-status.error {
  color: var(--danger);
  border-color: #f0caca;
  background: #fff0f0;
}
.redeem-status.success {
  color: var(--primary-dark);
  border-color: var(--line);
  background: var(--tint);
}
.redeem-help {
  margin: 20px 0 0;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}
.sidebar {
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(34, 169, 255, 0.28),
      transparent 36%
    ),
    linear-gradient(180deg, #062f75 0%, #071c3b 100%);
  color: white;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 8px 8px 28px;
}
.nav {
  display: grid;
  gap: 6px;
}
.nav-button {
  color: #dceaff;
  background: transparent;
  text-align: left;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}
.nav-button:hover,
.nav-button.active {
  background: rgba(34, 169, 255, 0.18);
  color: white;
}
.nav-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-button:hover {
  transform: translateX(2px);
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 8px 4px;
  font-size: 13px;
  color: #c8dbf7;
}
.sidebar-footer button {
  margin-top: 14px;
  color: white;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.main {
  padding: 34px clamp(24px, 5vw, 70px) 70px;
  min-width: 0;
  overflow-x: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.topbar-copy {
  min-width: 0;
}
.topbar-copy .muted {
  margin-bottom: 0;
  max-width: 720px;
}
.topbar h1 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.05em;
  margin: 0;
}
.pill {
  background: var(--tint);
  color: var(--primary-dark);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
}
.topbar-context {
  align-items: flex-end;
  color: var(--muted);
  display: grid;
  flex: 0 0 auto;
  font-size: 12px;
  gap: 7px;
  justify-items: end;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.metric {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-top: 12px;
  color: var(--primary-dark);
}
.metric-card {
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  content: '';
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}
.metric-label {
  color: var(--muted);
  font-size: 14px;
}
.section {
  margin-top: 28px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.section-head h3 {
  margin: 0;
  font-size: 20px;
}
.directory-actions {
  display: flex;
  justify-content: flex-end;
  margin: -10px 0 18px;
}
.enrollment-card {
  margin-bottom: 18px;
}
.compact {
  margin: 4px 0 0;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto;
  gap: 12px;
  margin-bottom: 16px;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}
th,
td {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f7faff;
}
tr:last-child td {
  border-bottom: 0;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 750;
  padding: 0;
  cursor: pointer;
}
.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}
.status.active,
.status.approved,
.status.create {
  background: var(--tint);
  color: var(--primary-dark);
}
.status.pending_enrollment,
.status.pending,
.status.in_review,
.status.draft,
.status.invite {
  background: #fff2d9;
  color: #7e5719;
}

.status.restricted {
  background: #fee2e2;
  color: #991b1b;
}
.status.superseded,
.status.retired,
.status.redeemed,
.status.expired,
.status.revoked {
  background: #edf0ee;
  color: #526159;
}
.status.skip {
  background: #edf0ee;
  color: #526159;
}
.status.reject {
  background: #f9e7e7;
  color: var(--danger);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}
.notice {
  border-left: 4px solid var(--accent);
  background: var(--tint);
  padding: 14px 16px;
  border-radius: 8px;
  color: #60491f;
}
.success {
  color: var(--primary-dark);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  margin: 0 0 16px;
}
.technical-details {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.technical-details summary {
  color: var(--primary);
  cursor: pointer;
  font-weight: 750;
}
.technical-details dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 12px;
  margin-bottom: 0;
}
.technical-details dt {
  color: var(--muted);
}
.technical-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.step {
  border: 1px solid var(--line);
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
.step.current {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--tint);
  font-weight: 750;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
}
.checkbox input {
  width: auto;
  margin-top: 3px;
}
.tokens {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  background: #071c3b;
  color: #dceaff;
  border-radius: 10px;
  padding: 14px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-story {
    display: none;
  }
  .login-panel {
    min-width: 0;
    padding: 28px 18px;
  }
  .redeem-shell {
    grid-template-columns: 1fr;
  }
  .redeem-story {
    padding: 28px 24px;
    gap: 18px;
  }
  .redeem-story h1 {
    margin: 14px 0;
    font-size: clamp(34px, 11vw, 50px);
  }
  .redeem-story .redeem-footnote {
    display: none;
  }
  .redeem-panel {
    padding: 24px 16px 40px;
  }
  .redeem-card {
    padding: 24px 20px;
  }
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px;
    min-width: 0;
  }
  .sidebar .brand {
    padding: 6px 4px 14px;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-button {
    text-align: center;
    padding: 9px;
    font-size: 13px;
  }
  .nav-button.active {
    box-shadow: inset 0 -3px 0 var(--accent);
  }
  .nav-button:hover {
    transform: none;
  }
  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 4px 2px;
  }
  .sidebar-footer button {
    margin-top: 0;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 24px 18px 50px;
  }
  .topbar {
    align-items: flex-start;
  }
  .directory-actions {
    margin-top: -8px;
  }
  .directory-actions .primary {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar-context {
    align-items: start;
    justify-items: start;
  }
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .section-head > button {
    width: 100%;
  }
}
