.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: var(--space-sm) var(--space-md);
  padding-bottom: var(--space-md);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table th:first-child {
  border-top-left-radius: var(--radius-lg);
}

.table th:last-child {
  border-top-right-radius: var(--radius-lg);
}

.table td {
  padding: var(--space-md) var(--space-md);
  font-size: var(--text-sm);
  color: var(--text);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Subtle row hover */
.table tr:hover td {
  background: var(--surface-hover);
}

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

/* Today row stripe */
.table__row--today td {
  background: var(--accent-muted);
}

.table__row--today td:first-child {
  border-left: 3px solid var(--accent);
}

/* Mobile responsive table → cards */
@media (max-width: 768px) {
  .table--responsive thead {
    display: none;
  }

  .table--responsive tbody tr {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
  }

  .table--responsive td {
    padding: 0;
    border: none;
    font-size: var(--text-sm);
  }

  .table--responsive td::before {
    content: attr(data-label);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
  }

  .table--responsive .text-data,
  .table--responsive strong {
    font-variant-numeric: tabular-nums;
  }
}
