/* Estilos para el dashboard */
.wrapper {
    position: relative;
    min-height: 100vh !important;
}

.content-wrapper {
    min-height: calc(100vh - 101px) !important;
}

.main-footer {
    margin-left: inherit;
    background: #fff;
    padding: 15px;
    color: #444;
    border-top: 1px solid #d2d6de;
}

/* =====================================
   CONTAINERS DEL MENU - ORGANIZACIÓN MEJORADA
   ===================================== */

/* Container principal del sidebar */
.sidebar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Container del menú de navegación */
.menu-navigation-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    position: relative;
}

/* Ocultar completamente el scrollbar en Webkit/Chrome */
.menu-navigation-container::-webkit-scrollbar {
    display: none;
}

/* Comportamiento responsive del container */
.sidebar-collapse .sidebar-container {
    padding: 0 2px;
}

.sidebar-collapse .menu-navigation-container {
    text-align: center;
}

/* CENTRADO PERFECTO DE ICONOS CUANDO MENU ESTÁ COLAPSADO */
.sidebar-collapse .sidebar-menu > li > a {
    text-align: center !important;
    padding: 12px 0 !important;
    margin: 2px 0 !important;
    display: block !important;
    position: relative !important;
}

.sidebar-collapse .sidebar-menu > li > a > i {
    margin: 0 !important;
    width: auto !important;
    text-align: center !important;
    display: block !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

.sidebar-collapse .sidebar-menu > li > a > span {
    display: none !important;
}

/* Centrado para elementos treeview colapsados */
.sidebar-collapse .sidebar-menu > li.treeview > a {
    text-align: center !important;
    padding: 12px 0 !important;
}

.sidebar-collapse .sidebar-menu > li.treeview > a > .pull-right-container {
    display: none !important;
}

/* Tooltip para mostrar texto en hover cuando está colapsado */
.sidebar-collapse .sidebar-menu > li > a::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-left: 10px;
    pointer-events: none;
}

.sidebar-collapse .sidebar-menu > li > a:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Ajustes especiales para el panel de usuario colapsado */
.sidebar-collapse .user-panel {
    padding: 8px 0 !important;
    margin: 8px 0 !important;
    text-align: center !important;
}

.sidebar-collapse .user-panel .image {
    float: none !important;
    margin: 0 auto !important;
    text-align: center !important;
    display: block !important;
}

.sidebar-collapse .user-panel .info {
    display: none !important;
}

/* Efectos de transición para los containers */
.sidebar-container,
.menu-navigation-container {
    transition: all 0.3s ease !important;
}

/* Altura específica para el container del menú */
.menu-navigation-container {
    height: auto;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
.menu-navigation-container::-webkit-scrollbar {
    width: 5px;
    background: rgba(0,0,0,0.1);
}
.menu-navigation-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}
.menu-navigation-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Ajustes para dispositivos móviles */
@media (max-width: 768px) {
    .sidebar-container {
        padding: 0 5px;
    }
    
    .menu-navigation-container {
        max-height: calc(100vh - 120px);
        min-height: 300px;
    }
    
    .menu-navigation-container::-webkit-scrollbar {
        width: 2px;
    }
}

/* Estado activo del container */
.sidebar:hover .menu-navigation-container {
    overflow-y: auto;
}

/* =====================================
   ESTILOS MEJORADOS PARA MENU LATERAL - ALTA VISIBILIDAD
   ===================================== */

/* Quitar borde izquierdo azul del item activo en el menu lateral */
.skin-blue .main-sidebar .sidebar-menu > li.active > a {
    border-left: none !important;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%) !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    margin: 3px 8px;
    color: #ffffff !important;
    font-weight: 600;
    transform: translateX(5px);
}

