.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 0.8rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  font-weight: 700;
  white-space: nowrap;
}
.table tbody tr:hover { background: #f9fbfa; }
.table tbody tr.row-owing-low { background: #fff8e6; }
.table tbody tr.row-owing-low:hover { background: #ffefc2; }
.table tbody tr.row-owing-high { background: #fdecea; }
.table tbody tr.row-owing-high:hover { background: #f9d6d2; }
.table tbody tr:last-child td { border-bottom: 0; }
.inline-form { display: inline-flex; margin: 0; }
.table-compact th, .table-compact td { padding: 0.55rem 0.75rem; }
.table .actions {
  display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end;
}
.table .col-num, .table .money { text-align: right; font-variant-numeric: tabular-nums; }
.table-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; flex-wrap: wrap;
  margin: 0.65rem 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Card list for narrow screens */
.mobile-cards { display: none; }
@media (max-width: 719px) {
  .table-responsive-cards .table-wrap { display: none; }
  .table-responsive-cards .mobile-cards { display: grid; gap: 0.75rem; }
  .mobile-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 0.95rem;
  }
  .mobile-card-row {
    display: flex; justify-content: space-between; gap: 0.75rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
  }
  .mobile-card-row span:first-child { color: var(--color-text-muted); }
}
