/* Forzar modals responsivos en móviles (Bootstrap + Jazzmin) */
@media (max-width: 576px) {  /* o max-width: 768px si quieres en tablets también */
    .modal-dialog {
        margin: 0.5rem !important;          /* reduce márgenes */
        max-width: 96% !important;          /* ocupa casi todo el ancho */
        width: 100% !important;
    }

    .modal-content {
        border-radius: 0.5rem;
        padding: 0.5rem;                    /* menos padding interno */
    }

    /* Contenido del form dentro del modal */
    .modal-body .fieldBox,
    .modal-body .form-row,
    .modal-body fieldset.module,
    .modal-body .inline-group {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.5rem 0 !important;
    }

    /* Inputs y selects no se desborden */
    .modal-body input,
    .modal-body select,
    .modal-body textarea,
    .modal-body .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Evitar scroll horizontal */
    .modal-body {
        overflow-x: hidden !important;
    }

    /* Si hay tabs o collapsible en el form */
    .tab-content,
    .accordion {
        width: 100% !important;
    }
}
/* CORRECCIÓN: ventanas emergentes para agregar o editar registros */
#related-modal-iframe,
iframe.related-iframe {
    display: block !important;
    width: 100% !important;
    height: 65vh !important;
    min-height: 450px !important;
    border: 0 !important;
    box-sizing: border-box !important;
}

/* CORRECCIÓN: ancho del menú lateral y contenido principal */
@media (min-width: 992px) {
    body.sidebar-open .app-wrapper {
        grid-template-columns: 250px minmax(0, 1fr) !important;
    }
}
