/* Shared responsive layout. Desktop density and existing permission controls stay intact. */
@media screen {
  .hms-table-scroll{max-width:100%;min-width:0;overflow-x:auto!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scroll-padding:12px}
  .hms-table-scroll:focus-visible{outline:2px solid #956b3b;outline-offset:2px}
  .hms-table-hint{display:none;color:#657183;font-size:12px;margin:6px 0}
  [data-hms-viewport-panel]{box-sizing:border-box;min-width:0;max-width:min(100%,calc(var(--hms-vv-width,100vw) - 24px))!important;max-height:calc(var(--hms-vv-height,100vh) - 24px)!important;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:64px}
  [data-hms-dialog-actions]{position:sticky!important;bottom:0;z-index:4;background:var(--theme-soft,#fffaf5);padding:10px 4px max(10px,env(safe-area-inset-bottom,0px));display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;border-top:1px solid #e4ded6;box-sizing:border-box}
  [data-hms-dialog-head]{position:sticky;top:0;z-index:5;background:var(--theme-soft,#fffaf5)}
  dialog,[data-hms-viewport-panel]{scrollbar-gutter:stable}
}
@media screen and (max-width:1180px){
  body.hms-executive-ui .shell{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  body.hms-executive-ui :is(.shell,.card,.phx-card,.grid,.formGrid,.form-grid,.report-layout,.phx-grid,.phx-wrap,.med-wrap,.admin-layout,.rx-main)>*{min-width:0}
  body.hms-executive-ui :is(.drTableScroll,.tbl-wrap,.table-wrap,.table-scroll,.phx-table-wrap,.phx-table-scroll){max-width:100%;min-width:0;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  body.hms-executive-ui :is(.toolbar,.filter-bar,.form-actions,.actions,.med-toolbar,.phx-toolbar,.rx-topbar,.dashboardToolbar,.dashboardToolbar .leftGroup,.dashboardToolbar .rightGroup){flex-wrap:wrap;max-width:100%}
  body.hms-executive-ui :is(.tabs,.med-tabs,.phx-tabs,.rx-subtabs){max-width:100%;flex-wrap:wrap;white-space:normal}
  body.hms-executive-ui .drTableScroll .drDashboardTable{min-width:1120px}
  body.hms-executive-ui .drActionCell{white-space:normal!important;min-width:210px}
  .hms-table-hint[data-overflow=true]{display:block}
}
@media screen and (max-width:767px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body.hms-executive-ui select{min-width:0;overflow:hidden;text-overflow:ellipsis}
  body.hms-executive-ui fieldset{min-inline-size:0;max-width:100%;box-sizing:border-box}
  body.hms-executive-ui .shell{padding:10px!important;margin-inline:0!important}
  body.hms-executive-ui :is(.card,.phx-card,.section-card){padding:12px!important;border-radius:12px!important;max-width:100%;box-sizing:border-box}
  body.hms-executive-ui :is(.formGrid,.form-grid,.grid-2,.grid-3,.grid-4,.editor-grid,.medGrid,.appearance-choices,.report-layout){grid-template-columns:minmax(0,1fr)!important}
  body.hms-executive-ui :is(.kpi-grid,.summary-strip,.tileRow,.tileGrid){grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.hms-executive-ui :is(.drKpiStrip,.phPatientKpiStrip){display:grid;grid-template-columns:minmax(0,1fr);width:100%;min-width:0}
  body.hms-executive-ui :is(.drKpiGroup,.phPatientKpiGroup){min-width:0;width:auto}
  body.hms-executive-ui :is(.dashboardToolbar form,.drDateFilter,.filter-bar,.phx-filterbar){flex-wrap:wrap;max-width:100%;gap:8px}
  body.hms-executive-ui :is(.dashboardToolbar .searchInput,.searchInput,.dateInput){width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box}
  body.hms-executive-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){max-width:100%;box-sizing:border-box;font-size:16px!important}
  body.hms-executive-ui :is(.filter-bar input,.filter-bar select){min-width:0;flex:1 1 140px}
  body.hms-executive-ui :is(.tablePager,.pager2,.pagination){flex-wrap:wrap;max-width:100%}
  body.hms-executive-ui :is(.kv,.kv .k){min-width:0;overflow-wrap:anywhere}
  body.hms-executive-ui [data-hms-wide-table]{min-width:720px}
  body.hms-executive-ui [data-hms-viewport-overlay]{padding:8px!important}
  body.hms-executive-ui dialog{max-width:calc(var(--hms-vv-width,100vw) - 16px)!important;max-height:calc(var(--hms-vv-height,100vh) - 16px)!important}
  body.hms-executive-ui :is(.hms-date-preset-menu,.hms-time-menu,.search-results){max-width:calc(100vw - 24px);box-sizing:border-box}
  body.hms-executive-ui :is(.salary-tools-grid,.employee-form-grid,.pm-form-grid,.sbe-grid,.hms-patient-edit-grid){grid-template-columns:minmax(0,1fr)!important}
}
@media screen and (pointer:coarse){
  body.hms-executive-ui :is(button,.btn,.phx-btn,.global-shell-action,.global-shell-notify-btn,select,input:not([type=hidden]):not([type=checkbox]):not([type=radio])){min-height:44px!important;touch-action:manipulation}
  body.hms-executive-ui :is(.dn-edit,.hms-note-icon,[aria-label][class*=icon]){min-width:44px;min-height:44px}
  body.hms-executive-ui :is(textarea,input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){font-size:16px!important}
  body.hms-executive-ui :is(.drKpiMetric,.phPatientKpiMetric){min-width:44px}
  body.hms-executive-ui input:is([type=checkbox],[type=radio]){width:20px;height:20px;margin:8px;flex-shrink:0}
  body.hms-executive-ui label:has(> input[type=checkbox]),body.hms-executive-ui label:has(> input[type=radio]){min-height:44px}
}
@media print{.hms-table-hint{display:none!important}.hms-table-scroll{overflow:visible!important;max-width:none!important}[data-hms-dialog-actions],[data-hms-dialog-head]{position:static!important}}

.hms-mobile-nav-toggle{display:none!important}
@media screen and (max-width:767px){
 body.hms-executive-ui .hms-mobile-nav-toggle{display:inline-flex!important;align-items:center;justify-content:space-between;min-height:44px!important;max-width:100%;white-space:normal;text-align:left}
 body.hms-executive-ui .hms-mobile-nav:not([data-mobile-open=true]){display:none!important}
 body.hms-executive-ui :is(.topbar,.rx-topbar){position:relative!important;top:auto!important;flex-wrap:wrap;gap:8px!important}
 body.hms-executive-ui .rx-left{flex-wrap:wrap}
 body.hms-executive-ui .hms-mobile-nav[data-mobile-open=true]{width:100%;flex-basis:100%;display:flex!important;flex-wrap:wrap!important;gap:6px!important}
 body.hms-executive-ui .hms-mobile-nav a{flex:1 1 140px;white-space:normal}
}
@media screen and (pointer:coarse),screen and (max-width:767px){
 body.hms-executive-ui .hms-table-scroll table :is(th,td){font-size:13px!important;line-height:1.4}
 body.hms-executive-ui .hms-table-scroll table :is(.small,.muted,.drPatientMeta,.drPatientLast,.drRegisteredTime,.drBillingActivity){font-size:12px!important}
 .hms-table-hint[data-overflow=true]{display:block}
}
