:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #6b7486;
  --line: rgba(139, 151, 174, .22);
  --surface: rgba(255, 255, 255, .76);
  --surface-strong: rgba(255, 255, 255, .92);
  --accent: #5546d7;
  --accent-dark: #4335bd;
  --accent-soft: #eeecff;
  --success: #16794a;
  --danger: #b42332;
  --shadow: 0 18px 55px rgba(35, 44, 75, .08), 0 2px 8px rgba(35, 44, 75, .04);
  --radius: 20px;
}

html {
  min-height: 100%;
  font-size: 15px;
  scroll-behavior: smooth;
}

body.portal-body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 2%, rgba(223, 229, 255, .8), transparent 34rem),
    radial-gradient(ellipse at 90% 30%, rgba(231, 245, 255, .72), transparent 30rem),
    linear-gradient(150deg, #f8f9fc 0%, #f2f5fa 52%, #f8f8fc 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 23rem;
  height: 23rem;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .38;
  pointer-events: none;
}

.ambient-one {
  top: 16rem;
  left: -13rem;
  background: #d7ddff;
}

.ambient-two {
  top: 31rem;
  right: -14rem;
  background: #d2eaff;
}

.app-shell {
  width: min(100% - 2.5rem, 1180px);
  margin-inline: auto;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: .8rem 0;
  border-bottom: 1px solid rgba(220, 225, 236, .72);
  background: rgba(249, 250, 253, .78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-navbar {
  min-height: 3.2rem;
  padding: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-right: 2rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup:hover {
  color: var(--ink);
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.brand-copy small {
  display: block;
  margin-top: .18rem;
  color: #8a91a1;
  font-size: .68rem;
  font-weight: 550;
  letter-spacing: .03em;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .38rem .48rem;
  border: 1px solid rgba(219, 225, 233, .72);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .92);
}

.brand-logo {
  display: block;
  width: 8.4rem;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 1.65rem;
  background: rgba(125, 136, 158, .3);
}

.footer-logo {
  display: block;
  width: 7.4rem;
  height: auto;
}

.app-nav-links {
  align-items: center;
  gap: .3rem;
}

.app-nav-links .nav-link {
  padding: .58rem .85rem;
  border-radius: .7rem;
  color: #667085;
  font-size: .88rem;
  font-weight: 620;
  transition: all .2s ease;
}

.app-nav-links .nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
}

.app-nav-links .nav-link.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.nav-account {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-left: auto;
}

.account-avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid #dedbff;
  border-radius: 50%;
  color: var(--accent-dark);
  background: #f0efff;
  font-size: .82rem;
  font-weight: 750;
}

.account-email {
  max-width: 14rem;
  overflow: hidden;
  color: #586174;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-caption {
  color: #7a8292;
  font-size: .82rem;
}

.app-nav-toggle {
  border-color: var(--line);
  border-radius: .75rem;
  transition: all .2s ease;
}

.app-main {
  min-height: calc(100vh - 9rem);
  padding-top: 2.6rem;
  padding-bottom: 4rem;
}

.app-footer {
  padding: 1.25rem 0 1.6rem;
  border-top: 1px solid rgba(220, 225, 236, .74);
  color: #9299a8;
  font-size: .76rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #677084;
  font-weight: 700;
}

.footer-dot {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: #7466e5;
  box-shadow: 0 0 0 3px rgba(116, 102, 229, .12);
}

h1, h2, h3, h4, h5 {
  color: #182238;
  letter-spacing: -.04em;
  font-weight: 720;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

h2 {
  font-size: 1.35rem;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.65rem;
}

.page-heading p,
.page-subtitle {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.eyebrow {
  margin-bottom: .55rem;
  color: #7568d9;
  font-size: .7rem;
  font-weight: 780;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.card,
.surface-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  color: #28334a;
  background: rgba(255, 255, 255, .38);
  font-size: .9rem;
  font-weight: 700;
}

.card-body {
  padding: 1.35rem;
}

.metric-card {
  position: relative;
  min-height: 8.2rem;
  padding: 1.2rem 1.25rem;
}

.metric-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.metric-value {
  margin-top: .7rem;
  color: #1d2840;
  font-size: 2rem;
  font-weight: 740;
  letter-spacing: -.06em;
  line-height: 1;
}

.metric-accent {
  position: absolute;
  top: 1.15rem;
  right: 1.2rem;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: .75rem;
  color: #6153d2;
  background: #efedff;
}

.metric-accent svg {
  width: 1.1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.table {
  margin: 0;
  color: #364155;
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(240, 241, 252, .5);
}

.table > :not(caption) > * > * {
  padding: .95rem 1.15rem;
  border-bottom-color: rgba(139, 151, 174, .16);
  vertical-align: middle;
}

.table thead th {
  color: #7e8798;
  background: rgba(248, 249, 252, .72);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table-controls,
.data-table-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.data-table-controls {
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(139, 151, 174, .16);
}

.data-table-controls label {
  display: grid;
  gap: .35rem;
  color: #737e92;
  font-size: .75rem;
  font-weight: 650;
}

.data-table-search {
  width: min(100%, 22rem);
}

.data-table-length .form-select {
  min-width: 5rem;
}

.data-table-sort {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.data-table-sort:hover,
.data-table-sort:focus-visible {
  color: #4338b8;
}

.data-table-sort:focus-visible {
  outline: 2px solid #7164dd;
  outline-offset: 3px;
}

.table thead th[aria-sort="ascending"] .data-table-sort::after {
  content: " ▲";
}

.table thead th[aria-sort="descending"] .data-table-sort::after {
  content: " ▼";
}

.data-table-footer {
  align-items: center;
  border-top: 1px solid rgba(139, 151, 174, .16);
  color: #737e92;
  font-size: .82rem;
}

.data-table-pagination {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.selected-clients-trigger {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 0;
  color: #4338b8;
  font-weight: 650;
  text-decoration: none;
}

.selected-clients-trigger svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.selected-clients-trigger:hover {
  color: #30248e;
}

.selected-clients-toolbar {
  display: flex;
  gap: .75rem;
}

.selected-clients-toolbar .form-select {
  width: auto;
  min-width: 9.5rem;
}

.selected-clients-footer {
  justify-content: space-between;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table a:not(.btn) {
  color: #4338b8;
  font-weight: 650;
  text-decoration: none;
}

.table a:not(.btn):hover {
  color: #30248e;
  text-decoration: underline;
}

.btn,
a,
button,
input,
select,
textarea,
summary {
  transition: all .2s ease;
}

.btn {
  border-radius: .75rem;
  font-size: .87rem;
  font-weight: 650;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(.98);
}

.btn-primary {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(135deg, #6b5ce1, #5142c9);
  box-shadow: 0 7px 16px rgba(83, 68, 205, .18);
}

.btn-primary:hover {
  border-color: var(--accent-dark);
  color: #fff;
  background: linear-gradient(135deg, #5e4fd3, #4537b8);
  box-shadow: 0 9px 20px rgba(83, 68, 205, .24);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(.98);
}

.btn-outline-primary {
  border-color: #c9c4ff;
  color: #5144c5;
  background: rgba(255, 255, 255, .45);
}

.btn-outline-primary:hover {
  border-color: #776ce0;
  color: #3e32aa;
  background: #f0efff;
}

.btn-outline-secondary,
.btn-quiet {
  border-color: rgba(125, 136, 158, .28);
  color: #606b7f;
  background: rgba(255, 255, 255, .58);
}

.btn-outline-secondary:hover,
.btn-quiet:hover {
  border-color: #c7cddd;
  color: #243049;
  background: #fff;
}

.btn:focus-visible,
.nav-link:focus-visible,
a:focus-visible,
button:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
summary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .22rem rgba(102, 88, 220, .22);
}

.btn:disabled,
.btn.disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.form-label {
  margin-bottom: .4rem;
  color: #344057;
  font-size: .82rem;
  font-weight: 670;
}

.form-control,
.form-select {
  min-height: 2.8rem;
  border: 1px solid rgba(133, 145, 169, .28);
  border-radius: .8rem;
  color: #1f2b40;
  background-color: rgba(255, 255, 255, .82);
  font-size: .9rem;
}

.form-control::placeholder {
  color: #a0a7b5;
}

.form-control:focus,
.form-select:focus {
  border-color: #9389ed;
  background-color: #fff;
  box-shadow: 0 0 0 .22rem rgba(102, 88, 220, .14);
}

.form-control:disabled,
.form-select:disabled {
  background-color: #f0f2f7;
  cursor: not-allowed;
}

.form-check-input {
  border-color: #aab2c2;
}

.form-check-input:checked {
  border-color: var(--accent);
  background-color: var(--accent);
}

.form-text {
  color: #7a8497;
  font-size: .77rem;
}

.field-validation-error,
.validation-summary-errors {
  color: var(--danger);
  font-size: .82rem;
}

.validation-summary-errors ul {
  margin-bottom: .6rem;
  padding-left: 1.1rem;
}

.alert {
  border: 1px solid transparent;
  border-radius: .9rem;
  font-size: .88rem;
}

.alert-info {
  border-color: #dce5ff;
  color: #34477f;
  background: rgba(238, 243, 255, .85);
}

.alert-danger {
  border-color: #f1d2d5;
  color: #8f2935;
  background: rgba(255, 242, 243, .9);
}

.alert-success {
  border-color: #c9ead9;
  color: #17613f;
  background: rgba(236, 250, 242, .9);
}

.badge {
  padding: .4rem .62rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}

.text-muted {
  color: var(--muted) !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .34rem .62rem;
  border: 1px solid #e1e4eb;
  border-radius: 999px;
  color: #667085;
  background: rgba(255, 255, 255, .65);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill::before {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.status-success {
  border-color: #c9ead9;
  color: var(--success);
  background: #effaf4;
}

.status-pill.status-warn {
  border-color: #f2e3bf;
  color: #9a6b0c;
  background: #fff9e9;
}

.status-pill.status-danger {
  border-color: #f1d2d5;
  color: var(--danger);
  background: #fff2f3;
}

.empty-state {
  padding: 2.7rem 1.5rem !important;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: .3rem;
  color: #344057;
}

@media (max-width: 575.98px) {
  .data-table-controls,
  .data-table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .data-table-search {
    width: 100%;
  }

  .data-table-pagination {
    justify-content: space-between;
  }

  .selected-clients-toolbar,
  .selected-clients-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-clients-toolbar .form-select {
    width: 100%;
  }
}

.form-surface {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.auth-shell {
  display: grid;
  width: min(100%, 900px);
  min-height: 520px;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  margin: 2rem auto 3rem;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 1.8rem;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 24px 80px rgba(40, 47, 83, .12);
  backdrop-filter: blur(22px);
}

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 2.4rem;
  color: white;
  background:
    radial-gradient(circle at 85% 18%, rgba(171, 160, 255, .58), transparent 13rem),
    linear-gradient(145deg, #2e315b, #5549bb 68%, #7064d2);
}

.auth-aside::after {
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 21rem;
  height: 21rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 2.3rem rgba(255, 255, 255, .045), 0 0 0 4.6rem rgba(255, 255, 255, .035);
  content: "";
}

.auth-aside > * {
  position: relative;
  z-index: 1;
}

.auth-aside h2 {
  max-width: 19rem;
  margin: 2.5rem 0 .8rem;
  color: #fff;
  font-size: 2rem;
}

.auth-aside p {
  max-width: 19rem;
  color: rgba(255, 255, 255, .76);
  font-size: .9rem;
}

.auth-aside-note {
  color: rgba(255, 255, 255, .68);
  font-size: .75rem;
}

.auth-aside .brand-copy small {
  color: rgba(255, 255, 255, .68);
}

.auth-aside .brand-divider {
  background: rgba(255, 255, 255, .3);
}

.auth-aside .brand-logo-wrap {
  border-color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .96);
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.auth-form-panel h1 {
  margin-bottom: .45rem;
  font-size: 1.85rem;
}

.auth-form-panel .page-subtitle {
  margin-bottom: 1.7rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.detail-grid > div {
  min-width: 0;
}

.detail-grid dt {
  margin-bottom: .2rem;
  color: #858da0;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  color: #2e3950;
  font-size: .88rem;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.attempt-history {
  margin-top: .55rem;
  padding-left: .75rem;
  border-left: 2px solid #e6e3ff;
}

.attempt-entry {
  padding: .5rem 0;
}

.attempt-entry + .attempt-entry {
  border-top: 1px solid rgba(139, 151, 174, .16);
}

.activity-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.15rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .36);
}

.attempt-details {
  margin-top: .45rem;
}

.narrow-panel {
  width: min(100%, 620px);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  border-top: 1px solid var(--line);
}

.list-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: rgba(255, 255, 255, .56);
}

.list-group-item {
  border-color: rgba(139, 151, 174, .16);
  color: #3d4960;
  background: transparent;
  cursor: pointer;
}

.list-group-item:hover {
  background: rgba(241, 240, 255, .78);
}

.list-group-item:focus-within {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px rgba(102, 88, 220, .36);
}

.request-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(247, 248, 252, .75);
  font-size: .8rem;
}

.request-id span {
  color: var(--muted);
}

.request-id code {
  color: #4a40b4;
  overflow-wrap: anywhere;
}

.campaign-message {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

details > summary {
  color: #4a40b4;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 650;
}

@media (max-width: 767.98px) {
  .app-shell {
    width: min(100% - 1.25rem, 1180px);
  }

  .app-header {
    padding: .55rem 0;
  }

  .app-main {
    min-height: calc(100vh - 8rem);
    padding-top: 1.6rem;
  }

  .app-nav-links {
    align-items: stretch;
    padding-top: .7rem;
  }

  .nav-account {
    justify-content: flex-start;
    margin: .7rem 0 .2rem;
    padding-top: .75rem;
    border-top: 1px solid var(--line);
  }

  .account-email {
    max-width: 11rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    width: min(100%, 520px);
    min-height: 0;
    grid-template-columns: 1fr;
    margin-top: .5rem;
  }

  .auth-aside {
    min-height: 210px;
    padding: 1.5rem;
  }

  .auth-aside h2 {
    margin: 1.25rem 0 .4rem;
    font-size: 1.55rem;
  }

  .auth-aside-note {
    display: none;
  }

  .auth-form-panel {
    padding: 1.5rem;
  }

  .footer-content {
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
