/*
 * Tabulator dark theme override для rapa-results.
 * Vendor tabulator.min.css фиксирует light-only фоны (#f3f3f3 / #efefef / #fff)
 * с !important, что ломает читабельность в dark UI (см. session_2026-05-03_rapa_phase_6_planning.md).
 *
 * Применяется при html.dark (по умолчанию для проекта). Light theme — vendor default.
 * Eclipse identity tokens — input.css @theme.
 */

/* Корневой контейнер */
html.dark .tabulator {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e5e7eb;
  font-family: inherit;
}

/* Header */
html.dark .tabulator .tabulator-header,
html.dark .tabulator .tabulator-header .tabulator-col,
html.dark .tabulator .tabulator-header .tabulator-col.tabulator-sortable {
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

html.dark .tabulator .tabulator-header .tabulator-col {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

html.dark .tabulator .tabulator-header .tabulator-col-title {
  color: #9ca3af;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.dark .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  cursor: pointer;
}

html.dark .tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow {
  border-bottom-color: #9ca3af;
}

html.dark .tabulator .tabulator-header .tabulator-col[aria-sort="ascending"] .tabulator-col-sorter .tabulator-arrow,
html.dark .tabulator .tabulator-header .tabulator-col[aria-sort="descending"] .tabulator-col-sorter .tabulator-arrow {
  border-bottom-color: #e83e8c;
  border-top-color: #e83e8c;
}

/* Header filters input */
html.dark .tabulator .tabulator-header-filter input,
html.dark .tabulator .tabulator-header-filter select {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
}

html.dark .tabulator .tabulator-header-filter input:focus,
html.dark .tabulator .tabulator-header-filter select:focus {
  border-color: rgba(232, 62, 140, 0.5);
  outline: none;
}

/* Rows — главный fix V огрызка */
html.dark .tabulator .tabulator-tableholder,
html.dark .tabulator .tabulator-tableholder .tabulator-table {
  background: transparent !important;
  color: #e5e7eb !important;
}

html.dark .tabulator .tabulator-row,
html.dark .tabulator .tabulator-row.tabulator-row-even,
html.dark .tabulator .tabulator-row.tabulator-row-odd {
  background: transparent !important;
  background-color: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

html.dark .tabulator .tabulator-row:hover,
html.dark .tabulator .tabulator-row.tabulator-selectable:hover {
  background: rgba(232, 62, 140, 0.06) !important;
  background-color: rgba(232, 62, 140, 0.06) !important;
  cursor: pointer;
}

html.dark .tabulator .tabulator-row.tabulator-selected,
html.dark .tabulator .tabulator-row.tabulator-selected:hover {
  background: rgba(232, 62, 140, 0.12) !important;
  background-color: rgba(232, 62, 140, 0.12) !important;
}

/* Cells */
html.dark .tabulator .tabulator-row .tabulator-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  padding: 8px 10px;
  font-size: 13px;
}

html.dark .tabulator .tabulator-row .tabulator-cell:last-child {
  border-right: none;
}

/* Footer / pagination */
html.dark .tabulator .tabulator-footer {
  background: rgba(255, 255, 255, 0.02) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

html.dark .tabulator .tabulator-footer .tabulator-paginator,
html.dark .tabulator .tabulator-footer .tabulator-page-counter {
  color: #9ca3af;
}

html.dark .tabulator .tabulator-footer .tabulator-page {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
  margin: 0 2px;
}

html.dark .tabulator .tabulator-footer .tabulator-page:hover {
  background: rgba(232, 62, 140, 0.15) !important;
  cursor: pointer;
}

html.dark .tabulator .tabulator-footer .tabulator-page.active {
  background: linear-gradient(135deg, #e83e8c, #6f42c1) !important;
  color: #fff !important;
  border-color: transparent;
}

/* Calculation rows (не используется сейчас, но на всякий) */
html.dark .tabulator .tabulator-row.tabulator-calcs {
  background: rgba(255, 255, 255, 0.04) !important;
  font-weight: 600;
}

/* Empty state */
html.dark .tabulator .tabulator-placeholder {
  background: transparent !important;
  color: #6b7280;
}

html.dark .tabulator .tabulator-placeholder span {
  color: #6b7280 !important;
}

/* Loader */
html.dark .tabulator .tabulator-loader {
  background: rgba(0, 0, 0, 0.5);
}

html.dark .tabulator .tabulator-loader .tabulator-loader-msg {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
