.data-table-wrap { width: 100%; overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  padding: var(--space-2) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  background: var(--color-surface-2);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--color-surface-2); }

.data-table--compact td,
.data-table--compact th { padding: var(--space-2) var(--space-3); }

.data-table__empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-10) 0;
}

/* Sticky table header — opt-in via the --sticky modifier on the wrap.
   .data-table-wrap already sets overflow-x, so the browser makes the wrap a
   scroll container on BOTH axes; a sticky thead therefore resolves against this
   wrap, not the page. Giving the wrap a bounded height turns it into a real
   vertical scrollport, so the header pins to its top while the body scrolls.
   Tune per page with --table-sticky-max-h. */
.data-table-wrap--sticky {
  max-height: var(--table-sticky-max-h, calc(100vh - 160px));
  overflow: auto;
}
.data-table-wrap--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;                                   /* above scrolling body cells */
  /* th already carries an opaque background (rows can't show through). The
     collapsed border-bottom can drop out while scrolling, so paint the divider
     as an inset shadow that always tracks the sticky header. */
  box-shadow: inset 0 -1px 0 var(--color-border);
}
