﻿html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
}

.content-wrapper {
    flex: 1;
    padding: 1rem;
    overflow: auto;
}

main {
    flex-grow: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
}

.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    background-color: #212529;
}

    .sidebar .btn-toggle {
        width: 100%;
        text-align: left;
        padding-left: 1.5rem;
        background: none;
        border: none;
        color: white;
        margin-bottom: 0.5rem;
        transition: background .2s;
    }

        .sidebar .btn-toggle:hover {
            background: rgba(255,255,255,.1);
        }

    /* Links internos */
    .sidebar a.nav-link {
        padding-left: 2rem;
        color: white;
    }

        .sidebar a.nav-link:hover {
            background: rgba(255,255,255,.1);
        }

        /* Ítem activo */
        .sidebar a.nav-link.active {
            background: #0d6efd;
            border-radius: 4px;
        }

/* Icono dropdown */
.btn-toggle .dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-toggle[aria-expanded="true"] .dropdown-icon {
    transform: rotate(90deg);
}

/* Puntito submenu */
.nav-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

/* =========================================
   4. TABLAS
========================================= */

.table-header-darkgray {
    background-color: #2b2b2b !important;
    color: white !important;
}

.table-body-white {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.table-bordered td,
.table-bordered th {
    border-color: #ddd !important;
}

/* DataTables */
table.dataTable th, table.dataTable td,
.tabla-usuarios th, .tabla-usuarios td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* =========================================
   5. COMPONENTES
========================================= */

/* Cards */
.hub-card {
    border: 1px solid #000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

    .hub-card:hover {
        transform: translateY(-5px);
    }

/* Inputs */
.readonly-input {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Usuario logueado */
.user-info {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    border-radius: 50px;
}

/* Toast */
.custom-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #323232;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
}

/* Footer */
.footer {
    background-color: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 15px 0;
}

/* Buscar */
div.dataTables_filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

div.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    font-weight: 500;
}

div.dataTables_filter input {
    margin-left: 0 !important;
}

/* Mostrar registros */
div.dataTables_length {
    display: flex;
    align-items: center;
    gap: 6px;
}

div.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    font-weight: 500;
    white-space: nowrap;
}
/* Contenedor */
.dataTables_paginate {
    margin-top: 10px;
}

/* ===== DATATABLES PAGINATION - OVERRIDE TOTAL ===== */
/* ===== FIX DEFINITIVO PAGINATE_BUTTON ===== */

/* RESET TOTAL del LI */
.dataTables_wrapper .paginate_button {
    background: transparent !important;
    box-shadow: none !important;
}

    /* IMPORTANTE: el LI activo NO debe reaccionar */
    .dataTables_wrapper .paginate_button.active {
        background: transparent !important;
    }

        /* NI HOVER, NI FOCUS, NI NADA */
        .dataTables_wrapper .paginate_button.active:hover,
        .dataTables_wrapper .paginate_button.active:focus,
        .dataTables_wrapper .paginate_button.active:active {
            background: transparent !important;
        }

    /* El estilo VISUAL va SOLO en el link */
    .dataTables_wrapper .paginate_button .page-link {
        border: 1px solid #000;
        background-color: transparent;
        color: #000;
        border-radius: 6px;
        padding: 6px 14px;
        box-shadow: none !important;
    }

    /* Hover SOLO no activos */
    .dataTables_wrapper
    .paginate_button:not(.active):not(.disabled)
    .page-link:hover {
        background-color: rgba(0,0,0,0.06) !important;
        color: #000 !important;
    }

    /* Página activa */
    .dataTables_wrapper .paginate_button.active .page-link {
        background-color: #000 !important;
        color: #fff !important;
        border-color: #000 !important;
        cursor: default;
    }

 
        .dataTables_wrapper .paginate_button.active .page-link:hover {
            background-color: #000 !important;
            color: #fff !important;
        }
        
/*==================================================
    GRID CUENTAS
==================================================*/

#cuentasContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/*==================================================
    WRAPPER
==================================================*/

.cuenta-wrapper {
    display: block;
}

.cuenta-checkbox {
    display: none;
}

/*==================================================
    TARJETA
==================================================*/

.cuenta-card {
    width: 100%;
    height: 100%;

    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #dcdcdc;
    background: #f1f1f1;
    opacity: .75;
    transition: all .25s ease;
}

    .cuenta-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 20px rgba(0,0,0,.12);
    }

    /*==================================================
    TARJETA SELECCIONADA
==================================================*/

    .cuenta-card.selected {
        background: white;
        border: 2px solid #111111;
        opacity: 1;
        box-shadow: 0 8px 20px rgba(0,0,0,.18);
    }

