/* === 操作欄固定在最右側（水平捲動時不消失） === */
.sticky-col-right {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: var(--bs-card-bg, var(--bs-body-bg));
    box-shadow: -3px 0 6px rgba(0, 0, 0, .12);
}

thead .sticky-col-right {
    z-index: 3;
}

/* 手機版卡片模式不需要 sticky */
/*@media (max-width: 767.98px) {
    .sticky-col-right {
        position: static;
        box-shadow: none;
    }
}*/

/* th 縮到最小，td 只需要不換行 */
.table th {
    width: 1px !important;
    min-width: 80px;
    white-space: nowrap !important;
}

.table td {
    white-space: nowrap !important;
}

    /* 加 .col-fill 的 th/td 才撐開換行 */
    .table th.col-fill,
    .table td.col-fill {
        width: auto !important;
        white-space: normal !important;
    }

/* 沒有 .col-fill 撐開時，最後一欄自動吃掉剩餘寬度，
   避免表格右側留白（沒有儲存格覆蓋的空白，上不到表頭底色，會出現一半灰一半白的接縫）。 */
.table > thead > tr > th:last-child,
.table > tbody > tr > td:last-child {
    width: auto !important;
}
