/* Variables */
:root {
    --primary-color: #d4af37;
    --secondary-color: #2ca246;
    --warning-color: #fbbc05;
    --danger-color: #ea4335;
    --dark-color: #202124;
    --light-color: #f8f9fa;
    --gray-light: #e8eaed;
    --gray-medium: #dadce0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --border-radius: 20px;
    --border-radius-small: 15px;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Correction des débordements horizontaux */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Container principal */
.statistiques-container {
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 140px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Header avec animation de stade */
.fan-header {
    position: relative;
    height: 300px;
    margin-bottom: 40px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    width: 100%;
}

.stadium-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.pitch-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(to right, 
            transparent 49%, 
            rgba(255, 255, 255, 0.1) 49%, 
            rgba(255, 255, 255, 0.1) 51%, 
            transparent 51%),
        linear-gradient(to bottom, 
            transparent 49%, 
            rgba(255, 255, 255, 0.1) 49%, 
            rgba(255, 255, 255, 0.1) 51%, 
            transparent 51%),
        radial-gradient(circle at 50% 50%, 
            transparent 40%, 
            rgba(255, 255, 255, 0.1) 40%, 
            rgba(255, 255, 255, 0.1) 42%, 
            transparent 42%);
}

.ball-animation {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation: moveBall 8s linear infinite;
    z-index: 1;
}

.ball-animation i {
    font-size: 30px;
    color: #fff;
    animation: rotateBall 2s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes moveBall {
    0% { left: 0; }
    50% { left: calc(100% - 30px); }
    100% { left: 0; }
}

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

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: white;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.main-title {
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
}

.title-gradient {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(45deg, #ffffff, #e0e0e0, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: block;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
}

.title-sub {
    display: block;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 300;
    margin-top: 10px;
    opacity: 0.9;
    letter-spacing: 1px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.update-time {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: center;
    box-sizing: border-box;
}

.update-time i {
    animation: spin 4s linear infinite;
    flex-shrink: 0;
}

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

/* Grille des statistiques principales */
.main-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    width: 100%;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.total-card::before {
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
}

.paid-card::before {
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
}

.promise-card::before {
    background: linear-gradient(90deg, #fad0c4, #ffd1ff);
}

.socios-card::before {
    background: linear-gradient(90deg, #a8edea, #fed6e3);
}

.card-icon {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.total-card .card-icon { color: #ff6b6b; }
.paid-card .card-icon { color: #4ecdc4; }
.promise-card .card-icon { color: #ff8e53; }
.socios-card .card-icon { color: #a8edea; }

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Important pour éviter les débordements */
}

.card-content h3 {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    color: #5f6368;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.stat-value {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
}

.currency {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: #5f6368;
}

.stat-label {
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    color: #80868b;
    margin-bottom: 15px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

.progress-bar {
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 1s ease;
}

.card-sparkle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.card-sparkle i {
    font-size: clamp(10px, 1vw, 12px);
    color: #ffd700;
    animation: sparkle 2s ease-in-out infinite;
}

.card-sparkle i:nth-child(2) { animation-delay: 0.5s; }
.card-sparkle i:nth-child(3) { animation-delay: 1s; }

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.socios-avatar {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: -8px;
}

.socios-avatar i {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--primary-color);
    background: white;
    border-radius: 50%;
    padding: clamp(4px, 1vw, 5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section graphiques */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

.chart-container,
.distribution-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.chart-header h3 {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.chart-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
}

.filter-btn {
    padding: clamp(5px, 1vw, 6px) clamp(10px, 2vw, 15px);
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius-small);
    background: white;
    color: #5f6368;
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* CORRECTION DU BUG CHART.JS */
.chart-wrapper {
    height: 300px;
    position: relative;
    flex: 1;
    min-height: 250px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Solution pour le bug de responsive de Chart.js */
.chart-wrapper canvas {
    max-width: 100% !important;

    display: block;
}

/* Container spécifique pour Chart.js */
#monthlyChart {
    width: 100% !important;
    height: 100% !important;
}

/* Distribution par type - CORRIGÉ */
.distribution-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
    grid-template-columns: 1fr;
    width: 100%;
    box-sizing: border-box;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    min-height: 120px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.type-card:hover {
    transform: translateX(5px);
}

.cash-type {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border-left: 4px solid #4CAF50;
}

.cheque-type {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
    border-left: 4px solid #2196F3;
}

.type-icon {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

.cash-type .type-icon {
    background: #4CAF50;
}

.cheque-type .type-icon {
    background: #2196F3;
}

.type-info {
    flex: 1;
    min-width: 0; /* Pour empêcher le débordement */
    overflow: hidden;
}

.type-info h4 {
    margin: 0 0 5px 0;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.type-value {
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.type-percentage {
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    color: #5f6368;
    margin-top: 5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Détails par mois */
.details-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.section-header {
    margin-bottom: 25px;
    width: 100%;
}

.section-header h3 {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.month-card {
    background: var(--light-color);
    border-radius: var(--border-radius-small);
    padding: 20px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.month-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.month-header h4 {
    margin: 0;
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    color: var(--dark-color);
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.month-total {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.month-stats {
    margin-bottom: 15px;
    flex: 1;
    width: 100%;
}

.month-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
    width: 100%;
    box-sizing: border-box;
}

.month-stat:last-child {
    border-bottom: none;
}

.month-stat .stat-label {
    color: #5f6368;
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    margin-bottom: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.month-stat .stat-value {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    font-weight: 600;
    margin-bottom: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: right;
}

.month-progress {
    margin-top: 15px;
    width: 100%;
}

.paid-fill {
    background: #4CAF50;
}

.promise-fill {
    background: #FF9800;
}

/* États vides */
.no-data,
.no-activity {
    text-align: center;
    padding: 40px;
    color: #80868b;
    grid-column: 1 / -1;
    width: 100%;
}

.no-data i,
.no-activity i {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 15px;
    opacity: 0.3;
}

.no-data p,
.no-activity p {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Footer */
.stats-footer {
    background: linear-gradient(135deg, #0c2461, #1e3799);
    color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 40px;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.team-spirit {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    flex-wrap: wrap;
}

.team-spirit i {
    color: #ffd700;
    animation: bounce 2s infinite;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    flex-shrink: 0;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.last-updated {
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    opacity: 0.8;
    text-align: right;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .statistiques-container {
        margin-top: 120px;
        padding: 0 15px;
    }
    
    .fan-header {
        height: 250px;
    }
    
    .main-stats-grid {
        gap: 20px;
    }
    
    .charts-section {
        gap: 20px;
    }
    
    .months-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .statistiques-container {
        margin-top: 110px;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .distribution-grid {
        grid-template-columns: 1fr;
    }
    
    .fan-header {
        height: 220px;
    }
    
    /* Correction spécifique pour les écrans moyens */
    .chart-wrapper {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .statistiques-container {
        margin-top: 110px;
        padding: 0 10px;
    }
    
    .fan-header {
        height: 200px;
        margin-bottom: 30px;
    }
    
    .main-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
        min-height: 180px;
    }
    
    .card-icon {
        margin-bottom: 15px;
    }
    
    .chart-container,
    .distribution-container,
    .details-section {
        padding: 20px;
    }
    
    .distribution-grid {
        gap: 15px;
    }
    
    .type-card {
        padding: 15px;
        min-height: 100px;
        gap: 15px;
    }
    
    .type-info {
        flex: 1;
        min-width: 0;
    }
    
    .months-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .month-card {
        padding: 15px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .chart-filters {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .title-gradient {
        font-size: 2rem;
    }
    
    .title-sub {
        font-size: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .last-updated {
        text-align: center;
        width: 100%;
    }
    
    /* Correction pour les petits écrans */
    .type-value,
    .type-info h4 {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 576px) {
    .statistiques-container {
        margin-top: 110px;
    }
    
    .fan-header {
        height: 180px;
    }
    
    .title-gradient {
        font-size: 1.8rem;
    }
    
    .title-sub {
        font-size: 0.9rem;
    }
    
    .update-time {
        padding: 6px 15px;
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .chart-wrapper {
        height: 200px;
    }
    
    .type-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .type-info {
        width: 100%;
    }
    
    .type-info h4,
    .type-value {
        text-align: center;
    }
    
    .month-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .month-total {
        align-self: flex-start;
    }
    
    /* Correction pour les très petits écrans */
    .chart-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    
    .filter-btn {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .statistiques-container {
        margin-top: 110px;
        padding: 0 8px;
    }
    
    .fan-header {
        height: 160px;
        border-radius: 15px;
    }
    
    .ball-animation i {
        font-size: 24px;
    }
    
    .stat-card {
        padding: 15px;
        border-radius: 15px;
    }
    
    .card-sparkle {
        top: 10px;
        right: 10px;
    }
    
    .socios-avatar {
        bottom: 10px;
        right: 10px;
    }
    
    .chart-container,
    .distribution-container,
    .details-section {
        padding: 15px;
        border-radius: 15px;
    }
    
    .type-card {
        padding: 12px;
        flex-direction: row;
        text-align: left;
    }
    
    .type-icon {
        width: 50px;
        height: 50px;
    }
    
    .filter-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    /* Ajustement spécifique pour les très petits écrans */
    .chart-wrapper {
        height: 200px;
    }
}

@media (max-width: 360px) {
    .title-gradient {
        font-size: 1.6rem;
    }
    
    .title-sub {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .chart-wrapper {
        height: 180px;
    }
    
    .month-card {
        padding: 12px;
    }
    
    .type-card {
        flex-direction: column;
        text-align: center;
    }
    
    .type-info h4,
    .type-value {
        text-align: center;
    }
}

/* Support pour les appareils en orientation paysage */
@media (max-height: 600px) and (orientation: landscape) {
    .fan-header {
        height: 200px;
    }
    
    .statistiques-container {
        margin-top: 100px;
    }
    
    .main-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-wrapper {
        height: 200px;
    }
}

/* Support pour les écrans très larges */
@media (min-width: 1600px) {
    .statistiques-container {
        max-width: 1600px;
    }
    
    .fan-header {
        height: 350px;
    }
    
    .main-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .months-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .ball-animation,
    .ball-animation i,
    .update-time i,
    .card-sparkle i,
    .team-spirit i {
        animation: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .type-card:hover {
        transform: none;
    }
}

/* Correction supplémentaire pour le débordement de texte */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Garantir que tout le contenu reste dans les limites */
* {
    max-width: 100%;
}

img, canvas, video {
    max-width: 100%;
    height: auto;
}

/* Styles pour éviter le reflow en boucle */
.chart-container {
    position: relative;
}

.chart-wrapper {
    position: relative;
    contain: layout;
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}








.month-export-section {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #f1f3f4;
}

.btn-export-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.2);
}

.btn-export-pdf:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.month-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Surcharge du style existant */
.main-stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px; /* Espacement normal */
    margin-bottom: 40px;
    width: 100%;
}

/* Chaque carte prend 25% moins l'espacement */
.main-stats-grid .stat-card {
    flex: 0 0 calc(24% - 15px);
}

/* Espacement double entre les paires */
.main-stats-grid .stat-card:nth-child(2) {
    margin-right: 60px; /* ESPACE VISIBLE ICI */
}

/* Responsive */
@media (max-width: 1200px) {
    .main-stats-grid {
        flex-wrap: wrap;
    }
    
    .main-stats-grid .stat-card {
        flex: 0 0 calc(50% - 15px);
    }
    
    .main-stats-grid .stat-card:nth-child(2) {
        margin-right: 0; /* Retirer l'espace spécial en responsive */
    }
}

@media (max-width: 768px) {
    .main-stats-grid .stat-card {
        flex: 0 0 100%;
    }
}

