/* data-selbar.css — frontend-data-views (SP8) — the selection bar
   (`.enr-selbar*`) and `body.enr-selecting`, the reference-counted flag
   `selection-dom.js` sets while any surface on the page is in selection
   mode (architecture §12 "State: body.enr-selecting").

   Slot in base.html: after data-rail.css, before data-feed.css.

   Tokens only. Mirrors the existing `.ol-selbar` dark sticky bar
   (`pages/orders-list.css`) this component's bar is migrating — same
   shape, framework-tier home; `.enr-selbar` itself starts `hidden` in the
   server-rendered markup (D11) and stays outside the swap target
   (SP6+SP7 integration note 2), so it is never replaced by a fragment. */

.enr-selbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--enroute-ink-900);
  color: var(--fg-on-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: var(--space-2);
  z-index: var(--z-sticky);
}
.enr-selbar[hidden] {
  display: none !important;
}
.enr-selbar [data-enr-dv-selbar-total] {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.enr-selbar__allwrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.enr-selbar__all {
  appearance: none;
  -webkit-appearance: none;
  width: var(--space-8);
  height: var(--space-8);
  margin: 0;
  padding: 0;
  border: 0;
  flex: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.enr-selbar__all::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--fg-on-ink);
  transition: background var(--dur-fast) var(--ease-standard);
}
.enr-selbar__all:checked::before {
  background: var(--brand);
  box-shadow: inset 0 0 0 1.5px var(--brand);
}
.enr-selbar__all:checked::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 9px;
  border: solid var(--fg-on-ink);
  border-width: 0 2px 2px 0;
  transform: translate(0, -1px) rotate(45deg);
}
.enr-selbar__all:focus-visible {
  outline: 2px solid var(--fg-on-ink);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}
.enr-selbar__count {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.enr-selbar__allmatching {
  appearance: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  font: inherit;
  min-height: var(--space-8);
  padding: 0 var(--space-2);
  color: var(--fg-on-ink);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.enr-selbar__allmatching:hover {
  color: var(--fg-on-ink);
  opacity: 0.85;
}
.enr-selbar__allmatching:focus-visible {
  outline: 2px solid var(--fg-on-ink);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.enr-selbar__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-left: auto;
}
.enr-selbar__action {
  min-height: var(--space-8);
}
/* The default `.btn--outline`/`.btn--ghost` dark ink is invisible on this
   bar's own dark fill — a light treatment for exactly those two variants,
   the same fix `.ol-selbar`'s outline actions already carry. */
.enr-selbar__action.btn--outline,
.enr-selbar__action.btn--ghost {
  background: transparent;
  border-color: var(--enroute-ink-600);
  color: var(--fg-on-ink);
}
.enr-selbar__action.btn--outline:hover,
.enr-selbar__action.btn--ghost:hover {
  background: var(--enroute-ink-800);
  border-color: var(--enroute-ink-500);
}
.enr-selbar__action:focus-visible {
  outline: 2px solid var(--fg-on-ink);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.enr-selbar__close {
  appearance: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--fg-on-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--space-8);
  height: var(--space-8);
  flex: none;
  border-radius: var(--radius-sm);
}
.enr-selbar__close:hover {
  background: var(--enroute-ink-800);
}
.enr-selbar__close:focus-visible {
  outline: 2px solid var(--fg-on-ink);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* Reserve room for the sticky bar so it never overlaps the last row while
   a surface is in selection mode (mirrors `.ol-table-wrap`'s own
   `is-selecting` padding reservation). */
body.enr-selecting .enr-dataview__results {
  padding-bottom: var(--space-8);
}
