/* ---------------------------------------- */
/* Layout general y colapso                 */
/* ---------------------------------------- */
.app-shell {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar content";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 60px 1fr;
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

    /* Cuando collapsed = true */
    .app-shell.collapsed {
        grid-template-columns: 0 1fr !important;
    }

        /* Oculta completamente el sidebar */
        .app-shell.collapsed .app-sidebar {
            display: none !important;
        }

/* ---------------------------------------- */
/* Cabecera del aplicativo                  */
/* ---------------------------------------- */
.app-header {
    grid-area: header;
    background: #001f6e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-weight: bold;
}

/* ---------------------------------------- */
/* Botones de icono (hamburguesa, cerrar)   */
/* ---------------------------------------- */
.btn-icon {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
}

    .btn-icon.hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        padding: 0;
    }

        .btn-icon.hamburger span {
            display: block;
            height: 3px;
            background: #fff;
            border-radius: 2px;
        }

/* ---------------------------------------- */
/* Sidebar                                   */
/* ---------------------------------------- */
.app-sidebar {
    grid-area: sidebar;
    background: #0c1d58;
    color: #fff;
    padding-top: 1rem;
    overflow-y: auto;
    transition: opacity 0.2s ease;
}

    .app-sidebar ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .app-sidebar li {
        cursor: pointer;
    }

        .app-sidebar li.active,
        .app-sidebar li:hover {
            background: rgba(255, 255, 255, 0.1);
        }

/* ---------------------------------------- */
/* Contenido principal                      */
/* ---------------------------------------- */
.app-content {
    grid-area: content;
    background: #ddd;
    margin: 1rem;
    padding: 1rem;
    border-radius: 1.5rem;
    overflow-y: auto;
}

/* ---------------------------------------- */
/* Enlaces del sidebar (NavLink)            */
/* ---------------------------------------- */
.app-sidebar .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

    .app-sidebar .nav-link:hover,
    .app-sidebar .nav-link.active {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

:root {
    --color-principal: #1c2c5c;
    --bs-primary: var(--color-principal);
    --bs-primary-rgb: 28, 44, 92;
    --bs-primary-hover: color-mix(in srgb, var(--color-principal), white 20%);
}

/* Botón primario */
.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:active {
        background-color: var(--bs-primary-hover) !important;
        border-color: var(--bs-primary-hover) !important;
        color: #fff !important;
    }

/* Enlaces */
.link-primary {
    color: var(--bs-primary) !important;
}

    .link-primary:hover {
        color: var(--bs-primary-hover) !important;
    }

/* Texto */
.text-primary {
    color: var(--bs-primary) !important;
}

/* Bordes */
.border-primary {
    border-color: var(--bs-primary) !important;
}

/* Fondos */
.bg-primary {
    background-color: var(--bs-primary) !important;
    color: #fff;
}

.nav-link {
    color: var(--bs-primary) !important;
}

    .nav-link.active {
        background-color: var(--bs-primary) !important;
        color: #fff !important;
    }

    .nav-link:hover:not(.active) {
        background-color: var(--bs-primary-hover) !important;
        color: #fff !important;
    }

/* Estilos para prioridad visual (cola de trabajo) */
.prioridad-alta {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 0.5rem;
}

.prioridad-media {
    background-color: #ffc107;
    color: black;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 0.5rem;
}

.prioridad-baja {
    background-color: #198754;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 0.5rem;
}

/* Bloque visual en el span */
span[class^="prioridad-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 28px;
    padding: 4px 12px;
    border-radius: 0.5rem;
    font-weight: bold;
    font-size: 0.85rem;
    line-height: 1.25rem;
    text-align: center;
}

.swal2-spinner .swal2-title {
    color: white !important;
    font-weight: bold !important;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.6);
}

.swal2-spinner {
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.form-control:disabled {
    background-color: #c0c0c0 !important; /* override fuerte */
    color: #444 !important;
    opacity: 1 !important;
}

/*Pagina defs formulario consulta*/
.titulo-consulta {
    font-size: 1.5rem; 
    font-weight: bold; 
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

th, td {
    text-align: center;
    vertical-align: middle;
}

/*Pagina formulario externo*/
.pages-azul {
    color: #0074D9 !important;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal.show {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    background-color: rgba(0,0,0,0.5);
}

.modal-backdrop {
    z-index: 9999 !important;
}

#comprobante-container {
    max-height: 80vh;
    overflow-y: auto;
    padding: 1rem;
    background: white;
    border-radius: 1rem;
}

/* dashboard*/
/* Alto fijo + scroll vertical + header sticky */
.detalle-scroll {
    max-height: 240px; /* 3–5 filas aprox */
    overflow-y: auto;
    overflow-x: hidden; /* el horizontal lo maneja .table-responsive */
    position: relative; /* ayuda al sticky */
    -webkit-overflow-scrolling: touch; /* suave en iOS */
}

    .detalle-scroll thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
        /* opcional: sombreado para separar */
        box-shadow: 0 2px 0 rgba(0,0,0,.03);
    }

    /* Evita espacio extra al final */
    .detalle-scroll table {
        margin-bottom: 0;
    }
* Encabezado fijo */
.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
}

/* Fila de totales fija al fondo */
.table-scroll tfoot th,
.table-scroll tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 0 -1px 0 rgba(0,0,0,.06);
    font-weight: 600;
}

/* Para que no se corten textos */
.table-scroll .table-sm th,
.table-scroll .table-sm td {
    white-space: nowrap;
}