/* Dashboard Profesional GEM 2025 - Modernizado */

/* Variables CSS para consistencia */
:root {
    --dashboard-primary: #2563eb;
    --dashboard-secondary: #64748b;
    --dashboard-success: #10b981;
    --dashboard-warning: #f59e0b;
    --dashboard-danger: #ef4444;
    --dashboard-bg: #f8fafc;
    --dashboard-card-bg: #ffffff;
    --dashboard-border: #e2e8f0;
    --dashboard-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --dashboard-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --dashboard-radius: 12px;
    --dashboard-radius-sm: 6px;
}

/* Contenedor principal del dashboard moderno */
.modern-dashboard {
    background: var(--dashboard-bg);
    min-height: calc(100vh - 120px);
    padding: 24px;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Header del Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-title-section {
    flex: 1;
    min-width: 300px;
}

.breadcrumb-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--dashboard-secondary);
}

.breadcrumb-separator {
    font-size: 10px;
    opacity: 0.6;
}

.breadcrumb-current {
    color: var(--dashboard-primary);
    font-weight: 500;
}

.dashboard-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-icon {
    color: var(--dashboard-primary);
    font-size: 2rem;
}

.dashboard-date-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--dashboard-card-bg);
    padding: 12px 16px;
    border-radius: var(--dashboard-radius-sm);
    box-shadow: var(--dashboard-shadow);
    font-weight: 500;
    color: #374151;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.period-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.period-selector label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dashboard-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modern-datepicker {
    background: var(--dashboard-card-bg);
    border: 2px solid var(--dashboard-border);
    border-radius: var(--dashboard-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    width: 240px;
    transition: all 0.2s ease;
    color: #374151;
}

