/* Mobile Responsive Tables */

@media (max-width: 768px) {
    /* Hide table headers on mobile */
    .table thead {
        display: none;
    }

    /* Convert table rows to card-like blocks */
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    /* Style table cells as key-value pairs */
    .table tbody td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.75rem 0;
        border: none;
        position: relative;
        padding-left: 0;
    }

    /* Add labels to cells using data attributes */
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 0.25rem;
    }

    /* Zebra striping on mobile */
    .table tbody tr:nth-child(odd) {
        background-color: #f8f9fa;
    }

    /* Make action buttons full-width on mobile */
    .table .btn-sm {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .table .btn-sm:last-child {
        margin-bottom: 0;
    }

    /* Stack button groups vertically */
    .btn-group-vertical .btn-sm {
        margin-bottom: 0.25rem;
    }

    /* Responsive cell styling */
    .table .badge {
        display: inline-block;
        margin-bottom: 0.25rem;
    }

    /* Center status columns */
    .table td[data-label*="Status"] {
        text-align: center;
    }

    .table td[data-label*="Status"]::before {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .table tbody tr {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .table tbody td {
        padding: 0.5rem 0;
        font-size: 0.95rem;
    }

    .table .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Print styles */
@media print {
    .table {
        border-collapse: collapse;
    }

    .table thead {
        display: table-header-group;
    }

    .table tbody tr {
        display: table-row;
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    .table tbody td {
        display: table-cell;
        padding: 0.5rem;
    }

    .btn {
        display: none;
    }
}