/*==================================================
    PARTE SUPERIOR
==================================================*/

.cuenta-top {
    background: #bdbdbd;
    color: #2d2d2d;
    padding: 18px;
    min-height: 120px;
    transition: all .25s ease;
}

.cuenta-card.selected .cuenta-top {
    background: linear-gradient(135deg,#111111,#3a3a3a);
    color: white;
}

/*==================================================
    PARTE INFERIOR
==================================================*/

.cuenta-bottom {
    background: white;
    padding: 16px 18px;
    border-top: 1px solid #e2e2e2;
}

.cuenta-card.selected .cuenta-bottom {
    background: #ffffff;
}

/*==================================================
    TEXTOS
==================================================*/

.numero-cuenta {
    font-weight: 700;
    font-size: .9rem;
}

.banco-texto {
    opacity: .85;
}

.cuenta-card.selected .banco-texto {
    opacity: 1;
}

/* =========================================
   TEXTO BANCO
========================================= */

.banco-texto {
    color: #555;
    transition: all 0.25s ease;
}

.cuenta-card.selected .banco-texto {
    color: rgba(255,255,255,0.85);
}

/* =========================================
   CHECKBOX
========================================= */

.cuenta-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1400px) {
    #cuentasContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    #cuentasContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    #cuentasContainer {
        grid-template-columns: repeat(1, 1fr);
    }
}


.role-card.selected {
    background: linear-gradient(135deg, #111111, #333333);
    border: 2px solid #111;
    color: white;
    opacity: 1;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

    .role-card.selected p {
        color: rgba(255,255,255,0.75) !important;
    }

.role-icon {
    font-size: 42px;
    margin-bottom: 18px;
}

.btn-ticket-flotante {
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,.25);
    z-index: 9998;
    transition: all .2s ease;
}

    .btn-ticket-flotante:hover {
        color: white;
        transform: scale(1.08);
    }

    .btn-ticket-flotante:active {
        transform: scale(.95);
    }

.sla-negro {
    background-color: #000;
    color: #fff;
    font-weight: bold;
}

.sla-rojo {
    background-color: #dc3545;
    color: #fff;
    font-weight: bold;
}

.sla-naranja {
    background-color: #fd7e14;
    color: #fff;
    font-weight: bold;
}

.sla-amarillo {
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
}

.sla-azul {
    background-color: #0d6efd;
    color: #fff;
    font-weight: bold;
}

.estado-cfg {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.estado-verde {
    background-color: #198754;
}

.estado-rojo {
    background-color: #dc3545;
}

.estado-gris {
    background-color: #6c757d;
}

.badge-estado {
    width: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.bg-purple {
    background: #6f42c1;
}

.document-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 5px;
    scroll-behavior: smooth;
}

    .document-slider::-webkit-scrollbar {
        height: 10px;
    }

    .document-slider::-webkit-scrollbar-thumb {
        background: #b8b8b8;
        border-radius: 20px;
    }

    .document-slider::-webkit-scrollbar-track {
        background: #ececec;
    }

/* Tarjeta */
.document-card {
    width: 180px;
    height: 120px;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    overflow: hidden;
    transition: all .20s ease;
}

    .document-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 .6rem 1.2rem rgba(0,0,0,.18);
    }

/* Header de la tarjeta */
.document-header {
    min-height: 42px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Cuerpo */
.document-body {
    height: calc(100px - 42px);
    padding: 18px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Espacio reservado para imagen */
.document-preview {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #adb5bd;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* Iconos */
.document-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

    /* Tamaño de iconos */
    .document-icons img {
        width: 30px;
        height: 30px;
        object-fit: contain;
        transition: .2s;
    }

        .document-icons img:hover {
            transform: scale(1.08);
        }

/* Disponible */
.icon-active {
    opacity: 1;
}

/* No disponible */
.icon-disabled {
    opacity: .20;
    filter: grayscale(100%);
}

/* Enlaces */
.document-card a,
.document-card a:hover {
    text-decoration: none;
    color: inherit;
}

/* Card de categorías */
.card-header {
    letter-spacing: .3px;
}
/* Imagen representativa del documento */
.document-preview-img {
    max-width: 90px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: .80;
    transition: .2s;
}

.document-card:hover .document-preview-img {
    transform: scale(1.05);
    opacity: 1;
}

.dashboard-comdata {
    background-color: #390099 !important;
    color: white !important;
}

.dashboard-cliente {
    background-color: #ffbd00 !important;
    color: white !important;
}

.dashboard-etv {
    background-color: #ff0054 !important;
    color: #212529 !important;
}