.modern-datepicker:focus {
    outline: none;
    border-color: var(--dashboard-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.refresh-btn {
    background: var(--dashboard-primary);
    color: white;
    border: none;
    border-radius: var(--dashboard-radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.refresh-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

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

/* Grid Principal del Dashboard */
.dashboard-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

/* Sección de Métricas */
.metrics-overview {
    margin-bottom: 8px;
}

.section-title {
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--dashboard-secondary);
    font-weight: 400;
}

/* Grid de KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 8px;
}

.kpi-card {
    background: var(--dashboard-card-bg);
    border: 1px solid var(--dashboard-border);
    border-radius: var(--dashboard-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dashboard-shadow-lg);
    border-color: var(--dashboard-primary);
}

.kpi-icon {
    background: linear-gradient(135deg, var(--dashboard-primary), #3b82f6);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: var(--dashboard-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 14px;
    color: var(--dashboard-secondary);
    font-weight: 500;
}

.kpi-trend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--dashboard-radius-sm);
}

.kpi-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--dashboard-success);
}

.kpi-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--dashboard-danger);
}

/* Cards Modernas del Dashboard */
.dashboard-card-modern {
    background: var(--dashboard-card-bg);
    border: 1px solid var(--dashboard-border);
    border-radius: var(--dashboard-radius);
    box-shadow: var(--dashboard-shadow);
    overflow: hidden;
    transition: all 0.2s ease;
}

.dashboard-card-modern:hover {
    box-shadow: var(--dashboard-shadow-lg);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--dashboard-border);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.card-title i {
    color: var(--dashboard-primary);
    font-size: 1.25rem;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: transparent;
    border: 1px solid var(--dashboard-border);
    border-radius: var(--dashboard-radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--dashboard-secondary);
}

.btn-action:hover {
    background: var(--dashboard-primary);
    color: white;
    border-color: var(--dashboard-primary);
}

.card-content {
    padding: 24px;
}

/* Sección de Conversiones */
.conversion-rate {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.rate-label {
    color: var(--dashboard-secondary);
    font-weight: 500;
}

.rate-value {
    font-weight: 700;
    color: var(--dashboard-primary);
    font-size: 16px;
}

/* Sistema de Tabs */
.panel-tabs {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: var(--dashboard-radius-sm);
    padding: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dashboard-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: white;
    color: var(--dashboard-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Áreas de Contenido */
.traffic-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-container,
.conversion-funnel,
.main-panel-content {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: var(--dashboard-radius-sm);
    color: var(--dashboard-secondary);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
    background: white;
    border-radius: var(--dashboard-radius);
    box-shadow: var(--dashboard-shadow-lg);
}

.loading-icon {
    font-size: 2rem;
    color: var(--dashboard-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-dashboard {
        padding: 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-date-section {
        align-items: flex-start;
        width: 100%;
    }
    
    .dashboard-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .modern-datepicker {
        width: 100%;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-main-title {
        font-size: 2rem;
    }
}

.dashboard-card input:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.1);
}

/* Labels profesionales */
.dashboard-card label {
    font-weight: 500;
    color: #495057;
    font-size: 13px;
    white-space: nowrap;
}

/* Flexbox para organizar métricas horizontalmente sin espacios desperdiciados */
.dashboard-metrics-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

/* Info wrappers que aprovechan todo el ancho disponible */
.dashboard-info-wrapper {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
    max-width: none;
}

.dashboard-info-wrapper:hover {
    border-color: #6c63ff;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.1);
}

/* Iconos profesionales */
.dashboard-icono {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin: 0 auto 10px;
    color: #6c63ff;
    transition: all 0.2s ease;
}

.dashboard-info-wrapper:hover .dashboard-icono {
    background: #6c63ff;
    color: white;
    border-color: #6c63ff;
}

/* Números y estadísticas */
.dashboard-info-wrapper .numero {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 8px 0 5px;
    color: #2c3e50;
}

.dashboard-info-wrapper .texto {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    line-height: 1.3;
}

/* Card de operaciones profesional */
.dashboard-card-ultimo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    width: 100%;
}

.dashboard-card-ultimo h5,
.dashboard-card-ultimo h6 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* Servicios de operaciones que aprovechan el ancho */
.dashboard-card-ultimo .d-flex {
    width: 100%;
}

.content_operaciones {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 8px;
    transition: all 0.2s ease;
    color: white;
    text-decoration: none;
    flex: 1;
    min-width: 130px;
}

.content_operaciones:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.content_operaciones a {
    color: white;
    text-decoration: none;
}

.content_operaciones label {
    color: white;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    font-size: 13px;
}

/* Estados de servicios */
.fa-circle.text-yellow {
    color: #ffc107 !important;
}

.fa-circle.text-success {
    color: #28a745 !important;
}

.fa-circle.text-danger {
    color: #dc3545 !important;
}

/* Conversiones en línea horizontal que aprovecha el ancho */
#flow-conversiones {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

#flow-conversiones .dashboard-info-wrapper {
    margin: 5px 0;
    flex: 1;
    min-width: 130px;
}

/* Tasa de conversión destacada pero sobria */
.conversion-rate-wrapper {
    background: #f8f9fa;
    border: 2px solid #6c63ff;
    border-radius: 8px;
    flex: 1.2 !important;
    min-width: 150px;
}

.conversion-rate-wrapper .dashboard-icono {
    background: #6c63ff;
    color: white;
    border-color: #6c63ff;
}

.conversion-rate-wrapper .numero {
    color: #6c63ff;
    font-size: 2rem;
}

/* Responsive optimizado para diferentes tamaños */
@media (min-width: 1400px) {
    .dashboard-info-wrapper {
        min-width: 160px;
    }
    
    #flow-conversiones .dashboard-info-wrapper {
        min-width: 140px;
    }
}

@media (max-width: 1200px) {
    .dashboard-metrics-row {
        gap: 10px;
    }
    
    .dashboard-info-wrapper {
        min-width: 120px;
    }
    
    #flow-conversiones .dashboard-info-wrapper {
        min-width: 110px;
    }
}

@media (max-width: 992px) {
    .wrapper-visitas {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .dashboard-metrics-row .dashboard-info-wrapper {
        min-width: 48%;
    }
    
    #flow-conversiones .dashboard-info-wrapper {
        min-width: 45%;
    }
}

@media (max-width: 768px) {
    #content-administracion {
        padding: 15px;
        margin: 10px 0;
    }
    
    .dashboard-card {
        padding: 15px;
        margin: 10px 0;
    }
    
    .dashboard-metrics-row .dashboard-info-wrapper {
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    #flow-conversiones .dashboard-info-wrapper {
        min-width: 48%;
    }
    
    .dashboard-card input {
        width: 100%;
    }
}

@media (max-width: 576px) {
    #flow-conversiones .dashboard-info-wrapper {
        min-width: 100%;
    }
}

/* Animaciones suaves y profesionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card {
    animation: fadeInUp 0.4s ease-out;
}

/* Espaciado compacto */
hr {
    margin: 15px 0;
    border-color: #e9ecef;
}

/* Título del período más compacto */
.text-muted {
    font-size: 12px;
}

/* Eliminar márgenes laterales del contenedor principal */
.content-wrapper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.content-wrapper .content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

section.content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Asegurar que todo el ancho se aproveche */
body, html {
    width: 100%;
    overflow-x: hidden;
}

/* Reglas específicas para container-fluid */
.container-fluid {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 15px !important; /* Solo padding mínimo para no pegar todo al borde */
}

/* Dashboard principal ocupa todo el ancho */
.dashboard-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Overrides para AdminLTE - Optimización de espacio */
.wrapper {
    width: 100% !important;
    max-width: none !important;
}

/* Mantener sidebar pero optimizar el content-wrapper */
.wrapper .content-wrapper {
    width: calc(100% - 250px) !important; /* 250px es el ancho típico de sidebar AdminLTE */
    margin-left: 250px !important;
}

/* Optimización específica para dashboard */
.dashboard-page .content-wrapper {
    padding: 0 !important;
}

.dashboard-page .container-fluid {
    padding: 10px !important;
    margin: 0 !important;
    max-width: none !important;
}

/* Sidebar colapsada - usar todo el ancho */
.sidebar-collapse .content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Para pantallas pequeñas - colapsar sidebar automáticamente */
@media (max-width: 991.98px) {
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .main-sidebar {
        margin-left: -250px;
    }
    
    .sidebar-open .main-sidebar {
        margin-left: 0;
    }
}

/* ===== ICONOS MODERNOS DEL MENÚ LATERAL ===== */

/* Colores claros para el menú lateral sobre fondo oscuro */
.main-sidebar .nav-sidebar .nav-link {
    color: #e9ecef !important; /* Color claro para el texto */
}

.main-sidebar .nav-sidebar .nav-link:hover {
    color: #ffffff !important; /* Blanco al hacer hover */
    background-color: rgba(255,255,255,0.1) !important;
}

.main-sidebar .nav-sidebar .nav-link.active {
    color: #ffffff !important; /* Blanco para elementos activos */
    background-color: rgba(255,255,255,0.15) !important;
}

/* Iconos modernos con colores claros */
.nav-sidebar .nav-icon {
    color: #e9ecef !important; /* Color claro para iconos */
    font-size: 16px !important;
    width: 20px !important;
    text-align: center;
    margin-right: 8px !important;
    transition: all 0.3s ease;
    position: relative;
}

/* Efectos modernos para iconos */
.nav-sidebar .nav-icon.modern-icon {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    transform: translateZ(0); /* Activar aceleración de hardware */
}

/* Hover effects para iconos modernos */
.nav-sidebar .nav-link:hover .nav-icon {
    color: #ffffff !important; /* Blanco brillante al hacer hover */
    transform: translateX(3px) scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Iconos activos */
.nav-sidebar .nav-link.active .nav-icon {
    color: #ffffff !important; /* Blanco para iconos activos */
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* Texto del menú con mejor contraste */
.nav-sidebar .nav-link p {
    color: inherit !important;
    font-weight: 500 !important;
}

/* Submenús también con colores claros */
.nav-sidebar .nav-treeview .nav-link {
    color: #d1d3d4 !important;
    padding-left: 2rem !important;
}

.nav-sidebar .nav-treeview .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.08) !important;
}

.nav-sidebar .nav-treeview .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.12) !important;
}

