.smart-table { table-layout: fixed; }

.smart-table-wrap.table-responsive {
  overflow: visible;
}
.smart-table-wrap .smart-table thead,
.smart-table-wrap .smart-table thead th {
  overflow: visible;
}

.smart-table th,
.smart-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}

/* Keeps cell tidy even if the column is narrow */
.smart-table td {
  vertical-align: middle;
}

.smart-table th {
  cursor: grab;
  position: relative;
}

/*  multi-select */
.smart-table-multi__list {
  max-height: 220px;
  overflow: auto;
}

.smart-table th.dragging {
  opacity: 0.6;
  cursor: grabbing;
}

/* Resize handle */
.smart-table .col-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  touch-action: none;

  /* Visual affordance */
  background: transparent;
}

/* Visible vertical grip line */
.smart-table .col-resize-handle::before {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 1px;
}

/* Hover state */
.smart-table th:hover .col-resize-handle::before {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Active drag state (optional but recommended) */
.smart-table .col-resize-handle:active::before {
  background-color: rgba(0, 0, 0, 0.8);
}

.smart-table-col--actions { width: 3%; }
.smart-table-th--actions,
.smart-table-td--actions {
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.smart-table-multiselect__menu {
  max-height: 240px;
  overflow: auto;
  min-width: 220px;
}

.smart-table-multiselect__label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.smart-table-cell--currency {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.smart-table td.smart-table-cell--img {
  text-align: center;
}

/* Default image cell styling */
.smart-table-img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  /* max-height: 48px;          /* default */
  object-fit: contain;       /* preserve full image */
  border-radius: 0.25rem;    /* subtle */
}




/* Grid layout */
.smart-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.smart-table-grid__tile {
  width: 100%;
}

/* Placeholder shown when no image is present */
.smart-table-grid__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
  color: #adb5bd;
}

/* Placeholder text */
.smart-table-grid__placeholder-text {
  font-size: 0.85rem;
}

/* Link wrapper (optional styling) */
.smart-table-grid__link {
  display: block;
  text-decoration: none;
}

/* Image base */
.smart-table-img {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}


/* Optional sizes */
.smart-table-img--xs { max-height: 24px; }
.smart-table-img--sm { max-height: 32px; }
.smart-table-img--md { max-height: 80px; }
.smart-table-img--lg { max-height: 140px; }
.smart-table-img--xl { max-height: 220px; }

/* Make placeholder match heights so the grid stays uniform */
.smart-table-grid__placeholder { height: 140px; }            /* default */

/* If you want the placeholder to respect the chosen size, use size-specific wrappers */
.smart-table-grid__tile .smart-table-img--xs ~ .smart-table-grid__placeholder { height: 24px; }
.smart-table-grid__tile .smart-table-img--sm ~ .smart-table-grid__placeholder { height: 32px; }
.smart-table-grid__tile .smart-table-img--md ~ .smart-table-grid__placeholder { height: 80px; }
.smart-table-grid__tile .smart-table-img--lg ~ .smart-table-grid__placeholder { height: 140px; }
.smart-table-grid__tile .smart-table-img--xl ~ .smart-table-grid__placeholder { height: 220px; }

.smart-table-grid .smart-table-img--sm + .smart-table-grid__placeholder { height: 32px; } /* not used, but harmless */

.smart-table-delete-btn {
  padding: .12rem .25rem;
  font-size: .6rem;
  border-radius: .2rem;
}
