/* ═══════════════════════════════════════════════════════════
   Enhanced Table – interactive column resize + sort styles
   ═══════════════════════════════════════════════════════════ */

/* ── Resize handle (vertical bar on right of each th) ─── */
.et-resize-handle {
  position: absolute;
  top: 0;
  right: -2px;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  background: transparent;
  transition: background 0.15s;
}

.et-resize-handle:hover,
.et-resizing .et-resize-handle {
  background: var(--color-primary, #0a6ad1);
  opacity: 0.5;
  border-radius: 2px;
}

/* Visual cue: thin divider line always visible */
.et-enhanced thead th:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 25%;
  right: 0;
  width: 1px;
  height: 50%;
  background: rgba(0,0,0,0.12);
  pointer-events: none;
}

/* While actively resizing, disable text selection on table */
.et-resizing {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Sortable header styling ───────────────────────────── */
.et-sortable {
  cursor: pointer;
  position: relative;
  padding-right: 20px !important;
  user-select: none;
}

.et-sortable:hover {
  background: rgba(0,0,0,0.06);
}

/* Sort indicator arrows */
.et-sort-indicator {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  color: rgba(0,0,0,0.28);
  pointer-events: none;
}

/* Default: show ⇅ double arrow */
.et-sortable .et-sort-indicator::after {
  content: '⇅';
}

.et-sortable:hover .et-sort-indicator {
  color: rgba(0,0,0,0.5);
}

/* Active sort indicators */
.et-sorted-asc .et-sort-indicator::after {
  content: '▲';
}
.et-sorted-asc .et-sort-indicator {
  color: var(--color-primary, #0a6ad1);
}

.et-sorted-desc .et-sort-indicator::after {
  content: '▼';
}
.et-sorted-desc .et-sort-indicator {
  color: var(--color-primary, #0a6ad1);
}

/* ── Enhanced table baseline ───────────────────────────── */
.et-enhanced {
  table-layout: fixed;
}

.et-enhanced thead th {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ensure cell content clips properly */
.et-enhanced td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Allow wrapping on cells that contain textarea or have .et-wrap */
.et-enhanced td.et-wrap,
.et-enhanced td:has(textarea) {
  white-space: normal;
  word-wrap: break-word;
}

/* ── Mobile: disable resize, keep sort ─────────────────── */
@media (max-width: 768px) {
  .et-resize-handle {
    display: none;
  }
  .et-enhanced thead th::after {
    display: none;
  }
  .et-enhanced {
    table-layout: auto;
  }
  .et-enhanced td,
  .et-enhanced th {
    white-space: normal;
  }
}

/* ── Transitions ───────────────────────────────────────── */
.et-enhanced th {
  transition: background 0.15s ease;
}

/* ── Row hover for better readability ──────────────────── */
.et-enhanced tbody tr:hover {
  background-color: rgba(10, 106, 209, 0.04) !important;
}
