/* ====================================================================
   DASHBOARD MINISTERIAL MAGA - CSS COMPLETO
   Versión 2.4 - Header Grande + Logo Animado + Scroll Mejorado + VISAR Fix
   ==================================================================== */

/* === VARIABLES CSS === */
:root {
    /* Colores principales */
    --primary-color: oklch(0.55 0.15 250);
    --primary-light: oklch(0.65 0.15 250);
    --primary-dark: oklch(0.45 0.15 250);
    
    /* Colores de estado */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Colores de fondo glassmorphism */
    --bg-light: oklch(0.96 0.01 220);
    --bg-card: rgba(255, 255, 255, 0.5);
    --bg-glass: rgba(255, 255, 255, 0.4);
    --bg-glass-hover: rgba(255, 255, 255, 0.65);
    
    /* Colores de texto */
    --text-dark: oklch(0.2 0.02 220);
    --text-gray: oklch(0.5 0.01 220);
    --text-muted: oklch(0.6 0.01 220);
    
    /* Borders glassmorphism */
    --border-light: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(255, 255, 255, 0.7);
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(31, 38, 135, 0.2);
    --shadow-xl: 0 20px 60px rgba(0, 31, 63, 0.3);
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    
    /* Navbar - AUMENTADO */
    --navbar-height: 130px;
    --navbar-height-mobile: 90px;
}

/* === RESET Y BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === FONDO CON IMAGEN === */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('../assets/images/FondoMaga.webp');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
}

/* === ANIMACIONES === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
    from { 
        transform: translateY(-100%);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from { 
        transform: translateY(0);
        opacity: 1;
    }
    to { 
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* NUEVA ANIMACIÓN - Logo flotante suave */
@keyframes logoFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-6px) rotate(1deg);
    }
    50% { 
        transform: translateY(-3px) rotate(0deg);
    }
    75% {
        transform: translateY(-6px) rotate(-1deg);
    }
}

/* NUEVA ANIMACIÓN - Entrada del header */
@keyframes headerSlideIn {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    60% {
        transform: translateY(5%);
        opacity: 0.9;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* NUEVA ANIMACIÓN - Brillo del logo */
@keyframes logoShine {
    0% {
        filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    }
    50% {
        filter: drop-shadow(0 12px 32px rgba(0, 31, 63, 0.35));
    }
    100% {
        filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    }
}

/* === GLASSMORPHISM UTILITIES === */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid var(--border-glass);
    box-shadow: 
        var(--shadow-lg),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 31, 63, 0.25),
        0 10px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.glass-button {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-md);
}

.glass-button:hover {
    background: var(--bg-glass-hover);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

/* ====================================================================
   LOGIN PAGE STYLES
   ==================================================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-xl);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.8s ease;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-logo img {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.login-logo img:hover {
    transform: scale(1.05) rotate(-2deg);
}

.login-card {
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1.1rem;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    border-color: var(--primary-color);
}

.form-input::placeholder {
    color: var(--text-gray);
}

.login-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 31, 63, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #003366 0%, #004488 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 31, 63, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-btn i {
    font-size: 1.1rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer p {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin: 0;
}

.security-notice {
    text-align: center;
    margin-top: 1.5rem;
}

.security-notice p {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin: 0;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: shake 0.5s ease;
}

.error-message i {
    font-size: 1.2rem;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-color);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.success-message i {
    font-size: 1.2rem;
}

.spinner-inline {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ====================================================================
   DASHBOARD PAGE STYLES
   ==================================================================== */

.dashboard-page {
    min-height: 100vh;
}

/* === HEADER / NAVBAR - STICKY CON SCROLL DINÁMICO === */
.glass-header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: var(--spacing-xl) var(--spacing-2xl);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--navbar-height);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* Estados de scroll */
.glass-header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.glass-header.header-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
    height: 100%;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

/* LOGO AUMENTADO CON ANIMACIÓN */
.logo-image {
    position: relative;
}

.logo-image img {
    height: 95px;
    width: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: logoFloat 4s ease-in-out infinite, logoShine 3s ease-in-out infinite;
}

.logo-image img:hover {
    transform: scale(1.08) rotate(-3deg);
    animation-play-state: paused;
    filter: drop-shadow(0 16px 40px rgba(0, 31, 63, 0.4));
}

.header-text h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
}

.header-text p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin: 0;
    font-weight: 500;
}

/* === BOTÓN HAMBURGUESA === */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
    position: relative;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
}

/* === HEADER ACTIONS (Menú) === */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Botón cerrar móvil - SIN FONDO ROJO */
.mobile-close-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    padding: 0;
    outline: none;
}

