/*=========== RESET GLOBAL==============*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/*=========== VARIABLES DE COLOR Y Z-INDEX ==============*/
:root {
    --z-sidebar: 1000;
    --z-header: 100;
    --z-dropdown: 5000;
    --z-modal: 9999;
    --z-modal-content: 10000;
    --z-confirmation: 99999;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --bg-light: #f8f9fa;
    --text-light: #1e293b;
}

/*=========== FONDO DEGRADADO ==============*/
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-card) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

    body::before {
        content: '';
        position: fixed;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
        z-index: -1;
        animation: pulse 15s ease-in-out infinite;
    }

/* ========== TEMA CLARO ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

body.light-theme {
    background: linear-gradient(135deg, var(--bg-light) 0%, #e5e7eb 100%) !important;
    color: var(--text-light) !important;
}

    body.light-theme::before {
        display: none !important;
    }

    body.light-theme .sidebar {
        background: #ffffff !important;
        border-right: 1px solid #dee2e6 !important;
    }

    body.light-theme .nav-item {
        color: var(--text-light) !important;
    }

        body.light-theme .nav-item:hover,
        body.light-theme .nav-item.active {
            background: var(--primary) !important;
            color: #ffffff !important;
        }

    body.light-theme .header {
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid #dee2e6 !important;
    }

    body.light-theme .stat-card,
    body.light-theme .table-container {
        background: rgba(255, 255, 255, 0.9) !important;
        color: var(--text-light) !important;
    }

    body.light-theme .user-profile,
    body.light-theme .dropdown-menu {
        background: #f1f5f9 !important;
        border: 1px solid #dee2e6 !important;
    }

    body.light-theme .modal-content {
        background: #ffffff !important;
        color: var(--text-light) !important;
    }

    body.light-theme .form-control {
        background: #f1f5f9 !important;
        color: var(--text-light) !important;
        border-color: #d1d5db !important;
    }

/*=========== MENU LATERAL ==============*/
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    transition: transform 0.3s ease;
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
    .sidebar-footer .theme-toggle,
    .sidebar-footer .logout-btn {
        padding: 1rem 1.25rem;
        border-radius: 12px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 0.95rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-decoration: none;
        width: 100%;
        text-align: left;
    }
        .sidebar-footer .theme-toggle:hover,
        .sidebar-footer .logout-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
            transform: translateX(5px);
        }

        .sidebar-footer .theme-toggle .icon,
        .sidebar-footer .logout-btn .icon {
            font-size: 1.2rem;
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

    .sidebar-footer .logout-btn {
        color: var(--text-secondary);
    }

        .sidebar-footer .logout-btn:hover {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger);
            border-left: 3px solid var(--danger);
        }

/*=========== LOGO + NOMBRE ==============*/
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
/*=========== OPCIONES DEL MENU ==============*/
.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.nav-item {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

    .nav-item:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        transform: translateX(5px);
    }

    .nav-item.active {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    }

.nav-item-icon {
    font-size: 1.2rem;
    width: 20px;
    height: 20px;
}

/*=========== TITULO + PERFIL USUARIO ==============*/
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: relative;
    z-index: var(--z-header);
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/*=========== FOTO/NOMBRE ==============*/
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

    .user-profile:hover {
        background: var(--bg-hover);
        transform: translateY(-2px);
        box-shadow: 0 8px 24px var(--shadow);
    }

/*=========== MENU DESPLEGABLE DEL PERFIL ==============*/
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--shadow);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: var(--z-dropdown); /* por encima del carrusel */
}

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dropdown-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.5rem;
}

.dropdown-user-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.dropdown-user-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

    .dropdown-item:hover {
        background: var(--bg-hover);
    }

.dropdown-item-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.dropdown-item.danger {
    color: var(--danger);
}

    .dropdown-item.danger:hover {
        background: rgba(239, 68, 68, 0.1);
    }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

/*=========== SECCION PRINCIPAL ==============*/
.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

/*=========== TARJETAS DEL INICIO ==============*/
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    cursor: pointer;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), var(--secondary));
    }

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 32px var(--shadow);
        border-color: var(--primary);
    }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.icon-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.icon-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== AVATAR (PARA USUARIOS) ========== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* ========== TEXTO TRUNCADO ========== */
.text-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== PEQUEÑOS DETALLES ========== */
small {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/*=========== CARRUSEL DE IMAGENES ==============*/
.carousel {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px var(--shadow);
    margin-bottom: 2rem;
}

.carousel-inner {
    border-radius: 20px;
}

.carousel-item {
    height: 400px;
}

    .carousel-item img {
        height: 100%;
        object-fit: cover;
        border-radius: 20px;
    }

.carousel-caption {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
}

    .carousel-caption h5 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        color: var(--text-primary);
    }

    .carousel-caption p {
        font-size: 1rem;
        color: var(--text-secondary);
        margin: 0;
    }

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        opacity: 1;
    }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-color: rgba(99, 102, 241, 0.8);
    border-radius: 50%;
    padding: 0.5rem;
}

.carousel-indicators {
    margin-bottom: 1.5rem;
}

    .carousel-indicators button {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.5);
        border: none;
        margin: 0 0.5rem;
    }

        .carousel-indicators button.active {
            background-color: var(--primary);
            transform: scale(1.2);
        }

/*=========== MODALES ==============*/
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .modal.show {
        display: flex;
        opacity: 1;
    }

.modal-content {
    background: var(--bg-dark);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px var(--shadow);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .close-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

/*=========== DETALLES (VIAJE-CONDUCTOR-VEHICULO)==============*/
.details-container {
    padding: 1rem;
}

.details-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.details-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.detail-item {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: block;
}

.detail-value {
    margin: 0;
    color: var(--text-primary);
}

.profile-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-hover);
    border-radius: 8px;
    align-items: center;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/*=========== RESPONSIVE ==============*/
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
    }


    .user-profile span {
        color: var(--text-primary); /* Restaurar color original del nombre del usuario */
    }

    .table-container td {
        color: var(--text-primary); /* Restaurar color original de los datos de la tabla */
    }

    /* Asegurar consistencia en temas claro/oscuro */
    body.light-theme .user-profile span {
        color: var(--text-light); /* Ajuste para tema claro */
    }

    body.light-theme .table-container td {
        color: var(--text-light); /* Ajuste para tema claro */
    }

    /* Estilos para las secciones */
    .section {
        display: none;
    }

        .section.active {
            display: block;
        }

    

    /* Estilos para header-actions en tablas */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .search-box {
        display: flex;
        align-items: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.5rem 1rem;
    }

    .search-icon {
        margin-right: 0.5rem;
        color: var(--text-secondary);
    }

    .search-box input {
        border: none;
        background: transparent;
        color: var(--text-primary);
        outline: none;
        width: 200px;
    }

        .search-box input::placeholder {
            color: var(--text-secondary);
        }

    .btn-primary {
        background: var(--primary);
        border: none;
        padding: 0.5rem 1.5rem;
        border-radius: 12px;
        color: white;
        transition: all 0.3s ease;
    }

        .btn-primary:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
        }

    
}

/*=========== BUSQUEDA FILTROS ==============*/
.search-filters {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.filtros-dinamicos {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-count {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 600;
}

.search-results {
    animation: fadeIn 0.3s ease;
}

@import url('modo_claro.css');
/* ========== IMPORTO ESTILOS UNIFORMES DE TABLAS ========== */
@import url('tablas_uniformes.css');
