﻿:root {
    --brand: 54, 147, 109; /* verde principal en RGB separado */
    --brand-boostrap: 212, 237, 218;
    --brand-hover: 46, 125, 93; /* verde más oscuro para hover en RGB separado */
    --text-brand: 54, 147, 109; /* texto base en RGB separado */
    --text-brand-boostrap: 46, 125, 93; /* texto base en RGB separado */
    --text-gray: 52, 58, 64;
    --shadow: 0 6px 18px rgba(0,0,0,.15);
    --shadow-hover: 0 10px 24px rgba(0,0,0,.22);
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    overflow-y: auto; /* permite scroll natural */
    height: auto;
}

/* Focus y sombras */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ==== SweetAlert2 scroll fix ==== */
body.swal2-shown,
html.swal2-shown,
body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown),
html.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) {
    overflow-y: visible !important;
    height: auto !important;
}

/* Sidebar limpio */
.app-sidebar {
    width: 250px; /* ancho fijo */
    display: flex;
    flex-direction: column;
    background-color: var(--sidebar-bg, #f8f9fa);
    /* Eliminamos height: 100vh */
    /* Eliminamos overflow aquí; lo manejamos en .sidebar-wrapper */
}

/* Wrapper interno con scroll si hay muchas opciones */
.sidebar-wrapper {
    flex: 1 1 auto; /* ocupa el espacio restante */
    overflow-y: auto; /* scroll solo si hay muchas opciones */
    position: sticky; /* queda visible al hacer scroll */
    top: 0;
    padding: 0.5rem 1rem;
}


/* Logo grande y usuario */
.brand-image-top { width: 13rem; height: auto; }
.brand-image-usuario { width: 40px; height: auto; }

/* Contenedor de logo */
.sidebar-brand {
    border-bottom: 0px solid rgba(255, 255, 255, 0.1);
    overflow: visible !important;
}

/* Área del menú */
.sidebar-wrapper {
    overflow-y: auto;
}

/* Texto del nombre */
.brand-text {
    font-size: 1.1rem;
    color: var(--lte-sidebar-color);
}

/* Botón flotante lateral */
.navbar-nav.floating-toggle {
    position: fixed;
    top: 18px;
    left: 270px;
    z-index: 1100;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.navbar-nav.floating-toggle:hover {
    background-color: rgba(var(--brand), 1);
    transform: scale(1.08);
}

.navbar-nav.floating-toggle i {
    font-size: 1.4rem;
    color: #333;
    transition: color 0.25s ease;
}

.navbar-nav.floating-toggle:hover i { color: #fff; }

/* Dark mode toggle */
@media (prefers-color-scheme: dark) {
    .navbar-nav.floating-toggle { background-color: rgba(40, 40, 40, 0.9); }
    .navbar-nav.floating-toggle i { color: #ddd; }
}

/* Sidebar collapsed/open */
body.sidebar-collapse .navbar-nav.floating-toggle { left: 30px !important; }
body.sidebar-open .navbar-nav.floating-toggle { left: 270px !important; }

/* App wrapper */
.app-wrapper,
.app-main,
.app-content {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

/* Reset de márgenes */
* { margin-bottom: 0 !important; }

/* Pie del menú lateral */
.sidebar-footer {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    padding: 14px 18px;
    width: 100%;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.sidebar-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-text {
    line-height: 1.4;
    font-weight: 400;
    font-family: "Segoe UI", Arial, sans-serif;
}

.renderbody { padding: 5rem 0 0 0 !important; }

/* Títulos */
.titulo {
    font-size: 1.3rem;
    color: rgba(var(--text-brand), 0.65);
    letter-spacing: 0.5px;
    border-left: 4px solid rgba(var(--brand), 1);
    padding-left: 12px;
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.subtitulo {
    font-size: 1.1rem;
    color: rgba(var(--text-brand), 0.65);
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.subtitulo2 {
    font-size: 1rem;
    color: rgba(var(--text-brand), 0.65);
    font-weight: 500;
    margin-bottom: 0.8rem;
}

/* Nav tabs */
.nav-tabs {
    display: flex;
}

.nav-tabs .nav-link {
    border: none;
    color: #495057;
    font-weight: 500;
    width: 220px;
    text-align: center;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.nav-tabs .nav-link:hover {
    background-color: #f8f9fa;
    font-weight: bold;
    color: rgba(var(--brand), 1);
}

.nav-tabs .nav-link.active {
    color: rgba(var(--brand), 1);
    background-color: transparent;
    position: relative;
    font-weight: bold;
}

.nav-tabs .nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 200px;
    height: 3px;
    background-color: rgba(var(--brand), 1);
    transform: translateX(-50%);
}

/* Tab content */
.tab-pane {
    background-color: #fafafa;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Tab counter */
.tab-counter {
    display: inline-block;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    background-color: rgba(var(--text-gray), 1);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    border-radius: 50%;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.tab-counter:hover { transform: scale(1.1); }

.nav-tabs .nav-link.active .tab-counter {
    background-color: rgba(var(--brand), 1);
}

.nav-tabs .nav-link.active:hover .tab-counter {
    background-color: rgba(var(--brand-hover), 1);
}

.nav-tabs .nav-link:hover .tab-counter {
    background-color: rgba(var(--brand), 1);
    transform: scale(1.1);
}

/* Card header */
.card-header {
    background: rgba(var(--brand-boostrap), 1); 
    color: rgba(var(--text-brand-boostrap), 1); 
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card-header:hover {
    background: rgba(var(--brand-boostrap), 0.75);
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

/* Breadcrumb */
.breadcrumb-section {
    border-left: 5px solid rgba(var(--brand), 1);
    padding-left: 15px;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.breadcrumb-section .breadcrumb-item {
    color: rgba(var(--text-gray), 0.6);
}

.breadcrumb-section .breadcrumb-item.active {
    color: rgba(var(--text-gray), 1);
    font-weight: 600;
}

/* Tabla */
.table .col-audit { max-width: 100px; }


#global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none !important;
    align-items: center;
    justify-content: center;
}
    #global-loader.active {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
.loader-dual-ring {
    display: inline-block;
    width: 80px;
    height: 80px;
}

    .loader-dual-ring:after {
        content: " ";
        display: block;
        width: 64px;
        height: 64px;
        margin: 8px;
        border-radius: 50%;
        border: 6px solid rgba(var(--brand), 1);
        border-color: rgba(var(--brand), 1) transparent rgba(var(--brand), 1) transparent;
        animation: loader-dual-ring 1.2s linear infinite;
    }

@keyframes loader-dual-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-class {
    color: rgba(var(--text-brand), 1) !important;
    font-size: 1.2rem;
}

.disabled {
    pointer-events: none; /* bloquea clics, focus, hover */
    opacity: 1; /* efecto visual de deshabilitado */
    background-color: #e9ecef !important;
    cursor: not-allowed;
}

.select2-container.disabled .select2-selection--single {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
}

.highlight-section {
    transition: background-color 1s ease-in-out !important;
    background-color: rgba(13, 110, 253, 0.15) !important; /* Un azul muy tenue pero perceptible */
    outline: 2px solid rgba(13, 110, 253, 0.3); /* Borde suave opcional */
}