/* MOONZON V131: fix the actual logged-in portal root wrapping the dashboard shell.
   The portal section itself must not be a two-column grid: its only direct child
   is the complete sidebar+content shell. Making the root block lets that shell
   occupy the full available width instead of one grid track. */
html,body{max-width:100%;overflow-x:hidden}
body.portal-customer #customerDashboard,
body.portal-seller #sellerSection,
body.portal-admin #adminSection{
  display:block!important;
  width:min(1500px,calc(100% - 32px))!important;
  max-width:1500px!important;
  min-width:0!important;
  margin:22px auto!important;
  padding:0!important;
  box-sizing:border-box!important;
  grid-template-columns:none!important;
  gap:0!important;
}
body.portal-customer #customerDashboard>.mz-dashboard-shell,
body.portal-seller #sellerSection>.mz-dashboard-shell,
body.portal-admin #adminSection>.mz-dashboard-shell{
  display:grid!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  grid-template-columns:245px minmax(0,1fr)!important;
  box-sizing:border-box!important;
  margin:0!important;
}
.mz-dashboard-content,.mz-dashboard-body{min-width:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important}
.mz-dashboard-body>*{min-width:0;max-width:100%;box-sizing:border-box}
body.portal-customer #customerDashboard .mz-dashboard-body>.panel,
body.portal-seller #sellerSection .mz-dashboard-body>.panel,
body.portal-admin #adminSection .mz-dashboard-body>.panel{width:100%!important;min-width:0!important}
body.portal-customer #customerProfileForm{width:100%;min-width:0}
body.portal-customer #customerProfileForm input,
body.portal-customer #customerProfileForm textarea,
body.portal-customer #customerProfileForm select{width:100%;min-width:0}
@media(max-width:900px){
 body.portal-customer #customerDashboard,body.portal-seller #sellerSection,body.portal-admin #adminSection{width:calc(100% - 20px)!important;margin:10px auto!important}
 body.portal-customer #customerDashboard>.mz-dashboard-shell,body.portal-seller #sellerSection>.mz-dashboard-shell,body.portal-admin #adminSection>.mz-dashboard-shell{grid-template-columns:190px minmax(0,1fr)!important}
}
@media(max-width:640px){
 body.portal-customer #customerDashboard>.mz-dashboard-shell,body.portal-seller #sellerSection>.mz-dashboard-shell,body.portal-admin #adminSection>.mz-dashboard-shell{grid-template-columns:minmax(0,1fr)!important}
 .mz-dashboard-sidebar{min-width:0!important;width:100%!important}
 .mz-dashboard-content{min-width:0!important;width:100%!important}
 .mz-dashboard-body{padding:12px!important}
}


/* V132: CRITICAL visibility correction.
   V131 forced display:block on portal roots with !important. That overrode
   the shared .hide class, so the dashboard remained visible behind/under
   the login form. Hidden state must always win; the layout rule applies
   only after the hide class has been removed by the authenticated flow. */
body.portal-customer #customerDashboard.hide,
body.portal-seller #sellerSection.hide,
body.portal-admin #adminSection.hide {
  display: none !important;
}
body.portal-customer #customerDashboard:not(.hide),
body.portal-seller #sellerSection:not(.hide),
body.portal-admin #adminSection:not(.hide) {
  display: block !important;
}
