/* RESPONSIVE_GLOBAL_AVE_FENIX_V4_APROVECHA_ESPACIO - 2026-08-07 */
:root{
  --af-content-max:1500px;
  --af-page-pad:1rem;
}
*{box-sizing:border-box;}
html,body{width:100%;max-width:100%;overflow-x:hidden;}
body,main,section,article,aside,header,footer,nav,form,.grid,.flex{min-width:0;}
.grid>* ,.flex>*{min-width:0;}
img,video,canvas,svg{max-width:100%;height:auto;}
iframe{max-width:100%;}
input,select,textarea,button{max-width:100%;}
textarea{resize:vertical;}
pre{max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;}
code{overflow-wrap:anywhere;word-break:break-word;}

/* Una sola geometría para TODOS los módulos del panel. */
.af-module-page{
  width:100%!important;
  max-width:100%!important;
  padding:var(--af-page-pad)!important;
  margin:0!important;
  overflow-x:hidden;
}
.af-module-shell,
.usuarios-shell,
.configuracion-shell{
  width:100%!important;
  max-width:var(--af-content-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  min-width:0!important;
}
#main-content{min-width:0;max-width:100%;overflow-x:hidden;}
#main-content>div,#main-content>section{max-width:100%;min-width:0;}

/* Tablas: el desplazamiento queda dentro de la tabla y nunca de toda la página. */
.dataTables_wrapper{width:100%!important;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_length{max-width:100%;}
.dataTables_wrapper .dataTables_filter input{max-width:70vw;}
.af-table-scroll,.overflow-x-auto{max-width:100%;-webkit-overflow-scrolling:touch;}
.af-break-anywhere{overflow-wrap:anywhere;word-break:break-word;}

/* Modales y tarjetas no deben salirse de pantalla. */
[role="dialog"],.swal2-popup{max-width:calc(100vw - 1.25rem)!important;}
.swal2-html-container{max-width:100%;overflow-x:auto;}

@media (min-width:768px){
  :root{--af-page-pad:1.5rem;}
}
@media (min-width:1280px){
  :root{--af-page-pad:2rem;}
}
@media (max-width:1023px){
  body{background-attachment:scroll!important;}
  #main-content{width:100%!important;max-width:100%!important;margin-left:0!important;overflow-x:hidden!important;}
}
@media (max-width:767px){
  .fixed-header,.fixed-footer{min-width:0;}
  .rounded-\[2\.5rem\],.rounded-\[2\.4rem\],.rounded-\[2\.2rem\]{border-radius:1.5rem!important;}
  .dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_length{float:none!important;text-align:left!important;margin:.5rem 0!important;}
  .dataTables_wrapper .dataTables_paginate{float:none!important;text-align:center!important;white-space:normal!important;}
  table.dataTable{width:100%!important;}
}
@media (max-width:480px){
  input,select,textarea{font-size:16px!important;}
  .dataTables_wrapper .dataTables_filter input{max-width:62vw;}
}

/* Geometría del panel: el contenido usa exactamente el espacio restante a la derecha del sidebar. */
#main-content .af-module-shell,
#main-content .usuarios-shell,
#main-content .configuracion-shell{
  width:100%!important;
  max-width:var(--af-content-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
@media (min-width:1024px){
  #main-content{
    width:calc(100% - 16rem)!important;
    max-width:calc(100% - 16rem)!important;
    margin-left:16rem!important;
    overflow-x:hidden!important;
  }
  :root{--af-page-pad:1rem;}
}
@media (min-width:1536px){
  :root{--af-page-pad:1.25rem;}
}

/* Usuarios: prioriza que Entrega y Acciones se vean completas en escritorio. */
@media (min-width:1200px){
  #tablaUsers th,#tablaUsers td{padding-left:.75rem!important;padding-right:.75rem!important;}
  #tablaUsers td:first-child{min-width:250px!important;}
  #tablaUsers td:nth-child(3){min-width:110px!important;}
  #tablaUsers td:nth-child(4){min-width:140px!important;}
  #tablaUsers td:nth-child(5){min-width:215px!important;}
  #tablaUsers td:nth-child(6){min-width:205px!important;}
  #tablaUsers td:nth-child(6) .inline-flex{gap:.35rem!important;}
  #tablaUsers td:nth-child(6) button{padding-left:.7rem!important;padding-right:.7rem!important;}
}
