:root {
    /* Paleta de Colores Moderna Avena La Mía (Azul, Amarillo y Rojo) */
    --brand-primary: #28539B; /* Azul Corporativo */
    --brand-primary-rgb: 40, 83, 155;
    
    --brand-accent: #FDE02D; /* Amarillo Avena */
    --brand-accent-rgb: 253, 224, 45;
    
    --brand-danger: #D82E3E; /* Rojo Carmesí */
    
    --brand-light: #EBF1FA; /* Azul muy tenue para fondos/hovers */
    --brand-bone: #F8FAFD; /* Fondo general ultra claro con tinte azul */
    
    /* Tipografía */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Textos */
    --text-dark: #1E293B;
    --text-muted: #64748B;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 10px 40px -10px rgba(40, 83, 155, 0.12); /* Sombra tintada en azul */
}

/* ==========================================================================
   RESET & TIPOGRAFÍA
   ========================================================================== */
body {
    background-color: var(--brand-bone);
    color: var(--text-dark);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .fw-bold {
    font-family: var(--font-heading) !important;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   FONDO MESH ORGÁNICO (EFECTO AURORA LA MÍA)
   ========================================================================== */
.bg-mesh {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: -1;
    background-color: var(--brand-bone);
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: floatOrb 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Orbe 1: Azul profundo (Primary) esquina superior izquierda */
.orb-1 {
    width: 50vw;
    height: 50vw;
    background: var(--brand-primary);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
    animation-delay: -5s;
}

/* Orbe 2: Amarillo radiante (Accent) en el centro-derecha */
.orb-2 {
    width: 45vw;
    height: 45vw;
    background: var(--brand-accent);
    top: 20%;
    right: -10%;
    animation-duration: 22s;
    animation-delay: -2s;
    opacity: 0.35; /* Un poco más suave para que el amarillo no encandile */
}

/* Orbe 3: Rojo carmesí sutil en la parte inferior izquierda */
.orb-3 {
    width: 55vw;
    height: 55vw;
    background: rgba(216, 46, 62, 0.3); /* Rojo corporativo suave */
    bottom: -20%;
    left: 10%;
    animation-duration: 7s;
    animation-delay: -10s;
}

/* Orbe 4: Cyan grisáceo moviéndose por el centro para dar contraste */
.orb-4 {
    width: 40vw;
    height: 40vw;
    background: #4A90E2; 
    top: 40%;
    left: 40%;
    opacity: 0.15;
    animation-duration: 5s;
}

@keyframes floatOrb {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(8vw, -10vh, 0) scale(1.1); }
    66% { transform: translate3d(-10vw, 8vh, 0) scale(0.9); }
    100% { transform: translate3d(5vw, 5vh, 0) scale(1); }
}

/* ==========================================================================
   UTILIDADES & BOTONES
   ========================================================================== */
.text-brand { color: var(--brand-primary) !important; }
.border-brand { border-color: rgba(40, 83, 155, 0.15) !important; }
.bg-brand-light { background-color: var(--brand-light) !important; }

/* Botón principal: Azul sólido a Azul más oscuro */
.btn-brand, .btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), #1C3F7A) !important;
    border: none !important;
    color: #ffffff !important;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(40, 83, 155, 0.3);
}

.btn-brand:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 83, 155, 0.4);
    background: linear-gradient(135deg, #1C3F7A, #122B57) !important;
}

/* Botón outline: Azul corporativo */
.btn-outline-brand {
    background: transparent;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-outline-brand:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    transform: translateY(-1px);
}

/* ==========================================================================
   NAVBAR PREMIUM
   ========================================================================== */
.premium-glass-navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(40, 83, 155, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
    padding: 0.8rem 0;
}

/* El logo ahora tiene un borde y sombra más acordes al azul */
.brand-logo-wrapper {
    background: linear-gradient(135deg, var(--brand-light), #fff);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(40, 83, 155, 0.15);
    border: 1px solid rgba(40, 83, 155, 0.1);
}

.brand-logo-wrapper img {
    object-fit: cover;
    border-radius: 6px;
}

.premium-glass-navbar .brand-text {
    color: var(--brand-primary) !important;
    font-size: 1.25rem;
}

.nav-custom-link {
    color: var(--text-muted) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-custom-link:hover {
    color: var(--brand-primary) !important;
    background-color: var(--brand-light);
}

.nav-custom-link.active {
    color: var(--brand-primary) !important;
    background-color: var(--brand-light);
}

.btn-admin-nav {
    background-color: var(--brand-bone);
    color: var(--brand-primary);
    border: 1px solid rgba(40, 83, 155, 0.2);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
}

.btn-admin-nav:hover {
    background-color: var(--brand-primary);
    color: white;
}

.custom-toggler {
    border: none !important;
    color: var(--brand-primary);
    font-size: 1.5rem;
}

.custom-toggler:focus {
    box-shadow: none !important;
}

/* ==========================================================================
   GLASS CARDS (Tarjetas Modernas)
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(40, 83, 155, 0.15);
    border-color: rgba(40, 83, 155, 0.2);
}

/* La decoración superior ahora intercala Amarillo y Azul */
.card-glow-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary));
    opacity: 0.9;
}

.glass-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.5rem;
}

.glass-card .metrica {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    font-family: var(--font-heading);
    margin: 0;
    line-height: 1.1;
}

/* ==========================================================================
   TABS Y TABLAS
   ========================================================================== */
.custom-tabs-glass {
    background: rgba(40, 83, 155, 0.04);
    border: 1px solid rgba(40, 83, 155, 0.08);
    padding: 6px;
    border-radius: 12px;
    display: inline-flex !important;
    gap: 4px;
}

.custom-tabs-glass .nav-link {
    color: var(--text-muted) !important;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
}

.custom-tabs-glass .nav-link.active {
    background-color: white !important;
    color: var(--brand-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-tabs-glass .nav-link:hover:not(.active) {
    color: var(--text-dark) !important;
}

.table-responsive {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.table-light.sticky-top th {
    background-color: #F1F5F9 !important;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid rgba(40, 83, 155, 0.1);
}

.table td {
    padding: 1rem;
    color: var(--text-dark);
    font-size: 0.9rem;
    border-bottom-color: rgba(0,0,0,0.03);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover { 
    background-color: var(--brand-light) !important; 
}