/* =========================================================
   StockVault — Data tables
   ========================================================= */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--surface-muted);
  padding: 14px var(--s-4);
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
.table thead th:first-child { border-top-left-radius: var(--r-lg); }
.table thead th:last-child  { border-top-right-radius: var(--r-lg); }

.table tbody td {
  padding: 14px var(--s-4);
  font-size: var(--fs-base);
  color: var(--text);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--surface-muted); }

.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-actions { text-align: right; white-space: nowrap; width: 1%; }

.table .cell-product {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 220px;
}
.table .cell-thumb {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  box-shadow: var(--shadow-inset-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex: 0 0 auto;
  overflow: hidden;
}
.table .cell-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table .cell-name { font-weight: var(--fw-medium); }
.table .cell-sub { font-size: var(--fs-xs); color: var(--text-secondary); }

.table .row-actions {
  display: inline-flex;
  gap: 4px;
  opacity: 0.5;
  transition: opacity var(--t-fast) var(--ease-out);
}
.table tbody tr:hover .row-actions { opacity: 1; }
.table .row-actions .icon-btn { width: 32px; height: 32px; }

/* Row states */
.table tbody tr.is-selected { background: var(--accent-soft); }
.table tbody tr.is-disabled { opacity: 0.55; }

/* Checkbox column */
.table .col-check { width: 1%; }
.table .col-check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--divider);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.pagination__controls { display: inline-flex; gap: var(--s-2); align-items: center; }
.pagination__btn {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border: 0; border-radius: var(--r-sm);
  background: var(--surface-raised);
  color: var(--text-secondary);
  box-shadow: var(--shadow-raised-sm);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.pagination__btn:hover { color: var(--text); }
.pagination__btn[aria-current="true"] {
  color: var(--text);
  background: var(--surface-inset);
  box-shadow: var(--shadow-pressed);
}
.pagination__btn[disabled] { opacity: 0.45; cursor: not-allowed; }