.ui-table-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-radius: var(--radius);
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: var(--surface-panel);
  color: var(--text-default);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.ui-table caption {
  padding: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: left;
}

.ui-table th,
.ui-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.ui-table thead th {
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.ui-table tbody th {
  color: var(--text-strong);
  font-weight: var(--font-weight-medium);
}

.ui-table tbody tr:last-child th,
.ui-table tbody tr:last-child td {
  border-bottom: 0;
}

.ui-table tfoot th,
.ui-table tfoot td {
  border-top: 1px solid var(--border-strong);
  border-bottom: 0;
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-weight: var(--font-weight-semibold);
}

.ui-table__numeric {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.ui-table__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
  white-space: nowrap;
}

.ui-table--compact th,
.ui-table--compact td {
  padding: var(--space-2) var(--space-3);
}

.ui-table--hover tbody tr {
  transition: background-color var(--transition-fast);
}

.ui-table--hover tbody tr:hover {
  background: var(--surface-hover);
}

.ui-table--bordered {
  border: 1px solid var(--border);
}

.ui-table--bordered th,
.ui-table--bordered td {
  border-right: 1px solid var(--border);
}

.ui-table--bordered th:last-child,
.ui-table--bordered td:last-child {
  border-right: 0;
}

.ui-table__nowrap {
  white-space: nowrap;
}

.ui-table__wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .ui-table th,
  .ui-table td {
    padding: var(--space-3);
  }

  .ui-table--compact th,
  .ui-table--compact td {
    padding: var(--space-2);
  }
}
