/* ===== FUTURISTIC DASHBOARD STYLES ===== */
/* Basado en el diseño del login innovador */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #b8c5d1;
    --text-accent: #667eea;
    --shadow-glow: 0 8px 32px rgba(102, 126, 234, 0.25);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-intense: 0 20px 60px rgba(102, 126, 234, 0.4);
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--dark-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== FONDO ANIMADO ===== */
.futuristic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--dark-gradient);
}

.futuristic-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundShift 25s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.7; transform: scale(1.05) rotate(0.5deg); }
}

/* ===== PARTÍCULAS FLOTANTES ===== */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(102, 126, 234, 0.4);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.particle:nth-child(2n) {
    background: rgba(255, 119, 198, 0.4);
    animation-duration: 25s;
}

.particle:nth-child(3n) {
    background: rgba(120, 219, 255, 0.4);
    animation-duration: 30s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== LÍNEAS GEOMÉTRICAS ===== */
.geometric-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.geometric-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    animation: moveLine 15s infinite linear;
}

.geometric-line:nth-child(1) {
    width: 200px;
    height: 1px;
    top: 20%;
    animation-delay: 0s;
}

.geometric-line:nth-child(2) {
    width: 150px;
    height: 1px;
    top: 60%;
    animation-delay: 5s;
}

.geometric-line:nth-child(3) {
    width: 100px;
    height: 1px;
    top: 80%;
    animation-delay: 10s;
}

@keyframes moveLine {
    0% {
        left: -200px;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.dashboard-container {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

/* ===== HEADER DEL DASHBOARD ===== */
.dashboard-hero {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding: 3rem 0;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.hero-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.3)); }
    100% { filter: drop-shadow(0 0 40px rgba(102, 126, 234, 0.6)); }
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    display: block;
}

.hero-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== CARDS FUTURISTAS ===== */
.futuristic-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.futuristic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.futuristic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-intense);
}

.futuristic-card:hover::before {
    left: 100%;
}

/* ===== HEADERS DE CARDS ===== */
.card-header-futuristic {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.card-header-futuristic::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.card-title-futuristic {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle-futuristic {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* ===== MÉTRICAS DESTACADAS ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: rotate 8s linear infinite;
    z-index: -1;
}

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

.metric-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.metric-icon {
    width: 70px;
    height: 70px;
    background: var(--accent-gradient);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 28px;
    color: white;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

.metric-number {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.metric-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.trend-up {
    color: #00ff88;
}

.trend-down {
    color: #ff4757;
}

/* ===== TABLAS FUTURISTAS ===== */
.table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.futuristic-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.futuristic-table th {
    background: var(--primary-gradient);
    color: white;
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.futuristic-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.futuristic-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.futuristic-table tbody tr {
    transition: all 0.3s ease;
}

.futuristic-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

.futuristic-table tbody tr:hover td {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ===== ESTADOS DE DATOS ===== */
.amount-positive {
    color: #00ff88;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.amount-negative {
    color: #ff4757;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
}

.status-active {
    color: #00ff88;
    font-weight: 600;
}

.status-inactive {
    color: #ff4757;
    font-weight: 600;
}

.status-pending {
    color: #ffa502;
    font-weight: 600;
}

/* ===== BOTONES FUTURISTAS ===== */
.btn-futuristic {
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 0.8rem 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-futuristic::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: left 0.5s;
}

.btn-futuristic:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

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

/* ===== GRÁFICOS Y VISUALIZACIONES ===== */
.chart-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.chart-placeholder {
    height: 300px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(255, 119, 198, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    border: 2px dashed var(--glass-border);
}

/* ===== ANIMACIONES DE ENTRADA ===== */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
    opacity: 0;
    transform: translateX(-50px);
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
    transform: scale(0.8);
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .hero-stats {
        gap: 2rem;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .futuristic-card {
        padding: 1.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .metric-card {
        padding: 1.5rem;
    }
    
    .futuristic-table th,
    .futuristic-table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .metric-number {
        font-size: 2rem;
    }
    
    .futuristic-table {
        font-size: 0.7rem;
    }
}

/* ===== UTILIDADES ===== */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-effect {
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}

.pulse-animation {
    animation: pulse 2s infinite;
}

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

/* ===== TARJETA DE PERFIL EN SIDEBAR ===== */
.user-card {
    width: 100%;
    display: block;
    color: inherit;
    transition: all 0.3s ease;
}

.user-card:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.user-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    /*padding: 0.5rem;*/
    border-radius: 12px;
    transition: all 0.3s ease;
}

.user-card:hover .user-card-content {
    background: rgba(102, 126, 234, 0.1);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-status {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ===== MULTISELECT PERSONALIZADO ===== */
.multiselect-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
    width: 100%;
    text-align: left;
    color: var(--text-secondary);
}

.multiselect-btn:hover {
    border-color: var(--text-accent);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 4px;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.multiselect-option {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

.multiselect-option input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: var(--text-accent);
    cursor: pointer;
}

.multiselect-option label {
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    margin: 0;
}

/* ===== TAGS DE EMPRESAS SELECCIONADAS ===== */
.selected-enterprises {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.enterprise-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px;
    font-size: 12px;
    color: white !important;
    animation: fadeInScale 0.3s ease;
}

.enterprise-tag.primary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

/* Asegurar que los tags tengan colores en ambos formularios */
.selected-enterprises .enterprise-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.selected-enterprises .enterprise-tag.primary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.primary-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: white;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ocultar select original cuando hay interfaz personalizada */
.input-container:has(.multiselect-btn) select {
    display: none !important;
}

/* Scrollbar personalizado para multiselect */
.multiselect-dropdown::-webkit-scrollbar {
    width: 6px;
}

.multiselect-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb {
    background: var(--text-accent);
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* ===== RESPONSIVE MULTISELECT ===== */
@media (max-width: 768px) {
    .multiselect-dropdown {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw;
        max-width: 400px;
        max-height: 70vh;
    }
    
    .enterprise-tag {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .primary-badge {
        font-size: 9px;
        padding: 1px 4px;
    }
}
