/**
 * Общие стили Alpine-таблиц (имитация DataTables: scroll, maximize, sorting).
 * Клик по строке — в page JS / макросе, не здесь.
 */
.cursor-pointer {
  cursor: pointer;
}

.alpine-table-scroll {
  overflow: auto;
  width: 100%;
  position: relative;
}

.alpine-table-scroll.is-processing {
  pointer-events: none;
  /* чтобы спиннер был виден при пустой таблице (первая загрузка) */
  min-height: 8rem;
}

/* Оверлей загрузки / сортировки */
.alpine-table-scroll.is-processing::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.55);
}

.alpine-table-scroll.is-processing::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 21;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 0.22rem solid rgba(0, 123, 255, 0.2);
  border-top-color: #007bff;
  border-radius: 50%;
  animation: alpine-table-spin 0.65s linear infinite;
}

@keyframes alpine-table-spin {
  to {
    transform: rotate(360deg);
  }
}

.card.maximized-card {
  display: flex;
  flex-direction: column;
}

.card.maximized-card > .card-body {
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card.maximized-card .alpine-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
}

/* Sticky-шапка внутри scroll-контейнера (как AdminLTE .table-head-fixed) */
.alpine-table-scroll > table thead tr:first-child th,
.alpine-table-scroll > table.table-head-fixed thead tr:nth-child(1) th {
  background-color: #ffffff;
  border-bottom: 0;
  box-shadow: inset 0 1px 0 #dee2e6, inset 0 -1px 0 #dee2e6;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
}

table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  cursor: pointer;
  user-select: none;
}
