.mh-brand,.mh-quick,.mh-nav,.mh-more{display:none}
@media(max-width:650px){
 body:has(.app-layout:not([hidden])) .app-layout>.sidebar,body .rw-nav-toggle,body .rw-nav-backdrop{display:none!important}
 body:has(.app-layout:not([hidden])) .app-layout>.workspace{padding:16px 12px 100px!important}
 body:has(#dashboardModule:not([hidden])) #mainActionRibbon,body:has(#dashboardModule:not([hidden])) .quickmenu{display:none!important}
 #dashboardModule{display:flex;flex-direction:column;gap:16px;min-width:0}
 #dashboardModule[hidden]{display:none}
 #dashboardModule *{min-width:0;box-sizing:border-box}
 #dashboardModule .mh-brand{display:flex;align-items:center;gap:12px;order:-5;color:#570d2b;font-size:20px}
 .mh-brand>span{background:linear-gradient(135deg,#db427c,#a50f48);color:white;padding:12px;border-radius:12px;font-size:18px}
 #dashboardModule .home-top{display:flex;flex-direction:column;gap:14px;margin:0;order:-4}
 #dashboardModule .home-head-actions{order:-1;width:100%}
 #dashboardModule .home-branch-picker{width:100%;display:grid;padding:10px 14px;border:1px solid #e8abc3;border-radius:12px;background:white}
 #dashboardModule .home-branch-picker select{width:100%;min-height:44px;font-size:16px}
 #dashboardModule .home-hero{width:100%;min-height:145px;padding:16px;border:1px solid #dfb352;border-radius:14px;background:linear-gradient(110deg,#fff1c9,#fff9ec);overflow:hidden}
 #dashboardModule .home-hero h1{font-size:24px;max-width:70%;overflow-wrap:anywhere}
 #dashboardModule .home-hero p{font-size:12px;max-width:65%}
 #dashboardModule .home-hero img{width:110px;max-height:140px;object-fit:contain;right:0;bottom:0}
 #dashboardModule .mh-quick:not([hidden]){display:block;order:-3}
 .mh-quick h2{font-size:19px;margin:0 0 8px}
 .mh-quick>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .mh-quick button{min-height:66px;padding:10px 8px;border:1px solid #c33b72;border-radius:12px;background:#fff;color:#530a28;font-size:13px;display:flex;align-items:center;gap:8px;text-align:left}
 .mh-quick button:first-child{background:linear-gradient(110deg,#fff3ca,#ffdb84);border-color:#c79528}
 .mh-quick button span{font-size:25px;padding-right:8px;border-right:1px solid #efd4df}
 #homeRepairOverviewLabel{order:-2;margin:0}
 #homeRepairOverviewLabel p,#homeRepairOverviewLabel>span{display:none}
 #homeRepairOverviewLabel h2{font-size:19px;margin:0}
 #homeRepairKpis{order:-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
 #homeRepairKpis article{padding:12px;min-height:86px;display:flex;gap:8px;background:#fff;border:1px solid #eddae2;border-radius:12px}
 #homeRepairKpis img{width:32px;height:32px;object-fit:contain}
 #homeRepairKpis b{font-size:21px}#homeRepairKpis span{font-size:12px}
 #homeRepairKpis article:last-child{grid-column:1/-1;min-height:58px}
 #dashboardModule .home-dashboard-grid,#dashboardModule .home-column{display:contents}
 #dashboardModule .home-panel{padding:12px;border-radius:12px;margin:0;width:100%;max-width:100%}
 #dashboardModule .home-panel:has(#homeActionList){order:0}
 #dashboardModule .home-panel:has(#recentJobs){order:1}
 #dashboardModule .home-panel:has(#homeQuickGrid){order:3}
 #dashboardModule:has(.mh-quick:not([hidden])) .home-panel:has(#homeQuickGrid){display:none}
 #homeBusinessOverview,#homeOperationalSnapshot,#homeWorkflowPanel{order:4}
 #dashboardModule .home-panel h2{font-size:18px}
 #dashboardModule .home-urgent-main{display:flex;gap:12px;padding:12px}
 #dashboardModule .home-urgent-main img{width:45px;height:45px}
 #dashboardModule .home-urgent-main b{font-size:18px}
 #dashboardModule .home-urgent-main span{font-size:13px}
 #dashboardModule .home-action-row{min-height:52px;width:100%;white-space:normal}
 #recentJobs{overflow:visible}#recentJobs table,#recentJobs tbody{display:block;width:100%;white-space:normal}
 #recentJobs thead{display:none}#recentJobs tr{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:12px 0;border-bottom:1px solid #eadce1}
 #recentJobs td{padding:4px;border:0;overflow-wrap:anywhere;font-size:12px}#recentJobs td:nth-child(2){grid-column:1/-1;grid-row:1}#recentJobs button{min-height:44px}
 #dashboardModule .home-finance-overview,#dashboardModule .home-finance-metrics,#dashboardModule .home-operational-snapshot,#dashboardModule .home-stock-status-grid,#dashboardModule .home-flow{grid-template-columns:minmax(0,1fr);width:100%}
 #dashboardModule .home-operation-panel table{white-space:normal;font-size:10px}#dashboardModule .home-operation-panel td,#dashboardModule .home-operation-panel th{padding:4px;white-space:normal}
 body:has(.app-layout:not([hidden])) .mh-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;padding:6px 4px calc(6px + env(safe-area-inset-bottom));background:#fff9fc;border-top:1px solid #ecd7e1;z-index:30}
 .mh-nav button{min-height:58px;border:0;border-radius:0;background:transparent;color:#483b4c;padding:4px;font-size:11px;display:grid;place-items:center;gap:3px}
 .mh-nav button span{font-size:24px;line-height:1.2}
 .mh-nav button[data-mobile-route=pos]{border-radius:50%;background:#b81756;color:#fff;width:64px;height:64px;justify-self:center;margin-top:-18px;box-shadow:0 0 0 5px #fff9fc}
 body:has(#dashboardModule:not([hidden])) .mh-nav button[data-mobile-route=home]{color:#b81756;font-weight:800}
 .mh-more:not([hidden]){display:block;position:fixed;inset:0;background:#fff8fc;z-index:100;padding:16px;overflow-y:auto}
 .mh-more header{display:flex;justify-content:space-between;align-items:center}.mh-more button{min-height:44px}
 .mh-more-items{display:grid;gap:8px}.mh-more-items button{text-align:left;background:white;color:#530a28;border-color:#e8c7d5}
 body:has(.modal:not([hidden]),.rs-modal,.ql-editor) .mh-nav{display:none}
 body:has(#stockReceiptForm:not([hidden])) .mh-nav{display:none!important}
 #stockReceiptForm .rcv-footer{bottom:0!important}
 body:has(#stockModule:not([hidden]) #stockPanelReceive:not([hidden]) #stockReceiptForm:not([hidden])) .mh-nav{display:none}
}
@media(max-width:650px){
 #dashboardModule[data-mobile-mode=STORE] #dashTotal,#dashboardModule[data-mobile-mode=STORE] #dashOverdue{font-size:0!important}
 #dashboardModule[data-mobile-mode=STORE] #dashTotal::after,#dashboardModule[data-mobile-mode=STORE] #dashOverdue::after{content:attr(data-mobile-value);font-size:20px}
 #dashboardModule[data-mobile-mode=STORE] #dashOverdueLabel{font-size:0}
 #dashboardModule[data-mobile-mode=STORE] #dashOverdueLabel::after{content:'Stock ถึงจุดสั่งซื้อ';font-size:13px}
 #dashboardModule[data-mobile-mode=STORE] #dashRepair::after,#dashboardModule[data-mobile-mode=STORE] #dashTesting::after{content:' งาน';font-size:13px}
 #dashboardModule[data-mobile-mode=STORE] #dashCompleted::after{content:' รายการ';font-size:13px}
}
@media(max-width:650px){
 body:has(#dashboardModule:not([hidden])),body:has(#dashboardModule:not([hidden])) .workspace{background:#fff3f8}
 #homeRepairKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #dashboardModule .home-branch-picker select{border:0;border-radius:8px;padding:4px;background:transparent;color:#510c29}
 #dashboardModule .home-panel-head h2{font-size:18px!important}
 #dashboardModule .home-recent td{font-size:13px!important}
 #dashboardModule .home-recent td:nth-child(2) small{display:block;margin-top:4px;color:#776778}
 #dashboardModule .home-panel:has(#recentJobs){margin-top:0}
 #dashboardModule .home-dashboard-grid,#dashboardModule .home-column{gap:0}
 #dashboardModule .home-flow{overflow:visible;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #dashboardModule .home-flow article::after{display:none}
}
