.table-container, .modal-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}
.table-container table, .modal-table-container table {
    min-width: 600px;
    overflow-x: scroll;
    border-collapse: separate;
    border-spacing: 0;
}
.table-container table th:first-child, .modal-table-container table th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}

th, td {
    padding: 8px;
    border: 1px solid #ddd;
}

.table-block .openModal {
    margin-left: auto;
    text-align: right;
}
.openModal {
    display: inline-block;
    margin-bottom: 8px;
    background: #0078d7;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

@media screen and (max-width: 768px) {
    .table-container table td {
        position: relative;
        padding: 8px;
        border: 1px solid #ddd;
        vertical-align: top;
    }

    .table-container table td::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        color: #333;
        text-align: center;
        margin-bottom: 4px;
        background-color: lightblue;
        word-break: break-word;
    }

    /* Hide the leftmost column */
    .table-container table th:first-child,
    .table-container table td:first-child {
        display: none;
    }
    /* Hide the open modal button */
    .openModal {
        display: none;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-height: calc(90vh - 50px);
    overflow-y: auto;
    overflow-x: auto;
    cursor: grab;
    box-sizing: border-box;
}
.modal-content .close {
    font-size: 1.5rem;
}
.modal-table-container {
    overflow-x: auto;
}

.modal-table-container table {
    margin-bottom: 16px;
}