@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

body { 
    font-family: 'Inter', sans-serif; 
    -webkit-tap-highlight-color: transparent; 
    background-color: #f1f5f9; 
    margin: 0; 
    display: flex; 
    flex-direction: row; 
    height: 100vh; 
    overflow: hidden; 
}

.custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 1. BARRA LATERAL */
#sidebar-container { 
    width: 240px; 
    height: 100vh; 
    background-color: #0f172a; 
    color: white; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 50; 
    flex-shrink: 0; 
}

/* 2. ÁREA PRINCIPAL */
#main-area { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    position: relative; 
    height: 100vh;
    background-color: #f8fafc;
    width: calc(100% - 240px); 
}

/* 3. TOP BAR */
#top-user-bar {
    width: 100%;
    height: 50px; 
    min-height: 50px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    padding: 0 20px;
    z-index: 40;
}

#content-wrapper { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 20px; 
    position: relative; 
}

header {
    background-color: transparent !important;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.brand-logo {
    font-weight: 900;
    font-size: 20px;
    color: white;
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #1e293b;
    letter-spacing: 1px;
}

.nav-links-container {
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
}

/* --- ESTILOS NUEVOS PARA MENÚ DESPLEGABLE --- */

/* El título ahora es un botón clicable */
.nav-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 10px;
    margin-top: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between; /* Texto a la izq, flecha a la der */
    align-items: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-section-title:hover {
    background-color: #1e293b;
    color: white;
}

.nav-section-title i {
    font-size: 10px;
    transition: transform 0.3s;
}

/* Clase para rotar la flechita cuando está abierto */
.nav-arrow-rotate {
    transform: rotate(180deg);
}

/* Contenedor de los links (se oculta o muestra) */
.nav-section-items {
    padding-left: 0px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-hidden {
    display: none;
}

/* ------------------------------------------- */

.nav-link { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px 15px; 
    color: #64748b; /* Un poco más oscuro */
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 500; 
    transition: all 0.2s; 
    border-radius: 8px;
    margin-bottom: 2px;
}

.nav-link:hover { 
    background-color: #1e293b; 
    color: white; 
    transform: translateX(5px); 
}

.nav-link.active { 
    background-color: #4f46e5; 
    color: white; 
    font-weight: bold;
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.4);
}

.funnel-step { clip-path: polygon(1% 0%, 99% 0%, 94% 100%, 6% 100%); }
.funnel-last { clip-path: polygon(1% 0%, 99% 0%, 85% 100%, 15% 100%); }
.client-card-selected { border-left: 4px solid #4338ca; background-color: #f8fafc; }
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.nav-link i.fa-truck-monster { color: #84cc16; }