/* Desktop has no layout overrides. Controls only exist in the mobile shell. */
.mobile-menu-toggle,.mobile-menu-close,.mobile-menu-backdrop{display:none}
@media(max-width:760px),(max-width:1100px) and (pointer:coarse){
 html,body{height:100%;overflow:hidden}
 body .app{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:56px minmax(0,1fr)!important;height:100vh!important;height:100dvh!important;min-height:0!important;width:100%;overflow:hidden!important}
 body .app>.app-header{grid-column:1!important;grid-row:1!important;position:relative!important;display:flex!important;flex-wrap:nowrap!important;gap:8px!important;padding:0 10px!important;height:56px!important;min-height:56px!important;overflow:visible!important;z-index:100}
 body .header-left{flex:1!important;min-width:0;gap:0!important;overflow:hidden}
 body .header-company-brand{min-width:0;gap:7px!important;max-width:100%;display:flex;align-items:center}
 body .header-company-brand img,body .header-company-fallback{width:30px!important;height:30px!important;flex-shrink:0}
 body .header-company-brand strong{font-size:13px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body .header-module-divider,body .module-name,body .module-nav,body .datetime-widget,body .topbar-update-button,body .erp-fullscreen-button,body .header-reminders{display:none!important}
 body .header-actions{flex:0 0 auto!important;width:auto!important;gap:6px!important;flex-wrap:nowrap!important;overflow:visible!important}
 body .language-switcher-header{width:auto!important;min-width:0!important;height:32px!important;padding:0 8px!important;font-size:11px!important}
 body .app>.main{grid-column:1!important;grid-row:2!important;width:100%!important;height:100%!important;min-height:0!important;min-width:0!important;margin:0!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch}
 body .content{min-width:0!important;max-width:100%;padding:12px!important}
 body .topbar{min-width:0;max-width:100%;position:relative!important}
 body .search-tools{min-width:0!important;max-width:100%!important}
 body .mobile-menu-toggle{display:flex;align-items:center;justify-content:center;flex:0 0 34px;height:34px;border:1px solid #ffffff40;border-radius:7px;background:#ffffff10;color:white;font-size:21px;cursor:pointer}
 body .app>.sidebar{display:block!important;position:fixed!important;top:56px!important;bottom:0!important;left:0!important;right:auto!important;width:min(290px,86vw)!important;height:calc(100vh - 56px)!important;height:calc(100dvh - 56px)!important;min-height:0!important;max-height:none!important;padding:8px 0 20px!important;overflow-y:auto!important;overflow-x:hidden!important;z-index:102!important;transform:translateX(-105%);visibility:hidden;transition:transform .18s ease,visibility .18s;overscroll-behavior:contain;box-shadow:8px 0 28px #0003}
 body.mobile-menu-open .app>.sidebar{transform:translateX(0);visibility:visible}
 body .mobile-menu-close{display:flex;align-items:center;gap:12px;min-height:42px;width:100%;padding:8px 16px;color:#fff;background:transparent;border:0;border-bottom:1px solid #ffffff20;cursor:pointer;font:inherit}
 body .sidebar .nav{display:flex!important;flex-direction:column!important;grid-template-columns:none!important;gap:2px!important}
 body .sidebar .nav>a:not([hidden]),body .sidebar .nav>div:not(.collapsed)>a:not([hidden]){display:flex!important;justify-content:flex-start!important;text-align:left!important;white-space:normal!important;min-height:40px!important;border-radius:0!important;font-size:13px!important}
 body .sidebar .nav>div.collapsed>a,body .sidebar .nav a[hidden]{display:none!important}
 body .sidebar .nav button{min-height:44px!important;white-space:normal!important;justify-content:flex-start!important}
 body .sidebar-collapse-toggle{display:none!important}
 body .mobile-menu-backdrop:not([hidden]){display:block;position:fixed;inset:56px 0 0;border:0;background:#06121c80;z-index:101}
}
/* Products become readable cards only on mobile; desktop table remains intact. */
@media(max-width:760px),(max-width:1100px) and (pointer:coarse){
 body .products-modern-card{padding:10px!important;min-width:0}
 body .products-table-scroll{overflow:visible!important;max-width:100%}
 body .products-modern-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important}
 body .products-modern-table colgroup,body .products-modern-table thead{display:none!important}
 body .products-modern-table tbody{display:grid!important;gap:12px;width:100%}
 body .products-modern-table tbody tr:not([hidden]){display:grid!important;grid-template-columns:28px minmax(0,1fr) minmax(0,1fr)!important;gap:10px 8px;padding:12px!important;border:1px solid #dbe5ec!important;border-radius:10px;background:#fff!important;width:100%;box-sizing:border-box}
 body .products-modern-table tbody tr[hidden]{display:none!important}
 body .products-modern-table tbody td{display:block!important;min-width:0!important;width:auto!important;padding:0!important;border:0!important;white-space:normal!important;overflow:visible!important;font-size:13px!important;text-overflow:clip!important;overflow-wrap:anywhere}
 body .products-modern-table tbody td:nth-child(1){grid-column:1;grid-row:1;align-self:start;padding-top:2px!important}
 body .products-modern-table tbody td:nth-child(2){grid-column:2 / 4;grid-row:1;padding-bottom:8px!important;border-bottom:1px solid #edf1f5!important}
 body .products-modern-table tbody td:nth-child(n+3){grid-column:2 / 4}
 body .products-modern-table tbody td:nth-child(5),body .products-modern-table tbody td:nth-child(7){grid-column:2}
 body .products-modern-table tbody td:nth-child(6),body .products-modern-table tbody td:nth-child(8){grid-column:3}
 body .products-modern-table tbody td::before{display:block;color:#748493;font-size:11px;font-weight:400;margin-bottom:4px}
 body .products-modern-table tbody td:nth-child(3)::before{content:'Category / القسم'}
 body .products-modern-table tbody td:nth-child(4)::before{content:'Vendor / المورد'}
 body .products-modern-table tbody td:nth-child(5)::before{content:'Quantity / الكمية'}
 body .products-modern-table tbody td:nth-child(6)::before{content:'Status / الحالة'}
 body .products-modern-table tbody td:nth-child(7)::before{content:'Selling Price / سعر البيع'}
 body .products-modern-table tbody td:nth-child(8)::before{content:'Purchase Price / سعر الشراء'}
 body .products-modern-table tbody td:nth-child(9){text-align:right}
 body .modern-product-name,body .modern-product-name strong,body .variant-product-name,body .variant-product-name strong{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;max-width:100%!important;line-height:1.5}
 body .product-name-with-toggle{min-width:0;align-items:flex-start}
 body .products-modern-table .stock-status{font-size:11px!important;padding:5px 7px!important;white-space:normal!important;display:inline-block}
 body .products-modern-table .product-row-action{width:36px!important;height:36px!important}
 body .products-modern-table .products-empty{grid-column:1 / 4!important}
 body .products-modern-table .products-empty::before{content:none!important}
 body .products-modern-table .product-variant-row{background:#f1f7fa!important;border-left:3px solid #65b8d2!important}
 body .products-filter-bar{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
 body .products-filter-bar>*{min-width:0!important;max-width:100%}
}