/* Mejorar visualización en dispositivos móviles */
@media (max-width: 768px) {
    .nav-sidebar .nav-icon {
        font-size: 18px !important;
        margin-right: 10px !important;
    }
    
    .main-sidebar .nav-sidebar .nav-link {
        color: #f8f9fa !important; /* Aún más claro en móviles */
    }
}

/* Mejoras adicionales para el contraste del menú */
.main-sidebar {
    background: linear-gradient(180deg, #343a40 0%, #2c3439 100%) !important;
}

/* Separadores visuales entre elementos del menú */
.nav-sidebar .nav-item {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-sidebar .nav-item:last-child {
    border-bottom: none;
}

/* Indicador visual para elementos con submenús */
.nav-sidebar .nav-item.has-treeview > .nav-link .right {
    color: #adb5bd !important;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-item.has-treeview:hover > .nav-link .right {
    color: #ffffff !important;
    transform: rotate(180deg);
}

.nav-sidebar .nav-item.menu-open > .nav-link .right {
    transform: rotate(-90deg);
    color: #ffffff !important;
}

/* Animaciones suaves para el menú */
.nav-sidebar .nav-link {
    transition: all 0.3s ease !important;
    border-radius: 6px !important;
    margin: 2px 8px !important;
}

.nav-sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1) !important;
    transform: translateX(2px) !important;
}

.nav-sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.2) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Mejoras para submenús */
.nav-sidebar .nav-treeview .nav-link {
    margin-left: 30px !important;
    font-size: 0.9rem !important;
}

.nav-sidebar .nav-treeview .nav-link .nav-icon {
    font-size: 0.8rem !important;
    opacity: 0.8 !important;
}

