/* Stage 35 mobile refinement: scope to screen and dashboard, no financial logic or print changes. */
@media screen and (max-width:767px){
  html,body{max-width:100%;overflow-x:clip}
  .clinic-topbar{display:flex!important;align-items:center;gap:8px;padding-inline:12px;min-width:0}
  .clinic-topbar .sidebar-toggle{flex:0 0 42px}
  .clinic-topbar .global-search{flex:1 1 0;min-width:0;width:auto!important;max-width:none!important;margin:0!important}
  .clinic-topbar .global-search input{min-width:0;width:100%;font-size:14px!important;text-overflow:ellipsis}
  .clinic-topbar .topbar-user{flex:0 0 auto;min-width:0;max-width:48px;overflow:hidden;gap:0!important}
  .clinic-topbar .topbar-user .hp28-user-details{display:none!important}
  .clinic-topbar .topbar-user .profile-avatar{flex-shrink:0}
  .clinic-topbar .topbar-logout{display:none!important}
  .dashboard-kpis,.hp-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .dashboard-kpis .stat,.hp-kpi-grid > *{min-width:0!important;overflow:hidden;isolation:isolate;overflow-wrap:break-word}
  .dashboard-kpis .stat::before,.dashboard-kpis .stat::after,.dashboard-kpis .stat .stat-watermark{display:none!important}
  .dashboard-kpis .stat small{font-size:11px!important;line-height:1.35!important;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:normal;hyphens:none}
  .dashboard-kpis .stat > span:not(.stat-icon){font-size:12px!important;line-height:1.35!important}
  .dashboard-kpis .stat b{font-size:clamp(19px,5vw,26px)!important;line-height:1.2!important}
  .dashboard-kpis .stat-icon{position:relative;z-index:1}
  .hp24-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .hp24-action-grid a{min-width:0!important}
  .dashboard-columns,.hp25-overview{min-width:0}
  .dashboard-columns .panel{min-width:0}
  .panel .tablewrap,.tablewrap{max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .panel .tablewrap table,.tablewrap table{width:max-content;min-width:100%;table-layout:auto}
  .panel .tablewrap th,.panel .tablewrap td{white-space:nowrap;overflow-wrap:normal}
  .hp-approval-panel{min-width:0}
  .hp-approval-panel h2{font-size:clamp(19px,5vw,24px);line-height:1.25}
  /* Compact stacked date inputs without altering their submitted values. */
  form:has(input[type=date]){row-gap:10px}
  form:has(input[type=date]) label{margin-bottom:4px}
  form:has(input[type=date]) input[type=date]{min-height:44px}
}
@media screen and (max-width:380px){
  .dashboard-kpis .stat{padding:10px!important}
  .dashboard-kpis .stat small{font-size:10px!important}
  .clinic-topbar .topbar-user{max-width:38px}
}
