/* Variables CSS para colores y espaciado - Paleta cálida con soporte claro/oscuro */
:root {
    /* Paleta solicitada (modo claro) */
    --primary-color: #14ebdd; /* azul base */
    --primary-color-strong: #0fb0b8; /* azul profundo para énfasis */
    --secondary-color: #EBDE14; /* amarillo de combinación */
    --success-color: #2e7d32; /* verde accesible */
    --warning-color: #EBDE14; /* usar amarillo para advertencias */
    --danger-color: #b91c1c; /* rojo de alerta */
    --info-color: #4b58ff; /* azul claro informativo derivado del primario */

    /* Superficies y texto (modo claro) */
    --light-color: #f8fafc; /* blanco neutro */
    --dark-color: #e3e6ec;  /* gris oscuro para texto */
    --text-muted: #e5e8ed;  /* gris medio para textos secundarios */
    --surface-0: #ffffff;   /* fondo base neutro */
    --surface-1: #f3f4f6;   /* tarjetas / menús */
    --surface-2: #e5e7eb;   /* contenedores */
    --border-color: #e5e7eb;

    /* Sombra y transiciones */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --box-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradientes basados en la nueva paleta */
    --gradient-primary: linear-gradient(135deg, var(--primary-color-strong) 0%, var(--primary-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #c7b90f 100%);
    --gradient-success: linear-gradient(135deg, var(--success-color) 0%, #1b5e20 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning-color) 0%, #c7b90f 100%);
    --gradient-danger: linear-gradient(135deg, var(--danger-color) 0%, #7f1d1d 100%);

    /* Apoyos de foco */
    --secondary-focus-shadow: rgba(235, 222, 20, 0.25); /* sombra amarilla */
    --bg-gradient: linear-gradient(135deg, var(--surface-0) 0%, var(--surface-1) 100%);

    /* Escala tipográfica responsiva */
    --font-size-xs: clamp(0.85rem, 0.8rem + 0.2vw, 0.95rem);
    --font-size-sm: clamp(0.95rem, 0.92rem + 0.2vw, 1.05rem);
    --font-size-base: clamp(1rem, 0.98rem + 0.3vw, 1.125rem);
    --font-size-lg: clamp(1.125rem, 1.08rem + 0.3vw, 1.25rem);
    --font-size-xl: clamp(1.35rem, 1.28rem + 0.4vw, 1.6rem);
}

/* Overrides para modo oscuro */
:root[data-theme="dark"] {
    --primary-color: #072a3c; /* azul más brillante en oscuro */
    --primary-color-strong: #064662;
    --secondary-color: #EBDE14; /* mantiene acento amarillo */
    --success-color: #81c784;
    --warning-color: #f0e43a; /* amarillo accesible en oscuro */
    --danger-color: #ef4444;
    --info-color: #7c86ff;

    --light-color: #e5e7eb;  /* texto secundario claro */
    --dark-color: #f9fafb;   /* texto principal claro */
    --text-muted: #cbd5e1;
    --surface-0: #0f172a;    /* fondo base neutro oscuro */
    --surface-1: #111827;    /* tarjetas / menús */
    --surface-2: #1f2937;    /* contenedores */
    --border-color: #374151;

    --box-shadow: 0 4px 24px rgba(0,0,0,0.35);
    --box-shadow-lg: 0 8px 40px rgba(0,0,0,0.45);

    --gradient-primary: linear-gradient(135deg, var(--primary-color-strong) 0%, var(--primary-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #c7b90f 100%);
    --gradient-success: linear-gradient(135deg, var(--success-color) 0%, #2e7d32 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning-color) 0%, #b9ad1a 100%);
    --gradient-danger: linear-gradient(135deg, var(--danger-color) 0%, #b91c1c 100%);

    --secondary-focus-shadow: rgba(235, 222, 20, 0.45);
    --bg-gradient: linear-gradient(135deg, var(--surface-0) 0%, var(--surface-1) 100%);
}

:root { --surface-transparent: transparent; }
:root[data-theme="dark"] { --surface-transparent: transparent; }
:root { --overlay-background: rgba(255, 255, 255, 0.9); }
:root[data-theme="dark"] { --overlay-background: rgba(0, 0, 0, 0.6); }
:root { --box-shadow-hover: 0 6px 20px rgba(0,0,0,0.15); }
:root[data-theme="dark"] { --box-shadow-hover: 0 6px 24px rgba(0,0,0,0.45); }
:root { --box-shadow-sm: 0 5px 15px rgba(0,0,0,0.2); }
:root[data-theme="dark"] { --box-shadow-sm: 0 5px 20px rgba(0,0,0,0.45); }
:root { --box-shadow-xl: 0 10px 40px rgba(0,0,0,0.2); }
:root[data-theme="dark"] { --box-shadow-xl: 0 12px 48px rgba(0,0,0,0.55); }
:root { --divider-color: rgba(0,0,0,0.08); }
:root[data-theme="dark"] { --divider-color: rgba(255,255,255,0.12); }
/* Sombras de texto y drop-shadow centralizadas */
:root { --text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
:root { --text-shadow-soft: 0 2px 4px rgba(0,0,0,0.1); }
:root[data-theme="dark"] { --text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
:root[data-theme="dark"] { --text-shadow-soft: 0 2px 4px rgba(0,0,0,0.25); }
:root { --drop-shadow-img: drop-shadow(0 12px 24px rgba(0,0,0,0.25)); }
:root[data-theme="dark"] { --drop-shadow-img: drop-shadow(0 12px 24px rgba(0,0,0,0.55)); }
/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    background-color: var(--surface-0);
    color: var(--dark-color);
    line-height: 1.6;
    font-size: var(--font-size-base);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-strong);
}

/* Header y navegación ultra moderna */
.navbar {
    background: var(--gradient-primary);
    box-shadow: var(--box-shadow);
    padding: 0;
    backdrop-filter: blur(10px);
    border-bottom: 3px solid rgba(20, 33, 235, 0.25);
    z-index: 1030;
}

/* Brand mejorado */
.brand-icon-wrapper {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.navbar-brand:hover .brand-icon-wrapper {
    background: rgba(255,255,255,0.25);
    transform: rotate(10deg) scale(1.1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: white;
}

.brand-subtitle {
    font-size: var(--font-size-xs);
    color: rgba(2, 12, 40, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    color: white !important;
    text-shadow: var(--text-shadow);
}

/* Nav Links Ultra Modernos */
.navbar-nav .nav-link {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 600;
    padding: 1.2rem 1.5rem !important;
    border-radius: 0;
    transition: var(--transition);
    margin: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: left;
}

.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white !important;
}

.navbar-nav .nav-link:hover::after {
    transform: scaleX(1);
}

.navbar-nav .nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
}

.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white !important;
}

.navbar-nav .nav-link.active::after {
    transform: scaleX(1);
}

/* Dropdown Mega Moderno */
.dropdown-menu-modern {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-xl);
    padding: 0.5rem;
    min-width: 280px;
    margin-top: 0.5rem;
    animation: dropdownSlide 0.3s ease-out;
}

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

.dropdown-menu-modern .dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    margin: 0.25rem 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 2px solid var(--surface-transparent);
}

.dropdown-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.dropdown-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dropdown-content strong {
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.dropdown-content small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(20, 33, 235, 0.05), rgba(46, 125, 50, 0.05));
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.dropdown-menu-modern .dropdown-item:hover .dropdown-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--box-shadow-sm);
}

.dropdown-menu-modern .dropdown-divider {
    margin: 0.5rem 0;
    border-top-color: var(--divider-color);
}

/* Alertas en navbar mejoradas */
.alert-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--gradient-danger);
    color: var(--light-color);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s infinite;
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.5);
    border: 2px solid var(--light-color);
}

@keyframes pulse-glow {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    }
    50% { 
        transform: scale(1.1); 
    box-shadow: 0 0 20px rgba(185, 28, 28, 0.8);
    }
    100% { 
        transform: scale(1); 
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.5);
    }
}

