/**
 * CRM dense list tables — keep the same layout, fit the viewport without left/right scroll.
 * Usage:
 *   <div class="crm-dense-table-wrap">
 *     <table class="table ... crm-dense-table">...</table>
 *   </div>
 * Hide secondary columns with Bootstrap: d-none d-md-table-cell / d-lg-table-cell / d-xl-table-cell
 * Show stacked meta under a primary cell with: <div class="crm-dense-meta d-lg-none">...</div>
 */
.crm-dense-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.crm-dense-table {
  width: 100% !important;
  max-width: 100%;
  table-layout: fixed;
  margin-bottom: 0;
}

.crm-dense-table thead th {
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.4rem !important;
  white-space: nowrap;
  vertical-align: middle;
}

.crm-dense-table tbody td {
  padding: 0.5rem 0.4rem !important;
  font-size: 0.8rem;
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.crm-dense-table .crm-dense-clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-dense-table .crm-dense-meta {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  line-height: 1.25;
  color: #8392ab;
}

.crm-dense-table .crm-dense-actions,
.crm-dense-table .support-col-actions {
  width: 1%;
  white-space: nowrap !important;
  text-align: end;
}

.crm-dense-table .crm-dense-actions .btn,
.crm-dense-table .support-row-actions .btn {
  padding: 0.25rem 0.4rem;
}

.crm-dense-table .avatar.avatar-sm {
  width: 1.6rem;
  height: 1.6rem;
  min-width: 1.6rem;
}

.crm-dense-table .badge {
  white-space: normal;
  max-width: 100%;
}

/* Compact on tablets / phones */
@media (max-width: 991.98px) {
  .crm-dense-table thead th,
  .crm-dense-table tbody td {
    padding: 0.4rem 0.3rem !important;
  }

  .crm-dense-table .crm-dense-hide-avatar {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .crm-dense-table thead th {
    font-size: 0.6rem;
  }

  .crm-dense-table tbody td {
    font-size: 0.75rem;
  }
}
