/* MH-ADMIN V18.25.39 — sticky task column header */
@media (min-width:1300px){
  /* overflow:auto on this wrapper was preventing viewport-sticky TH cells. */
  #tasksSection,
  #tasksSection #taskList,
  #tasksSection .task-table-wrap{
    overflow:visible!important;
  }

  #tasksSection .mh35-readonly-table thead th{
    position:-webkit-sticky!important;
    position:sticky!important;
    top:0!important;
    z-index:120!important;
    background:#f4eeee!important;
    color:#171717!important;
    box-shadow:0 2px 0 rgba(185,39,45,.12),0 5px 12px rgba(0,0,0,.06)!important;
  }

  #tasksSection .mh35-readonly-table thead{
    position:relative;
    z-index:119;
  }
}

/* Keep the existing horizontal table scroll on narrower screens. */
@media (max-width:1299px){
  #tasksSection .task-table-wrap{overflow:auto!important}
}


/* MH-ADMIN V18.25.41
   Sticky task header is only visible while the task LIST itself is active.
   When any modal/dialog is open, the background table header must not float
   above the modal. */
@media (min-width:1300px){
  body:has(.modal.open) #tasksSection .mh35-readonly-table thead,
  body:has(.modal.open) #tasksSection .mh35-readonly-table thead th,
  body:has([role="dialog"][open]) #tasksSection .mh35-readonly-table thead,
  body:has([role="dialog"][open]) #tasksSection .mh35-readonly-table thead th{
    visibility:hidden!important;
    pointer-events:none!important;
    box-shadow:none!important;
  }

  /* Extra guard for the known task/detail modals. */
  body:has(#detailModal.open) #tasksSection .mh35-readonly-table thead,
  body:has(#detailModal.open) #tasksSection .mh35-readonly-table thead th,
  body:has(#taskModal.open) #tasksSection .mh35-readonly-table thead,
  body:has(#taskModal.open) #tasksSection .mh35-readonly-table thead th{
    visibility:hidden!important;
    pointer-events:none!important;
  }
}
