/* Общая раскладка колонок: ширина перетаскиванием границы, порядок — перетаскиванием заголовка.
   Opt-in: table[data-sd-cols] или SuperDashTableLayout.attach(table, options). */

.sd-table-scroll {
  overflow: auto;
  max-height: min(70vh, 52rem);
}

.sd-table-scroll .sd-data-table,
table.sd-data-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
}

.sd-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--bs-table-bg, var(--bs-body-bg, #fff));
  box-shadow: 0 1px 0 var(--bs-border-color);
  vertical-align: middle;
}

.sd-data-table td {
  vertical-align: top;
}

.sd-th {
  position: relative;
  padding-right: 0.55rem !important;
  overflow: visible;
}

.sd-col-head {
  display: flex;
  align-items: center;
  min-height: 1.75rem;
  user-select: none;
  position: relative;
  gap: 0.2rem;
}

.sd-col-label {
  flex: 1 1 auto;
  min-width: 0;
}

.sd-col-drag {
  cursor: grab;
  flex: 0 0 auto;
  touch-action: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  min-width: 0.85rem;
  height: 1.1rem;
  color: var(--bs-secondary);
  opacity: 0.45;
  line-height: 1;
}

.sd-col-drag-grip {
  display: block;
  width: 0.45rem;
  height: 0.7rem;
  background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.1px);
  background-size: 0.45rem 0.23rem;
  background-repeat: repeat;
}

.sd-col-drag:hover {
  opacity: 0.95;
  color: var(--bs-primary);
}

.sd-col-drag:active {
  cursor: grabbing;
}

.sd-th.sd-th-dragging {
  opacity: 0.55;
  background: rgba(var(--bs-primary-rgb), 0.12);
}

.sd-th.sd-th-drop-target {
  box-shadow: inset 0 -3px 0 var(--bs-primary);
}

.sd-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
}

.sd-col-resizer:hover,
.sd-table-resizing .sd-col-resizer:hover {
  background: rgba(var(--bs-primary-rgb), 0.25);
}

.sd-table-resizing {
  cursor: col-resize;
  user-select: none;
}

.sd-table-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.sd-cell-url,
.sd-url {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sd-cell-num {
  white-space: nowrap;
  text-align: center;
}

.sd-col-select {
  text-align: center;
  vertical-align: middle;
}

.sd-hops {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.sd-hops li {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  margin-top: 0.2rem;
}

.sd-hops .badge {
  flex: 0 0 auto;
  margin-top: 0.1rem;
}
