/* BizBarrel — reactive table headers (asc/desc)
   Author: Dave Greenlaw
   Shared chrome for .bb-table-sort + known mode class aliases.
*/

.bb-table-sort,
.pf-list-table__sort,
.budget-cashflow-sort-btn,
.budget-expense-report-detail-table .bb-table-sort,
.bb-blog-analytics-table .bb-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  border-radius: 4px;
  text-align: inherit;
}

.bb-table-sort:hover,
.bb-table-sort:focus-visible,
.pf-list-table__sort:hover,
.pf-list-table__sort:focus-visible,
.budget-cashflow-sort-btn:hover,
.budget-cashflow-sort-btn:focus-visible,
.bb-blog-analytics-table .bb-table-sort:hover,
.bb-blog-analytics-table .bb-table-sort:focus-visible {
  outline: none;
}

.bb-table-sort:focus-visible,
.pf-list-table__sort:focus-visible,
.budget-cashflow-sort-btn:focus-visible,
.bb-blog-analytics-table .bb-table-sort:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #0078d4) 45%, transparent);
}

.bb-table-sort__ind,
.pf-list-table__sort-ind {
  flex: 0 0 auto;
  min-width: 0.9em;
  opacity: 0.35;
  font-size: 12px;
  line-height: 1;
}

.bb-table-sort.is-active .bb-table-sort__ind,
.pf-list-table__sort.is-active .pf-list-table__sort-ind {
  opacity: 1;
  color: var(--accent, #0078d4);
}

/* Theme × Display — keep headers readable on dark / glass / contrast */
html[data-theme="dark"] .bb-table-sort:hover,
html[data-theme="soft"] .bb-table-sort:hover,
html[data-theme="dark"] .budget-cashflow-sort-btn:hover,
html[data-theme="soft"] .budget-cashflow-sort-btn:hover,
html[data-theme="dark"] .bb-blog-analytics-table .bb-table-sort:hover,
html[data-theme="soft"] .bb-blog-analytics-table .bb-table-sort:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="glass"] .bb-table-sort:hover,
html[data-theme="glass"] .pf-list-table__sort:hover,
html[data-theme="glass"] .budget-cashflow-sort-btn:hover,
html[data-theme="glass"] .bb-blog-analytics-table .bb-table-sort:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #f2f4f8);
}

html[data-theme="glass"] .bb-table-sort.is-active .bb-table-sort__ind,
html[data-theme="glass"] .pf-list-table__sort.is-active .pf-list-table__sort-ind {
  color: var(--accent, #d4c4a8);
}

html[data-a11y-view="contrast"] .bb-table-sort:focus-visible,
html[data-a11y-view="contrast"] .pf-list-table__sort:focus-visible,
html[data-a11y-view="contrast"] .budget-cashflow-sort-btn:focus-visible,
html[data-a11y-view="contrast"] .bb-blog-analytics-table .bb-table-sort:focus-visible {
  outline: 3px solid var(--accent, currentColor);
  outline-offset: 2px;
  box-shadow: none;
}

html[data-a11y-view="comfort"] .bb-table-sort,
html[data-a11y-view="comfort"] .pf-list-table__sort,
html[data-a11y-view="comfort"] .budget-cashflow-sort-btn,
html[data-a11y-view="comfort"] .bb-blog-analytics-table .bb-table-sort {
  min-height: 40px;
  padding: 4px 2px;
}
