/* Responsive card mode for every view table (2026-08-17).
   Desktop keeps the table; under 768px each row becomes a labelled card.
   Labels come from data-label attributes stamped by erpal-resptable.js. */

@media (max-width: 767px) {
  table.erpal-resptable thead { display: none; }
  table.erpal-resptable, table.erpal-resptable tbody { display: block; width: 100%; }

  table.erpal-resptable tbody tr {
    display: block;
    margin: 0 0 .65rem;
    padding: .55rem .8rem;
    border: 1px solid var(--erpal-border, #e5e7eb);
    border-radius: 10px;
    background: var(--erpal-surface, #fff);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  }

  table.erpal-resptable tbody td {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .18rem 0;
    border: 0;
    font-size: .85rem;
    overflow-wrap: break-word;
    min-width: 0;
  }

  table.erpal-resptable tbody td::before {
    content: attr(data-label);
    flex: 0 0 34%;
    max-width: 34%;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--erpal-muted, #6b7280);
  }

  /* Empty cells add nothing on a card. */
  table.erpal-resptable tbody td:empty { display: none; }

  /* Bulk-select checkbox column: no label, inline compact. */
  table.erpal-resptable tbody td.views-field-operations::before,
  table.erpal-resptable tbody td:has(> input[type="checkbox"]:only-child)::before { content: none; }
  table.erpal-resptable tbody td:has(> input[type="checkbox"]:only-child) { padding: 0 0 .25rem; }

  /* Phone cells: keep call + text side by side, numbers unbroken. */
  table.erpal-resptable .erpal-celllink { white-space: nowrap; }
}

@media (max-width: 767px) {
  table.erpal-resptable tbody td.erpal-td-empty { display: none; }
}
