.tso-frontend table {
    width: 100%;
    border-collapse: collapse;
}

.tso-frontend th, .tso-frontend td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

p {
    margin-bottom: 10px;
}

.tso-vehicle-clickable {
    cursor: pointer;
    color: orange;
    text-decoration: underline;
    font-weight: bold;
}

/* Add scroll for table to fit page */
.tso-timeslips {
    overflow-x: auto;
    padding-top: 16px;
}

.tso-timeslips tr:nth-child(3n+1) {
    background-color: #5F6366; /* Dark gray background */
}

.tso-timeslips tr:nth-child(3n+2) {
    background-color: #B1B1B1; /* Light gray background */
}

/* Modal */
#tso-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Allow browser scroll if content exceeds viewport */
    background-color: rgba(0,0,0,0.4);
    display: none;
}

.tso-modal-content {
    background-color: #fefefe;
    margin: 2% auto; /* Further reduced top margin */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    /* Removed max-height and overflow-y to let browser handle scrolling */
}

.tso-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.tso-close:hover,
.tso-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.tso-timeslip-vertical {
    text-align: center;
}

.tso-timeslip-vertical p {
    margin-bottom: 7px;
}

.tso-thumbnail {
    max-width: 100%;
    height: auto;
}

/* Expandable vehicle groups */
.tso-vehicle-group {
    margin-bottom: 10px;
}

.tso-vehicle-group summary {
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tso-vehicle-group summary:hover {
    background-color: #e0e0e0;
}

.tso-vehicle-group table {
    margin-top: 10px;
}

/* Admin-specific styles */
.tso-admin-table {
    margin-bottom: 20px;
}

/* Responsive stacking */
@media (max-width: 768px) {
    .tso-frontend table, .tso-frontend thead, .tso-frontend tbody, .tso-frontend th, .tso-frontend td, .tso-frontend tr {
        display: block;
    }

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

    .tso-frontend tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    .tso-frontend td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
    }

    .tso-frontend td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: bold;
    }

    .tso-vehicle-group table {
        margin-bottom: 10px;
    }
}