.tableau-formations {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tableau-formations th {
 background: #f2f2f2;
text-transform: uppercase;
font-weight: 600;
padding: 15px;
border-left: 1px solid  #e7e7e7;
text-align: center;
font-size: 14px;
}


.tableau-formations td {
    text-align: center;
    padding-top: 10px;
    padding-bottom: 1px;
    border-bottom: 1px solid #e2e2e2;
    border-left: 1px solid  #e7e7e7;
    vertical-align: middle;
    color: 14px;
}

.tableau-formations tr:hover {
    background: #f9fafb;
}

/* Grisé si pas de date ou pas de stock */
.tableau-formations .row-grisee {
    background-color: #f6f6f6;
    color: #999;
}

.tableau-formations .text-gris {
    color: #aaa;
    font-style: italic;
}

.tableau-formations .titre-formation {
    font-weight: 700;
    color: #111;
    text-align: left;
}

.tableau-formations .button {
    display: inline-block;
    padding: 4px 36px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tableau-formations .button.secondary {
    background-color: #132f46;
    color: #fff;
}
.tableau-formations .button.secondary:hover {
    background-color: #0f2438;
}

.tableau-formations .button.primary {
    background-color: #f9923e;
    color: #fff;
}
.tableau-formations .button.primary:hover {
    background-color: #e67e22;
}

.tableau-formations .btn-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.tableau-formations .stock-limite {
    color: #f59e0b;
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
    margin-left: 6px;
}

.tableau-formations .stock-critique {
    color: #ef4444;
    font-weight: 700;
    font-size: 13px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .tableau-formations thead { display: none; }
    .tableau-formations tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 12px;
        padding: 10px;
        background: #fff;
    }
    .tableau-formations td {
        display: block;
        text-align: right;
        font-size: 14px;
        border-bottom: none;
    }
    .tableau-formations td::before {
        content: attr(data-label) ": ";
        float: left;
        font-weight: bold;
        text-transform: uppercase;
    }
}

/* Ajouter un padding à la première colonne pour éviter que le texte soit collé au bord */
.tableau-formations td:first-child {
    padding-left: 20px; /* Ajuste la valeur selon ton besoin */
    text-align: left;   /* S'assure que le texte reste aligné à gauche */
}

@media (max-width: 768px) {
    /* Empêcher la déformation des boutons */
    .tableau-formations .button {
        display: inline-block;
        width: auto;              /* Empêche de prendre toute la largeur */
        min-width: 140px;         /* Largeur minimale uniforme */
        text-align: center;       /* Centrer le texte à l'intérieur */
        white-space: nowrap;      /* Évite le retour à la ligne */
        margin-top: 8px;
    }

  
}

/* --- VERSION RESPONSIVE AMÉLIORÉE --- */
@media (max-width: 768px) {
    .tableau-formations {
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
        background: transparent;
    }

    .tableau-formations thead {
        display: none; /* On masque l’en-tête du tableau */
    }

    .tableau-formations tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid #e2e2e2;
        border-radius: 12px;
        margin-bottom: 18px;
        padding: 15px;
        box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    }

    .tableau-formations td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 8px 0;
        border: none;
        font-size: 15px;
    }

    .tableau-formations td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        color: #444;
        font-size: 13px;
        flex: 1;
    }

    .tableau-formations td:last-child {
        border-bottom: none;
    }

    /* Titres plus visibles */
    .tableau-formations .titre-formation {
        font-size: 17px;
        font-weight: 700;
        color: #132f46;
        margin-bottom: 8px;
    }

    /* Centrer les boutons */
    .tableau-formations td[data-label="La formation"],
    .tableau-formations td[data-label="Inscription"] {
        justify-content: center;
    }

    .tableau-formations .button {
        display: inline-block;
        width: auto;
        min-width: 160px;
        padding: 10px 16px;
        text-align: center;
        white-space: nowrap;
        border-radius: 8px;
        margin: 4px auto;
        font-size: 14px;
        font-weight: 600;
    }

    .tableau-formations .button.primary {
        background-color: #f9923e;
        color: #fff;
    }

    .tableau-formations .button.secondary {
        background-color: #132f46;
        color: #fff;
    }

    /* Pour les lignes grisées (formations sans date) */
    .tableau-formations .row-grisee {
        opacity: 0.8;
        background: #f9f9f9;
    }

    /* Petits espacements visuels */
    .tableau-formations td + td {
        border-top: 1px solid #f0f0f0;
    }
}



/* --- VERSION RESPONSIVE AMÉLIORÉE (active dès 1024px) --- */
@media (max-width: 1024px) {
    .tableau-formations {
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
        background: transparent;
    }

    .tableau-formations thead {
        display: none; /* Masque les en-têtes */
    }

    .tableau-formations tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid #e2e2e2;
        border-radius: 12px;
        margin-bottom: 1px;
        box-shadow: 0 3px 6px rgba(0,0,0,0.05);
        overflow: hidden;
    }

    .tableau-formations td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 12px 1px;
        border: none;
        font-size: 15px;
    }

    .tableau-formations td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        color: #444;
        font-size: 13px;
        flex: 1;
    }

    /* --- TITRE AVEC FOND GRIS CLAIR --- */
    .tableau-formations td.titre-formation {
        background-color: #f5f5f5;
        font-size: 17px;
        font-weight: 700;
        color: #132f46;
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .tableau-formations td.titre-formation::before {
        display: none; /* On ne met pas "Formations:" avant le titre */
    }

    /* Centrer les boutons */
    .tableau-formations td[data-label="La formation"],
    .tableau-formations td[data-label="Inscription"] {
        justify-content: center;
    }

    .tableau-formations .button {
        display: inline-block;
        width: auto;
        min-width: 160px;
        padding: 10px 16px;
        text-align: center;
        white-space: nowrap;
        border-radius: 8px;
        margin: 6px auto;
        font-size: 14px;
        font-weight: 600;
    }

    .tableau-formations .button.primary {
        background-color: #f9923e;
        color: #fff;
    }

    .tableau-formations .button.secondary {
        background-color: #132f46;
        color: #fff;
    }

    /* Lignes grisées (produits sans date ni stock) */
    .tableau-formations .row-grisee {
        opacity: 0.8;
        background: #fafafa;
    }

    /* Séparations entre les cellules */
    .tableau-formations td + td {
        border-top: 1px solid #f0f0f0;
    }
}