/* Mejoras generales del sidebar con mayor contraste */
.main-sidebar {
    background: linear-gradient(180deg, #1a252f 0%, #2c3e50 100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    border-right: 1px solid rgba(255,255,255,0.1);
    overflow: hidden !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}
.main-sidebar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}
/* Asegurar que todos los contenedores internos del sidebar no tengan scroll */
.main-sidebar .sidebar,
.main-sidebar .sidebar-menu,
.main-sidebar .sidebar-menu > li,
.main-sidebar .user-panel,
.main-sidebar .sidebar-form {
    overflow: hidden !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Panel de usuario en el sidebar - RESPONSIVE MEJORADO */
.user-panel {
    padding: 8px 15px 8px;
    margin: 0px 8px 8px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(46, 204, 113, 0.15) 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease !important;
    display: block !important;
    text-align: left !important;
    min-height: 80px !important;
}

/* Responsive behavior - cuando sidebar está colapsado */
.sidebar-collapse .user-panel {
    padding: 8px 5px !important;
    margin: 5px 2px !important;
    text-align: center !important;
    display: block !important;
    min-height: auto !important;
}

.sidebar-collapse .user-panel .info {
    display: none !important;
}

.sidebar-collapse .user-panel .image {
    float: none !important;
    margin: 0 auto !important;
    text-align: center !important;
    display: block !important;
}

.sidebar-collapse .user-panel .image img {
    width: 35px !important;
    height: 35px !important;
}

/* Comportamiento adicional para sidebar mini */
.sidebar-mini .user-panel .info {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.sidebar-mini:hover .user-panel .info {
    opacity: 1 !important;
}

/* Transiciones suaves para el panel completo */
.user-panel, .user-panel .info, .user-panel .image {
    transition: all 0.3s ease !important;
}

.user-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c, #f39c12);
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.user-panel .image img {
    width: 45px;
    height: 45px;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

/* Mejorar centrado de elementos del panel de usuario */
.user-panel .image {
    float: left !important;
    margin-right: 15px !important;
    display: block !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.user-panel .info {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 15px !important;
    padding-top: 2px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.user-panel:hover .image img {
    transform: scale(1.08);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.5);
    border-color: rgba(255,255,255,1);
}

.user-panel .info p {
    color: #ffffff !important;
    font-weight: 700;
    margin: 0 0 4px !important;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.user-panel .info small {
    color: rgba(255,255,255,0.9) !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 !important;
}

/* Override para clases pull-left en user-panel */
.user-panel .pull-left {
    float: left !important;
}

.user-panel .pull-left.image {
    display: block !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
    width: auto !important;
}

.user-panel .pull-left.info {
    display: block !important;
    overflow: hidden !important;
    margin-left: 0 !important;
    margin-right: 15px !important;
    padding-top: 5px !important;
}

.user-panel .info .text-success {
    color: #2ecc71 !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

/* Mejoras en los elementos del menú para mayor visibilidad */
.sidebar-menu > li > a {
    padding: 10px 18px;
    margin: 2px 8px;
    border-radius: 8px;
    transition: all 0.4s ease;
    position: relative;
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    font-size: 14px;
}

.sidebar-menu > li > a:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(46, 204, 113, 0.3) 100%) !important;
    transform: translateX(6px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    color: #ffffff !important;
    border-left: 4px solid #3498db;
}

/* Iconos del menu con mejor espaciado y visibilidad */
.sidebar-menu > li > a > i {
    margin-right: 12px;
    width: 22px;
    text-align: center;
    font-size: 17px;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.sidebar-menu > li > a:hover > i,
.sidebar-menu > li.active > a > i {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    transform: scale(1.1);
}

/* Estilos para submenus (treeview) mejorados */
.treeview-menu {
    background: linear-gradient(135deg, rgba(26, 37, 47, 0.9) 0%, rgba(44, 62, 80, 0.9) 100%) !important;
    margin: 5px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
    max-height: none; /* Sin límite de altura para mostrar todos los ítems */
    overflow-y: visible; /* Mostrar todo el contenido del submenú */
    will-change: transform; /* Optimización para animaciones */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

.treeview-menu > li > a {
    padding: 12px 18px 12px 45px;
    margin: 2px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.8) !important;
    font-size: 13px;
    border-left: 2px solid transparent;
}

.treeview-menu > li > a:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.4) 0%, rgba(46, 204, 113, 0.4) 100%) !important;
    padding-left: 50px;
    color: #ffffff !important;
    border-left: 2px solid #3498db;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

/* Animacion suave para el menu desplegable */
.treeview > a > .pull-right-container > .fa-angle-left {
    transition: transform 0.3s ease;
}

.treeview.menu-open > a > .pull-right-container > .fa-angle-left {
    transform: rotate(-90deg);
}

/* =====================================
   ESTILOS MEJORADOS PARA CABEZOTE - ALTA VISIBILIDAD
   ===================================== */

/* Mejoras del header principal - BARRA DELGADA */
.main-header {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 40%, #3498db 100%) !important;
    box-shadow: 0 6px 25px rgba(0,0,0,0.8) !important;
    position: relative !important;
    border-bottom: 3px solid #3498db !important;
    z-index: 10000 !important;
    min-height: 50px !important;
    height: 50px !important;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #27ae60, #3498db, #9b59b6, #e74c3c);
    background-size: 400% 100%;
    animation: rainbow-flow 3s linear infinite;
}

@keyframes rainbow-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Logo mejorado - AJUSTADO A BARRA DELGADA */
.main-header .logo {
    background: rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease;
    border-right: 2px solid rgba(255,255,255,0.2);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    height: 50px !important;
    line-height: 50px !important;
    padding: 0 15px !important;
}

.main-header .logo:hover {
    background: rgba(0,0,0,0.3) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.logo-lg, .logo-mini {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    color: #ffffff !important;
    font-size: 18px !important;
    line-height: 50px !important;
}

.logo-lg i, .logo-mini i {
    margin-left: 8px;
    font-size: 1em;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Boton hamburger personalizado - UNICO Y VISIBLE */
.hamburger {
    display: inline-block;
    position: relative;
    width: 24px;
    height: 18px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 3px;
    background: #ffffff;
    margin: 3px 0;
    transition: all 0.4s ease;
    transform-origin: center;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Animación mejorada del hamburger */
.sidebar-collapse .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: #e74c3c;
}

.sidebar-collapse .hamburger span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.sidebar-collapse .hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: #e74c3c;
}

/* Información de fecha en header - ADAPTADA A BARRA DELGADA */
.navbar-text {
    color: rgba(255,255,255,0.95) !important;
    padding: 8px 10px !important;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    margin: 4px;
    line-height: 1.2;
}

.navbar-text i {
    margin-right: 6px;
    color: #f39c12;
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
    font-size: 12px;
}

/* Boton toggle del sidebar - ADAPTADO A BARRA DELGADA */
.sidebar-toggle {
    padding: 8px 12px !important;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    position: relative !important;
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border-radius: 8px !important;
    margin: 4px 8px !important;
    border: 1px solid #fff !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4) !important;
    z-index: 9999 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 32px !important;
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #2980b9, #1f5582) !important;
    transform: scale(1.05) rotate(2deg) !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.6) !important;
    border-color: #f39c12 !important;
}

.sidebar-toggle:focus,
.sidebar-toggle:active {
    background: linear-gradient(135deg, #1f5582, #154360) !important;
    outline: none !important;
    transform: scale(0.98) !important;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* Efectos para las barras del hamburguesa */
.sidebar-toggle .hamburger {
    position: relative !important;
}

.sidebar-toggle .hamburger span {
    background: #fff !important;
    height: 3px !important;
    border-radius: 2px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    transition: all 0.3s ease !important;
}

.sidebar-toggle:hover .hamburger span {
    background: #f39c12 !important;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.5) !important;
}

/* COMENTADO: Pseudo-elemento que causaba duplicación visual del botón
.sidebar-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover::after {
    width: 40px;
    height: 40px;
}
*/

/* Menu de usuario - ADAPTADO A BARRA DELGADA */
.navbar-custom-menu .dropdown-toggle {
    padding: 8px 12px !important;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.1);
    border-radius: 6px;
    margin: 4px 6px;
    border: 1px solid rgba(255,255,255,0.1);
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
}

.navbar-custom-menu .dropdown-toggle:hover {
    background: rgba(0,0,0,0.2) !important;
    transform: scale(1.02);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.user-image {
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    width: 24px !important;
    height: 24px !important;
}

.dropdown-toggle:hover .user-image {
    border-color: rgba(255,255,255,1);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

/* Texto del usuario - ADAPTADO A BARRA DELGADA */
.navbar-custom-menu .hidden-xs {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin-left: 8px;
    font-size: 13px !important;
    line-height: 1.2 !important;
}

.user-role {
    display: block;
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
    color: rgba(255,255,255,0.7) !important;
    margin-top: 1px;
}

/* Dropdown del usuario */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border: none;
    overflow: hidden;
    min-width: 280px;
}

.user-header {
    background: linear-gradient(135deg, #3c8dbc 0%, #367fa9 100%);
    color: white;
    text-align: center;
    padding: 20px;
}

.user-header img {
    border: 3px solid rgba(255,255,255,0.8);
    margin-bottom: 10px;
}

.user-header p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.user-header small {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
}

.user-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    text-align: center;
}

.user-footer {
    background: #f4f4f4;
    padding: 10px 15px;
    text-align: center;
}

.user-role {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    font-weight: normal;
}

.btn-danger.btn-flat {
    background: linear-gradient(135deg, #d73925 0%, #c23321 100%) !important;
    color: white !important;
    border: none !important;
    padding: 8px 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(215, 57, 37, 0.4) !important;
    transition: all 0.3s ease !important;
}

.btn-danger.btn-flat:hover {
    background: linear-gradient(135deg, #c23321 0%, #a02622 100%) !important;
    box-shadow: 0 4px 12px rgba(215, 57, 37, 0.6) !important;
    transform: translateY(-2px) !important;
}

.btn-danger.btn-flat:active,
.btn-danger.btn-flat:focus {
    background: linear-gradient(135deg, #a02622 0%, #8b1f1c 100%) !important;
    outline: none !important;
}

/* Estilos específicos para el botón cerrar sesión en móvil */
@media (max-width: 768px) {
    .user-footer {
        background: #f8f9fa !important;
        padding: 15px !important;
    }
    
    /* Eliminar float en móvil para el contenedor del botón */
    .user-footer .pull-right {
        float: none !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .user-footer .btn-danger.btn-flat {
        width: 100% !important;
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        color: #ffffff !important;
        font-size: 14px !important;
        padding: 12px 20px !important;
        border-radius: 6px !important;
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.5) !important;
        display: block !important;
        text-align: center !important;
        font-weight: 700 !important;
        float: none !important;
    }
    
    .user-footer .btn-danger.btn-flat:hover,
    .user-footer .btn-danger.btn-flat:active {
        background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
        box-shadow: 0 5px 15px rgba(220, 53, 69, 0.7) !important;
    }
    
    .user-footer .btn-danger.btn-flat i {
        margin-right: 8px !important;
        font-size: 16px !important;
    }
}

/* Estilos para desktop - mantener el diseño original */
@media (min-width: 769px) {
    .user-footer .btn-danger.btn-flat {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        color: #ffffff !important;
        border: none !important;
    }
    
    .user-footer .btn-danger.btn-flat:hover {
        background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    }
}

/* =====================================
   ESTILOS RESPONSIVE PARA HEADER Y MENU
   ===================================== */

@media (max-width: 768px) {
    .main-header .logo {
        padding: 15px 10px;
    }
    
    .sidebar-menu > li > a {
        padding: 10px 12px;
    }
    
    .sidebar-menu > li > a > i {
        margin-right: 8px;
        font-size: 14px;
    }
    
    .navbar-custom-menu .dropdown-toggle {
        padding: 12px 8px !important;
    }
    
    /* Panel de usuario responsive en móvil */
    .user-panel {
        padding: 15px 10px 12px !important;
        margin: 8px 5px 15px !important;
    }
    
    .user-panel .image img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .user-panel .info {
        margin-left: 52px !important;
        padding-top: 4px !important;
    }
    
    .user-panel .info p {
        font-size: 13px !important;
        margin: 0 0 4px !important;
    }
    
    .user-panel .info small {
        font-size: 11px !important;
    }
}

/* Mejoras adicionales para dispositivos pequenos */
@media (max-width: 480px) {
    .hidden-xs {
        display: none !important;
    }
    
    .user-image {
        width: 25px;
        height: 25px;
    }
    
    .sidebar-menu > li > a span {
        font-size: 14px;
    }
}

/* =====================================
   ANIMACIONES Y EFECTOS ESPECIALES
   ===================================== */

/* Efecto hover suave para todos los enlaces del menu */
.sidebar-menu a {
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-menu a:hover::before {
    left: 100%;
}

/* Efecto pulsante para elementos activos */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(60, 141, 188, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(60, 141, 188, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 141, 188, 0); }
}

.sidebar-menu > li.active > a {
    animation: pulse 2s infinite;
}

/* Ocultar scrollbar del sidebar */
.sidebar {
    overflow: hidden !important;
    -ms-overflow-style: none !important;  /* IE y Edge */
    scrollbar-width: none !important;  /* Firefox */
}
.sidebar::-webkit-scrollbar {
    display: none !important;  /* Chrome, Safari y Opera */
    width: 0 !important;
}

/* Mejoras para tooltips */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Transiciones suaves globales */
* {
    transition: all 0.3s ease;
}

/* Mejoras para el contenido principal */
.content-wrapper {
    background: linear-gradient(135deg, #f4f4f4 0%, #e8e8e8 100%);
    min-height: calc(100vh - 50px); /* Asegura que el contenido empuje el footer hacia abajo */
}

/* Estilos para mejorar la responsividad de las tablas */
@media (max-width: 768px) {
    .tablaVentas {
        font-size: 12px;
    }
    
    .tablaVentas img {
        max-width: 30px !important;
        height: auto;
    }
    
    .dt-buttons {
        margin-bottom: 10px;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
    }
    
    .table-responsive {
        border: none;
    }
}

/* Mejorar la visualizacion de botones en dispositivos moviles */
@media (max-width: 576px) {
    .btnAgregarProducto {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .input-group {
        margin-bottom: 10px;
    }
    
    .form-group .col-xs-3,
    .form-group .col-xs-6 {
        margin-bottom: 10px;
    }
}

/* Estilos para DataTables responsive */
.dtr-details {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
}

.dtr-title {
    font-weight: bold;
    margin-right: 10px;
}

/* Ajustar el control de expansion de filas */
.dtr-control {
    text-align: center;
    cursor: pointer;
}

.dtr-control:before {
    background-color: #007bff;
    border-radius: 50%;
    color: white;
    content: '+';
    display: inline-block;
    font-weight: bold;
    height: 20px;
    line-height: 20px;
    text-align: center;
    width: 20px;
}

.dtr-control.collapsed:before {
    content: '+';
}

.dtr-control.expanded:before {
    content: '-';
}

/* SOLUCION FINAL - Eliminar TODOS los botones duplicados */
/* Ocultar ABSOLUTAMENTE todos los navbar-toggle de Bootstrap */
.navbar-toggle,
button.navbar-toggle,
.navbar .navbar-toggle,
.navbar-header .navbar-toggle,
[data-toggle="collapse"],
.navbar-collapse .navbar-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Garantizar que SOLO el sidebar-toggle sea visible */
.sidebar-toggle {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 99999 !important;
    pointer-events: all !important;
}

/* MENU SIDEBAR - Visibilidad máxima mejorada */
.main-sidebar .sidebar {
    background: transparent !important;
}

.sidebar-menu > li > a {
    color: #ecf0f1 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
    font-weight: 600 !important;
    border-left: 4px solid transparent !important;
    transition: all 0.3s ease !important;
}

.sidebar-menu > li:hover > a {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(41, 128, 185, 0.3)) !important;
    border-left-color: #3498db !important;
    color: #fff !important;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.8) !important;
    transform: translateX(5px) !important;
}

.sidebar-menu > li.active > a {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border-left-color: #f39c12 !important;
    color: #fff !important;
    text-shadow: 0 0 15px rgba(243, 156, 18, 0.8) !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4) !important;
    font-weight: 700 !important;
}

/* Efecto de pulso para elementos activos */
.sidebar-menu > li.active > a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

/*=====================================
TABLA VEHÍCULOS - RESPONSIVE
======================================*/

/* Tabla de vehículos con scroll horizontal */
.vehiculos-table-container {
    overflow-x: auto;
    overflow-y: visible;
    white-space: nowrap;
    margin-bottom: 1rem;
}

/* Ajustar el ancho mínimo de la tabla de vehículos */
.vehiculos-table-container table {
    min-width: 1500px;
    white-space: nowrap;
}

/* Columnas de la tabla de vehículos con anchos específicos */
.vehiculos-table-container th:nth-child(1),
.vehiculos-table-container td:nth-child(1) { width: 40px; } /* # */

.vehiculos-table-container th:nth-child(2),
.vehiculos-table-container td:nth-child(2) { width: 100px; } /* Código */

.vehiculos-table-container th:nth-child(3),
.vehiculos-table-container td:nth-child(3) { width: 150px; } /* Nombre */

.vehiculos-table-container th:nth-child(4),
.vehiculos-table-container td:nth-child(4) { width: 120px; } /* Tipo */

.vehiculos-table-container th:nth-child(5),
.vehiculos-table-container td:nth-child(5) { width: 140px; } /* Marca/Modelo */

.vehiculos-table-container th:nth-child(6),
.vehiculos-table-container td:nth-child(6) { width: 100px; } /* Patente */

.vehiculos-table-container th:nth-child(7),
.vehiculos-table-container td:nth-child(7) { width: 120px; } /* N° Serie */

.vehiculos-table-container th:nth-child(8),
.vehiculos-table-container td:nth-child(8) { width: 70px; } /* Año */

.vehiculos-table-container th:nth-child(9),
.vehiculos-table-container td:nth-child(9) { width: 110px; } /* Estado */

.vehiculos-table-container th:nth-child(10),
.vehiculos-table-container td:nth-child(10) { width: 100px; } /* Kilometraje */

.vehiculos-table-container th:nth-child(11),
.vehiculos-table-container td:nth-child(11) { width: 80px; } /* Horas */

.vehiculos-table-container th:nth-child(12),
.vehiculos-table-container td:nth-child(12) { width: 120px; } /* Combustible */

.vehiculos-table-container th:nth-child(13),
.vehiculos-table-container td:nth-child(13) { width: 110px; } /* Propietario */

.vehiculos-table-container th:nth-child(14),
.vehiculos-table-container td:nth-child(14) { width: 150px; } /* Ubicación */

.vehiculos-table-container th:nth-child(15),
.vehiculos-table-container td:nth-child(15) { width: 70px; } /* Alertas */

.vehiculos-table-container th:nth-child(16),
.vehiculos-table-container td:nth-child(16) { width: 180px; } /* Acciones */

/* Estilos para las etiquetas de estado y combustible */
.vehiculos-table-container .label {
    font-size: 10px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* Labels específicos para combustible */
.label-combustible {
    display: inline-block;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tooltips para celdas truncadas */
.vehiculos-table-container td {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive design para pantallas pequeñas */
@media (max-width: 768px) {
    .vehiculos-table-container {
        font-size: 12px;
    }
    
    .vehiculos-table-container .label {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .vehiculos-table-container .btn-group .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/*=====================================
MODAL VEHÍCULOS - MEJORADO
======================================*/

/* Modal más ancho para acomodar todos los campos */
.modal-vehiculos {
    width: 90%;
    max-width: 1200px;
}

/* Modal extra ancho para agregar vehículo */
#modalAgregarVehiculo .modal-dialog {
    width: 95% !important;
    max-width: 1400px !important;
    margin: 80px auto !important; /* aumentado para bajar el modal respecto al header */
}

#modalAgregarVehiculo .modal-content {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#modalAgregarVehiculo .modal-body {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Mejor espaciado entre filas en el modal agregar */
#modalAgregarVehiculo .row {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 6px;
    background-color: #fafafa;
    border-left: 4px solid #3c8dbc;
}

#modalAgregarVehiculo .form-group {
    margin-bottom: 20px;
}

/* Labels con iconos destacados */
#modalAgregarVehiculo label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

#modalAgregarVehiculo label i {
    margin-right: 8px;
    font-size: 16px;
}

/* Colores específicos para iconos de labels */
#modalAgregarVehiculo label .text-primary { color: #3c8dbc !important; }
#modalAgregarVehiculo label .text-info { color: #17a2b8 !important; }
#modalAgregarVehiculo label .text-warning { color: #ffc107 !important; }
#modalAgregarVehiculo label .text-danger { color: #dc3545 !important; }
#modalAgregarVehiculo label .text-success { color: #28a745 !important; }
#modalAgregarVehiculo label .text-muted { color: #6c757d !important; }

/* Input groups con mejor apariencia */
#modalAgregarVehiculo .input-group-addon {
    background-color: #f8f9fa;
    border-color: #ddd;
    color: #495057;
    font-weight: 500;
    min-width: 45px;
}

#modalAgregarVehiculo .form-control {
    border-color: #ddd;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.075);
    transition: all 0.3s ease;
}

#modalAgregarVehiculo .form-control:focus {
    border-color: #3c8dbc;
    box-shadow: 0 0 0 0.2rem rgba(60, 141, 188, 0.25);
}

/* Hover effects para mejor interactividad */
#modalAgregarVehiculo .form-group:hover .input-group-addon {
    background-color: #e9ecef;
    transition: background-color 0.3s ease;
}

/* Campos obligatorios con indicador visual */
#modalAgregarVehiculo label:contains("*")::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Separadores con diferentes colores por sección */
#modalAgregarVehiculo .row:nth-child(1) { border-left-color: #3c8dbc; } /* Información Básica - Azul */
#modalAgregarVehiculo .row:nth-child(2) { border-left-color: #17a2b8; } /* Identificación - Cian */
#modalAgregarVehiculo .row:nth-child(3) { border-left-color: #ffc107; } /* Características - Amarillo */
#modalAgregarVehiculo .row:nth-child(4) { border-left-color: #28a745; } /* Fechas y Ubicación - Verde */
#modalAgregarVehiculo .row:nth-child(5) { border-left-color: #6f42c1; } /* Mediciones - Púrpura */
#modalAgregarVehiculo .row:nth-child(6) { border-left-color: #fd7e14; } /* Valores - Naranja */
#modalAgregarVehiculo .row:nth-child(7) { border-left-color: #20c997; } /* Especificaciones - Verde azulado */
#modalAgregarVehiculo .row:nth-child(8) { border-left-color: #e83e8c; } /* Responsabilidades - Rosa */

/* Textarea mejorado */
#modalAgregarVehiculo textarea {
    resize: vertical;
    min-height: 80px;
}

/* Responsive para tablets */
@media (max-width: 768px) {
    #modalAgregarVehiculo .modal-dialog {
        width: 98% !important;
        margin: 30px auto !important; /* espacio superior aumentado en móvil */
    }
    
    #modalAgregarVehiculo .col-md-4 {
        margin-bottom: 15px;
    }
    
    #modalAgregarVehiculo .row {
        padding: 10px;
        margin-bottom: 15px;
    }
}

/*=============================================
MENU RESIZER - DIVISOR ARRASTRABLE
=============================================*/

/* Divisor arrastrable entre sidebar y contenido */
.sidebar-resizer {
    position: fixed;
    top: 50px; /* Altura del header */
    bottom: 0;
    width: 8px;
    left: 230px; /* Ancho por defecto del sidebar */
    background: transparent;
    cursor: ew-resize;
    z-index: 1000;
    transition: all 0.3s ease;
    display: block;
}

/* Handle visual del divisor */
.sidebar-resizer-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 60px;
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.3) 0%, rgba(52, 152, 219, 0.7) 50%, rgba(52, 152, 219, 0.3) 100%);
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.sidebar-resizer-handle i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #3498db;
    font-size: 10px;
    opacity: 0.8;
}

