/* Apply the same header size to sortable, plain, and custom table headings. */
th,
thead td,
.MuiTableHead-root .MuiTableCell-root,
.MuiTableCell-head,
[role="columnheader"],
th :not(svg):not(svg *),
thead td :not(svg):not(svg *),
.MuiTableHead-root .MuiTableCell-root :not(svg):not(svg *),
.MuiTableCell-head :not(svg):not(svg *),
[role="columnheader"] :not(svg):not(svg *) {
  font-size: 12px !important;
  white-space: nowrap !important;
}

th,
thead td,
.MuiTableHead-root .MuiTableCell-root,
[role="columnheader"] {
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 20px !important;
  height: auto;
}

/* Keep each label and its sort arrow together on one line. */
th .MuiTableSortLabel-root,
thead .MuiTableSortLabel-root,
[role="columnheader"] .MuiTableSortLabel-root {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap !important;
  overflow-wrap: normal;
  align-items: center;
  line-height: 20px !important;
  font-size: 12px !important;
}

.MuiTableSortLabel-root .table-header-label {
  min-width: 0;
  white-space: nowrap !important;
  overflow-wrap: normal;
}

thead .MuiTableSortLabel-icon,
th .MuiTableSortLabel-icon,
[role="columnheader"] .MuiTableSortLabel-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0 0 0 4px;
}

/* Keep columns bounded so long row values can be truncated. */
.MuiTableContainer-root {
  overflow-x: auto !important;
}

table {
  table-layout: fixed !important;
  max-width: none !important;
}

/* Constrain row text to its column without changing action or badge layouts. */
tbody td,
.MuiTableCell-body,
tbody td .MuiTypography-root,
tbody td > a,
tbody td > span:not(.MuiButtonBase-root):not(.MuiChip-root),
.MuiTableCell-body .MuiTypography-root {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal !important;
  word-break: normal !important;
  min-width: 0;
  max-width: 100%;
}


/* Truncate plain headings and nested labels within their column. */
th, thead td, .MuiTableCell-head { overflow: hidden; text-overflow: ellipsis; }
th .MuiTableSortLabel-root, thead .MuiTableSortLabel-root { overflow: hidden; }
th .MuiTableSortLabel-root > span:not(.MuiTableSortLabel-icon) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
