@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-700.woff2") format("woff2");
}

:root, [data-theme="light"] {
  --brand: #006bb7;
  --brand-hover: #005a9a;
  --bg: #eef2f6;
  --fg: #111827;
  --card: #ffffff;
  --muted: #5b6573;
  --border: #d5dde6;
  --input: #ffffff;
  --banner: #fdecee;
  --banner-fg: #8a1f2b;
  --shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
  --ring: 0 0 0 3px rgba(0, 107, 183, 0.28);
}

[data-theme="dark"] {
  --bg: #0e1116;
  --fg: #f3f5f7;
  --card: #171c22;
  --muted: #9aa4b2;
  --border: #2a323c;
  --input: #12171d;
  --banner: #3a1d22;
  --banner-fg: #ffc9d0;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 3px rgba(0, 107, 183, 0.45);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
}

#theme-toggle {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: 500 0.85rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}

#theme-toggle:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem 2rem;
}

.card {
  width: 100%;
  max-width: 26.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2.25rem 2rem 2rem;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: var(--brand);
}

.brand-mark {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 1rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  display: none;
}

[data-theme="light"] .brand-logo-light,
[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.card h1 {
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0.4rem 0 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.field {
  margin: 0 0 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--fg);
  font: inherit;
}

.field input:focus {
  border-color: var(--brand);
}

.field input[aria-invalid="true"] {
  border-color: #c03746;
}

.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--input);
  font-size: 0.92rem;
}

.identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.link, a.link {
  background: none;
  border: 0;
  color: var(--brand);
  font: 600 0.85rem Inter, system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

button.primary, a.button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.35rem;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font: 600 1rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button.primary:hover, a.button:hover {
  background: var(--brand-hover);
}

.banner {
  background: var(--banner);
  color: var(--banner-fg);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.powered {
  padding: 0 1.25rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.powered nav {
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.85rem;
  justify-content: center;
}

.powered a {
  color: var(--muted);
  text-decoration: none;
}

.powered a:hover {
  color: var(--brand);
}

.account-meta {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.account-meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.65rem;
}

.account-meta dt:first-child {
  margin-top: 0;
}

.account-meta dd {
  margin: 0.15rem 0 0;
  font-weight: 500;
}

.ref code {
  font-size: 1rem;
}

#blazor-error-ui {
  background: var(--banner);
  color: var(--banner-fg);
  bottom: 0;
  left: 0;
  width: 100%;
  position: fixed;
  display: none;
  padding: 0.7rem 1.25rem;
  box-sizing: border-box;
  z-index: 1000;
}

.codes {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.banner.ok {
  background: #e7f6ee;
  color: #146c3a;
}

.sa-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  position: relative;
}

.sa-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.65rem;
  position: sticky;
  top: 0;
  z-index: 30;
  margin-left: 260px;
  padding: 0.75rem 1.25rem 0.5rem;
  background: var(--bg);
  overflow: visible;
}

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

.sa-back,
.sa-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: 500 0.85rem/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.sa-grid-icon {
  flex: 0 0 auto;
}

.sa-switcher {
  position: relative;
  flex: 0 0 auto;
}

.sa-switcher-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 240px;
  max-width: min(92vw, 340px);
  max-height: min(78vh, 640px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  z-index: 40;
  flex-direction: column;
  gap: 0.15rem;
}

.sa-switcher-menu[hidden] {
  display: none !important;
}

.sa-switcher-menu:not([hidden]) {
  display: flex;
}

.sa-switcher-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--fg);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
}

.sa-switcher-menu a.active,
.sa-switcher-menu a:hover {
  background: var(--bg);
}

.sa-legacy {
  font-size: 0.8rem;
  color: var(--muted);
}

.sa-search-wrap {
  flex: 1 1 8rem;
  min-width: 0;
}

.sa-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--input);
  color: var(--fg);
  font: inherit;
}

.sa-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.sa-crumb a {
  color: var(--muted);
  text-decoration: none;
}

.acct-shell {
  min-height: 100vh;
  background: var(--bg);
}

.acct-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  position: relative;
  z-index: 20;
}

.sa-top-actions,
.acct-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.acct-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  box-sizing: border-box;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  margin: 0 0 1.75rem;
}

.app-grid-home {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem 0.9rem 0.9rem;
  text-decoration: none;
  color: var(--fg);
  min-width: 0;
}

.app-tile-iodsa {
  border-color: var(--brand);
}

.app-tile-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.app-tile-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.app-tile-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.acct-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.2rem;
}

.launcher {
  margin: 0 0 1.75rem;
}

.sa-menu,
.sa-brand.sa-brand-top {
  display: none;
}