/* Hover sobre el resizer */
.sidebar-resizer:hover {
    background: rgba(52, 152, 219, 0.1);
}

.sidebar-resizer:hover .sidebar-resizer-handle {
    opacity: 1;
    width: 6px;
    height: 80px;
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.5) 0%, rgba(52, 152, 219, 1) 50%, rgba(52, 152, 219, 0.5) 100%);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

/* Estado activo (mientras se arrastra) */
.sidebar-resizer.resizing {
    background: rgba(52, 152, 219, 0.2);
}

.sidebar-resizer.resizing .sidebar-resizer-handle {
    opacity: 1;
    width: 8px;
    height: 100px;
    background: linear-gradient(180deg, rgba(243, 156, 18, 0.6) 0%, rgba(243, 156, 18, 1) 50%, rgba(243, 156, 18, 0.6) 100%);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.8);
}

/* Tooltip del resizer */
.sidebar-resizer-tooltip {
    position: absolute;
    top: 20px;
    left: 15px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-resizer-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent rgba(0, 0, 0, 0.85) transparent transparent;
}

.sidebar-resizer:hover .sidebar-resizer-tooltip {
    opacity: 1;
    visibility: visible;
    left: 20px;
}

/* Cursor para toda la página mientras se arrastra */
body.sidebar-resizing {
    cursor: ew-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

body.sidebar-resizing * {
    cursor: ew-resize !important;
}

/* Feedback visual de confirmación */
.sidebar-resizer-feedback {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.sidebar-resizer-feedback.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sidebar-resizer-feedback::before {
    content: '✓ ';
    font-weight: bold;
    margin-right: 6px;
}

/* Ocultar resizer en móviles */
@media (max-width: 768px) {
    .sidebar-resizer {
        display: none !important;
    }
}

/* Transiciones suaves para el sidebar cuando se redimensiona */
.main-sidebar,
.content-wrapper,
.main-header .logo,
.main-header .navbar {
    transition: width 0.05s ease, margin-left 0.05s ease !important;
}

/* Cuando está en modo resize, hacer transiciones instantáneas */
body.sidebar-resizing .main-sidebar,
body.sidebar-resizing .content-wrapper,
body.sidebar-resizing .main-header .logo,
body.sidebar-resizing .main-header .navbar {
    transition: none !important;
}

/* Indicador de ancho actual (opcional) */
.sidebar-width-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #3498db;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

body.sidebar-resizing .sidebar-width-indicator {
    opacity: 1;
    visibility: visible;
}

/* Mejora visual para el área de arrastre */
.sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(52, 152, 219, 0.05) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer.resizing::after {
    opacity: 1;
}

/* Animación de pulso para el handle cuando no se ha usado */
@keyframes pulse-resizer {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

.sidebar-resizer-handle.hint {
    animation: pulse-resizer 2s ease-in-out infinite;
    opacity: 0.6;
}

/* Desactivar hint después del primer uso */
.sidebar-resizer-used .sidebar-resizer-handle.hint {
    animation: none;
}

/* Títulos de sección implícitos con pseudo-elementos */
#modalAgregarVehiculo .row:nth-child(1)::before {
    content: "📋 INFORMACIÓN BÁSICA";
    display: block;
    font-weight: bold;
    color: #3c8dbc;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(2)::before {
    content: "🔖 IDENTIFICACIÓN";
    display: block;
    font-weight: bold;
    color: #17a2b8;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(3)::before {
    content: "🚗 CARACTERÍSTICAS FÍSICAS";
    display: block;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(4)::before {
    content: "📅 FECHAS Y UBICACIÓN";
    display: block;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(5)::before {
    content: "📊 MEDICIONES Y USO";
    display: block;
    font-weight: bold;
    color: #6f42c1;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(6)::before {
    content: "💰 VALORES ECONÓMICOS";
    display: block;
    font-weight: bold;
    color: #fd7e14;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(7)::before {
    content: "⚙️ ESPECIFICACIONES TÉCNICAS";
    display: block;
    font-weight: bold;
    color: #20c997;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modalAgregarVehiculo .row:nth-child(8)::before {
    content: "👤 RESPONSABILIDADES";
    display: block;
    font-weight: bold;
    color: #e83e8c;
    margin-bottom: 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Organización en pestañas para el modal */
.tabs-vehiculos {
    margin-bottom: 20px;
}

.tabs-vehiculos .nav-tabs {
    border-bottom: 2px solid #3c8dbc;
}

.tabs-vehiculos .nav-tabs > li.active > a {
    background-color: #3c8dbc;
    color: white;
    border-color: #3c8dbc;
}

/* Campos de formulario con mejor espaciado */
.form-vehiculos .form-group {
    margin-bottom: 15px;
}

.form-vehiculos .input-group-addon {
    min-width: 40px;
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

/*=====================================
BADGES Y ALERTAS MEJORADAS
======================================*/

/* Badge de alertas con animación */
.badge-alertas {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Colores personalizados para estados */
.label-operativo { background-color: #28a745 !important; }
.label-mantenimiento { background-color: #ffc107 !important; }
.label-reparacion { background-color: #dc3545 !important; }
.label-fuera-servicio { background-color: #6c757d !important; }

/* Labels para tipo de propietario */
.label-propio { background-color: #28a745 !important; }
.label-arrendado { background-color: #17a2b8 !important; }
.label-leasing { background-color: #ffc107 !important; }
.label-comodato { background-color: #6c757d !important; }

/*=====================================
AJUSTE DE POSICIÓN PARA TODOS LOS MODALES
======================================*/

/* Aumentar el espacio superior de todos los modales para no superponerse al header */
.modal-dialog {
    margin-top: 80px !important; /* aumentado para bajar todos los modales */
}

/* Ajuste específico para pantallas pequeñas */
@media (max-width: 768px) {
    .modal-dialog {
        margin-top: 30px !important; /* espacio superior aumentado en móvil */
    }
}