* {
  box-sizing: border-box;
}

html, body, #app {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: #f7f7f9;
  height: 100%;
}

.app-drawer {
  background: #ffffff;
  color: #0d0d0d;
  padding: 24px 20px;
  border-right: 1px solid rgba(13, 13, 13, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.brand img {
  max-width: 170px;
}

.brand span {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.45);
}

.app-appbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(13, 13, 13, 0.08);
  border-top: 4px solid var(--color-primary);
  gap: 12px;
}

.announcement-bar {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  color: #ffffff;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 6px 16px;
}

.app-title {
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-menu-button {
  display: none;
}

.appbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mud-layout,
.mud-main-content {
  min-height: 100vh;
}

.mud-main-content {
  display: flex;
  flex-direction: column;
}

.app-content {
  padding: 32px 40px 56px;
  min-height: calc(100vh - 140px);
  background: radial-gradient(circle at top left, rgba(119, 100, 197, 0.08), rgba(255, 255, 255, 0) 55%);
  flex: 1 1 auto;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(13, 13, 13, 0.1);
  max-width: min(100%, 320px);
  min-width: 0;
}

.user-pill-copy {
  min-width: 0;
}

.user-pill-copy .mud-typography {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  white-space: nowrap;
}

.notification-menu-host {
  margin-right: 8px;
}

.notification-bell {
  position: relative;
}

.notification-bell-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d83f3f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.notification-center {
  width: min(380px, 82vw);
  padding: 8px 0;
}

.notification-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid rgba(13, 13, 13, 0.08);
}

.notification-center-title {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-center-subtitle {
  color: rgba(13, 13, 13, 0.55);
  font-size: 12px;
}

.notification-center-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 16px;
}

.notification-center-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}

.notification-center-item {
  border-radius: 18px;
  margin: 4px 0;
}

.notification-center-item-unread {
  background: rgba(119, 100, 197, 0.08);
}

.notification-center-item-content {
  width: 100%;
  white-space: normal;
}

.notification-center-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-center-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: 0 0 auto;
}

.notification-center-meta {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(13, 13, 13, 0.5);
}

.muted {
  color: rgba(13, 13, 13, 0.6);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  overflow: hidden;
}

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

.nav-section {
  margin: 18px 0 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.45);
}

.nav-menu .mud-nav-link {
  color: rgba(13, 13, 13, 0.72);
  border-radius: 14px;
  margin: 2px 0;
}

.nav-menu .mud-nav-link.active {
  background: rgba(119, 100, 197, 0.14);
  color: #0d0d0d;
}

.nav-menu .mud-nav-link:hover {
  background: rgba(119, 100, 197, 0.08);
}

.portal-skeleton-stack {
  display: grid;
  gap: 16px;
}

.portal-skeleton-grid {
  display: grid;
  gap: 16px;
}

.portal-skeleton-grid-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-skeleton-grid-panels,
.portal-skeleton-grid-split {
  grid-template-columns: minmax(0, 1fr);
}

.portal-skeleton-grid-insights {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-skeleton-grid-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-skeleton-card,
.portal-skeleton-list-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(13, 13, 13, 0.06);
  background: #fff;
}

.portal-skeleton-card {
  padding: 20px;
}

.portal-skeleton-card-large {
  min-height: 240px;
}

.portal-skeleton-card-inner {
  background: #f7f7f9;
}

.portal-skeleton-line,
.portal-skeleton-chip,
.portal-skeleton-input,
.portal-skeleton-icon,
.portal-skeleton-banner,
.portal-skeleton-row {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(119, 100, 197, 0.12);
}

.portal-skeleton-line::after,
.portal-skeleton-chip::after,
.portal-skeleton-input::after,
.portal-skeleton-icon::after,
.portal-skeleton-banner::after,
.portal-skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
  animation: portal-skeleton-shimmer 1.4s infinite;
}

.portal-skeleton-line {
  height: 12px;
  margin-bottom: 10px;
}

.portal-skeleton-line-short {
  width: 34%;
}

.portal-skeleton-line-medium {
  width: 62%;
}

.portal-skeleton-line-title {
  width: 48%;
  height: 16px;
  margin-bottom: 14px;
}

.portal-skeleton-line-value {
  width: 44%;
  height: 28px;
  margin-bottom: 14px;
}

.portal-skeleton-chip {
  width: 84px;
  min-width: 84px;
  height: 30px;
}

.portal-skeleton-chip-small {
  width: 58px;
  min-width: 58px;
  height: 24px;
}

.portal-skeleton-chip-wide {
  width: 128px;
}

.portal-skeleton-input {
  height: 44px;
  margin-bottom: 4px;
}

.portal-skeleton-input-wide {
  grid-column: 1 / -1;
}

.portal-skeleton-icon {
  width: 36px;
  height: 36px;
}

.portal-skeleton-icon-small {
  width: 24px;
  height: 24px;
}

.portal-skeleton-inline,
.portal-skeleton-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-skeleton-inline {
  align-items: center;
  margin: 8px 0 18px;
}

.portal-skeleton-inline-compact {
  margin: 0;
  justify-content: flex-start;
}

.portal-skeleton-list-item-center {
  align-items: center;
}

.portal-skeleton-list-card {
  padding: 18px;
  margin-top: 12px;
}

.portal-skeleton-banner {
  height: 64px;
  border-radius: 18px;
  margin: 12px 0 18px;
}

.portal-skeleton-table {
  margin-top: 16px;
}

.portal-skeleton-row {
  height: 52px;
  border-radius: 18px;
  margin-top: 10px;
}

