/* 
 * CSS de Corrección para DataTables 2.3.4 con Bootstrap 3 
 * Fecha: 03 de Enero 2026
 * VigiControl CRM - Perfex Adaptation
 * 
 * SOLUCIÓN DEFINITIVA CON MÁXIMA ESPECIFICIDAD
 */

/* ============================================
   CORRECCIÓN BARRA DE BÚSQUEDA - MÁXIMA PRIORIDAD
   ============================================ */

/* Todos los posibles selectores para la barra de búsqueda */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_filter,
.dataTables_wrapper .row .dataTables_filter,
.dataTables_wrapper > .row > div > .dataTables_filter,
div.dt-container div.dt-layout-end,
div.dt-container div.dt-search,
.dt-container .dt-layout-end,
.dt-container .dt-search {
    float: right !important;
    text-align: right !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    display: block !important;
}

/* Container de la columna derecha */
.dataTables_wrapper .row > .col-sm-6:last-child,
.dataTables_wrapper > .row > div:last-child {
    text-align: right !important;
}

/* Labels de búsqueda */
.dataTables_filter label,
.dt-search label {
    float: right !important;
    margin-left: auto !important;
}

/* ============================================
   CORRECCIÓN DROPDOWN - IZQUIERDA
   ============================================ */

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_length,
div.dt-container div.dt-layout-start,
div.dt-container div.dt-length,
.dt-container .dt-layout-start,
.dt-container .dt-length {
    float: left !important;
    text-align: left !important;
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* ============================================
   ESTILOS GENERALES
   ============================================ */

/* Wrapper principal */
.dataTables_wrapper,
div.dt-container {
    width: 100% !important;
    clear: both !important;
}

/* Rows */
.dataTables_wrapper .row,
.dataTables_wrapper > .row,
div.dt-container div.dt-layout-row {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Limpiar floats */
.dataTables_wrapper .row::after,
div.dt-container div.dt-layout-row::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* ============================================
   INPUTS Y SELECTS - BOOTSTRAP 3
   ============================================ */

/* Dropdown de cantidad */
.dataTables_length select,
div.dt-container div.dt-length select {
    display: inline-block !important;
    width: auto !important;
    min-width: 75px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    line-height: 1.42857143 !important;
    color: #555 !important;
    background-color: #fff !important;
    background-image: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075) !important;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !important;
    margin: 0 5px !important;
}

.dataTables_length select:focus,
div.dt-container div.dt-length select:focus {
    border-color: #66afe9 !important;
    outline: 0 !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6) !important;
}

/* Input de búsqueda */
.dataTables_filter input,
div.dt-container div.dt-search input {
    display: inline-block !important;
    width: auto !important;
    min-width: 200px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    line-height: 1.42857143 !important;
    color: #555 !important;
    background-color: #fff !important;
    background-image: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075) !important;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !important;
    margin-left: 5px !important;
}

.dataTables_filter input:focus,
div.dt-container div.dt-search input:focus {
    border-color: #66afe9 !important;
    outline: 0 !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6) !important;
}

/* Labels */
.dataTables_length label,
.dataTables_filter label,
div.dt-container div.dt-length label,
div.dt-container div.dt-search label {
    font-weight: normal !important;
    white-space: nowrap !important;
    margin-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* ============================================
   PAGINACIÓN - INFO Y BOTONES
   ============================================ */

/* Info */
.dataTables_wrapper .dataTables_info,
div.dt-container div.dt-info {
    float: left !important;
    padding-top: 0.755em !important;
    padding-bottom: 8px !important;
    clear: both !important;
}

/* Paginación */
.dataTables_wrapper .dataTables_paginate,
div.dt-container div.dt-paging {
    float: right !important;
    text-align: right !important;
    padding-top: 0.25em !important;
    padding-bottom: 8px !important;
}

/* ============================================
   BOTONES DE PAGINACIÓN - BOOTSTRAP 3
   ============================================ */

/* Botones DataTables 1.x */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    box-sizing: border-box !important;
    display: inline-block !important;
    min-width: 1.5em !important;
    padding: 6px 12px !important;
    margin-left: 2px !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    border-color: #337ab7 !important;
    background-color: #337ab7 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    cursor: default !important;
    color: #777 !important;
    border-color: #ddd !important;
    background-color: #fff !important;
    opacity: 0.6 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #333 !important;
    border-color: #adadad !important;
    background-color: #e6e6e6 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:active {
    outline: none !important;
    background-color: #d4d4d4 !important;
    border-color: #8c8c8c !important;
}

/* Botones DataTables 2.x */
div.dt-container div.dt-paging .dt-paging-button {
    box-sizing: border-box !important;
    display: inline-block !important;
    min-width: 1.5em !important;
    padding: 6px 12px !important;
    margin-left: 2px !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    pointer-events: auto !important;
}

div.dt-container div.dt-paging .dt-paging-button.current,
div.dt-container div.dt-paging .dt-paging-button.current:hover {
    color: #fff !important;
    border-color: #337ab7 !important;
    background-color: #337ab7 !important;
}

div.dt-container div.dt-paging .dt-paging-button.disabled,
div.dt-container div.dt-paging .dt-paging-button.disabled:hover {
    cursor: default !important;
    color: #777 !important;
    border-color: #ddd !important;
    background-color: #fff !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

div.dt-container div.dt-paging .dt-paging-button:hover:not(.disabled):not(.current) {
    color: #333 !important;
    border-color: #adadad !important;
    background-color: #e6e6e6 !important;
}

div.dt-container div.dt-paging .dt-paging-button:active:not(.disabled) {
    outline: none !important;
    background-color: #d4d4d4 !important;
    border-color: #8c8c8c !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    div.dt-container div.dt-layout-start,
    div.dt-container div.dt-layout-end {
        float: none !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate,
    div.dt-container div.dt-info,
    div.dt-container div.dt-paging {
        float: none !important;
        text-align: center !important;
    }
    
    .dataTables_filter input,
    div.dt-container div.dt-search input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 5px !important;
    }
}

/* ============================================
   EXTRAS
   ============================================ */

/* Fix para dropdown options */
.dataTables_length select option,
div.dt-container div.dt-length select option {
    padding: 5px !important;
}

/* Fix para tablas en panels */
.panel .dataTables_wrapper,
.panel div.dt-container {
    padding: 15px !important;
}

.panel-body .dataTables_wrapper,
.panel-body div.dt-container {
    padding: 0 !important;
}
