/* Modern page layout */
.page-content {
  padding: 12px 32px 24px;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  color: #4a4a4a;
  text-transform: uppercase;
}

.page-title-actions {
  display: flex;
  align-items: center;
  column-gap: 10px;
}

/* Scrollable container for card layouts: keeps the title + filters fixed
   while the cards scroll inside. Set --card-height inline per view
   (e.g. style="--card-height: calc(100vh - 190px)"). */
.card-scroll-container {
  max-height: var(--card-height, calc(100vh - 200px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 4px 24px;
}

/* On mobile, lock a page to the viewport height so only its inner scroll area
   scrolls (no page/viewport scroll). Apply to a .page-content that contains a
   header + a .card-scroll-container. Uses dvh so the browser bar is respected. */
@media (max-width: 768px) {
  .viewport-locked {
    height: 100vh;         /* fallback */
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* the inner scroll area takes the remaining space and is the only scroller */
  .viewport-locked .card-scroll-container {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
}

/* ---- responsive ---- */
@media (max-width: 768px) {
  .page-content {
    padding: 12px 16px 24px;
  }

  /* title on its own line, actions/filters wrap below */
  .page-title-row {
    flex-wrap: wrap;
    row-gap: 14px;
  }

  .page-title {
    font-size: 18px;
    flex: 1 1 100%;
    text-align: center;
  }

  .page-title-actions {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 10px 12px 20px;
  }

  .page-title {
    font-size: 16px;
  }

  /* action buttons take full width so they don't get cramped */
  .page-title-actions {
    width: 100%;
  }

  .page-title-actions .inline-filter-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
