﻿/* Botones de exportación */
.dt-buttons {
    text-align: left;
}

.d-flex > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dt-length {
    margin-left: auto;
}

/* Espaciado entre botones de exportación */
div.dt-buttons {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-custom-pink {
    background-color: #E27AB0 !important;
    color: #fff !important;
    border: none !important;
}

    .btn-custom-pink:hover {
        background-color: #d66da3 !important;
        color: white !important;
    }

.btn-sm {
    font-size: 0.85rem !important;
    padding: 0.3rem 0.7rem !important;
}

/* Estilos personalizados para DataTables */

.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: #E27AB0 !important;
    border-color: #E27AB0 !important;
    color: #FFFFFF !important;
}

.dataTables_wrapper .pagination .page-item .page-link {
    color: #E27AB0 !important;
    border-color: #E27AB0 !important;
}

    .dataTables_wrapper .pagination .page-item .page-link:hover {
        background-color: #F8E5ED !important;
        color: #E27AB0 !important;
        border-color: #E27AB0 !important;
    }

.dataTables_wrapper .pagination .page-link {
    border: none !important;
}

.dataTables_wrapper .pagination .page-item.active .page-link:focus {
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_length select {
    display: none !important;
}

/* Estilos personalizados para el dropdown de menú de longitud (LengthMenu) del DataTable */

.custom-dropdown-button {
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 50px;
    background-color: #F8F9FA;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    position: relative;
    text-align: left;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    .custom-dropdown-button:after {
        content: '▼';
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        color: #495057;
    }

    .custom-dropdown-button:hover {
        border-color: #E27AB0;
        box-shadow: 0 0 0 0.2rem rgba(226, 122, 176, 0.25);
    }

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #E27AB0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

    .custom-dropdown-menu.show {
        display: block;
    }

.custom-dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    border-bottom: 1px solid #F8F9FA;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    .custom-dropdown-item:last-child {
        border-bottom: none;
    }

    .custom-dropdown-item:hover {
        background-color: #F8E5ED;
        color: #E27AB0;
    }

    .custom-dropdown-item.active {
        background-color: #E27AB0;
        color: white;
    }

/* Fijar los componentes de DataTable al hacer scroll horizontal */

.dataTables_wrapper {
    overflow-x: auto;
    width: 100%;
    position: relative;
}

/* Agrupa los controles en una sola fila horizontal superior */
.dt-toolbar {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 30;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.dt-info-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    left: 0;
    bottom: 3.5rem;
    z-index: 40;
    width: 100%;
    padding: 0.5rem 0 0.25rem 0;
    box-sizing: border-box;
}

    .dt-info-bar .dataTables_info {
        position: sticky;
        left: 0;
        z-index: 41;
        display: block;
        margin-left: 0;
        margin-right: 0;
        text-align: center;
        width: auto;
    }

.dt-paginate-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    left: 0;
    bottom: 0;
    z-index: 41;
    width: 100%;
    padding: 0.25rem 0 0.5rem 0;
    box-sizing: border-box;
}

    .dt-paginate-bar .dataTables_paginate {
        position: sticky;
        left: 0;
        z-index: 42;
        display: block;
        margin-left: 0;
        margin-right: 0;
        text-align: center;
        width: auto;
    }

    /* Todos los controles superiores con sticky horizontal */
    .dataTables_wrapper .dt-buttons,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .custom-length-dropdown,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate {
        position: sticky;
        left: 0;
        z-index: 20;
        top: 0; /* Si quieres que también sean sticky verticalmente */
    }

        .dataTables_wrapper .dataTables_length,
        .dataTables_wrapper .custom-length-dropdown {
            display: block;
        }

        .table-responsive {
            overflow-x: unset !important;
        }

/* Flechas de ordenamiento para DataTables */
th.sorting::after,
th.sorting_asc::after,
th.sorting_desc::after {
    font-family: "Font Awesome 6 Free", "Arial", sans-serif;
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8em;
    color:lightgray;
    vertical-align: middle;
    display: inline-block;
}

th.sorting::after {
    content: "\f0dc"; /* fa-sort (FontAwesome) o usa "⇅" si no tienes FontAwesome */
}

th.sorting_asc::after {
    content: "\f0de"; /* fa-sort-up (FontAwesome) o usa "↑" */
}

th.sorting_desc::after {
    content: "\f0dd"; /* fa-sort-down (FontAwesome) o usa "↓" */
}