/* Contenido principal mejorado */
.main-content {
    padding: 2.5rem 0;
    min-height: calc(100vh - 120px);
}

.page-header {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2.5rem;
    border-left: 5px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(20, 33, 235, 0.05));
}

.page-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Cards y contenedores mejorados */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 2rem;
    background: var(--surface-0);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-header {
    background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-color);
    padding: 1.25rem 1.5rem;
    position: relative;
}

.card-body {
    padding: 1.5rem;
}

/* Estadísticas del dashboard mejoradas */
.stat-card {
    background: var(--surface-0);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
    border-left: 5px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(20, 33, 235, 0.05) 0%, rgba(46, 125, 50, 0.05) 100%);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--box-shadow-lg);
    border-left-color: var(--success-color);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    text-shadow: var(--text-shadow-soft);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.stat-icon {
    font-size: 4rem;
    opacity: 0.08;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    opacity: 0.15;
    transform: scale(1.1) rotate(5deg);
}

/* Estados de equipos mejorados */
.estado-operativo { 
    color: var(--success-color); 
    font-weight: 600;
}
.estado-mantenimiento { 
    color: var(--warning-color); 
    font-weight: 600;
}
.estado-standby { 
    color: var(--text-muted); 
    font-weight: 600;
}
.estado-fuera-servicio { 
    color: var(--danger-color); 
    font-weight: 600;
}