.portal-skeleton-divider {
  height: 1px;
  background: rgba(13, 13, 13, 0.08);
  margin: 8px 0 18px;
}

.portal-skeleton-button {
  width: 180px;
  height: 42px;
  border-radius: 14px;
  background: rgba(119, 100, 197, 0.16);
  margin-top: 14px;
  position: relative;
  overflow: hidden;
}

.portal-skeleton-button-small {
  width: 120px;
}

.portal-skeleton-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.65), rgba(255,255,255,0));
  animation: portal-skeleton-shimmer 1.4s infinite;
}

.portal-skeleton-timeline-entry {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
}

.portal-skeleton-marker {
  width: 12px;
  min-width: 12px;
  border-radius: 999px;
  background: rgba(119, 100, 197, 0.22);
}

.portal-skeleton-card-fill {
  flex: 1;
}

.portal-skeleton-banner-small {
  height: 40px;
  margin: 10px 0 14px;
}

.portal-skeleton-grid-insights-third {
  margin-top: 16px;
}

@keyframes portal-skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (min-width: 960px) {
  .portal-skeleton-grid-panels {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .portal-skeleton-grid-split {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  }
}

.nav-menu .mud-nav-link .mud-nav-link-icon {
  color: rgba(13, 13, 13, 0.5);
}

.nav-menu .mud-nav-link.active .mud-nav-link-icon {
  color: var(--color-primary);
}

.nav-menu .mud-nav-group {
  margin-top: 6px;
}

.nav-menu .mud-nav-group .mud-nav-link {
  margin-left: 12px;
}

.metric-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.metric-card {
  cursor: pointer;
  border-radius: 24px;
  border: 1px solid rgba(13, 13, 13, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.portal-card {
  border-radius: 24px;
  border: 1px solid rgba(13, 13, 13, 0.06);
  box-shadow: 0 8px 24px rgba(13, 13, 13, 0.06);
}

.access-state-page {
  min-height: calc(100vh - 196px);
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.access-state-card {
  width: min(100%, 560px);
}

.access-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.profile-summary-card {
  background: linear-gradient(180deg, rgba(119, 100, 197, 0.08), rgba(255, 255, 255, 0.96));
}

.profile-hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-family: var(--font-heading);
  font-size: 32px;
  letter-spacing: 0.08em;
  box-shadow: 0 18px 40px rgba(13, 13, 13, 0.12);
}

.profile-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-table thead th {
  font-weight: 600;
  color: rgba(13, 13, 13, 0.7);
}

.portal-table tbody td {
  color: rgba(13, 13, 13, 0.8);
}

.mud-button-root {
  border-radius: 999px;
}

.bottom-gradient {
  height: 56px;
  background: linear-gradient(90deg, #6f5bd1 0%, #b35ad6 45%, #ef4f78 70%, #f33a3a 100%);
  margin-top: auto;
}

.wizard-stepper {
  flex-wrap: wrap;
}

.wizard-step-button {
  gap: 10px;
}

.wizard-step-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 700;
}

.wizard-action-row {
  flex-wrap: wrap;
}

.wizard-success-card {
  background: linear-gradient(135deg, rgba(69, 182, 73, 0.14), rgba(255, 255, 255, 0.96));
}

.wizard-review-card {
  height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(13, 13, 13, 0.06);
  background: #fbfbfd;
}

.wizard-review-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(13, 13, 13, 0.06);
}

.wizard-review-row:last-child {
  border-bottom: 0;
}

.wizard-review-row span {
  color: rgba(13, 13, 13, 0.58);
}

.wizard-review-row strong {
  text-align: right;
  max-width: 60%;
}

.wizard-checkbox-grid {
  flex-wrap: wrap;
}

.wizard-lead-highlight td {
  background: rgba(69, 182, 73, 0.12);
}

@media (max-width: 900px) {
  .app-drawer {
    padding-top: 18px;
  }

  .app-menu-button {
    display: inline-flex;
  }

  .app-title {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
  }

  .appbar-actions {
    gap: 8px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }

  .user-pill {
    padding: 6px 10px;
    gap: 10px;
    max-width: min(56vw, 220px);
  }

  .logout-button {
    min-width: auto;
    padding-inline: 8px;
  }

  .app-content {
    padding: 20px;
  }

  .wizard-review-row {
    flex-direction: column;
  }

  .wizard-review-row strong {
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .announcement-bar {
    font-size: 10px;
    letter-spacing: 0.14em;
    padding: 6px 10px;
  }

  .app-appbar {
    padding-inline: 10px;
    gap: 8px;
  }

  .app-title {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notification-menu-host {
    margin-right: 0;
  }

  .user-pill {
    border: 0;
    background: transparent;
    box-shadow: none;
    max-width: 144px;
    padding: 0;
  }

  .user-pill-copy {
    display: none;
  }

  .avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .logout-button {
    font-size: 0.78rem;
    padding-inline: 4px;
  }

  .app-content {
    padding: 16px 12px 40px;
  }

  .portal-card {
    border-radius: 20px;
  }

  .access-state-page {
    min-height: calc(100vh - 154px);
    place-items: start;
  }

  .access-state-card {
    width: 100%;
  }
}

#blazor-error-ui {
  color-scheme: light only;
  background: #fff5d6;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.1);
  color: #b00020;
  display: none;
  left: 0;
  padding: 10px 16px;
  position: fixed;
  width: 100%;
  z-index: 2147483647;
}

#blazor-error-ui a,
#blazor-error-ui .dismiss {
  color: #b00020;
  font-weight: 600;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 12px;
  top: 8px;
}

.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--color-primary);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: bold;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Loading");
}
