.app-shell {
  background: #f4f6f8;
  color: #10131a;
  min-height: 100vh;
}

.app-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  background: #10131a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.app-sidebar a,
.app-sidebar button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0.75rem;
  text-align: left;
  text-decoration: none;
}

.app-sidebar a:hover,
.app-sidebar button:hover,
.app-sidebar .active {
  background: rgba(255, 255, 255, 0.1);
}

.app-main {
  padding: clamp(1rem, 3vw, 2rem);
}

.app-topbar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.app-search {
  max-width: 460px;
}

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

.app-card,
.auth-card,
.app-panel {
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 1rem;
}

.metric {
  color: #116b73;
  display: block;
  font-size: 2rem;
  font-weight: 850;
}

.table-list {
  display: grid;
  gap: 0.75rem;
}

.table-row {
  align-items: center;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.85rem;
}

.table-row small,
.muted {
  color: #5a6472;
}

.progress {
  background: #e4eaf0;
  border-radius: 999px;
  height: 0.55rem;
  overflow: hidden;
}

.progress span {
  background: linear-gradient(90deg, #2457a7, #116b73);
  display: block;
  height: 100%;
}

.auth-page {
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 178, 195, 0.16), transparent 26rem),
    linear-gradient(135deg, #f7f9fb, #edf2f5);
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  max-width: 520px;
  width: 100%;
}

.auth-card-centered {
  text-align: center;
}

.auth-page h1,
.auth-page h2 {
  letter-spacing: 0;
  line-height: 1;
  overflow-wrap: anywhere;
}

.auth-page h1 {
  font-size: clamp(2.4rem, 7vw, 5.8rem);
}

.auth-page h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.portal-login {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  max-width: 1120px;
  width: min(100%, 1120px);
}

.portal-login-copy {
  align-self: center;
}

.portal-logo {
  display: inline-flex;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.portal-logo img {
  display: block;
  height: clamp(52px, 7vw, 86px);
  max-width: min(74vw, 520px);
  object-fit: contain;
  width: auto;
}

.portal-login-copy h1 {
  margin: 0 0 1rem;
  max-width: 9ch;
  text-transform: uppercase;
}

.portal-login-copy p {
  color: #5a6472;
  font-size: 1.05rem;
  max-width: 580px;
}

.portal-feature-list {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.portal-feature-list li {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  color: #243241;
  font-weight: 780;
  padding: 0.75rem;
}

.portal-feature-list li::before {
  color: #00b2c3;
  content: "+ ";
  font-weight: 900;
}

.portal-back {
  color: #0d1b2a;
  font-weight: 820;
}

.portal-login-card {
  align-self: center;
  box-shadow: 0 24px 70px rgba(13, 27, 42, 0.12);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.portal-login-card h2 {
  margin-bottom: 0;
}

.portal-login-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.forgot-button {
  background: transparent;
  border: 0;
  color: #116b73;
  cursor: pointer;
  font: inherit;
  font-weight: 780;
  padding: 0.4rem 0;
}

[data-status] {
  color: #116b73;
  font-weight: 760;
  margin: 0;
}

[data-status][data-type="error"] {
  color: #b42318;
}

.app-form {
  display: grid;
  gap: 0.8rem;
}

.app-form label {
  display: grid;
  font-weight: 760;
  gap: 0.35rem;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hidden {
  display: none !important;
}

.message-list {
  display: grid;
  gap: 0.6rem;
  max-height: 360px;
  overflow: auto;
}

.message {
  background: #f4f6f8;
  border-radius: 8px;
  padding: 0.75rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tabs button {
  background: #edf2f5;
  border: 1px solid #cbd3dc;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 0.5rem 0.75rem;
}

.tabs button.active {
  background: #10131a;
  color: #fff;
}

@media (max-width: 820px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    left: 0;
    position: sticky;
    right: 0;
    top: 0;
    z-index: 5;
  }

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

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

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

  .portal-login-copy h1 {
    max-width: 11ch;
  }
}

@media (max-width: 460px) {
  .portal-feature-list {
    grid-template-columns: 1fr;
  }

  .portal-login-actions {
    align-items: stretch;
    display: grid;
  }
}