/* Iconos específicos con mejores glifos modernos */
.nav-icon.fa-tachometer-alt::before { content: "\f3fd"; }
.nav-icon.fa-user-friends::before { content: "\f500"; }
.nav-icon.fa-hand-holding-dollar::before { content: "\f4c0"; }
.nav-icon.fa-building-columns::before { content: "\f19c"; }
.nav-icon.fa-chart-area::before { content: "\f1fe"; }
.nav-icon.fa-project-diagram::before { content: "\f542"; }
.nav-icon.fa-comment-dollar::before { content: "\f651"; }

/* === ESTILOS PARA ESTADÍSTICAS DE TRÁFICO === */
.traffic-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.traffic-stat {
    text-align: center;
    padding: 16px;
    background: var(--dashboard-card-bg);
    border-radius: 8px;
    border: 1px solid var(--dashboard-border);
    transition: all 0.2s ease;
}

.traffic-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.traffic-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dashboard-primary);
    margin-bottom: 4px;
}

.traffic-stat .stat-label {
    font-size: 12px;
    color: var(--dashboard-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === MEJORAS PARA KPI CHANGES === */
.kpi-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 12px;
}

.kpi-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kpi-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kpi-change.neutral {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

.kpi-change i {
    font-size: 10px;
}
.nav-icon.fa-money-bill-wave::before { content: "\f53a"; }
.nav-icon.fa-list-ul::before { content: "\f0ca"; }
.nav-icon.fa-sliders-h::before { content: "\f1de"; }
.nav-icon.fa-heart-pulse::before { content: "\f21e"; }
.nav-icon.fa-gear::before { content: "\f013"; }

/* === ESTILOS COMPLEMENTARIOS PARA DASHBOARD MODERNO === */

/* Métricas mejoradas para el nuevo dashboard */
.dashboard-metrics-row,
.traffic-chart,
.conversion-funnel {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 200px;
    background: #f8fafc;
    border-radius: var(--dashboard-radius-sm, 6px);
    color: #64748b;
    font-weight: 500;
}

/* Métricas individuales modernas */
.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    margin: 0 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    min-width: 120px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

/* Estados de carga modernos */
.dashboard-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
}

.dashboard-loading-state i {
    font-size: 2rem;
    margin-bottom: 12px;
    animation: pulse 2s infinite;
}

/* Animaciones suaves */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-animate {
    animation: slideInUp 0.3s ease-out;
}

/* Mejoras para elementos heredados */
.dashboard-card input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: 0;
}

.dashboard-card label {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0;
    white-space: nowrap;
}

.dashboard-card label i {
    color: #2563eb;
}

/* Compatibilidad con elementos de operaciones */
.modern-dashboard-page .dashboard-card-ultimo {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.modern-dashboard-page .content_operaciones {
    transition: all 0.2s ease;
}

.modern-dashboard-page .content_operaciones:hover {
    transform: translateY(-2px);
}

/* === ESTILOS ESPECÍFICOS PARA DASHBOARD DE OPERACIONES === */

.operations-dashboard {
    background: var(--dashboard-bg, #f8fafc);
}

/* Sección de Servicios */
.services-section {
    margin-bottom: 24px;
}

.services-card {
    margin-bottom: 24px;
}

.services-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Grid de Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.service-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: var(--dashboard-primary, #2563eb);
    box-shadow: 0 8px 25px -5px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.service-icon {
    background: linear-gradient(135deg, var(--dashboard-primary, #2563eb), #3b82f6);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.service-status {
    position: relative;
}

.status-indicator-icon {
    font-size: 12px;
    animation: pulse 2s infinite;
}

.status-indicator-icon.text-success {
    color: #10b981 !important;
}

.status-indicator-icon.text-warning {
    color: #f59e0b !important;
}

.status-indicator-icon.text-danger {
    color: #ef4444 !important;
}

.service-content {
    text-align: left;
}

.service-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.service-metrics {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.metric-item-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    min-width: 70px;
}

.metric-value-small {
    font-size: 14px;
    font-weight: 700;
    color: var(--dashboard-primary, #2563eb);
}

.metric-label-small {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}

.service-actions {
    display: flex;
    gap: 8px;
}

.btn-service-action {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.btn-service-action:hover {
    background: var(--dashboard-primary, #2563eb);
    color: white;
    border-color: var(--dashboard-primary, #2563eb);
}

/* Sección de Monitoreo */
.monitoring-section {
    margin-top: 24px;
}

.monitoring-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--dashboard-primary, #2563eb);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Grid de Monitoreo */
.monitoring-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8fafc;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    gap: 12px;
}

.chart-placeholder i {
    font-size: 2rem;
    opacity: 0.5;
}

.system-stats h6 {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.stat-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--dashboard-primary, #2563eb);
}

/* Responsive para Dashboard de Operaciones */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .monitoring-grid {
        grid-template-columns: 1fr;
    }
    
    .service-metrics {
        justify-content: space-between;
    }
    
    .services-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
