﻿/* Estilos para el modal del dashboard */
.dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dashboard-content {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    height: 90%;
    max-height: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dashboard-header {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

    .dashboard-header h2 {
        margin: 0;
        font-size: 1.5rem;
    }

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

#dashboardContainer {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.btn-dashboard {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

    .btn-dashboard:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-1px);
    }

    .btn-dashboard i {
        font-size: 11px;
    }

/* Ajustar el contenedor del indicador de crédito */
.credito-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}


    /* Cuando es clickeable */
    .credito-indicator.clickeable {
        cursor: pointer !important;
        user-select: none;
    }

        .credito-indicator.clickeable:hover {
            background: rgba(255, 255, 255, 0.1) !important;
            padding: 8px !important;
            transform: scale(1.02);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }

        .credito-indicator.clickeable:active {
            transform: scale(0.98);
        }

        /* Tooltip para desktop */
        .credito-indicator.clickeable:hover::after {
            content: "👆 Click para dashboard completo";
            position: absolute;
            bottom: -35px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.9);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 0.8rem;
            white-space: nowrap;
            z-index: 1000;
            animation: fadeIn 0.3s ease;
        }

.action-buttons {
    margin-top: 8px;
}

.btn-action {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-email:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.email-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1001;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        margin: 0;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

    .modal-close:hover {
        background: rgba(255,255,255,0.3);
    }

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #333;
        display: flex;
        align-items: center;
        gap: 6px;
    }

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

    .form-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    }

.info-message {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    color: #6c757d;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-footer {
    background: #f8f9fa;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e9ecef;
}


.btn-secondary {
    background: #6c757d;
    color: white;
}

    .btn-secondary:hover {
        background: #5a6268;
    }

.btn-primary {
    background: #007bff;
    color: white;
}

    .btn-primary:hover {
        background: #0056b3;
        transform: translateY(-1px);
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive - ocultar tooltip en móvil */
@media (max-width: 768px) {
    .credito-indicator.clickeable:hover::after {
        display: none;
    }

    .credito-indicator.clickeable:hover {
        background: rgba(255, 255, 255, 0.2) !important;
    }
}

.credito-indicator[style*="cursor: pointer"] {
    cursor: pointer !important;
}

    .credito-indicator[style*="cursor: pointer"]:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        padding: 8px;
        transform: scale(1.02);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

        .credito-indicator[style*="cursor: pointer"]:hover::after {
            content: " 👆 Click para dashboard completo";
            position: absolute;
            bottom: -25px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            white-space: nowrap;
            z-index: 1000;
        }

/* Estilos adicionales para estadísticas */
#divEstadisticasVentas div[style*="display: flex"] {
    justify-content: space-around;
}

#divSegmentacionEstados div[style*="display: grid"] {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.credito-porcentaje.danger {
    color: red;
}
/* Responsive */
@media (max-width: 768px) {
    .dashboard-modal {
        padding: 10px;
    }

    .dashboard-content {
        width: 100%;
        height: 95%;
        border-radius: 15px;
    }

    .dashboard-header {
        padding: 15px 20px;
        border-radius: 15px 15px 0 0;
    }

        .dashboard-header h2 {
            font-size: 1.2rem;
        }

    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    #divEstadisticasVentas div[style*="display: flex"] {
        justify-content: space-around;
    }

    #divSegmentacionEstados div[style*="display: grid"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .credito-indicator[style*="cursor: pointer"]:hover::after {
        display: none; /* Ocultar tooltip en móvil */
    }
}
