/* [2026-10-16, SPEC 180d] PAGE TABS ARE UNDERLINE TABS, ON EVERY PAGE.

   A, 2026-10-16: "For the pills on live assignments, pre-order requests, and
   companies ... we don't want it to be pills, but we want it to be tabs."
   Asked about scope, he picked EVERY page whose pills switch pages, and board
   11A of canvas AjYidVP6E9KFGWiV26dvGb: plain upper-case words in the UI face
   on one line, one thin rule under the whole row, a 3px sage bar under the
   open tab, a small square count badge, and a phone row that scrolls
   sideways instead of stacking.

   ONE PRIMITIVE, ONE SHEET. Every page-switching strip in the estate is
   `nav.crm-tabs` (the `crm/_views.html::tabs` macro on the CRM and staff
   pages, the White Glove hub's `installers/_hub_tabs.html`, the client
   record's and the case record's panel tabs, the workflow's three sections).
   No filter row uses `.crm-tabs`: filters are `.srm-chiprow` / `.wg-filters`
   pills and keep their look. So the markup does not move a byte and this
   sheet restyles the class.

   WHY A SHEET AND NOT srm.css. srm.css is pinned by length in a dozen suites;
   this is the SPEC 161 / 164 / 169 shape: linked by `_base.html` after
   `pl-checks.css`, before `{% block page_styles %}`, and named in
   `templates_engine.VERSIONED_ASSETS`.

   SPECIFICITY. Every rule here EQUALS the srm.css rule it replaces (sections
   39, 52.x and the record band: (0,3,0) for a tab, (0,4,0) for hover and the
   open tab) and wins by loading later. `:is(a, .srm-pill)` because the
   workflow's strip draws bare anchors; `:is(.is-on, [aria-current="page"])`
   because the workflow marks its open tab with aria-current alone (the
   record tabs' script keeps the two in step). The hub's own pill restatement
   in `white-glove.css` section 1 is removed in the same commit; only its
   margin stays there.

   TOKENS ONLY, square corners, no gradient, no shadow. */

.srm-main .crm-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--sp-7);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  /* THE RULE UNDER THE ROW IS AN INSET LINE, NOT A BORDER. A scrolling strip
     clips its children at the padding edge, so a tab pulled 1px down over a
     border would lose its bar; the inset line is painted UNDER the tabs and
     the open tab's 3px bar covers it. */
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--border-soft);
}

.srm-main .crm-tabs > :is(a, .srm-pill) {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-2);
  min-height: 44px;
  margin: 0;
  padding: var(--sp-3) var(--sp-1);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--fg-2);
  font-family: var(--ff-ui);
  font-size: var(--fs-md);
  letter-spacing: var(--tracking-ui);
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}

.srm-main .crm-tabs > :is(a, .srm-pill):hover {
  color: var(--fg-1);
  border-bottom-color: var(--border-strong);
  background: none;
}

/* THE OPEN TAB: dark words over the sage bar. Declared after the hover at the
   same weight, so pointing at the open tab keeps its bar. */
.srm-main .crm-tabs > :is(a, .srm-pill):is(.is-on, [aria-current="page"]) {
  color: var(--fg-1);
  border-bottom-color: var(--ag-sage);
  background: none;
}

/* THE KEYBOARD RING sits INSIDE the tab: an outset ring would be clipped by
   the scrolling row. */
.srm-main .crm-tabs > :is(a, .srm-pill):focus-visible {
  outline: 2px solid var(--ag-sage);
  outline-offset: -2px;
}

/* THE COUNT: a small square badge, pale on a closed tab, sage on the open
   one. The numeral takes the body face (Alata's 1 reads as a capital I beside
   a word; the Leads and Clients sheets say the same). `span.` because those
   two sheets restate the count's ink at (0,5,0) and load after this one; the
   open tab's white numeral has to outrank them. */
.srm-main .crm-tabs > :is(a, .srm-pill) > span.crm-tab-count {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: 0;
  background: var(--ag-sage-10);
  color: var(--fg-2);
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.3;
}
.srm-main .crm-tabs > :is(a, .srm-pill):is(.is-on, [aria-current="page"]) > span.crm-tab-count {
  background: var(--ag-sage);
  color: var(--fg-inverse);
}

/* Chinese has no capitals and Latin tracking reads as gaps (SPEC section 3's
   carve-out, the same one srm.css keeps for `.srm-pill`). */
:lang(zh) .srm-main .crm-tabs > :is(a, .srm-pill) {
  text-transform: none;
  letter-spacing: 0;
}

/* A PHONE SCROLLS THE ROW SIDEWAYS; it never stacks. The words step down one
   size and the gap closes a little so two or three tabs still fit. */
@media (max-width: 640px) {
  .srm-main .crm-tabs { gap: var(--sp-6); }
  .srm-main .crm-tabs > :is(a, .srm-pill) {
    padding-left: var(--sp-1);
    padding-right: var(--sp-1);
    font-size: var(--fs-sm);
  }
}
