/* NexoProCRM v0.17.11 · Ajuste fino móvil de Contabilidad
   Capa visual. No modifica lógica fiscal, facturación ni plantillas PDF. */

@media(max-width:760px){
  /* Cabecera principal más compacta en móvil */
  .ch301-app-layout-v2 .ch301-main{
    padding-inline:10px!important;
    padding-bottom:calc(128px + env(safe-area-inset-bottom))!important;
  }
  .ch301-app-layout-v2 .ch301-header{
    padding:16px!important;
    margin-bottom:12px!important;
    border-radius:16px!important;
    gap:12px!important;
  }
  .ch301-app-layout-v2 .ch301-header:before{
    height:4px!important;
  }
  .ch301-app-layout-v2 .ch301-eyebrow{
    font-size:10px!important;
    letter-spacing:.11em!important;
    color:#667085!important;
  }
  .ch301-app-layout-v2 .ch301-title-block h1,
  .ch301-app-layout-v2 .ch301-header h1{
    font-size:28px!important;
    line-height:1.05!important;
    letter-spacing:-.045em!important;
    font-weight:850!important;
  }
  .ch301-app-layout-v2 .ch301-header-right{
    width:100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:10px!important;
  }
  .ch301-app-layout-v2 .ch301-icon-btn,
  .ch301-app-layout-v2 .ch301-header .ch301-icon-button{
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    border-radius:12px!important;
  }
  .ch301-app-layout-v2 .ch301-user-pill{
    min-height:48px!important;
    max-width:188px!important;
    padding:0 14px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:12px!important;
    font-size:14px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  /* Migas: menor altura y lectura más sencilla */
  .ch301-app-layout-v2 .ch301-breadcrumbs{
    padding:13px 14px!important;
    border-radius:14px!important;
    margin-bottom:12px!important;
    font-size:14px!important;
    line-height:1.3!important;
    white-space:normal!important;
  }

  /* Navegación inferior: compacta y sin tarjetas activas gigantes */
  .ch301-app-layout-v2 .ch301-nav{
    left:8px!important;
    right:8px!important;
    bottom:8px!important;
    max-height:76px!important;
    min-height:76px!important;
    padding:7px!important;
    gap:6px!important;
    border-radius:18px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain!important;
  }
  .ch301-app-layout-v2 .ch301-nav-scroll,
  .ch301-app-layout-v2 .ch301-nav-group-items{
    gap:6px!important;
  }
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-item{
    width:72px!important;
    min-width:72px!important;
    max-width:72px!important;
    min-height:60px!important;
    padding:6px 5px!important;
    gap:4px!important;
    border-radius:14px!important;
    font-size:10px!important;
    line-height:1.05!important;
    box-shadow:none!important;
    transform:none!important;
  }
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-item span{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:10px!important;
    line-height:1.05!important;
    font-weight:850!important;
  }
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-icon,
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-item .dashicons{
    width:20px!important;
    height:20px!important;
    min-width:20px!important;
    flex:0 0 20px!important;
  }
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-icon svg{
    width:18px!important;
    height:18px!important;
  }
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-item.is-active{
    background:#202832!important;
    color:#fff!important;
    border-color:#202832!important;
  }

  /* Menú de Contabilidad: scroll horizontal real y pestañas compactas */
  .nxp-accounting-nav,
  .nxp-invoice-nav{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:0!important;
    padding:5px!important;
    margin-bottom:14px!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    border-radius:16px!important;
    scrollbar-width:none!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .nxp-accounting-nav::-webkit-scrollbar,
  .nxp-invoice-nav::-webkit-scrollbar{
    display:none!important;
  }
  .nxp-accounting-nav a,
  .nxp-invoice-nav a{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:max-content!important;
    min-height:46px!important;
    padding:0 15px!important;
    border-radius:12px!important;
    font-size:13px!important;
    line-height:46px!important;
    white-space:nowrap!important;
  }
  .nxp-accounting-nav a.is-active,
  .nxp-invoice-nav a.is-active{
    box-shadow:inset 0 3px 0 #d71920!important;
  }
  .nxp-accounting-nav .nxp-accounting-new{
    min-height:46px!important;
  }

  /* Cabeceras internas de Contabilidad menos pesadas */
  .nxp-accounting-header{
    padding:18px!important;
    border-radius:18px!important;
    margin-bottom:14px!important;
  }
  .nxp-accounting-eyebrow,
  .nxp-section-kicker{
    color:#667085!important;
    font-size:11px!important;
    letter-spacing:.12em!important;
  }
  .nxp-accounting-header h2,
  .nxp-commission-section-head h2{
    font-size:29px!important;
    line-height:1.1!important;
    letter-spacing:-.035em!important;
    font-weight:760!important;
  }
  .nxp-accounting-header p,
  .nxp-commission-section-head p{
    font-size:15px!important;
    line-height:1.45!important;
  }

  /* Formulario de periodo: más compacto y sin sensación de bloque gigante */
  .nxp-period-form,
  .nxp-history-year,
  .nxp-payment-form{
    gap:12px!important;
  }
  .nxp-period-form label,
  .nxp-history-year label,
  .nxp-payment-form label{
    font-size:11px!important;
    letter-spacing:.08em!important;
  }
  .nxp-period-form input,
  .nxp-period-form select,
  .nxp-history-year input,
  .nxp-history-year select,
  .nxp-payment-form input,
  .nxp-payment-form select{
    min-height:50px!important;
    height:50px!important;
    border-radius:12px!important;
    font-size:15px!important;
  }
  .nxp-period-form .ch301-btn,
  .nxp-history-year .ch301-btn,
  .nxp-payment-form .ch301-btn{
    min-height:52px!important;
    height:52px!important;
    border-radius:12px!important;
    font-size:15px!important;
  }
}

@media(max-width:380px){
  .ch301-app-layout-v2 .ch301-title-block h1,
  .ch301-app-layout-v2 .ch301-header h1{
    font-size:25px!important;
  }
  .ch301-app-layout-v2 .ch301-user-pill{
    max-width:160px!important;
    font-size:13px!important;
  }
  .ch301-app-layout-v2 .ch301-nav .ch301-nav-item{
    width:66px!important;
    min-width:66px!important;
    max-width:66px!important;
  }
  .nxp-accounting-header h2,
  .nxp-commission-section-head h2{
    font-size:26px!important;
  }
}
