/* Style rules for SearchKit Admin
   Forked on 19 July 24. Called on SearchKit Admin pages
   Status: merged */

table.crm-sticky-header > thead > tr {
  position: sticky !important;
  top: var(--crm-menubar-bottom, 0px);
  z-index: 2;
}
.crm-search-display-table > table.table > thead > tr > th.crm-search-result-select {
  padding-inline: 0;
  text-transform: none;
  color: initial;
  min-width: 95px; /* Don't allow button to be split on 2 lines */
}
.crm-search-display-table > table.table > thead > tr > th i.crm-search-table-column-sort-icon + .crm-search-display-table-column-label {
  margin-left: 0 !important;
}
.crm-search-display.crm-search-display-table tfoot > tr > td {
  font-weight: bold;
}

/* Afform tables */
#bootstrap-theme td.crm-search-col-type-buttons {
  padding: var(--crm-table-padding) calc(var(--crm-table-padding) - var(--crm-s)) calc(var(--crm-table-padding) - var(--crm-s)) var(--crm-table-padding);
  --crm-btn-margin: 0 var(--crm-s) var(--crm-s) 0;
}
#bootstrap-theme td:is(.crm-search-col-type-buttons,.crm-search-col-type-menu) {
  width: 1px; /* shrinks cell to width of button/menu */
}
#bootstrap-theme th.crm-search-result-select button.btn {
  background: transparent;
  padding: var(--crm-xs1) var(--crm-m1);
}
#bootstrap-theme th.crm-search-result-select button.btn:hover,
#bootstrap-theme th.crm-search-result-select button.btn:focus {
  background: transparent;
}
#bootstrap-theme th.crm-search-result-select button.btn i.crm-i {
  color: var(--crm-c-text);
  min-width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
}
.crm-search-display-table table {
  border: var(--crm-table-outside-border);
  box-shadow: var(--crm-block-shadow);
}

/* Nested styling for hierarchical rows */
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-row {
  position: relative;
}
#bootstrap-theme .crm-search-display-table crm-search-display-toggle-collapse {
  position: relative;
  z-index: 1;
}

/* Depth >= 1 */
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-child:first-child:not(.crm-search-ctrl-column), #bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-child {
  padding-left: 2.5rem;
}
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-child:first-child:not(.crm-search-ctrl-column):before,
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-child:before {
  content: "";
  position: absolute;
  top: 0;
  left: 1rem;
  width: 1rem;
  height: 50%;
  border-bottom: 2px dotted currentColor;
  border-left: 2px dotted currentColor;
}
#bootstrap-theme .crm-search-display-table .crm-hierarchical-depth-1 crm-search-display-toggle-collapse {
  left: 1.5rem;
}
/* Depth = 2 */
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-depth-2:first-child:not(.crm-search-ctrl-column),
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-depth-2 {
  padding-left: 4rem;
}
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-depth-2:first-child:not(.crm-search-ctrl-column):before,
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-depth-2:before {
  left: 2.5rem;
}
#bootstrap-theme .crm-search-display-table .crm-hierarchical-depth-2 crm-search-display-toggle-collapse {
  left: 3rem;
}
/* Depth = 3 */
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-depth-3:first-child:not(.crm-search-ctrl-column),
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-depth-3 {
  padding-left: 5.5rem;
}
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-depth-3:first-child:not(.crm-search-ctrl-column):before,
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-depth-3:before {
  left: 4rem;
}
#bootstrap-theme .crm-search-display-table .crm-hierarchical-depth-3 crm-search-display-toggle-collapse {
  left: 4.5rem;
}
/* Depth = 4 */
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-depth-4:first-child:not(.crm-search-ctrl-column),
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-depth-4 {
  padding-left: 7rem;
}
#bootstrap-theme .crm-search-display-table tr td.crm-hierarchical-depth-4:first-child:not(.crm-search-ctrl-column):before,
#bootstrap-theme .crm-search-display-table tr td.crm-search-ctrl-column + td.crm-hierarchical-depth-4:before {
  left: 5.5rem;
}
#bootstrap-theme .crm-search-display-table .crm-hierarchical-depth-4 crm-search-display-toggle-collapse {
  left: 6rem;
}
