tr.gridjs-tr.gridjs-tr-clickable {
  td.gridjs-td * {
    cursor: pointer;
  }

  td.gridjs-td *:not(.badge, .badge *) {
    color: var(--bs-primary) !important;
  }
}

/* Sub-table "cards" layout (renderTable's layout=>'cards' option). Same
   <table>/<tr>/<td> markup as the plain table — add/delete-row, validation
   and CSRF wiring are all untouched — this only re-skins it visually, using
   the data-label each <td> now carries in place of the hidden <thead>. */
table.card-grid-table {
  border: none;
  background: transparent;

  > thead {
    display: none;
  }

  > tbody.gridjs-tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    background: transparent;

    > tr[data-index] {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      position: relative;
      background: var(--bs-body-bg);
      border: 1px solid var(--bs-border-color);
      border-radius: 0.75rem;
      padding: 1rem 1rem 2.75rem;

      > td {
        display: block;
        border: none !important;
        padding: 0;
        background: transparent;

        &[data-label]:not(.d-none)::before {
          content: attr(data-label);
          display: block;
          font-size: 0.75rem;
          font-weight: 600;
          color: var(--bs-gray-600);
          margin-bottom: 0.25rem;
        }

        &:not([data-label]) {
          position: absolute;
          bottom: 0.75rem;
          right: 1rem;
          width: auto;
        }
      }
    }
  }
}
/* The action column stays in view while a wide grid scrolls sideways, pinned
   to whichever side Settings > Appearance puts it on (the first or the last
   column). An opaque background — the card's, which follows the light/dark
   theme (--kt-*, not --bs-*) — so the columns scrolling under it don't show
   through. The cards layout has no columns to pin. */
table.gridjs-table:not(.card-grid-table) {
  th[data-column-id="actions"],
  td[data-column-id="actions"] {
    position: sticky;
    z-index: 1;
    background-color: var(--kt-card-bg, var(--bs-card-bg));
  }

  th[data-column-id="actions"]:first-child,
  td[data-column-id="actions"]:first-child {
    left: 0;
    box-shadow: inset -1px 0 0 var(--kt-border-color, var(--bs-border-color));
  }

  th[data-column-id="actions"]:last-child,
  td[data-column-id="actions"]:last-child {
    right: 0;
    box-shadow: inset 1px 0 0 var(--kt-border-color, var(--bs-border-color));
  }
}