.badge-operativo { 
    background: var(--gradient-success);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}
.badge-mantenimiento { 
    background: var(--gradient-warning);
    box-shadow: 0 2px 8px rgba(235, 222, 20, 0.3);
}
.badge-standby { 
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-1) 100%);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}
.badge-fuera-servicio { 
    background: var(--gradient-danger);
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.3);
}

/* Botones personalizados mejorados */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

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

.btn-primary {
    background: var(--gradient-secondary);
    color: var(--light-color);
}

.btn-primary:hover {
    background: var(--gradient-primary);
    color: var(--surface-0);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--light-color);
}

.btn-success:hover {
    background: var(--gradient-success);
    color: var(--surface-0);
}

.btn-warning {
    background: var(--gradient-warning);
    color: var(--light-color);
}

.btn-warning:hover {
    background: var(--gradient-warning);
    color: var(--surface-0);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--light-color);
}

.btn-danger:hover {
    background: var(--gradient-danger);
    color: var(--surface-0);
}

.btn-outline-primary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: var(--surface-transparent);
}

.btn-outline-primary:hover {
    background: var(--gradient-secondary);
    color: var(--light-color);
    border-color: var(--surface-transparent);
}

/* Botones de acción flotantes */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    color: var(--light-color);
    border: none;
    box-shadow: 0 8px 25px rgba(20, 33, 235, 0.4);
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 1000;
}

.btn-floating:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 35px rgba(20, 33, 235, 0.6);
    color: var(--light-color);
}

.btn-floating:active {
    transform: scale(1.05);
}

/* Tablas mejoradas */
.table {
    background: var(--surface-0);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 0;
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--surface-1);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(20, 33, 235, 0.06) 0%, rgba(235, 222, 20, 0.06) 100%);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border: none;
}

/* Formularios mejorados */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: var(--font-size-base);
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(20, 33, 235, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: var(--font-size-base);
}

/* Placeholders e inputs accesibles */
.form-control::placeholder {
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    font-size: var(--font-size-base);
}

.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(20, 33, 235, 0.25);
}

/* Modales mejorados */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-dialog-scrollable .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
    padding-bottom: 100px;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-dialog-scrollable .modal-body {
    max-height: none;
    overflow: visible;
}

.modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    background: var(--surface-1);
}

/* Alertas mejoradas */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    box-shadow: var(--box-shadow);
}

.alert-success {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1) 0%, rgba(46, 125, 50, 0.05) 100%);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(235, 222, 20, 0.15) 0%, rgba(235, 222, 20, 0.08) 100%);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.12) 0%, rgba(185, 28, 28, 0.06) 100%);
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(75, 88, 255, 0.1) 0%, rgba(20, 33, 235, 0.05) 100%);
    border-left-color: var(--info-color);
    color: var(--info-color);
}

