/* ==========================================================================
   Section header (cp-fold-header): the header of a card or tab section on the
   opportunity, Purchase Order and project pages, rendered by
   SectionHeaderHelper#section_header (shared/_section_header). Title with icon
   and a one-line description on the left; count pills (cp-fold-pill) and the
   section's buttons on the right. First built for the opportunity SPIN / MEDDIC
   tabs, hence the cp-fold-* names.
   The cp-tone-* class picks a pill's Bootstrap colour. It is built on the
   --bs-*-rgb / --bs-*-text-emphasis variables, which dark_theme.css re-points,
   so no dark rules.
   ========================================================================== */
/* Lets a flex child (a header's title block) shrink and wrap instead of overflowing;
   Bootstrap has no such utility. */
.min-w-0 { min-width: 0; }

.cp-tone-primary { --cp-tone-rgb: var(--bs-primary-rgb); --cp-tone-text: var(--bs-primary-text-emphasis); }
.cp-tone-warning { --cp-tone-rgb: var(--bs-warning-rgb); --cp-tone-text: var(--bs-warning-text-emphasis); }
.cp-tone-danger  { --cp-tone-rgb: var(--bs-danger-rgb);  --cp-tone-text: var(--bs-danger-text-emphasis); }
.cp-tone-success { --cp-tone-rgb: var(--bs-success-rgb); --cp-tone-text: var(--bs-success-text-emphasis); }
.cp-tone-info    { --cp-tone-rgb: var(--bs-info-rgb);    --cp-tone-text: var(--bs-info-text-emphasis); }
.cp-tone-secondary { --cp-tone-rgb: var(--bs-secondary-rgb); --cp-tone-text: var(--bs-secondary-text-emphasis); }

.cp-fold-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.cp-fold-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.cp-fold-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cp-tone-text);
  background-color: rgba(var(--cp-tone-rgb), 0.12);
}

/* The title block takes the free width and wraps its description first, so in a
   narrow card (half-width Overview cards) the buttons stay beside the title
   instead of dropping onto their own line. */
.cp-fold-header-title {
  flex: 1 1 14rem;
}

/* Right-hand side: pills, then the section's buttons with some air between. */
.cp-fold-header-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
}

.cp-fold-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
