/* NexoProCRM v0.21.10 · Escritorio compacto por zoom/ancho útil
   Corrige Samsung Book / portátiles táctiles 13" cuando el zoom del navegador modifica el ancho CSS
   y fuerza indebidamente la barra lateral de escritorio. Capa visual únicamente. */

@media (min-width:961px) and (max-width:3000px) and (max-height:1500px){
  body.nexopro-app-page.nxp-compact-touch-layout{
    overflow-x:hidden!important;
    background:#f4f6f8!important;
  }

  body.nxp-compact-touch-layout .ch301-app.ch301-app-layout-v2{
    width:100%!important;
    max-width:none!important;
  }

  body.nxp-compact-touch-layout .ch301-layout{
    display:block!important;
    grid-template-columns:none!important;
    width:100%!important;
    min-height:100vh!important;
  }

  body.nxp-compact-touch-layout .ch301-layout > .ch301-nav{
    display:none!important;
  }

  body.nxp-compact-touch-layout .ch301-main{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    padding:18px 18px 46px!important;
    box-sizing:border-box!important;
  }

  body.nxp-compact-touch-layout .ch301-header{
    position:relative!important;
    top:auto!important;
    z-index:10!important;
    margin:0 0 12px!important;
    padding:20px 22px!important;
    border-radius:18px!important;
  }

  body.nxp-compact-touch-layout .ch301-header .ch301-title-block,
  body.nxp-compact-touch-layout .ch301-title-block{
    min-width:0!important;
  }

  body.nxp-compact-touch-layout .ch301-header h1,
  body.nxp-compact-touch-layout .ch301-title-block h1{
    font-size:32px!important;
    line-height:1.05!important;
    letter-spacing:-.04em!important;
  }

  body.nxp-compact-touch-layout .ch301-header-right{
    gap:10px!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
  }

  body.nxp-compact-touch-layout .ch301-refresh-button,
  body.nxp-compact-touch-layout .ch301-user-pill,
  body.nxp-compact-touch-layout .ch301-brand-bosch{
    min-height:42px!important;
    border-radius:12px!important;
  }

  body.nxp-compact-touch-layout .ch301-user-pill{
    max-width:220px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-actions{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:10px 0 12px!important;
    padding:0!important;
    overflow:hidden!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-actions-inner{
    display:flex!important;
    align-items:stretch!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scroll-snap-type:x proximity!important;
    padding:2px 2px 10px!important;
    scrollbar-width:thin!important;
    scrollbar-color:#cbd5e1 transparent!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-actions-inner::-webkit-scrollbar{
    height:6px!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-actions-inner::-webkit-scrollbar-thumb{
    background:#cbd5e1!important;
    border-radius:999px!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action{
    position:relative!important;
    flex:0 0 74px!important;
    width:74px!important;
    height:68px!important;
    min-width:74px!important;
    max-width:74px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    border:1px solid #dbe3ec!important;
    border-radius:15px!important;
    background:#fff!important;
    color:#667085!important;
    text-decoration:none!important;
    box-shadow:0 7px 18px rgba(15,23,42,.055)!important;
    scroll-snap-align:start!important;
    box-sizing:border-box!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action .ch301-nav-icon,
  body.nxp-compact-touch-layout .ch301-mobile-quick-action .ch301-nav-icon svg{
    width:21px!important;
    height:21px!important;
    min-width:21px!important;
    max-width:21px!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action .ch301-nav-icon svg{
    stroke-width:1.85!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action span:not(.ch301-nav-icon){
    max-width:68px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:inherit!important;
    font-size:10px!important;
    line-height:1!important;
    font-weight:850!important;
    letter-spacing:-.02em!important;
    text-align:center!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action:hover,
  body.nxp-compact-touch-layout .ch301-mobile-quick-action:focus-visible{
    color:#202832!important;
    background:#f8fafc!important;
    border-color:#cbd5e1!important;
    outline:none!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action.is-active{
    color:#d71920!important;
    background:#fff7f7!important;
    border-color:rgba(215,25,32,.30)!important;
    box-shadow:inset 0 -2px 0 #d71920,0 7px 18px rgba(15,23,42,.055)!important;
  }

  body.nxp-compact-touch-layout .ch301-mobile-quick-action.is-active:before{
    content:""!important;
    position:absolute!important;
    top:7px!important;
    left:50%!important;
    width:5px!important;
    height:5px!important;
    border-radius:999px!important;
    background:#d71920!important;
    transform:translateX(-50%)!important;
  }

  body.nxp-compact-touch-layout .ch301-breadcrumbs{
    margin:0 0 14px!important;
    padding:14px 16px!important;
    border-radius:14px!important;
  }

  body.nxp-compact-touch-layout .ch301-panel,
  body.nxp-compact-touch-layout .ch301-card,
  body.nxp-compact-touch-layout .ch301-dashboard,
  body.nxp-compact-touch-layout .nxp-accounting-wrap,
  body.nxp-compact-touch-layout .nxp-commission-wrap,
  body.nxp-compact-touch-layout .nxp-sales-hub,
  body.nxp-compact-touch-layout .nxp-sales-hub *{
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  body.nxp-compact-touch-layout .ch301-grid,
  body.nxp-compact-touch-layout .ch301-stats,
  body.nxp-compact-touch-layout .ch301-kpi-grid,
  body.nxp-compact-touch-layout .nxp-dashboard-kpis,
  body.nxp-compact-touch-layout .nxp-commission-kpi-grid,
  body.nxp-compact-touch-layout .nxp-commission-summary,
  body.nxp-compact-touch-layout .nxp-sales-hub .nxp-sales-grid,
  body.nxp-compact-touch-layout .nxp-sales-hub .nxp-sales-cards{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  body.nxp-compact-touch-layout .nxp-commission-table-wrap,
  body.nxp-compact-touch-layout .nxp-historical-table-wrap,
  body.nxp-compact-touch-layout .nxp-selected-range-table-wrap,
  body.nxp-compact-touch-layout .ch301-table-wrap,
  body.nxp-compact-touch-layout .nxp-accounting-table-wrap{
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
}

/* Salvavidas opcional: visitando cualquier página con ?nxp_layout=compact se fuerza este modo.
   Con ?nxp_layout=desktop se elimina el forzado guardado en el navegador. */


/* v0.21.10: salvaguarda extra para zoom 75 % en portátiles táctiles compactos.
   Mantiene la barra lateral fuera y fuerza ancho completo del contenido aunque el navegador declare un viewport grande. */
@media (min-width:1369px) and (max-width:3000px) and (max-height:1500px){
  body.nexopro-app-page.nxp-compact-touch-layout .ch301-layout > .ch301-nav{
    display:none!important;
    visibility:hidden!important;
    width:0!important;
    min-width:0!important;
    max-width:0!important;
    overflow:hidden!important;
  }

  body.nexopro-app-page.nxp-compact-touch-layout .ch301-main{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
  }

  body.nexopro-app-page.nxp-compact-touch-layout .ch301-mobile-quick-actions{
    display:block!important;
  }
}