/* Breadcrumbs mejorados */
.breadcrumb {
    background: var(--surface-0);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Paginación mejorada */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border: none;
    color: var(--secondary-color);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover {
    background: var(--gradient-secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(20, 33, 235, 0.3);
}

.page-item.active .page-link {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(20, 33, 235, 0.3);
}

/* Tooltips mejorados */
.tooltip-inner {
    background: var(--primary-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Spinners de carga */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(20, 33, 235, 0.3);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Efectos de entrada */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

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

/* Responsive design mejorado */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .page-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem !important;
        margin: 0.2rem 0;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}

/* Sistema de notificaciones flotantes (Toasts) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.toast {
    background: var(--surface-0);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-xl);
    margin-bottom: 1rem;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    gap: 1rem;
}

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

.toast-success {
    border-left: 5px solid var(--success-color);
}

.toast-success i:first-child {
    color: var(--success-color);
}

.toast-error {
    border-left: 5px solid var(--danger-color);
}

.toast-error i:first-child {
    color: var(--danger-color);
}

.toast-warning {
    border-left: 5px solid var(--warning-color);
}

.toast-warning i:first-child {
    color: var(--warning-color);
}

.toast-info {
    border-left: 5px solid var(--info-color);
}

.toast-info i:first-child {
    color: var(--info-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
    padding: 0;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--danger-color);
    transform: scale(1.2);
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Modales flotantes mejorados */
.modal {
    backdrop-filter: blur(5px);
    height: 100vh;
    overflow: hidden;
.modal-dialog {
    animation: modalSlideDown 0.3s ease-out;
    height: 100%;
}    height: 100%;
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    border-bottom: 3px solid rgba(255,255,255,0.2);
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-footer {
    border-top: none;
}

/* Formularios flotantes mejorados */
.form-floating {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-floating > .form-control {
    height: 60px;
    padding: 1rem 0.75rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: none;
    transform-origin: 0 0;
    transition: var(--transition);
    color: var(--text-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--secondary-color);
    background: transparent;
    padding: 0 0.5rem;
}

/* Inputs con iconos */
.input-group-icon {
    position: relative;
}

.input-group-icon .form-control {
    padding-left: 3rem;
}

.input-group-icon .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 1.1rem;
    z-index: 10;
}

/* Switches modernos */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
    background-color: var(--surface-2);
    border: none;
    transition: var(--transition);
}

.form-switch .form-check-input:checked {
    background-color: var(--success-color);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(46, 125, 50, 0.25);
}

/* Badges modernos */
.badge {
    padding: 0.5em 1em;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs modernos */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: var(--transition);
    position: relative;
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--secondary-color);
}

.nav-tabs .nav-link.active {
    color: var(--secondary-color);
    background: var(--surface-transparent);
}

.nav-tabs .nav-link.active::after {
    transform: scaleX(1);
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-text {
    margin-top: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Progress bars mejorados */
.progress {
    height: 1.5rem;
    border-radius: var(--border-radius-sm);
    background: var(--surface-1);
    overflow: visible;
}

.progress-bar {
    background: var(--gradient-secondary);
    border-radius: var(--border-radius-sm);
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(20, 33, 235, 0.3);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Cards de acciones rápidas */
.quick-action-card {
    background: var(--surface-0);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid var(--surface-transparent);
}

.quick-action-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.quick-action-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.quick-action-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Timeline de actividades */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-secondary);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--secondary-color);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    width: 60%;
}

/* Efectos de hover en imágenes */
.img-hover-zoom {
    overflow: hidden;
    border-radius: var(--border-radius);
}

.img-hover-zoom img {
    transition: var(--transition);
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* Pills modernos */
.nav-pills .nav-link {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.nav-pills .nav-link:hover {
    background: rgba(20, 33, 235, 0.1);
    color: var(--secondary-color);
}

.nav-pills .nav-link.active {
    background: var(--gradient-secondary);
}

/* Accordion mejorado */
.accordion-button {
    font-weight: 600;
    background: white;
    border-radius: var(--border-radius-sm);
}

.accordion-button:not(.collapsed) {
    background: var(--gradient-secondary);
    color: white;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(20, 33, 235, 0.25);
}

/* Dropdown mejorado con hover effects */
.dropdown-item {
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    margin: 0.25rem 0.5rem;
}

.dropdown-item:hover {
    background: var(--gradient-secondary);
    color: white;
    transform: translateX(5px);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html, body { height: auto; }
    .main-content { min-height: auto; }
    .container, .container-fluid { overflow-y: visible; }
    .scrollable, .content-scroll { max-height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* Mejoras responsive adicionales */
@media (max-width: 992px) {
    .navbar-nav {
        background: rgba(255,255,255,0.1);
        border-radius: var(--border-radius);
        padding: 1rem;
        margin-top: 1rem;
    }

    .navbar-nav .nav-link {
        margin: 0.25rem 0;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        height: 100%;
    }    height: 100%;
    }

    .modal-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 1rem;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem;
        border: none;
        border-bottom: 1px solid var(--surface-1);
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
    }

    .table tbody td:last-child {
        border-bottom: none;
    }
}

/* Dark mode support (aligned with global variables) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, var(--surface-0) 0%, var(--surface-1) 100%);
        color: var(--dark-color);
    }
    
    .card, .page-header, .table {
        background: var(--surface-1);
        color: var(--dark-color);
    }
    
    .form-control, .form-select {
        background: var(--surface-1);
        border-color: var(--border-color);
        color: var(--dark-color);
    }
    
    .modal-content {
        background: var(--surface-1);
        color: var(--dark-color);
    }
}
/* ==========================
   Brochure Moderno (Folleto)
   ========================== */
.brochure-modern {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface-0);
    border-radius: 16px;
    box-shadow: var(--box-shadow-lg);
    overflow: hidden;
}
.brochure-header {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100%);
    color: var(--surface-0);
    padding: 28px 32px;
}
.brochure-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}
.brochure-header .tagline {
    position: absolute;
    right: 28px;
    top: 28px;
    text-align: right;
}
.brochure-header .tagline .line1 {
    font-size: 18px;
    letter-spacing: 1px;
}
.brochure-header .tagline .line2 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
}
.brochure-header .tagline .line3 {
    font-size: 28px;
    font-weight: 700;
}
.brochure-header::after {
    content: '';
    position: absolute;
    right: -120px;
    top: -120px;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    transform: rotate(45deg);
}

