@layer components {
  /* Session History
   * Stats, filters, and paginated session list.
   */

  .history-stats {
    display: flex;
    gap: var(--space-4);
  }

  .history-stat {
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    flex: 1;
  }

  .history-stat__value {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
  }

  .history-stat__label {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
  }

  .history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: end;

    & .field {
      margin-block-end: 0;
      min-width: 10rem;
      flex: 1;
    }

    @media (max-width: 30rem) {
      flex-direction: column;

      & .field {
        width: 100%;
      }
    }
  }

  .history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    padding-block: var(--space-4);
  }
}
