/* ============================================
   DataTables 1.13.4 + AdminLTE 2.4.0 / Bootstrap 3.4.1
   ============================================ */

/* ============================================
   FILTROS, LONGITUD Y BÚSQUEDA
   ============================================ */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d2d6de;
    border-radius: 3px;
    padding: 5px 8px;
    background-color: #fff;
    color: #555;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #3c8dbc;
    outline: none;
    box-shadow: 0 0 3px rgba(60, 141, 188, .5);
}

/* ============================================
   TABLA
   ============================================ */
.dataTables_wrapper .table {
    margin-bottom: 0;
}

.dataTables_wrapper .table > thead > tr > th {
    border-bottom: 2px solid #f4f4f4;
    background: #f9f9f9;
    font-weight: 600;
}

/* ============================================
   BOTONES DE ACCIÓN
   ============================================ */
.dataTables_wrapper .dt-buttons .btn {
    border-radius: 3px;
    margin-right: 4px;
}

.dataTables_wrapper .dt-buttons .btn-default {
    background-color: #f4f4f4;
    border-color: #ddd;
    color: #444;
}

.dataTables_wrapper .dt-buttons .btn-default:hover {
    background-color: #e7e7e7;
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #444 !important;
    border-radius: 3px !important;
    margin: 0 2px;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #3c8dbc !important;
    border-color: #367fa9 !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e7e7e7 !important;
    color: #333 !important;
}

/* ============================================
   INFO
   ============================================ */
.dataTables_wrapper .dataTables_info {
    padding-top: 8px;
    color: #777;
}

/* ============================================
   BOTÓN + DE RESPONSIVE (dtr-control)
   ============================================ */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: #3c8dbc;
    border: 2px solid #fff;
    box-shadow: 0 0 3px rgba(0,0,0,.3);
    color: #fff;
    font-weight: bold;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
    background-color: #dd4b39;
}

/* ============================================
   FIXED HEADER
   ============================================ */
table.dataTable.fixedHeader-floating {
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

/* ============================================
   MODAL DE RESPONSIVE (.dtr-modal) - UNIFICADO
   ============================================ */

/* Contenedor principal del modal */
div.dtr-modal {
    z-index: 99999 !important;
}

/* Fondo oscuro */
div.dtr-modal-background {
    z-index: 99998 !important;
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Display (caja del modal) */
div.dtr-modal div.dtr-modal-display {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    margin: auto !important;
    z-index: 99999 !important;
    overflow: auto !important;
    background-color: #f5f5f7 !important;
    border: 1px solid #333 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;

    /* ✅ Desktop: 55% ancho, 70% alto */
    width: 55% !important;
    height: 70% !important;
    max-width: 850px !important;
}

/* Content interno (el que scrollea) */
div.dtr-modal div.dtr-modal-content {
    z-index: 100000 !important;
    background: #fff !important;
    color: #333 !important;
    padding: 20px;
    border-radius: 5px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 90%;
    position: relative;
}

/* Botón de cerrar (X) */
div.dtr-modal div.dtr-modal-close {
    z-index: 100001 !important;
    cursor: pointer;
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background: #f4f4f4;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

div.dtr-modal div.dtr-modal-close:hover {
    background: #dd4b39;
    color: #fff;
}

/* ============================================
   AJUSTES POR DISPOSITIVO
   ============================================ */

/* Tablet */
@media (max-width: 991px) and (min-width: 768px) {
    div.dtr-modal div.dtr-modal-display {
        width: 75% !important;
        height: 75% !important;
    }
}

/* Móvil */
@media (max-width: 767px) {
    div.dtr-modal div.dtr-modal-display {
        width: 95% !important;
        height: 80% !important;
        max-width: none !important;
        border-radius: 5px !important;
    }

    div.dtr-modal div.dtr-modal-content {
        padding: 15px;
    }

    /* Tabla dentro del modal más compacta en móvil */
    div.dtr-modal div.dtr-modal-content table.dtr-details td {
        padding: 6px 8px;
        font-size: 13px;
    }
}