body { 
    background-color: #0f0505; 
    color: #e2e8f0; 
    touch-action: manipulation; 
    position: relative; 
}

/* FIX PARA SCROLL SUAVE SIN "BAILE" */
body::before {
    content: "";
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-image: radial-gradient(at 0% 0%, rgba(220, 38, 38, 0.12) 0px, transparent 60%), radial-gradient(at 100% 0%, rgba(88, 28, 135, 0.10) 0px, transparent 50%);
    z-index: -1;
    pointer-events: none;
    will-change: transform; 
}

.glass-panel { 
    background: rgba(20, 10, 10, 0.75); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); 
    transition: all 0.3s ease; 
}

.ai-chat-panel { 
    background: rgba(15, 5, 5, 0.98); 
    border: 1px solid rgba(220, 38, 38, 0.3); 
    box-shadow: 0 0 50px rgba(220, 38, 38, 0.2); 
}

.clickable-card { cursor: pointer; position: relative; overflow: hidden; }
.clickable-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.3); box-shadow: 0 20px 40px -10px rgba(220, 38, 38, 0.2); }
.clickable-card::after { content: 'VER DETALLE ➜'; position: absolute; bottom: 10px; right: 20px; font-size: 10px; font-weight: bold; opacity: 0; transition: all 0.3s; transform: translateX(-10px); }
.clickable-card:hover::after { opacity: 1; transform: translateX(0); }

/* Sidebar & Nav Styles */
.nav-item { transition: all 0.2s; position: relative; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #f87171; background: rgba(220, 38, 38, 0.1); border-right: 2px solid #dc2626; }
.mobile-nav-item.active { color: #f87171; }
.mobile-nav-item.active i { transform: translateY(-2px); }

/* Custom Date Input Styling */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f0505; }
::-webkit-scrollbar-thumb { background: #7f1d1d; border-radius: 3px; }

/* Navigation Transitions */
.view-section { display: none; }
.view-section.active { display: block; animation: fade-in 0.4s ease-out; }

/* Status Badge */
.badge { padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.badge-cash { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-credit { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-debt { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Form Controls */
.form-select-dark {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select option {
    background-color: #18181b; 
    color: white;
}

/* SKELETON LOADING */
.skeleton {
    background-color: rgba(255, 255, 255, 0.1); 
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
}

.skeleton-text {
    color: transparent !important;
    background-color: rgba(255, 255, 255, 0.1);
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
    user-select: none;
}
.skeleton-text * { opacity: 0; }

@keyframes skeleton-loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.chart-skeleton {
    background-color: rgba(30, 30, 35, 0.9) !important;
    backdrop-filter: blur(5px);
}

/* ========================================= */
/* ESTILOS PARA ÁRBOL DE VENTAS (JERARQUÍA) */
/* ========================================= */

.tree-row {
    transition: background-color 0.2s ease;
}

/* Colores de Fondo por Nivel (Profundidad Visual) */
.tree-level-0 { background-color: rgba(255, 255, 255, 0.02); border-bottom: 1px solid rgba(255,255,255,0.05); }
.tree-level-1 { background-color: rgba(0, 0, 0, 0.3); border-left: 2px solid rgba(220, 38, 38, 0.3); } 
.tree-level-2 { background-color: rgba(0, 0, 0, 0.5); border-left: 2px solid rgba(220, 38, 38, 0.2); }
.tree-level-3 { background-color: rgba(0, 0, 0, 0.7); border-left: 2px solid rgba(220, 38, 38, 0.1); }
.tree-level-4 { background-color: rgba(0, 0, 0, 0.8); }

/* Indentación Progresiva (Efecto Escalera) */
/* !important se usa para sobreescribir el px-6 de Tailwind en la primera celda */
.tree-indent-0 { padding-left: 1.5rem !important; }
.tree-indent-1 { padding-left: 3.5rem !important; } /* Nivel 1 más adentro */
.tree-indent-2 { padding-left: 5.5rem !important; } /* Nivel 2 más adentro */
.tree-indent-3 { padding-left: 7.5rem !important; } /* Nivel 3 más adentro */
.tree-indent-4 { padding-left: 9.5rem !important; } /* Nivel 4 más adentro */

/* Icono de expansión */
.fa-chevron-right {
    display: inline-block;
    width: 12px;
    text-align: center;
}