/* ToneGrid — tenant theme (backstage.dimber.co) */
:root {
  /* ── Brand tokens ── */
  --brand-primary:       #6C3AEF;
  --brand-button-text:   #ffffff;
  --brand-accent:        #8B5CF6;
  --brand-secondary:     #151515;

  /* ── Aliases used by older pages ── */
  --primary:             #6C3AEF;
  --color-primary:       #6C3AEF;
  --color-primary-hover: color-mix(in srgb, #6C3AEF 85%, #000 15%);
  --color-primary-muted: color-mix(in srgb, #6C3AEF 15%, transparent);
  --color-accent:        #8B5CF6;
}

/* ── Universal brand-button overrides ────────────────────────────────────────
   Targets every primary action button pattern across admin + artist pages.
   Excludes ghost/outline/cancel/danger variants.
   !important needed to win over page-level <style> blocks.
   ──────────────────────────────────────────────────────────────────────────── */
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):not(#_tg),
.btn-primary:not(#_tg),
.btn-save:not(#_tg),
.btn-submit:not(#_tg),
.submit-btn:not(#_tg),
.edit-btn.primary:not(#_tg),
.edit-btn-primary:not(#_tg),
.action-btn.primary:not(#_tg),
.pill-btn.active:not(#_tg) {
  background:   #6C3AEF !important;
  color:        #ffffff !important;
  border-color: #6C3AEF !important;
}

.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):not(#_tg):hover,
.btn-primary:not(#_tg):hover,
.btn-save:not(#_tg):hover,
.btn-submit:not(#_tg):hover,
.submit-btn:not(#_tg):hover,
.edit-btn.primary:not(#_tg):hover,
.edit-btn-primary:not(#_tg):hover,
.action-btn.primary:not(#_tg):hover,
.pill-btn.active:not(#_tg):hover {
  background: color-mix(in srgb, #6C3AEF 85%, #000 15%) !important;
  color:      #ffffff !important;
}

/* ── Brand surfaces elsewhere in the platform ────────────────────────────────
   These already paint themselves with var(--brand-primary) in their own page
   or component CSS, but each picked its own label colour — #fff, #000,
   var(--tg-text), or nothing at all. Only the LABEL is corrected here; their
   backgrounds stay under the owning stylesheet's control. Regenerate this list
   with /root/gen_selectors.py after adding new brand-coloured controls. */
.ap-btn.primary:not(#_tg),
.au-btn-primary:not(#_tg),
.btn-br:not(#_tg),
.btn-create:not(#_tg),
.btn-create-video:not(#_tg),
.btn-delete:not(#_tg),
.btn-export:not(#_tg),
.btn-faded:not(#_tg),
.btn-hc:not(#_tg),
.btn-new:not(#_tg),
.btn-next:not(#_tg),
.btn-pill:not(#_tg),
.btn-pri:not(#_tg),
.btn-primary.btn-small:not(#_tg),
.btn-rev-create:not(#_tg),
.btn-sm.primary:not(#_tg),
.btn-small.btn-primary:not(#_tg),
.btn-success:not(#_tg),
.btn-view:not(#_tg),
.btn-white:not(#_tg),
.btn.btn-primary:not(#_tg),
.btn.btn-success:not(#_tg),
.btn.pri:not(#_tg),
.btn.submit:not(#_tg),
.cf-btn:not(#_tg),
.cf-btn-edit:not(#_tg),
.cf-chip.is-active:not(#_tg),
.chip[aria-pressed="true"]:not(#_tg),
.confirm-actions .submit:not(#_tg),
.conn-btn-primary:not(#_tg),
.create-artist-btn:not(#_tg),
.create-label-btn:not(#_tg),
.create-release-btn:not(#_tg),
.cta-upgrade:not(#_tg),
.df-apply:not(#_tg),
.df-btn.active:not(#_tg),
.dist-btn-distribute:not(#_tg),
.dist-rule-apply:not(#_tg),
.extra-pill:not(#_tg),
.filter-btn.active:not(#_tg),
.iid-iedit-save:not(#_tg),
.iid-isrc-save:not(#_tg),
.iid-play-btn:not(#_tg),
.iid-rd-save:not(#_tg),
.invite-icon-btn:not(#_tg),
.menu .cta-range:not(#_tg),
.nc-btn.nc-btn-continue:not(#_tg),
.next-step-btn:not(#_tg),
.p-datepicker table td.p-datepicker-today>span.p-highlight:not(#_tg),
.p-datepicker table td>span.p-highlight:not(#_tg),
.pag-btn.active:not(#_tg),
.page-btn.active:not(#_tg),
.page-btn[aria-current="page"]:not(#_tg),
.pam-btn-primary:not(#_tg),
.pg-btn.pg-on:not(#_tg),
.pill-item input:checked + .pill-lbl:not(#_tg),
.pill.active:not(#_tg),
.rcm-confirm:not(#_tg),
.rev-add-btn:not(#_tg),
.rev-radio-pill input:checked + span:not(#_tg),
.save-modal:not(#_tg),
.sl-btn--primary:not(#_tg),
.sle-btn--primary:not(#_tg),
.tab-btn.active .count-pill:not(#_tg),
.td-btn-primary:not(#_tg),
.td-btn-save:not(#_tg),
.td-prop-pill.active:not(#_tg),
.td-radio-pill:has(input:checked):not(#_tg),
.tdp-add-btn-primary:not(#_tg),
.tdp-btn-save:not(#_tg),
.tdp-prop-pill:has(input:checked):not(#_tg),
.tdp-suggest-apply:not(#_tg),
.terms-accept-btn:not(#_tg),
.tp-upload-btn:not(#_tg),
.ts-btn-save:not(#_tg),
.view-all-btn:not(#_tg),
.view-btn:not(#_tg),
.view-more-btn:not(#_tg),
.wiz-btn-primary:not(#_tg),
.wt-btn-primary:not(#_tg) {
  color: #ffffff !important;
}

/* ── House-style interaction polish for primary action buttons ───────────────
   Colour is owned by the block above (with !important); this only adds the
   standard motion every primary button should share: a smooth transition, a
   hover lift with a brand-tinted shadow, a pressed state, and a keyboard-only
   focus ring. Intentionally NO !important — width / radius / sizing stay under
   each page's control. The .pill-btn / tab / stepper accents are excluded so
   navigation chrome doesn't lift. See admin/login.php for the reference use. */
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn),
.btn-primary,
.btn-save,
.btn-submit,
.submit-btn,
.edit-btn.primary,
.edit-btn-primary,
.action-btn.primary {
  transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):hover,
.btn-primary:hover,
.btn-save:hover,
.btn-submit:hover,
.submit-btn:hover,
.edit-btn.primary:hover,
.edit-btn-primary:hover,
.action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, #6C3AEF 55%, transparent);
}
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):active,
.btn-primary:active,
.btn-save:active,
.btn-submit:active,
.submit-btn:active,
.edit-btn.primary:active,
.edit-btn-primary:active,
.action-btn.primary:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.28);
}
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):focus-visible,
.btn-primary:focus-visible,
.btn-save:focus-visible,
.btn-submit:focus-visible,
.submit-btn:focus-visible,
.edit-btn.primary:focus-visible,
.edit-btn-primary:focus-visible,
.action-btn.primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--tg-bg, #0d0d0d), 0 0 0 4px color-mix(in srgb, #6C3AEF 78%, #fff);
}
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):disabled,
.btn-primary:disabled,
.btn-save:disabled,
.btn-submit:disabled,
.submit-btn:disabled,
.edit-btn.primary:disabled,
.edit-btn-primary:disabled,
.action-btn.primary:disabled {
  transform: none;
  box-shadow: none;
}

/* ── Reusable loading state ───────────────────────────────────────────────────
   Add class="is-loading" (and disable the button) in JS while an async action
   is in flight; remove it when done. Draws a spinner in the current label
   colour, so it adapts to whatever text colour the brand token sets. Pattern is
   opt-in (a class, never :disabled) so validation-disabled buttons don't spin. */
.is-loading {
  cursor: progress;
}
.is-loading::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: tg-btn-spin .6s linear infinite;
}
@keyframes tg-btn-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn),
.btn-primary,
.btn-save,
.btn-submit,
.submit-btn,
.edit-btn.primary,
.edit-btn-primary,
.action-btn.primary,
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):hover,
.btn-primary:hover,
.btn-save:hover,
.btn-submit:hover,
.submit-btn:hover,
.edit-btn.primary:hover,
.edit-btn-primary:hover,
.action-btn.primary:hover,
.btn:not(.btn-ghost):not(.btn-outline):not(.btn-cancel):not(.cancel):not(.btn-danger):not(.act-btn):active,
.btn-primary:active,
.btn-save:active,
.btn-submit:active,
.submit-btn:active,
.edit-btn.primary:active,
.edit-btn-primary:active,
.action-btn.primary:active {
    transition: none;
    transform: none;
  }
  .is-loading::before { animation-duration: 1.4s; }
}

/* Active tab underline / stepper accent */
.tab-btn.active { border-bottom-color: #6C3AEF !important; }
.stepper a.active { background: #6C3AEF !important; }

