/* ===== Mobile dashboard fixes (phones only: max-width 767px). Desktop / tablet are NOT affected. ===== */
@media (max-width:767px){
  /* header: more compact so the page gets the screen space */
  .header{padding:8px 12px 0 !important}
  .header-top{padding-bottom:8px !important;gap:10px !important}
  .header .header-contact{display:none !important}
  .header .logo-wrap{width:38px !important;height:38px !important}
  .header .header-actions{display:grid !important;grid-template-columns:repeat(2,30px);grid-template-rows:repeat(2,30px);align-content:center;gap:5px !important;flex-shrink:0}
  .header .hbtn{width:30px !important;height:30px !important;font-size:14px !important;border-radius:9px !important}
  /* date / welcome bar: one line, name is never cut in the middle */
  .date-bar{padding:5px 12px !important;margin:0 -12px !important;font-size:11px !important;flex-wrap:nowrap !important;gap:8px !important}
  .date-bar #dateText{white-space:nowrap;flex:0 0 auto}
  .date-bar .date-welcome{flex:1 1 auto;min-width:0;justify-content:flex-end}
  .date-bar .dw-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
  /* "Dues" cards: same place as on desktop (after Bank Position), not above the Review tabs */
  .dash-tail-finance > :nth-child(5){order:9 !important}
  .dash-tail-finance > :nth-child(6){order:10 !important}
  /* Financial / Patient / Laboratory review tabs: icon above, short centred label */
  .review-toggle-btn{flex-direction:column !important;gap:1px !important;padding:6px 4px !important;line-height:1.15 !important;text-align:center}
  /* Today / MTD / YTD / Custom Date: all visible (wrap) instead of a cut-off scroller */
  .income-period-bar{flex-wrap:wrap !important;overflow:visible !important;gap:6px !important}
  .income-period-bar .ip-tab{padding:5px 8px !important;font-size:10.5px !important}
  /* Patient Review: tabs + search + modules first, then income / lab / lists (was: lists first, tabs far below) */
  #dashRightStack{order:20 !important}
  .dash-tail-main{order:21 !important}
  #dashRightStack{min-width:0 !important;max-width:100% !important;width:100% !important}
  body.patient-review-mode #dashRightStack .dr-hero{flex-direction:column !important;align-items:stretch !important;gap:8px !important;padding:10px 14px !important}
  #dashRightStack .dr-hero .dr-hero-main{order:1 !important;margin-left:0 !important;padding-left:0 !important;border-left:0 !important}
  #dashRightStack .dr-hero .dr-hero-row{order:2 !important}
  #dashRightStack .dr-hero .dr-range{order:3 !important;padding-left:0 !important;border-left:0 !important;padding-top:6px;border-top:1px solid rgba(255,255,255,.3)}
  body.patient-review-mode #labStatusWrap .cash-pos-grid{display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;overflow:visible !important}
  .review-toggle-btn{min-width:0 !important;flex:1 1 0 !important}
  /* sync status: only the coloured dot on phones (tap it for details) */
  #syncPill{padding:3px 5px !important;margin-left:6px !important}
  #syncPill > span{display:none !important}
}
@media (max-width:359px){
  .review-toggle-btn{font-size:9.5px !important;padding:6px 2px !important}
}
@media (max-width:767px){#storagePill{padding:3px 5px}}
