/* Solistrix Negocios v1.10.12
   Estabilización visual del frontend autenticado en escritorio.
   Corrige desbordamiento horizontal introducido por la decoración de v1.10.11
   y refuerza la contención de componentes sin alterar móvil, /admin, micrositio o lógica. */

@media (min-width:801px){
  /* El contenedor principal conserva siempre un ancho real dentro del viewport. */
  body.app-tenant-shell .page-shell{
    box-sizing:border-box;
    width:min(1240px,calc(100% - 40px))!important;
    max-width:1240px!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* La decoración ya no sale del contenedor ni amplía el ancho desplazable. */
  body.app-tenant-shell .page-shell::before{
    right:0!important;
    width:min(420px,32vw)!important;
    max-width:42%!important;
  }

  /* Contención transversal para todas las pantallas del frontend autenticado. */
  body.app-tenant-shell .page-shell>*,
  body.app-tenant-shell .page-title,
  body.app-tenant-shell .page-title>*,
  body.app-tenant-shell .card,
  body.app-tenant-shell .metric-grid,
  body.app-tenant-shell .metric,
  body.app-tenant-shell .quick-grid,
  body.app-tenant-shell .module-nav,
  body.app-tenant-shell .priority-grid,
  body.app-tenant-shell .action-grid,
  body.app-tenant-shell .form-grid,
  body.app-tenant-shell .detail-grid,
  body.app-tenant-shell .detail-list,
  body.app-tenant-shell .detail-actions,
  body.app-tenant-shell .form-actions,
  body.app-tenant-shell .section-heading,
  body.app-tenant-shell .filter-accordion,
  body.app-tenant-shell .grid-toolbar,
  body.app-tenant-shell .table-wrap,
  body.app-tenant-shell .settings-shell,
  body.app-tenant-shell .settings-main,
  body.app-tenant-shell .settings-form,
  body.app-tenant-shell .settings-section,
  body.app-tenant-shell .settings-fields,
  body.app-tenant-shell .settings-section-form,
  body.app-tenant-shell .business-settings-card,
  body.app-tenant-shell .business-settings-fields,
  body.app-tenant-shell .account-grid,
  body.app-tenant-shell .account-hero,
  body.app-tenant-shell .guide-welcome,
  body.app-tenant-shell .guide-step,
  body.app-tenant-shell .wa-template-form,
  body.app-tenant-shell .wa-template-group,
  body.app-tenant-shell .wa-template-grid,
  body.app-tenant-shell .wa-template-card,
  body.app-tenant-shell .inventory-operation-grid,
  body.app-tenant-shell .inventory-history,
  body.app-tenant-shell .report-grid,
  body.app-tenant-shell .report-metrics,
  body.app-tenant-shell .calendar,
  body.app-tenant-shell .quote-document{
    box-sizing:border-box;
    min-width:0!important;
    max-width:100%!important;
  }

  body.app-tenant-shell .page-title{
    width:100%;
  }
  body.app-tenant-shell .page-title>div:first-child{
    min-width:0;
  }

  body.app-tenant-shell .metric-grid,
  body.app-tenant-shell .quick-grid,
  body.app-tenant-shell .module-nav,
  body.app-tenant-shell .priority-grid,
  body.app-tenant-shell .action-grid,
  body.app-tenant-shell .report-grid,
  body.app-tenant-shell .report-metrics{
    width:100%;
  }

  body.app-tenant-shell .quick-grid>a,
  body.app-tenant-shell .module-nav>a,
  body.app-tenant-shell .priority-grid>a,
  body.app-tenant-shell .action-grid>a{
    min-width:0!important;
    max-width:100%!important;
  }

  /* Las tablas pueden desplazarse dentro de su propio contenedor, nunca la página completa. */
  body.app-tenant-shell .table-wrap,
  body.app-tenant-shell .inventory-history{
    width:100%;
    overflow-x:auto;
    overflow-y:visible;
  }

  body.app-tenant-shell :is(input,select,textarea,fieldset){
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
  }

  body.app-tenant-shell :is(.detail-actions,.form-actions,.section-heading,.grid-toolbar,.settings-section-save,.business-settings-save,.record-state-actions){
    min-width:0;
    max-width:100%;
    flex-wrap:wrap;
  }
}

/* Escritorio compacto: conserva margen lateral suficiente sin modificar el layout móvil. */
@media (min-width:801px) and (max-width:1100px){
  body.app-tenant-shell .page-shell{
    width:calc(100% - 32px)!important;
  }
}
