/* V61 Patient sort menu styled like the All Appointments sort menu */
#page-patients .crm-patient-filter-panel,
#page-patients .crm-inline-filter-panel,
#page-patients .crm-inline-filter-head,
#page-patients .card,
#page-patients .tbl-wrap{
  overflow:visible!important;
}

#page-patients .crm-inline-clear{
  display:none!important;
}

.crm-patient-sort-wrap{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  flex:0 0 auto!important;
  margin-left:0!important;
  z-index:2147482999!important;
}

.crm-patient-sort-btn{
  width:44px!important;
  min-width:44px!important;
  height:40px!important;
  min-height:40px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  border:1px solid #ffc5b4!important;
  border-radius:10px!important;
  background:#fff7f3!important;
  color:#e44822!important;
  cursor:pointer!important;
  box-shadow:none!important;
}

.crm-patient-sort-btn:hover,
.crm-patient-sort-btn[aria-expanded="true"]{
  background:#ff5c35!important;
  border-color:#ff5c35!important;
  color:#fff!important;
}

.crm-patient-sort-btn svg{
  width:17px!important;
  height:17px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

.crm-patient-sort-menu{
  position:absolute!important;
  right:0!important;
  top:46px!important;
  width:240px!important;
  max-height:min(430px,70vh)!important;
  overflow:auto!important;
  padding:8px!important;
  border:1px solid #dbe4ef!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 18px 46px rgba(15,23,42,.18)!important;
  z-index:2147483000!important;
  display:none!important;
}

.crm-patient-sort-menu.open{
  display:block!important;
}

.crm-patient-sort-title{
  padding:7px 9px 5px!important;
  color:#8a9ab0!important;
  font-size:9px!important;
  font-weight:900!important;
  letter-spacing:.1em!important;
  text-transform:uppercase!important;
}

.crm-patient-sort-menu-divider{
  height:1px!important;
  margin:6px 4px!important;
  background:#edf1f6!important;
}

.crm-patient-sort-option{
  width:100%!important;
  min-height:34px!important;
  padding:7px 9px!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#2a3d54!important;
  font-size:11px!important;
  font-weight:750!important;
  text-align:left!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  cursor:pointer!important;
}

.crm-patient-sort-option:hover{
  background:#f6f8fb!important;
}

.crm-patient-sort-option.active{
  background:#fff1ec!important;
  color:#d94825!important;
  font-weight:900!important;
}

.crm-patient-sort-option .crm-sort-check{
  opacity:0!important;
  color:#ff5c35!important;
  font-size:13px!important;
  font-weight:900!important;
}

.crm-patient-sort-option.active .crm-sort-check{
  opacity:1!important;
}

body.crm-night-mode .crm-patient-sort-btn{
  background:#202936!important;
  border-color:#3b485b!important;
  color:#e5ecf5!important;
}

body.crm-night-mode .crm-patient-sort-btn:hover,
body.crm-night-mode .crm-patient-sort-btn[aria-expanded="true"]{
  background:#3a2925!important;
  border-color:#a35c49!important;
  color:#ff987d!important;
}

body.crm-night-mode .crm-patient-sort-menu{
  background:#1d2633!important;
  border-color:#364356!important;
}

body.crm-night-mode .crm-patient-sort-option{
  color:#dce5f0!important;
}

body.crm-night-mode .crm-patient-sort-option:hover{
  background:#273244!important;
}

body.crm-night-mode .crm-patient-sort-option.active{
  background:#3a2925!important;
  color:#ff987d!important;
}

body.crm-night-mode .crm-patient-sort-menu-divider{
  background:#334054!important;
}

#page-patients .crm-source-sort-field{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 44px!important;
  grid-template-rows:auto auto!important;
  column-gap:8px!important;
  row-gap:6px!important;
  align-items:end!important;
}

#page-patients .crm-source-sort-field > span{
  grid-column:1 / -1!important;
  grid-row:1!important;
}

#page-patients .crm-source-sort-field > #filter-source{
  grid-column:1!important;
  grid-row:2!important;
  min-width:0!important;
}

#page-patients .crm-source-sort-field > .crm-patient-sort-wrap{
  grid-column:2!important;
  grid-row:2!important;
  width:44px!important;
  align-self:end!important;
}

#page-patients .crm-source-sort-field .crm-patient-sort-btn{
  width:44px!important;
  min-width:44px!important;
}

@media(max-width:760px){
  .crm-patient-sort-wrap{
    width:100%!important;
  }
  .crm-patient-sort-menu{
    left:auto!important;
    right:0!important;
    width:min(240px,calc(100vw - 32px))!important;
  }
  #page-patients .crm-source-sort-field{
    grid-template-columns:minmax(0,1fr) 44px!important;
  }
}
