/* responsive-tables.css */

/* Bootstrap 5 text-alignment utilities on a Bootstrap 4 site: templates use
   the BS5 names (.text-end/.text-start) but the loaded framework is BS4
   (which only knows .text-right/.text-left), so without these aliases the
   classes silently do nothing and amount columns render left-aligned.
   !important mirrors how Bootstrap defines its own utility classes. */
.text-end {
    text-align: right !important;
}
.text-start {
    text-align: left !important;
}

@media (max-width: 768px) {
    /* Hide the original table headers on small screens */
    .datatable thead {
        display: none;
    }
    /* Style each table row as a card */
    .datatable tbody tr {
        display: block;
        margin-bottom: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border-radius: 5px;
    }
    /* Ensure each cell behaves like a block element */
    .datatable td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    /* Label the data with a pseudo-element */
    .datatable td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }
}