/* ===== RAPPORTS & ANALYTICS CSS ===== */

/* Cartes de statistiques */
.stats-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card .subheader {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cartes de menu rapports */
.card-link-pop {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

.card-link-pop:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.card-link-pop .avatar {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto;
}

.card-link-pop .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Graphiques */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Tableaux de rapports */
.rapport-table {
    font-size: 0.9rem;
}

.rapport-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
}

.rapport-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.rapport-table .avatar {
    width: 2rem;
    height: 2rem;
}

/* Barres de progression personnalisées */
.progress-custom {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-custom .progress-bar {
    border-radius: 4px;
}

/* Badges personnalisés */
.badge-performance {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.badge-excellente {
    background-color: #198754;
    color: white;
}

.badge-bonne {
    background-color: #fd7e14;
    color: white;
}

.badge-faible {
    background-color: #dc3545;
    color: white;
}

/* Filtres de rapports */
.rapport-filters {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.rapport-filters .form-label {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.rapport-filters .form-control,
.rapport-filters .form-select {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rapport-filters .btn {
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Indicateurs de performance */
.performance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.performance-indicator.excellent {
    background-color: #d1e7dd;
    color: #0f5132;
}

.performance-indicator.good {
    background-color: #fff3cd;
    color: #664d03;
}

.performance-indicator.poor {
    background-color: #f8d7da;
    color: #721c24;
}

/* Widgets du dashboard */
.dashboard-widget {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.dashboard-widget:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.dashboard-widget .widget-header {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.dashboard-widget .widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.dashboard-widget .widget-body {
    padding: 1.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive design */
@media (max-width: 768px) {
    .stats-card .h1 {
        font-size: 2rem;
    }
    
    .card-link-pop .avatar {
        width: 3rem;
        height: 3rem;
    }
    
    .rapport-filters {
        padding: 1rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .stats-card .h1 {
        font-size: 1.75rem;
    }
    
    .rapport-table {
        font-size: 0.8rem;
    }
    
    .rapport-table th,
    .rapport-table td {
        padding: 0.5rem;
    }
}

/* Mode impression */
@media print {
    .d-print-none {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .stats-card,
    .dashboard-widget {
        break-inside: avoid;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Couleurs thématiques */
.text-revenue {
    color: #198754 !important;
}

.text-expense {
    color: #dc3545 !important;
}

.text-profit {
    color: #0d6efd !important;
}

.bg-revenue-lt {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.bg-expense-lt {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.bg-profit-lt {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Notifications de rapport */
.rapport-notification {
    border-left: 4px solid #0d6efd;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
}

.rapport-notification.success {
    border-left-color: #198754;
    background-color: #d1e7dd;
}

.rapport-notification.warning {
    border-left-color: #fd7e14;
    background-color: #fff3cd;
}

.rapport-notification.danger {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

/* Boutons d'export */
.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-buttons .btn {
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chargement des données */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #f3f3f3;
    border-top: 0.25em solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Styles pour les nouveaux graphiques */
.chart-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chart-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem 1.5rem;
}

.chart-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.chart-card .card-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-card .card-actions .btn {
    border-radius: 6px;
    border: none;
    padding: 0.375rem 0.75rem;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    transition: all 0.2s ease;
}

.chart-card .card-actions .btn:hover {
    background-color: #0d6efd;
    color: white;
    transform: scale(1.05);
}

/* Indicateurs de performance améliorés */
.performance-indicators {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 2rem;
}

.performance-indicators .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.performance-indicators .card-title {
    color: white;
    font-weight: 600;
}

.performance-indicators .h2 {
    font-size: 2.25rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.performance-indicators .text-secondary {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.performance-indicators .progress {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    height: 6px;
}

.performance-indicators .progress-bar {
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 1));
}

/* Animation pour les cartes */
.card-animate {
    animation: slideInUp 0.6s ease-out;
}

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

/* Responsive pour les graphiques */
@media (max-width: 768px) {
    .chart-card .card-header {
        padding: 1rem;
    }
    
    .chart-card .card-title {
        font-size: 1rem;
    }
    
    .performance-indicators .h2 {
        font-size: 1.75rem;
    }
}

/* Styles pour les erreurs de graphique */
.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6c757d;
    text-align: center;
}

.chart-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chart-error .error-message {
    font-size: 1rem;
    font-weight: 500;
}

/* Boutons d'action pour les graphiques */
.chart-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.chart-actions .btn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-card:hover .chart-actions .btn {
    opacity: 1;
} 