/* Block-level host that is allowed to shrink inside grid/flex parents.
   Without min-width: 0 a wide table forces its parent card to grow past
   its container (grid items default to min-width: auto), which is exactly
   the "table overflows the card" bug on Customers/Transactions. */
/* Encapsulation is None, so target the element selector directly
   (:host would not match). */
app-table {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.app-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color, #e4e4e7);
  border-radius: var(--radius-lg, 10px);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-base, 0.875rem);
  color: var(--text-primary, #1f322d);

  thead {
    background: var(--bg-secondary, #f4f4f5);
  }

  th {
    text-align: left;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-secondary, #6b7280);
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    border-bottom: 1px solid var(--border-color, #e4e4e7);
    white-space: nowrap;
  }

  td {
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    border-bottom: 1px solid var(--border-color, #e4e4e7);
    vertical-align: middle;
  }

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

  tbody tr:hover {
    background: var(--bg-secondary, #f4f4f5);
  }
}

.admin-density-compact .app-table {
  th, td {
    padding: var(--space-xs, 0.25rem) var(--space-md, 1rem);
  }
}
