/* Shared site table tokens inherit each page's established palette. */
:root {
  --vt-accent: var(--admin-accent, #0755f5);
  --vt-surface: var(--admin-surface, #fff);
  --vt-text: var(--admin-text, var(--ink, #101827));
  --vt-muted: var(--admin-muted, var(--muted, #697386));
  --vt-border: var(--admin-border, var(--line, #e0e4e9));
  --vt-head: #f5f6f8;
  --vt-hover: #f5f8fd;
  --vt-selection: #eaf1fd;
  --vt-danger: var(--red, #a42b37);
  --vt-cell-padding: 10px 12px;
}
.viso-table-scroll, .table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
.viso-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--vt-surface);
  color: var(--vt-text);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}
:is(.viso-table, .data-table) th {
  padding: var(--vt-cell-padding);
  border-bottom: 1px solid var(--vt-border);
  background: var(--vt-head);
  color: var(--vt-muted);
  font-weight: 600;
  text-align: inherit;
  white-space: nowrap;
}
:is(.viso-table, .data-table) td {
  padding: var(--vt-cell-padding);
  border-bottom: 1px solid var(--vt-border);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
:is(.viso-table, .data-table) tbody tr:last-child td { border-bottom: 0; }
:is(.viso-table, .data-table) tbody tr:hover { background: var(--vt-hover); }
:is(.viso-table, .data-table) :is(.vt-selected, .selected),
:is(.viso-table, .data-table) :is(.vt-selected, .selected):hover { background: var(--vt-selection); }
:is(.viso-table, .data-table) :is(.vt-row-selectable, .row-selectable) { cursor: pointer; }
:is(.viso-table, .data-table) :is(.vt-numeric, .numeric-cell, .align-right) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:is(.viso-table, .data-table) .vt-center { text-align: center; }
:is(.viso-table, .data-table) :is(.vt-actions, .action-cell) { white-space: nowrap; }
:is(.viso-table, .data-table) .action-cell > :is(button, a) + :is(button, a) { margin-left: 8px; }
.vt-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.vt-actions button:not(.outline-button) {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--vt-border);
  border-radius: 4px;
  background: var(--vt-surface);
  color: var(--vt-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.vt-actions button:not(.outline-button):hover:not(:disabled) { background: var(--vt-hover); border-color: var(--vt-accent); }
.vt-actions button.danger:not(.outline-button) { color: var(--vt-danger); }
.vt-actions button.danger:not(.outline-button):hover:not(:disabled) { border-color: var(--vt-danger); }
.vt-actions button:disabled { opacity: .55; cursor: not-allowed; }
:is(.viso-table, .data-table) :is(.vt-empty, .empty) {
  padding: 24px 12px;
  color: var(--vt-muted);
  text-align: center;
}
:is(.viso-table, .data-table) .primary-cell { color: var(--vt-text); font-weight: 600; }
:is(.viso-table, .data-table) .secondary-cell { display: block; margin-top: 2px; color: var(--vt-muted); font-size: 12px; }
:is(.viso-table, .data-table) .muted { color: var(--vt-muted); }
:is(.viso-table, .data-table) button.row-link {
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--vt-text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
:is(.viso-table, .data-table) button.row-link:hover { color: var(--vt-accent); text-decoration: underline; }
.vt-resizable { table-layout: fixed; }
.vt-resizable th[data-col-resize] { position: relative; padding-right: 28px; }
.vt-resizable .resizable-col-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}
.col-resize-handle::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 11px;
  width: 2px;
  border-radius: 1px;
  background: var(--vt-border);
}
.col-resize-handle:hover::after, .col-resize-handle:focus-visible::after { background: var(--vt-accent); }
.vt-sort-button {
  min-height: 24px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
:is(.viso-table, .data-table) :is(button, a, input, select, textarea, [tabindex]):focus-visible,
:is(.viso-table, .data-table) tr[tabindex]:focus-visible,
:is(.viso-table-scroll, .table-scroll):focus-visible {
  outline: 2px solid var(--vt-accent);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  :is(.viso-table, .data-table) :is(.vt-selected, .selected) { outline: 1px solid Highlight; outline-offset: -1px; }
}
