/* =========================================================
   ES DataTables (shared, Bootstrap-friendly)
   ========================================================= */

/* Controls wrapper (use this class on any page controls row) */
.es-dt-controls .form-control,
.es-dt-controls .form-select {
  min-width: 10rem;
}

@media (max-width: 575.98px) {
  .es-dt-controls .form-control,
  .es-dt-controls .form-select {
    min-width: 100%;
  }
}

/* Sortable headers */
th[data-esdt-col] {
  cursor: pointer;
  user-select: none;
}

/* Default faint arrow (single system) */
th[data-esdt-col]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: .35rem;
  border-left: .28rem solid transparent;
  border-right: .28rem solid transparent;
  border-top: .38rem solid rgba(0,0,0,.25);
  vertical-align: middle;
  opacity: .4;
}

[data-bs-theme="dark"] th[data-esdt-col]::after {
  border-top-color: rgba(255,255,255,.35);
}

/* Active sort states (JS toggles these classes) */
th.esdt-sort-asc::after {
  transform: rotate(180deg);
  opacity: .9;
}

th.esdt-sort-desc::after {
  opacity: .9;
}

/* Pager polish */
.pagination.pagination-sm .page-link {
  padding: .35rem .65rem;
  font-size: .875rem;
}

/* Date wrapping + responsive short format */
.es-date-wrap { white-space: normal; }

@media (max-width: 575.98px) {
  .table-sm td,
  .table-sm th {
    padding-top: .5rem;
    padding-bottom: .5rem;
  }
  .es-date-wrap { max-width: 7.5rem; }
}

.es-date-short { display: none; }
.es-date-full  { display: inline; }

@media (max-width: 575.98px) {
  .es-date-full  { display: none; }
  .es-date-short { display: inline; }
  .es-date-cell { white-space: normal; }
}

/* Stabilize small-table column behavior */
.es-dt-table { table-layout: fixed; }
.es-dt-table th, .es-dt-table td { vertical-align: middle; }

/* Optional column widths */
.es-col-date { width: 92px; }
.es-col-ref  { width: 160px; }
.es-col-res  { width: 92px; }
.es-col-prz  { width: 84px; }

/* === eScratch DataTables layout fixes (wallet/tickets) === */
.es-dt-table{
  table-layout: auto;          /* prevent forced character wrapping on narrow screens */
  width: 100%;
}

.es-dt-table th,
.es-dt-table td{
  vertical-align: middle;
  white-space: nowrap;         /* default: keep cells readable */
}

.es-dt-table td.es-game-cell{
  white-space: normal;         /* allow game name to wrap naturally */
}

@media (max-width: 575.98px){
  .table-responsive > .es-dt-table{
    min-width: 720px;          /* force horizontal scroll instead of collapsing columns */
  }
}

/* Column width hints */
.es-dt-table th.es-col-date,
.es-dt-table td.es-date-cell{ min-width: 160px; }

.es-dt-table th.es-col-ref,
.es-dt-table td.es-ref-cell{ min-width: 130px; }

.es-dt-table th.es-col-game,
.es-dt-table td.es-game-cell{ min-width: 220px; }

.es-dt-table th.es-col-res,
.es-dt-table td.es-res-cell{ min-width: 110px; }

.es-dt-table th.es-col-prz,
.es-dt-table td.es-prize-cell{ min-width: 110px; }
