/* EANA 360 — Color & spacing overrides on top of tabulator_materialize.min.css
   M3 seed: #00696D (SchemeTonalSpot)
   surface: #f4fbfa | onSurface: #161d1d | onSurfaceVariant: #3f4949
   outlineVariant: #bec8c9 | primary: #00696d | onPrimary: #ffffff */

/* ── Table container ── */
.tabulator {
  background-color: #f4fbfa;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #161d1d;
}

/* ── Header ── */
.tabulator .tabulator-header {
  background-color: #f4fbfa;
  border-bottom: 1px solid #bec8c9;
}

.tabulator .tabulator-header .tabulator-col {
  background: #f4fbfa;
  border-right: none;
  vertical-align: middle;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 15px 20px;
}

/* Sortable header spacing: 8px gap between title text and arrow,
   arrow inset from the right edge so right-of-arrow = left-of-text (20px). */
.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
  padding-right: 24px;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {
  right: 4px;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder {
  display: flex;
  align-items: center;
  height: 100%;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.15px;
  line-height: 24px;
  color: #161d1d;
  display: flex;
  align-items: center;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-content .tabulator-col-title,
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-content .tabulator-col-title {
  font-weight: 500;
}

@media (hover: hover) and (pointer: fine) {
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover {
    background-color: rgba(22, 29, 29, 0.08);
  }
}

/* ── Sort arrows — hidden by default, visible on hover or when actively sorted ── */
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-col-sorter {
  display: none;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"]:hover .tabulator-col-content .tabulator-col-sorter {
  display: flex;
  align-items: center;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .sort-arrow {
  font-size: 16px;
  color: #161d1d;
  line-height: 1;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .sort-arrow-neutral {
  display: none;
  opacity: 0.4;
  font-size: 16px;
  letter-spacing: -2px;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .sort-arrow-active {
  display: inline-block;
  transition: transform 0.15s ease;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-sorter .sort-arrow-active {
  display: none;
}

.tabulator .tabulator-header .tabulator-col[aria-sort="descending"] .tabulator-col-sorter .sort-arrow-active {
  transform: scaleY(-1);
}

/* ── Table body (rows and frozen cells inherit from here) ── */
.tabulator .tabulator-tableholder .tabulator-table {
  background-color: #f4fbfa;
}

/* ── Rows ── */
.tabulator-row {
  background-color: #f4fbfa;
  border-bottom: 1px solid #bec8c9;
}

.tabulator-row:last-child {
  border-bottom: none;
}

.tabulator-row.tabulator-row-even {
  background-color: #f4fbfa;
}

.tabulator-row:hover,
.tabulator-row.tabulator-selectable:hover {
  background-color: #e2e9e8 !important;
  cursor: default !important;
}

.tabulator-row.tabulator-selected {
  background-color: #cce8e9 !important;
}

.tabulator-row.tabulator-selected:hover {
  background-color: #c0dbdc !important;
  cursor: default !important;
}

/* ── Cells ── */
.tabulator-row .tabulator-cell {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #161d1d;
  line-height: 24px;
  user-select: text !important;
  -webkit-user-select: text !important;
  border-right: none;
  padding: 15px 20px;
  vertical-align: middle;
}

.tabulator-row .tabulator-cell.eana-mono {
  font-family: "Roboto Mono", monospace;
}

.tabulator-row .tabulator-cell small {
  color: #3f4949;
  font-size: 12px;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
  line-height: 16px;
}

/* ── Row header (checkbox column) — Materialize sets background: #fff ── */
.tabulator-row .tabulator-cell.tabulator-row-header {
  background: #f4fbfa;
  border-right: none;
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: pointer;
}

.tabulator .tabulator-header .tabulator-col.tabulator-row-header {
  border-right: none;
  overflow: visible;
}

.tabulator .tabulator-header .tabulator-col.tabulator-row-header .tabulator-col-content {
  justify-content: center;
  overflow: visible;
}

.tabulator .tabulator-header .tabulator-col.tabulator-row-header .tabulator-col-content .tabulator-col-title {
  overflow: visible;
}

/* ── Frozen column header ── */
.tabulator .tabulator-header .tabulator-col.tabulator-frozen:not(.tabulator-row-header) {
  background: #f4fbfa;
}

@media (hover: hover) and (pointer: fine) {
  .tabulator .tabulator-header .tabulator-col.tabulator-frozen.tabulator-sortable.tabulator-col-sorter-element:hover {
    background-color: #e2e9e8;
  }
}

/* Remove Tabulator's default frozen separator border */
.tabulator .tabulator-header .tabulator-col.tabulator-frozen.tabulator-frozen-left,
.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left {
  border-right: none !important;
}

/* ── Frozen cells ── */
.tabulator-row .tabulator-cell.tabulator-frozen:not(.tabulator-row-header) {
  background: #f4fbfa;
}

/* Subtle divider on the frozen/non-frozen boundary (only when scrolled) */
.tabulator.eana-scrolled .tabulator-header .tabulator-col.tabulator-frozen.tabulator-frozen-left:not(.tabulator-row-header),
.tabulator.eana-scrolled .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left:not(.tabulator-row-header) {
  box-shadow: 0px 0px 18px 0px rgb(0 0 0 / 10%);
  clip-path: inset(0px -18px 0px 0px);
}

.tabulator-row:hover .tabulator-cell.tabulator-frozen,
.tabulator-row:hover .tabulator-cell.tabulator-row-header {
  background: #e2e9e8 !important;
}

.tabulator-row.tabulator-selected .tabulator-cell.tabulator-frozen,
.tabulator-row.tabulator-selected .tabulator-cell.tabulator-row-header {
  background: #cce8e9 !important;
}

.tabulator-row.tabulator-selected:hover .tabulator-cell.tabulator-frozen,
.tabulator-row.tabulator-selected:hover .tabulator-cell.tabulator-row-header {
  background: #c0dbdc !important;
}

/* ── Scrollbar ── */
.tabulator .tabulator-tableholder::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
  background: transparent;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-corner {
  background: transparent;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
  background: #bec8c9;
  border-radius: 6px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
  background: #6f7979;
}

/* ── Checkboxes (M3 spec) ── */
.tabulator .tabulator-row .tabulator-cell input[type="checkbox"],
.tabulator .tabulator-header .tabulator-col input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 4px 0 0 0;
  border: 2px solid #3f4949;
  border-radius: 2px;
  background: transparent;
  position: relative;
  transition: background-color 0.1s, border-color 0.1s;
}

.tabulator-row .tabulator-cell.tabulator-row-header:hover input[type="checkbox"],
.tabulator .tabulator-header .tabulator-col.tabulator-row-header:hover input[type="checkbox"] {
  border-color: #161d1d;
  box-shadow: 0 0 0 11px rgba(0, 105, 109, 0.08);
  clip-path: circle(20px at center);
}

.tabulator-row .tabulator-cell.tabulator-row-header:hover input[type="checkbox"]:checked,
.tabulator .tabulator-header .tabulator-col.tabulator-row-header:hover input[type="checkbox"]:checked,
.tabulator .tabulator-header .tabulator-col.tabulator-row-header:hover input[type="checkbox"]:indeterminate {
  border-color: #00696d;
  box-shadow: 0 0 0 11px rgba(0, 105, 109, 0.08);
  clip-path: circle(20px at center);
}

.tabulator .tabulator-row .tabulator-cell input[type="checkbox"]:checked,
.tabulator .tabulator-header .tabulator-col input[type="checkbox"]:checked {
  background: #00696d;
  border-color: #00696d;
}

.tabulator .tabulator-row .tabulator-cell input[type="checkbox"]:checked::after,
.tabulator .tabulator-header .tabulator-col input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.tabulator .tabulator-header .tabulator-col input[type="checkbox"]:indeterminate {
  background: #00696d;
  border-color: #00696d;
}

.tabulator .tabulator-header .tabulator-col input[type="checkbox"]:indeterminate::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 5px;
  width: 10px;
  height: 2px;
  background: #ffffff;
}

/* ── Link cells ── */
.tabulator-row .tabulator-cell.eana-link-cell {
  padding: 15px 8px;
}

.tabulator-row .tabulator-cell a.eana-table-link {
  color: #00696d;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background-color 0.1s;
}

.tabulator-row .tabulator-cell a.eana-table-link:hover {
  color: #004f52;
  background: rgba(0, 105, 109, 0.08);
}

/* ── Header title with optional subtitle ── */
.eana-header-text {
  display: flex;
  flex-direction: column;
}

.eana-header-headline {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.5px;
  color: #161d1d;
}

.eana-header-supporting {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: #3f4949;
}

/* ── Header title wrapper for subtitle-enabled columns ── */
.eana-header-title {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

/* ── Column reorder drag feedback ── */

/* Grab cursor on all column headers to signal they are draggable */
.tabulator .tabulator-header .tabulator-col {
  cursor: grab;
}

/* Grabbing cursor while actively dragging */
.tabulator.tabulator-block-select .tabulator-header .tabulator-col {
  cursor: grabbing !important;
}

/* Ghost header — lifted with MD3 elevation 2 and secondary-container background */
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
  background: #cce8e9 !important;
  border: none !important;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.30), 0px 2px 6px 2px rgba(0, 0, 0, 0.15) !important;
  opacity: 0.96;
  cursor: grabbing !important;
}

/* Drop-slot placeholder — visible teal indicator showing where the column will land */
.tabulator .tabulator-header .tabulator-col-placeholder {
  background: rgba(0, 105, 109, 0.08) !important;
  border-left: none !important;
  border-right: none !important;
}

/* Column body cells highlighted while their header is being dragged */
.tabulator-row .tabulator-cell.eana-col-dragging {
  background: #cce8e9 !important;
}

/* Ghost overlay column that follows the header ghost during drag */
.eana-col-ghost {
  position: absolute;
  bottom: 0;
  pointer-events: none;
  z-index: 4;
  background: rgba(0, 105, 109, 0.12);
}

/* ── Column hover highlight (triggered via JS on header hover) ── */
@media (hover: hover) and (pointer: fine) {
  .tabulator-row .tabulator-cell.eana-col-hover {
    background-color: rgba(22, 29, 29, 0.08);
  }

  .tabulator-row .tabulator-cell.tabulator-frozen.eana-col-hover {
    background-color: #eaf0ef;
  }

  .tabulator-row:hover .tabulator-cell.eana-col-hover,
  .tabulator-row:hover .tabulator-cell.tabulator-frozen.eana-col-hover {
    background-color: #e2e9e8 !important;
  }

  .tabulator-row.tabulator-selected .tabulator-cell.eana-col-hover,
  .tabulator-row.tabulator-selected .tabulator-cell.tabulator-frozen.eana-col-hover {
    background-color: #cce8e9 !important;
  }

  .tabulator-row.tabulator-selected:hover .tabulator-cell.eana-col-hover,
  .tabulator-row.tabulator-selected:hover .tabulator-cell.tabulator-frozen.eana-col-hover {
    background-color: #c0dbdc !important;
  }
}
