/* --- Styles for the scrollable table wrapper --- */
.qdos-table-scroll-wrapper {
    overflow-y: auto;
    /* max-height will be set by JavaScript */
    width: 100%;
    margin: 5px 0;
    /* border: 1px solid #ccc; */
    overflow-x: auto;
    position: relative;
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #888 #f1f1f1; /* For Firefox */
}

/* --- Core styles for the table itself --- */
.qdos-table-scroll-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

/* --- Sticky Header Styles --- */
.qdos-table-scroll-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom-width: 2px; /* Thicker bottom border for visual separation */
}

/* Background helper for sticky header */
.qdos-table-scroll-wrapper thead th:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
    border-bottom: 2px solid;
}

/* --- Sticky Footer Styles --- */
.qdos-table-scroll-wrapper tfoot th,
.qdos-table-scroll-wrapper tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 10; /* Same level as header is fine */
    /* Add top border for visual separation from scrolling content */
    border-top-width: 2px;
}

/* Background helper for sticky footer */
.qdos-table-scroll-wrapper tfoot th:before,
.qdos-table-scroll-wrapper tfoot td:before {
    content: '';
    position: absolute;
    bottom: 0; /* Anchor to bottom */
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
}

/* Prevent border doubling between last tbody row and tfoot */
/* This might depend on border-collapse behavior, adjust if needed */
.qdos-table-scroll-wrapper tbody tr:last-child td {
   /* border-bottom: none; */ /* Optional: Uncomment if double borders appear */
}