.sa-side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  min-width: 260px;
  height: 100vh;
  box-sizing: border-box;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 20;
  overflow-x: hidden;
  overflow-y: auto;
}

.sa-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.sa-brand .brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.sa-brand-top {
  flex: 1;
  min-width: 0;
}

.sa-side nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sa-nav-group {
  margin-top: 0.65rem;
}

.sa-nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
}

.sa-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.sa-action-form {
  margin-top: 1rem;
}

.sa-table input,
.field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--fg);
  font: inherit;
}

.sa-table input[type="checkbox"] {
  width: auto;
}

.sa-side nav a,
.admin-subnav a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.sa-side nav a.active,
.admin-subnav a.active {
  background: var(--bg);
  color: var(--brand);
  font-weight: 600;
}

.sa-side nav a.button,
.sa-stat a.button {
  margin-top: 0.65rem;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 0.85rem;
  text-align: center;
  font-weight: 600;
}

.sa-side nav a.button:hover,
.sa-stat a.button:hover {
  background: var(--brand-hover);
  color: #fff;
}

.sa-side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.sa-side-foot a {
  color: var(--muted);
  text-decoration: none;
}

.sa-backdrop {
  display: none;
}

.sa-main {
  margin-left: 260px;
  padding: 1.75rem 1.75rem 2.5rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.sa-page-head h1 {
  margin: 0;
  text-align: left;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.sa-page-head .lede {
  text-align: left;
  margin: 0.35rem 0 1.25rem;
}

.sa-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sa-stat,
.sa-panel,
.sa-action {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

.sa-stat,
.sa-action,
.sa-panel {
  padding: 1.15rem 1.2rem 1.1rem;
}

.sa-stat::before,
.sa-action::before,
.sa-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: var(--brand);
}

.sa-stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sa-stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sa-stat-sub,
.sa-empty {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.sa-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sa-action {
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sa-action span {
  color: var(--muted);
  font-size: 0.88rem;
}

.sa-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

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

.sa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.sa-table th,
.sa-table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.sa-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.sa-menu {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: 500 0.85rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
}

@media (max-width: 1100px) {
  .sa-stats,
  .sa-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .sa-top {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
    padding: 0.75rem 1rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
  }

  .sa-back span {
    display: none;
  }

  .sa-brand.sa-brand-top span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42vw;
  }

  .sa-menu {
    display: inline-flex;
  }

  .sa-brand.sa-brand-top {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
  }

  .sa-search-wrap {
    order: 10;
    flex: 1 1 100%;
  }

  .sa-brand-side {
    display: none;
  }

  .sa-side {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  .sa-side.open {
    transform: translateX(0);
  }

  .sa-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.35);
    z-index: 15;
  }

  .sa-main {
    margin-left: 0;
    padding: 1.25rem 1rem 2rem;
  }
}

@media (max-width: 640px) {
  .sa-stats,
  .sa-actions {
    grid-template-columns: 1fr;
  }
}

.brand-preview {
  position: relative;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  background: var(--bg);
  margin: 0 0 1.5rem;
}

.brand-preview-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  opacity: 0.35;
  border-radius: 12px;
}

.brand-preview .card {
  position: relative;
  margin: 0 auto;
}

.app-switcher,
.avatar-menu {
  position: relative;
}

.app-switcher-btn,
.avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.app-switcher-pop,
.avatar-pop {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 50;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.7rem;
  min-width: 220px;
  max-width: min(92vw, 360px);
  max-height: min(78vh, 480px);
  overflow: auto;
}

.app-switcher-pop[hidden],
.avatar-pop[hidden],
.idle-dialog[hidden] {
  display: none !important;
}

.app-switcher-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-switcher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.app-switcher-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.75rem;
  padding: 0.55rem 0.3rem;
  border-radius: 10px;
}

.app-switcher-tile:hover,
.app-switcher-tile:focus {
  background: var(--bg);
}

.avatar-pop {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 0.4rem;
}

.avatar-pop a {
  color: var(--fg);
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
}

.avatar-pop a:hover,
.avatar-pop a:focus {
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

.avatar-btn {
  overflow: hidden;
}

.avatar-btn img.avatar-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.avatar-pop-who {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem 0.7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}

.avatar-pop-who strong {
  font-size: 0.95rem;
}

.avatar-pop-who span {
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-all;
}

.profile-avatar-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
}

.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
}

.sa-action-form {
  display: inline-block;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

.idle-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.45);
  padding: 1.25rem;
}

.idle-card {
  width: 100%;
  max-width: 22rem;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.35rem 1.25rem;
}

.idle-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.idle-card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .card {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 14px;
  }

  .app-switcher-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
