/* A page's title row (CLAUDE.md, "Page layout"): the title on the left and its subtitle, a short line such as
   "5 affiliates", on the right of the same row in a white pill (in capitals, spaced like a bar's title), never under it.
   <header class="title-row"><h1>Tracking</h1><p class="title-row__note">5 affiliates</p></header> */
.title-row {
  display: flex;
  align-items: center; /* the pill sits on the title's middle */
  justify-content: space-between;
  gap: var(--sp-3);
  min-width: 0;
}

.title-row h1 {
  min-width: 0;
}

.title-row .title-row__note { /* two classes: beats a page's own subtitle style (dashboard__hello p) */
  flex: none;
  margin: 0;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xxs); /* phones 10px, 11px from 576px (like a bar's title) */
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-caps); /* small capitals, like a bar's title (.box__title) */
  text-transform: uppercase;
  color: var(--c-text);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-pill);
}

/* A page's main box (CLAUDE.md, "Page layout"), the same on every page:
   1. its first row, an anthracite bar (.box__bar) always --bar-h high (48px), its name on the left (.box__title) and
      what it is filtered by on the right (the month and its arrows on Tracking);
   2. a grey toolbar under it, when the page has one (.box__toolbar: Partners' search);
   3. its content (.box__body), whose own boxes have a lighter title bar (the pale grey band, instead of anthracite).
   The box reaches down to the bottom of the screen and grows with its content (its page gives it the space left).
   <div class="box">
     <div class="box__bar"><h2 class="box__title"><i class="bi bi-..." aria-hidden="true"></i> Overview</h2> ...</div>
     <div class="box__body"><section class="dashboard__tile"><header class="dashboard__head">...</header>...</section></div>
   </div> */
.box {
  overflow: clip;
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-line);
  border-radius: var(--radius-2);
}

.box__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  height: var(--bar-h);
  padding-inline: var(--sp-3);
  color: var(--c-page);
  background-color: var(--c-anthracite);
}

.box__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2); /* its icon, then its name */
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: inherit;
}

.box__body {
  display: grid;
  align-content: start;
  gap: var(--sp-5);
  padding: var(--sp-4);
}

/* The grey toolbar under the bar (Earnings' sections, Partners' search). */
.box__toolbar {
  padding: var(--sp-3);
  background-color: var(--c-surface);
  border-bottom: var(--border-1) solid var(--c-line);
}

/* The boxes inside: a lighter title bar. Its A–Z / Sales choice shows the chosen one in anthracite. */
.box__body .dashboard__head {
  color: var(--c-text);
  background-color: var(--c-surface);
  border-bottom: var(--border-1) solid var(--c-line);
}

.box__body .dashboard__sort :checked + span {
  color: var(--c-page);
  background-color: var(--c-anthracite);
}

.box__body .dashboard__sort :focus-visible + span {
  outline-color: var(--c-anthracite);
}

@media (min-width: 576px) {
  .title-row .title-row__note {
    font-size: var(--fs-xs);
  }
}

@media (min-width: 768px) {
  .box__body {
    padding: var(--sp-6);
  }
}
