.login-page,
.app-page {
  min-height: 100vh;
  background: #f5f9fc;
  color: #071936;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 1.5rem;
  padding: 2rem;
}

.login-card {
  width: min(100%, 28rem);
  display: grid;
  gap: 0.85rem;
  padding: 2rem;
  border: 1px solid #d5e1ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 25, 54, 0.12);
}

.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
}

.login-card input,
.app-card input,
.app-card select {
  width: 100%;
  border: 1px solid #a9b9cc;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  font: inherit;
}

.login-card button,
.app-card button,
.app-action {
  border: 0;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  background: #008aa3;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.app-layout {
  display: grid;
  grid-template-columns: 16rem 1fr;
  min-height: 100vh;
}

.app-sidebar {
  background: #071936;
  color: #fff;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-sidebar .brand {
  color: #fff;
}

.app-sidebar nav {
  display: grid;
  gap: 0.4rem;
}

.app-sidebar a,
.app-sidebar button {
  color: #dcecff;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.app-sidebar a[aria-current="page"],
.app-sidebar a:hover,
.app-sidebar button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.app-main {
  padding: 2rem;
}

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

.app-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
}

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

.app-card {
  background: #fff;
  border: 1px solid #d5e1ee;
  border-radius: 8px;
  padding: 1.25rem;
}

.app-card strong {
  display: block;
  font-size: 1.7rem;
}

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

.portal-summary-grid {
  margin-bottom: 1rem;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 0.9fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.portal-side-stack {
  display: grid;
  gap: 1rem;
}

.portal-search-card,
.portal-results-card,
.portal-metrics-card,
.portal-watch-card {
  box-shadow: 0 24px 70px rgba(7, 25, 54, 0.08);
}

.portal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.portal-panel-head h2 {
  margin: 0;
  font-size: 1.4rem;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: #e6f8fc;
  color: #006d83;
  font-size: 0.82rem;
  font-weight: 800;
}

.portal-badge.secondary {
  background: #edf3f8;
  color: #4b5d73;
}

.portal-search-panel {
  max-width: none;
  margin-top: 0;
  box-shadow: none;
}

.portal-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.portal-filter-grid .check {
  align-content: end;
}

.portal-metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-note {
  margin: 1rem 0 0;
  color: #5c6c7f;
}

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

  .app-sidebar {
    position: static;
  }

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

  .portal-layout,
  .portal-filter-grid,
  .portal-metrics-grid {
    grid-template-columns: 1fr;
  }
}