.brochure-hero {
    position: relative;
    background: radial-gradient( circle at 30% 40%, rgba(255,255,255,0.1) 0, rgba(255,255,255,0) 60%),
                linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 60%);
    padding: 30px 32px;
}
.brochure-hero .machine {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}
.brochure-hero .machine img {
    max-height: 240px;
    width: auto;
    object-fit: contain;
    filter: var(--drop-shadow-img);
}
.brochure-hero .info {
    position: absolute;
    left: 32px;
    bottom: 24px;
    color: var(--surface-0);
    font-weight: 600;
}

.brochure-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 24px 32px;
    background: var(--surface-1);
}
.brochure-feature {
    background: var(--surface-0);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--box-shadow);
    text-align: center;
}
.brochure-feature .title {
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 1px;
}
.brochure-feature .desc {
    font-size: 13px;
    color: var(--text-muted);
}

.brochure-notes {
    padding: 16px 32px;
}
.brochure-notes h6 { font-weight: 700; }
.brochure-notes p { color: #444; }
.brochure-notes p { color: var(--dark-color); }

.brochure-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 18px 32px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
}
.brochure-footer .item {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .brochure-header .tagline { position: static; text-align: left; margin-top: 12px; }
    .brochure-header .tagline .line2 { font-size: 32px; }
    .brochure-features { grid-template-columns: 1fr; }
    .brochure-footer { grid-template-columns: 1fr; }
}