/* CRM V64 targeted fixes based on latest feedback */

/* Receptionist header: keep doctor filter and walk-in button on the same row */
#page-receptionist > .section-header{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
}
#page-receptionist > .section-header > div:last-child{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex-wrap:nowrap!important;
}
#page-receptionist > .section-header > div:last-child select{
  width:140px!important;
  min-width:140px!important;
  height:40px!important;
  font-size:12px!important;
  padding:0 12px!important;
  border:1px solid #d6e0ec!important;
  border-radius:10px!important;
  background:#fbfcfe!important;
}
#page-receptionist > .section-header > div:last-child .btn,
#page-receptionist > .section-header > div:last-child button{
  min-width:96px!important;
}

/* Lab tests: remove header chips and keep clean header */
#page-labtests .crm-lab-command-header{
  grid-template-columns:minmax(240px,1fr) auto!important;
}
#page-labtests .crm-lab-command-header .crm-unified-command-center,
#page-labtests .crm-lab-command-header .crm-unified-header-stats{
  display:none!important;
}

/* Medication page clean-up */
#page-medications .docx-search-card,
#page-medications #med-shopify-admin-system{
  display:none!important;
}
#page-medications .crm-med-records-card{
  margin-top:0!important;
}
#page-medications .crm-med-list-table{
  table-layout:auto!important;
}
#page-medications .crm-med-list-table th:last-child,
#page-medications .crm-med-list-table td:last-child{
  width:230px!important;
  min-width:230px!important;
}
#page-medications .crm-med-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  flex-wrap:nowrap!important;
  white-space:nowrap!important;
}
#page-medications .crm-med-view-prescription,
#page-medications .crm-med-secondary-action{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
}
#page-medications .crm-med-secondary-action{
  min-width:56px!important;
}
#page-medications .crm-med-mobile-item .crm-med-actions{
  justify-content:flex-start!important;
}

/* Medication filters should start directly with the unified filter */
#page-medications #crm-u-med-filter{
  margin-top:0!important;
}

@media(max-width:980px){
  #page-receptionist > .section-header > div:last-child select{
    width:128px!important;
    min-width:128px!important;
  }
  #page-medications .crm-med-list-table th:last-child,
  #page-medications .crm-med-list-table td:last-child{
    width:210px!important;
    min-width:210px!important;
  }
}

@media(max-width:760px){
  #page-receptionist > .section-header{
    flex-direction:column!important;
    align-items:stretch!important;
  }
  #page-receptionist > .section-header > div:last-child{
    width:100%!important;
    justify-content:stretch!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
  }
  #page-receptionist > .section-header > div:last-child select,
  #page-receptionist > .section-header > div:last-child .btn,
  #page-receptionist > .section-header > div:last-child button{
    width:100%!important;
    min-width:0!important;
  }
  #page-medications .crm-med-actions{
    flex-wrap:wrap!important;
  }
}
