.hmg-fm-table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.hmg-fm-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    font-size: 14px;
}

.hmg-fm-table thead {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.hmg-fm-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.hmg-fm-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.hmg-fm-table tbody tr:hover {
    background: #fafafa;
}

.hmg-fm-table .col-fonds {
    min-width: 250px;
}

.hmg-fm-table .col-valorisation {
    min-width: 120px;
    text-align: right;
}

.hmg-fm-table .col-performance {
    min-width: 80px;
    text-align: right;
}

.fond-name {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 4px;
}

.fond-name:hover {
    color: #c9a227;
}

.fond-isin {
    display: block;
    font-size: 12px;
    color: #888;
}

.fond-isin::before {
    content: "Code ISIN: ";
}

.col-valorisation .valeur {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
}

.col-valorisation .date {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.performance {
    font-weight: 600;
    font-size: 14px;
}

.performance.positive {
    color: #2e7d32;
}

.performance.negative {
    color: #c62828;
}

.performance.na {
    color: #bbb;
}

.hmg-fm-disclaimer {
    font-size: 11px;
    color: #888;
    margin-top: 15px;
    font-style: italic;
}

.hmg-fm-no-data {
    padding: 30px;
    text-align: center;
    color: #888;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .hmg-fm-table {
        font-size: 12px;
    }
    
    .hmg-fm-table th,
    .hmg-fm-table td {
        padding: 10px 8px;
    }
    
    .fond-name {
        font-size: 13px;
    }
    
    .col-valorisation .valeur {
        font-size: 14px;
    }
}

/* ============================================
   HMG FONDS CHART
   ============================================ */
.hmg-fm-chart-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin: 20px 0;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.hmg-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.hmg-chart-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.2px;
}

.hmg-chart-periods {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.hmg-chart-period-btn {
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.hmg-chart-period-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.hmg-chart-period-btn.active {
    background: #1a3a5c;
    color: #ffffff;
    border-color: #1a3a5c;
}

.hmg-chart-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 300px;
}

.hmg-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.hmg-chart-error {
    text-align: center;
    color: #888;
    padding: 40px;
}

@media (max-width: 768px) {
    .hmg-fm-chart-wrapper {
        padding: 16px;
    }

    .hmg-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hmg-chart-title {
        font-size: 16px;
    }

    .hmg-chart-period-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ============================================
   PERFORMANCES EN COULEUR NEUTRE (tableau)
   ============================================ */
.hmg-fm-perf-neutral .performance.positive,
.hmg-fm-perf-neutral .performance.negative {
    color: #1a1a1a;
}

/* ============================================
   ENCART DE PERFORMANCES DU GRAPHIQUE
   ============================================ */
.hmg-chart-perf {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 24px;
    margin-bottom: 16px;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.hmg-chart-perf .hmg-perf-period {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #9ca3af;
}
.hmg-chart-perf .hmg-perf-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.hmg-chart-perf .hmg-perf-label {
    font-size: 13px;
    color: #4b5563;
}
.hmg-chart-perf .hmg-perf-value {
    font-size: 18px;
    font-weight: 700;
}
.hmg-chart-perf .hmg-perf-fond .hmg-perf-value { color: #155531; }
.hmg-chart-perf .hmg-perf-indice .hmg-perf-value { color: #6b7280; }

/* ============================================
   TABLEAU RESPONSIVE : empilement en cartes sur mobile
   ============================================ */
@media (max-width: 640px) {
    .hmg-fm-table-container { overflow-x: visible; }
    .hmg-fm-table thead { display: none; }
    .hmg-fm-table,
    .hmg-fm-table tbody,
    .hmg-fm-table tr,
    .hmg-fm-table td { display: block; width: 100%; }
    .hmg-fm-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 14px;
        padding: 6px 12px;
        background: #fff;
    }
    .hmg-fm-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid #f1f1f1;
        text-align: right;
        min-width: 0;
    }
    .hmg-fm-table td:last-child { border-bottom: none; }
    .hmg-fm-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        text-align: left;
    }
    /* La colonne "Fonds" sert de titre de carte : pleine largeur, sans label */
    .hmg-fm-table td.col-fonds {
        display: block;
        text-align: left;
        border-bottom: 2px solid #eee;
        padding-bottom: 10px;
        margin-bottom: 4px;
    }
    .hmg-fm-table td.col-fonds::before { content: none; }
}
