/* ==========================================================================
   BIZWAVE ERP — TABLES (QuickBooks Data Table Style)
   ========================================================================== */

.erp-table-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  box-sizing: border-box;
}

.erp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  color: var(--c-text);
  text-align: left;
}

/* Table Header */
.erp-table thead th {
  background-color: #F4F5F8;
  color: var(--c-text);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.erp-table thead th.is-sortable {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.erp-table thead th.is-sortable:hover {
  background-color: #EAECEF;
}

.erp-table thead th .sort-indicator {
  display: inline-block;
  margin-left: var(--sp-1);
  color: var(--c-text-2);
  vertical-align: middle;
}

/* Table Body */
.erp-table tbody tr {
  transition: background-color var(--transition-fast);
}

.erp-table tbody tr:hover {
  background-color: var(--c-row-hover);
}

.erp-table tbody tr.is-selected {
  background-color: var(--c-primary-tint);
}

.erp-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);
  vertical-align: middle;
  white-space: nowrap;
}

.erp-table tbody tr:last-child td {
  border-bottom: none;
}

/* First Column: Link Blue Identifier */
.erp-table tbody td:first-child .table-link,
.erp-table tbody td.col-id a {
  color: var(--c-link);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.erp-table tbody td:first-child .table-link:hover,
.erp-table tbody td.col-id a:hover {
  text-decoration: underline;
  color: var(--c-link-hover);
}

/* Numeric & Money Alignment */
.erp-table th.col-number,
.erp-table td.col-number,
.erp-table th.col-money,
.erp-table td.col-money,
.erp-table th.col-percent,
.erp-table td.col-percent {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Checkbox Column */
.erp-table th.col-check,
.erp-table td.col-check {
  width: 40px;
  text-align: center;
  padding-left: var(--sp-3);
  padding-right: var(--sp-2);
}

/* Action Column */
.erp-table th.col-actions,
.erp-table td.col-actions {
  text-align: right;
  width: 140px;
  padding-right: var(--sp-4);
}

/* Totals / Summary Row */
.erp-table tfoot td {
  background-color: #F9FAFB;
  font-weight: var(--fw-bold);
  border-top: 2px solid var(--c-border);
  padding: var(--sp-3) var(--sp-4);
  color: var(--c-text);
}
