/* ============================================================
   TRANSACTION TABLE — charges and payouts list
   Used on Billing Overview, Charges, Payouts tabs.
   Extends the base table.css pattern.
   ============================================================ */

.tx-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}

.tx-table__head {
  display: grid;
  grid-template-columns: 130px 1fr 120px 120px 120px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.tx-table__row {
  display: grid;
  grid-template-columns: 130px 1fr 120px 120px 120px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
}

.tx-table__row:last-child {
  border-bottom: none;
}

.tx-table__row:hover {
  background: var(--bg-subtle);
}

@media (max-width: 720px) {
  .tx-table__head {
    display: none;
  }
  .tx-table__row {
    grid-template-columns: 1fr auto;
    gap: var(--space-2);
    padding: var(--space-3);
  }
  .tx-table__row > *:nth-child(n+3) { display: none; }
}

.tx-table__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.tx-table__description {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tx-table__description-title {
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.tx-table__description-detail {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.tx-table__amount {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-align: right;
}

.tx-table__amount--positive {
  color: var(--color-success-text);
}

.tx-table__amount--refund {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/* Status pill */
.tx-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.005em;
}

.tx-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  flex-shrink: 0;
}

.tx-status--paid {
  background: var(--color-success-subtle);
  color: var(--color-success-text);
}

.tx-status--refunded {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  border: 1px solid var(--border-strong);
}

.tx-status--pending {
  background: var(--color-warning-subtle);
  color: var(--color-warning-text);
}

.tx-status--failed {
  background: var(--color-danger-subtle);
  color: var(--color-danger-text);
}

/* Invoice download link */
.tx-table__invoice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
}

.tx-table__invoice:hover {
  text-decoration: underline;
}

.tx-table__invoice svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.tx-table__invoice--disabled {
  color: var(--text-tertiary);
  pointer-events: none;
  opacity: 0.6;
}
