.btn-primary {
  background: var(--gold);
  color: var(--surface);
  border-radius: var(--radius-control);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  transition: background var(--speed);
  white-space: nowrap;
}

.btn-primary:hover { background: var(--gold-hover); }

.btn-primary:disabled {
  background: var(--text-dim);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: border-color var(--speed), color var(--speed);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-control);
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--speed), color var(--speed);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Ribbon commands (CRM toolbar — Fluent-style command bar) ──
   Flat / borderless commands with an icon + label. Hover fills softly with the
   accent instead of drawing a hard box, matching the Microsoft 365 command
   bar. Scoped to .crm-ribbon so the flat look never leaks to other .btn-ribbon
   uses, and so per-theme overrides (e.g. win2000's beveled buttons, which
   win on specificity) keep their treatment. */

.crm-ribbon .btn-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--speed), color var(--speed);
}

.crm-ribbon .btn-ribbon:hover {
  background: var(--gold-soft);
  color: var(--gold);
}

.crm-ribbon .btn-ribbon:active {
  background: var(--gold-soft);
  color: var(--gold-hover);
}

.crm-ribbon .btn-ribbon:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}

.crm-ribbon .btn-ribbon:disabled,
.crm-ribbon .btn-ribbon.disabled {
  opacity: 0.40;
  pointer-events: none;
  cursor: default;
}

/* Command glyph — inherits the label color via currentColor. */
.ribbon-cmd-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: block;
}

/* The little dropdown caret is smaller and dimmer than the leading icon. */
.ribbon-cmd-caret {
  width: 11px;
  height: 11px;
  opacity: 0.7;
  margin-left: -1px;
}

/* The "⋯ More" overflow button is icon-only. */
.ribbon-overflow-btn {
  padding: 5px 8px;
}

/* Legacy separator — dividers are now drawn between .ribbon-group elements. */
.ribbon-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border);
  vertical-align: middle;
  margin: 0 2px;
  flex-shrink: 0;
}

/* ── Segmented product-line filter (CRM + Tracker) ── */

.ribbon-segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface);
}

.ribbon-seg-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--speed), color var(--speed);
  border-right: 1px solid var(--border);
}

.ribbon-seg-btn:last-child { border-right: none; }

.ribbon-seg-btn:hover {
  color: var(--gold);
}

.ribbon-seg-btn.active {
  background: var(--gold);
  color: var(--surface);
}

/* ── Add-row / ghost-small ── */

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-control);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color var(--speed), color var(--speed);
}

.btn-add:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Pill control ─────────────────────────────────────────────────────────
   The small white bordered control that sits in a page header next to the
   title — timeframe pickers, Filter, Export. Distinct from .btn-secondary in
   that it is a *chrome* control rather than an action: it never takes the
   accent on hover, only a slightly firmer border and full-strength ink, so a
   row of them stays quiet next to the one button that does something. */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--speed), color var(--speed), background var(--speed);
}

.btn-pill:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.btn-pill:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.btn-pill.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.btn-pill:disabled { opacity: 0.45; cursor: not-allowed; }

/* A <select> styled as a pill. Keeps the native menu (free keyboard and
   mobile behaviour) and just restyles the box; the caret is drawn by the UA,
   so the right padding leaves room for it. */
select.btn-pill {
  padding-right: 8px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 13px center, right 8px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

/* Icon-only variant — square, so a lone glyph isn't lost in pill padding. */
.btn-pill.is-icon {
  width: 34px;
  padding: 0;
  justify-content: center;
}
