/* Manual table column sizing ------------------------------------------------
   Desktop only. Widths are applied to the header and every matching row. */
@media (min-width: 761px) {
  html[data-columns-archive="true"] #incident-table-head,
  html[data-columns-archive="true"] #incidents-page .incident-row {
    grid-template-columns: var(--columns-archive) !important;
  }

  html[data-columns-disputes="true"] #dispute-table-head,
  html[data-columns-disputes="true"] #disputes-page .dispute-row {
    grid-template-columns: var(--columns-disputes) !important;
  }

  html[data-columns-cameras="true"] .camera-device-head,
  html[data-columns-cameras="true"] .camera-device-row {
    grid-template-columns: var(--columns-cameras) !important;
  }

  html[data-columns-zones="true"] .zone-device-head,
  html[data-columns-zones="true"] .zone-device-row {
    grid-template-columns: var(--columns-zones) !important;
  }

  html[data-columns-users="true"] .user-table-head,
  html[data-columns-users="true"] .unifi-user-list .user-item {
    grid-template-columns: var(--columns-users) !important;
  }

  html[data-columns-network="true"] .network-settings-head,
  html[data-columns-network="true"] .network-setting-row {
    grid-template-columns: var(--columns-network) !important;
  }
}

.resizable-table-head > * {
  position: relative;
  min-width: 0;
  align-self: stretch;
}

.resizable-table-head > span {
  display: flex;
  align-items: center;
}

.column-resize-handle {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: -9px;
  bottom: 4px;
  width: 18px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 1px;
  border-radius: 1px;
  background: var(--ui-border);
  opacity: .45;
  transition: opacity .14s ease, background-color .14s ease;
}

.column-resize-handle:hover::after,
.column-resize-handle:focus-visible::after,
.resizable-table-head.is-resizing .column-resize-handle::after {
  width: 2px;
  background: var(--accent-text);
  opacity: 1;
}

.column-resize-handle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

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

@media (max-width: 760px) {
  .column-resize-handle {
    display: none;
  }
}
