.tabulator.table-sm {
    font-size: .792em;
}

    .tabulator.table-sm .tabulator-footer,
    .tabulator.table-sm .tabulator-footer .tabulator-calcs-holder,
    .tabulator.table-sm .tabulator-footer .tabulator-calcs-holder .tabulator-calcs.tabulator-calcs-bottom.tabulator-row {
        max-height: 35px !important;
        min-height: 35px !important;
    }

    .tabulator.table-sm .tabulator-calcs-holder .tabulator-row .tabulator-cell {
        height: 35px !important;
        padding: 7px 5px 5px 5px !important;
        font-size: 14px;
    }

/* ヘッダー */
.tabulator .tabulator-header {
    border-top: none;
    border-color: var(--bs-border-color-translucent);
}

    .tabulator .tabulator-header .tabulator-header-contents {
        max-height: 84px;
    }

        .tabulator .tabulator-header .tabulator-header-contents .tabulator-headers {
            display: inline;
            padding: 0;
        }

    .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
        padding-right: 14px;
    }

    .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow,
    .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover {
        border-bottom: 8px solid var(--bs-primary);
    }

    .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow,
    .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover {
        border-top: 8px solid var(--bs-primary);
    }

    .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button {
        padding: 0 4px 0 0;
    }

/* 固定列 */
.tabulator .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left {
    border-color: transparent;
}

/* 行 */
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row {
    padding: 0;
    /* inputの有無で高さが異なるので統一 */
    height: 31px !important;
}

.tabulator.table-sm:is(.table-double-data-row) .tabulator-tableholder .tabulator-table .tabulator-row {
    /* inputに高さを合わせる */
    height: auto !important;
}

/* 複数行ヘッダー */
.tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 2px !important;
}

/* 行 [disabled] */
.tabulator-row:disabled,
.tabulator-row.disabled {
    pointer-events: none;
}

.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-group {
    min-height: 29px;
    display: flex;
    align-items: center;
}

/* セル */
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
    max-height: 100%;
}

    .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell:has(input),
    .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell:has(select) {
        /* 入力項目の場合paddingをなくす ※列幅が広くなるのを防止する */
        padding: 0px !important;
    }

    .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell:has(.form-control),
    .tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell:has(.form-select) {
        margin-top: 1px !important;
        margin-bottom: 1px !important;
        /* box-shadowを均等にするため はみ出し表示 */
        overflow: visible;
    }

/* リンクスタイル */
.tabulator.table-sm .tabulator-row .tabulator-cell:has(.link-style) {
    pointer-events: auto;
    cursor: pointer;
    color: var(--bs-link-color);
    text-decoration: underline;
}

    .tabulator.table-sm .tabulator-row .tabulator-cell:has(.link-style):hover {
        color: var(--bs-link-hover-color);
    }

/* タビュレーター内の入力要素調整 */
.tabulator-row .tabulator-cell .form-control,
.tabulator-row .tabulator-cell .form-select {
    border-radius: 0 !important;
    height: 29px !important;
    border: none !important;
}

    /* フォーカスイン時の枠調整 */
    .tabulator-row .tabulator-cell .form-control:focus,
    .tabulator-row .tabulator-cell .form-select:focus {
        box-shadow: 0 0 0 0.125rem var(--bs-focus-ring-color), 0 0 0 0.125rem var(--bs-focus-ring-color) inset !important;
    }

/* flatpickr */
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell .flatpickr-tabulator:has(.form-control[disabled]) {
    pointer-events: none !important;
}

.tabulator.table-sm .tabulator-row .tabulator-cell .flatpickr-tabulator:has(.form-control[disabled]) .bi-calendar3 {
    opacity: 0.3;
}

/* select */
.tabulator.table-sm .tabulator-row .tabulator-cell select {
    text-align: center;
}

    .tabulator.table-sm .tabulator-row .tabulator-cell select:disabled {
        background-image: none;
    }

/* 入力欄の背景色を変える */
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell .form-control[disabled],
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell .form-select[disabled] {
    background-color: inherit;
    pointer-events: none !important;
}

/* 行ホバー時に入力欄の背景色を変える */
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row:hover .tabulator-cell .form-control,
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row:hover .tabulator-cell .form-select {
    background-color: inherit;
}

/* 行選択時に入力欄の背景色を変える */
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected .tabulator-cell .form-control,
.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected .tabulator-cell .form-select {
    background-color: inherit;
}

/* デフォルトのpopupは非表示 */
.tabulator-popup.tabulator-popup-container {
    display: none;
}

.custom-popup {
    display: block !important;
    position: fixed;
}