.mobile-close-btn::before,
.mobile-close-btn::after {
    content: none !important;
    display: none !important;
}

.mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.mobile-close-btn:focus {
    outline: none;
}

.mobile-close-btn i {
    pointer-events: none;
    display: block;
    line-height: 1;
}

.mobile-close-btn i::before,
.mobile-close-btn i::after {
    content: none !important;
    display: none !important;
}

.user-info-mobile {
    display: none;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 3rem;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.7);
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.35rem;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.user-info i {
    font-size: 1.6rem;
    color: var(--primary-color);
}

.user-info span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.icon-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.icon-btn i {
    font-size: 1.3rem;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.logout-btn i {
    color: var(--danger-color);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-3px) scale(1.05);
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Overlay para cerrar menú */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* === MAIN CONTENT === */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--navbar-height) + var(--spacing-2xl)) var(--spacing-2xl) var(--spacing-2xl);
}

/* === SECCIONES === */
.section-header {
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
    margin: 0;
}

/* === STATS SECTION === */
.stats-section {
    margin-bottom: var(--spacing-2xl);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--spacing-xl);
}

/* === STAT CARDS === */
.stat-card-glass {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: 
        var(--shadow-lg),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

.stat-card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--success-color));
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

.stat-card-glass:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 24px 48px rgba(0, 31, 63, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-card-header-glass {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.stat-card-title-glass h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.stat-card-title-glass p {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 600;
    margin: 0;
}

.stat-expand-btn-glass {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.stat-card-glass:hover .stat-expand-btn-glass {
    transform: scale(1.1) rotate(45deg);
}

.stat-expand-btn-glass i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.stat-card-status-glass {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: var(--spacing-lg);
}

.stat-card-status-glass .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s ease-in-out infinite;
}

.stat-card-metrics-glass {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.metric-item-glass {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.metric-item-glass:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(5px);
}

.metric-icon-glass {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.metric-info-glass {
    flex: 1;
}

.metric-value-glass {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-label-glass {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* === SYSTEMS SECTION === */
.systems-section {
    margin-top: var(--spacing-2xl);
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

/* === SYSTEM CARDS === */
.system-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fadeIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.system-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #8b5cf6 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.system-card:hover::after {
    transform: scaleX(1);
}

.system-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 48px rgba(0, 31, 63, 0.3);
}

.system-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.system-card.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-lg);
}

.system-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.system-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.system-card:hover .system-icon {
    transform: rotate(360deg) scale(1.1);
}

.system-link-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.system-card:hover .system-link-btn {
    transform: translateX(5px) translateY(-5px);
    background: var(--primary-color);
    color: white;
}

.system-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.system-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.system-subtitle {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 500;
    margin: 0 0 var(--spacing-md) 0;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.system-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.system-status.development {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.system-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.system-status.active .status-dot {
    background: var(--success-color);
}

.system-status.development .status-dot {
    background: var(--warning-color);
}

/* === LOADING & ERRORS === */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

/* === TOAST NOTIFICATIONS === */
#toast-container {
    position: fixed;
    top: 140px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast i {
    font-size: 1.5rem;
}

.toast-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info-color);
}

/* ====================================================================
   TARJETA VISAR - Mismo diseño que las demás + Grid de 2 columnas
   ==================================================================== */

/* Tarjeta estilo VISAR - usado por todas las tarjetas de estadísticas */
.visar-card {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: 
        var(--shadow-lg),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

/* Línea decorativa lateral igual que las otras tarjetas */
.visar-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #10b981, #059669);
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

/* Efecto hover igual que las demás */
.visar-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 24px 48px rgba(0, 31, 63, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Header de VISAR */
.visar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.visar-title h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

.visar-title p {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 600;
    margin: 0.25rem 0 0 0;
}

/* Botón icono estilo glass igual que las demás */
.visar-icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.visar-card:hover .visar-icon-btn {
    transform: scale(1.1) rotate(45deg);
}

/* Status badge igual que las demás */
.visar-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.visar-status .dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Grid de 2x2 secciones */
.visar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

/* Cada sección con estilo metric-item-glass y misma opacidad */
.visar-section {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    min-width: 0; /* Permite que flex/grid reduzca el ancho */
    overflow: hidden;
}

.visar-section:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* Header de cada sección */
.visar-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
}

.visar-section-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.visar-section-icon.export { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.visar-section-icon.import { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.visar-section-icon.transport { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.visar-section-icon.fito { background: rgba(236, 72, 153, 0.2); color: #ec4899; }

.visar-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    line-height: 1.2;
    word-break: break-word;
}

/* Valores principales */
.visar-main-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.visar-main-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

/* Métricas secundarias */
.visar-metric {
    margin-bottom: 0.35rem;
}

.visar-metric:last-child {
    margin-bottom: 0;
}

.visar-metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #10b981;
    line-height: 1.2;
    word-break: break-word;
}

.visar-metric-value.blue { color: #3b82f6; }
.visar-metric-value.pink { color: #ec4899; }

.visar-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ====================================================================
   TARJETAS UNIFICADAS - Mismo estilo para todos los sistemas
   ==================================================================== */

/* Tarjeta principal unificada */
.stat-card-unified {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: 
        var(--shadow-lg),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

/* Línea decorativa lateral */
.stat-card-unified::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--success-color));
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

/* Efecto hover */
.stat-card-unified:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 24px 48px rgba(0, 31, 63, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Header de tarjeta */
.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.stat-title h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

.stat-title p {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 600;
    margin: 0.25rem 0 0 0;
}

/* Botón icono */
.stat-icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.stat-card-unified:hover .stat-icon-btn {
    transform: scale(1.1) rotate(45deg);
}

/* Status badge */
.stat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.stat-status .dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Grid de 4 secciones */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

/* Cada sección */
.stat-section {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.stat-section:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* Header de sección */
.stat-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--spacing-md);
}

.stat-section-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Colores de iconos */
.stat-section-icon.green { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.stat-section-icon.blue { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.stat-section-icon.purple { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.stat-section-icon.orange { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.stat-section-icon.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.stat-section-icon.pink { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.stat-section-icon.cyan { background: rgba(6, 182, 212, 0.2); color: #06b6d4; }

.stat-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gray);
}

/* Valores principales */
.stat-main-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-main-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

/* Métricas secundarias */
.stat-metric {
    margin-bottom: 0.4rem;
}

.stat-metric:last-child {
    margin-bottom: 0;
}

.stat-metric-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: #10b981;
}

.stat-metric-value.green { color: #10b981; }
.stat-metric-value.blue { color: #3b82f6; }
.stat-metric-value.purple { color: #8b5cf6; }
.stat-metric-value.orange { color: #f59e0b; }
.stat-metric-value.red { color: #ef4444; }
.stat-metric-value.pink { color: #ec4899; }
.stat-metric-value.cyan { color: #06b6d4; }

.stat-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ====================================================================
   RESPONSIVE TARJETAS UNIFICADAS
   ==================================================================== */

@media (min-width: 1201px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) and (min-width: 901px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-section {
        padding: var(--spacing-md);
    }
    
    .stat-main-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 900px) and (min-width: 769px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .stat-main-value {
        font-size: 1.5rem;
    }
    
    .stat-section-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .stat-card-unified {
        padding: var(--spacing-lg);
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-section {
        padding: var(--spacing-md);
    }
    
    .stat-main-value {
        font-size: 1.4rem;
    }
    
    .stat-section-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    
    .stat-section-title {
        font-size: 0.8rem;
    }
    
    .stat-metric-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .stat-card-unified {
        padding: var(--spacing-md);
    }
    
    .stat-title h3 {
        font-size: 1.25rem;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-section {
        padding: 0.75rem;
    }
    
    .stat-main-value {
        font-size: 1.25rem;
    }
    
    .stat-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-section-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}

@media (max-width: 380px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-main-value {
        font-size: 1.5rem;
    }
    
    .stat-section-header {
        flex-direction: row;
        align-items: center;
    }
}

/* ====================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ==================================================================== */

/* Tablets y menores (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --navbar-height: 100px;
    }

    .header-container {
        gap: var(--spacing-md);
    }

    .logo-image img {
        height: 75px;
    }

    .header-text h1 {
        font-size: 1.75rem;
    }

    .search-box {
        width: 240px;
    }

    .systems-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--spacing-lg);
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablets pequeños y móviles grandes (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --navbar-height: var(--navbar-height-mobile);
    }

    .glass-header {
        padding: var(--spacing-lg) var(--spacing-xl);
        height: var(--navbar-height-mobile);
    }

    /* Mostrar botón hamburguesa */
    .hamburger-btn {
        display: flex;
    }

    /* Ocultar elementos desktop */
    .desktop-only {
        display: none !important;
    }

    /* Header Actions como menú lateral */
    .header-actions {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-left: 2px solid var(--border-glass);
        padding: var(--spacing-xl);
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-lg);
        overflow-y: auto;
        z-index: 999;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .header-actions.active {
        right: 0;
    }

    /* Botón cerrar en móvil */
    .mobile-close-btn {
        display: flex;
        align-self: flex-end;
        margin-bottom: var(--spacing-md);
    }

    /* User info móvil */
    .user-info-mobile {
        display: flex;
        align-items: center;
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
        background: var(--bg-glass);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-light);
        margin-bottom: var(--spacing-md);
    }

    .user-avatar {
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 2rem;
        flex-shrink: 0;
    }

    .user-details {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .user-name {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-dark);
    }

    .user-role {
        font-size: 0.875rem;
        color: var(--text-gray);
    }

    /* Search box en móvil */
    .search-box {
        width: 100%;
        order: 3;
    }

    .search-box input {
        width: 100%;
    }

    /* Logout button en móvil */
    .logout-btn {
        width: 100%;
        height: auto;
        padding: var(--spacing-md) var(--spacing-lg);
        justify-content: center;
        gap: var(--spacing-sm);
        margin-top: auto;
    }

    .mobile-only {
        display: inline;
        font-weight: 600;
    }

    /* Logo section - MÁS ESPACIO Y LOGO MÁS GRANDE */
    .logo-section {
        gap: var(--spacing-lg);
    }

    .logo-image img {
        height: 65px;
    }

    .header-text h1 {
        font-size: 1.35rem;
    }

    .header-text p {
        font-size: 0.85rem;
    }

    /* Main content */
    .main-content {
        padding: calc(var(--navbar-height-mobile) + var(--spacing-lg)) var(--spacing-md) var(--spacing-lg);
    }

    /* Secciones */
    .section-header h2 {
        font-size: 1.5rem;
        flex-wrap: wrap;
    }

    /* Grids */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .systems-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Toast en móvil */
    #toast-container {
        top: 100px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }

    /* Login responsive */
    .login-wrapper {
        padding: 1rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .login-logo img {
        height: 70px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    /* VISAR en móvil */
    .visar-card {
        padding: var(--spacing-lg);
    }
    
    .visar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .visar-section {
        padding: 0.75rem;
    }
    
    .visar-main-value {
        font-size: 1.25rem;
    }
    
    .visar-section-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.9rem;
    }
    
    .visar-section-title {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .visar-metric-value {
        font-size: 0.85rem;
    }
    
    .visar-metric-label {
        font-size: 0.65rem;
    }
}

/* Móviles pequeños (max-width: 480px) */
@media (max-width: 480px) {
    .header-actions {
        width: 100%;
        max-width: 100vw;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .glass-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .logo-image img {
        height: 55px;
    }

    .header-text h1 {
        font-size: 1.15rem;
    }

    .header-text p {
        font-size: 0.75rem;
    }

    .stat-card-glass {
        padding: var(--spacing-md);
    }

    .metric-value-glass {
        font-size: 1.5rem;
    }

    .system-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .form-input {
        padding: 0.75rem 1rem 0.75rem 2.75rem;
    }

    /* VISAR en móviles pequeños */
    .visar-card {
        padding: var(--spacing-md);
    }
    
    .visar-title h3 {
        font-size: 1.25rem;
    }
    
    .visar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .visar-section {
        padding: 0.6rem;
    }
    
    .visar-main-value {
        font-size: 1.15rem;
    }
    
    .visar-section-header {
        gap: 0.35rem;
        margin-bottom: 0.5rem;
    }
    
    .visar-section-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 0.8rem;
    }
    
    .visar-section-title {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    .visar-main-label {
        font-size: 0.65rem;
    }
    
    .visar-metric-value {
        font-size: 0.8rem;
    }
    
    .visar-metric-label {
        font-size: 0.6rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 380px) {
    .visar-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .visar-main-value {
        font-size: 1.5rem;
    }
    
    .visar-section-header {
        flex-direction: row;
        align-items: center;
    }
    
    .visar-section-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.9rem;
    }
    
    .visar-section-title {
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

/* ====================================================================
   RESPONSIVE VISAR - Pantallas grandes
   ==================================================================== */

/* Pantallas extra grandes */
@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .visar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .visar-main-value {
        font-size: 1.75rem;
    }
    
    .visar-section-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.1rem;
    }
}

/* Pantallas grandes */
@media (min-width: 1201px) and (max-width: 1399px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .visar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets grandes: 2 columnas */
@media (max-width: 1200px) and (min-width: 901px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .visar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .visar-main-value {
        font-size: 1.5rem;
    }
}

/* Tablets */
@media (max-width: 900px) and (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .visar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .visar-main-value {
        font-size: 1.4rem;
    }
    
    .visar-section {
        padding: var(--spacing-md);
    }
}

/* === OPTIMIZACIÓN DE RENDIMIENTO === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .glass-header {
        transition: none;
        animation: none;
    }

    .logo-image img {
        animation: none;
    }
}

/* === SCROLLBAR PERSONALIZADO === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), #8b5cf6);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

.header-actions::-webkit-scrollbar {
    width: 6px;
}

/* === UTILIDADES === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }