/* responsive-tables.css - Transforme les tableaux en cartes sur mobile */

/* === TABLEAUX RESPONSIFS === */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sur mobile : on cache le tableau et on affiche des cartes */
@media (max-width: 767.98px) {
    .table-responsive {
        overflow-x: hidden;
    }

    /* On cache les en-têtes et le tableau classique */
    .table thead,
    .table tbody,
    .table tr,
    .table th,
    .table td {
        display: block;
    }

    .table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table tr {
        margin-bottom: 1.5rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        background-color: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .table td {
        /* On utilise data-label pour afficher le titre de colonne */
        border: none;
        border-bottom: 1px solid #dee2e6;
        position: relative;
        padding-left: 50%;
        text-align: right;
        min-height: 3rem;
    }

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

    .table td::before {
        position: absolute;
        top: 0.75rem;
        left: 1rem;
        width: 45%;
        padding-right: 1rem;
        white-space: nowrap;
        font-weight: 600;
        text-align: left;
        content: attr(data-label);
        color: #495057;
    }

    /* Action (dernière colonne) ? centrée et pleine largeur */
    .table td:last-child {
        text-align: center;
        padding: 1rem;
    }

    .table td:last-child::before {
        content: "";
    }
}

/* === Améliorations visuelles des cartes sur mobile === */
@media (max-width: 767.98px) {
    .card-mobile {
        margin-bottom: 1.25rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        overflow: hidden;
    }

    .card-mobile .card-body {
        padding: 1.25rem;
    }

    .card-mobile h5 {
        margin-bottom: 1rem;
        font-size: 1.15rem;
    }

    .card-mobile .badge {
        font-size: 0.9rem;
        padding: 0.5em 0.9em;
    }

    .card-mobile .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}