.dt-colvis-wrapper > .btn {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* DataTable dışı tabloların kolon menüsü, tablo araç çubuğu standardı gibi
   kapsayıcının tamamını kullanıp sağ kenara hizalanır. */
.dt-static-colvis-wrapper {
    display: flex !important;
    width: 100%;
    justify-content: flex-end;
}

/* DataTables araçları sabit kalır; yatay kaydırma yalnızca tabloyu etkiler. */
.dt-container.dt-controls-fixed {
    min-width: 0;
    width: 100%;
}

.dt-container.dt-controls-fixed > .dt-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    /* overflow-x:auto dikey ekseni de clipping alanına dönüştürür.
       Dropdown menüleri JS ile body katmanına taşındığı için burada yalnız
       tablo satırlarının scroll alanını yönetiyoruz. */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.dropdown-menu.dt-dropdown-portal {
    position: fixed;
    z-index: 1080;
}

.dt-container.dt-controls-fixed > .dt-layout-row,
.dt-container.dt-controls-fixed > .dt-custom-search,
.dt-container.dt-controls-fixed > .dt-length {
    min-width: 0;
}

.dt-container.dt-controls-fixed > .dt-table-scroll > table.dataTable,
.dt-container.dt-controls-fixed > .dt-table-scroll .dt-layout-table {
    margin-bottom: 0;
}

table.dataTable thead th.dt-col-resizable,
table.dt-preference-table thead th.dt-col-resizable {
    position: relative;
}

table.dt-preference-table {
    table-layout: auto;
    width: 100%;
}

table.dt-preference-table td .select2-container {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
}

table.dt-preference-table td .select2-selection__rendered {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table.dt-preference-table thead th.dt-col-draggable {
    cursor: move;
}

table.dt-preference-table thead th.dt-col-drag-source {
    opacity: .55;
}

table.dt-preference-table thead th.dt-col-drag-over {
    box-shadow: inset 3px 0 0 var(--bs-primary, #0d6efd);
}

.dt-col-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    z-index: 5;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

.dt-col-resize-handle::after {
    position: absolute;
    top: 25%;
    right: 3px;
    width: 1px;
    height: 50%;
    content: "";
    background-color: transparent;
}

table.dataTable thead th.dt-col-resizable:hover > .dt-col-resize-handle::after,
table.dataTable thead th.dt-column-resizing > .dt-col-resize-handle::after,
table.dt-preference-table thead th.dt-col-resizable:hover > .dt-col-resize-handle::after,
table.dt-preference-table thead th.dt-column-resizing > .dt-col-resize-handle::after {
    background-color: var(--bs-primary, #0d6efd);
}

body.dt-column-resizing {
    cursor: col-resize !important;
    user-select: none;
}

/* Table action and column visibility dropdowns must follow the active theme. */
.dt-colvis-wrapper > .btn {
    color: var(--text-secondary-light) !important;
    background-color: var(--white) !important;
    border-color: var(--neutral-300) !important;
}

.dt-colvis-wrapper > .btn:hover,
.dt-colvis-wrapper > .btn:focus,
.dt-colvis-wrapper > .btn.show {
    color: var(--primary-600) !important;
    background-color: var(--primary-50) !important;
    border-color: var(--primary-600) !important;
    box-shadow: none !important;
}

.table .dropdown-menu,
table.dataTable .dropdown-menu,
.dt-colvis-wrapper .dropdown-menu,
.dropdown-menu.dt-dropdown-portal {
    z-index: 1080;
    color: var(--text-primary-light);
    background-color: var(--white);
    border: 1px solid var(--neutral-200) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
}

.table .dropdown-menu .dropdown-item,
table.dataTable .dropdown-menu .dropdown-item,
.dt-colvis-wrapper .dropdown-menu .dropdown-item,
.dropdown-menu.dt-dropdown-portal .dropdown-item {
    color: var(--text-primary-light) !important;
    border-radius: 6px;
}

.table .dropdown-menu .dropdown-item:hover,
.table .dropdown-menu .dropdown-item:focus,
table.dataTable .dropdown-menu .dropdown-item:hover,
table.dataTable .dropdown-menu .dropdown-item:focus,
.dt-colvis-wrapper .dropdown-menu .dropdown-item:hover,
.dt-colvis-wrapper .dropdown-menu .dropdown-item:focus,
.dropdown-menu.dt-dropdown-portal .dropdown-item:hover,
.dropdown-menu.dt-dropdown-portal .dropdown-item:focus {
    color: var(--text-primary-light) !important;
    background-color: var(--neutral-100) !important;
}

.table .dropdown-menu .dropdown-item.text-primary,
.table .dropdown-menu .dropdown-item.text-primary-600,
table.dataTable .dropdown-menu .dropdown-item.text-primary,
table.dataTable .dropdown-menu .dropdown-item.text-primary-600,
.dt-colvis-wrapper .dropdown-menu .dropdown-item.text-primary,
.dt-colvis-wrapper .dropdown-menu .dropdown-item.text-primary-600,
.dropdown-menu.dt-dropdown-portal .dropdown-item.text-primary,
.dropdown-menu.dt-dropdown-portal .dropdown-item.text-primary-600 {
    color: var(--primary-600) !important;
}

.table .dropdown-menu .dropdown-item.text-danger,
.table .dropdown-menu .dropdown-item.text-danger-600,
table.dataTable .dropdown-menu .dropdown-item.text-danger,
table.dataTable .dropdown-menu .dropdown-item.text-danger-600,
.dt-colvis-wrapper .dropdown-menu .dropdown-item.text-danger,
.dt-colvis-wrapper .dropdown-menu .dropdown-item.text-danger-600,
.dropdown-menu.dt-dropdown-portal .dropdown-item.text-danger,
.dropdown-menu.dt-dropdown-portal .dropdown-item.text-danger-600 {
    color: var(--danger-600) !important;
}

.table .dropdown-menu .dropdown-item.text-success,
.table .dropdown-menu .dropdown-item.text-success-600,
table.dataTable .dropdown-menu .dropdown-item.text-success,
table.dataTable .dropdown-menu .dropdown-item.text-success-600,
.dt-colvis-wrapper .dropdown-menu .dropdown-item.text-success,
.dt-colvis-wrapper .dropdown-menu .dropdown-item.text-success-600,
.dropdown-menu.dt-dropdown-portal .dropdown-item.text-success,
.dropdown-menu.dt-dropdown-portal .dropdown-item.text-success-600 {
    color: var(--success-600) !important;
}

.table .dropdown-menu .dropdown-divider,
table.dataTable .dropdown-menu .dropdown-divider,
.dt-colvis-wrapper .dropdown-menu .dropdown-divider,
.dropdown-menu.dt-dropdown-portal .dropdown-divider {
    border-color: var(--neutral-200);
}

[data-theme=dark] .dt-colvis-wrapper > .btn {
    color: var(--text-primary-light) !important;
    background-color: var(--dark-3) !important;
    border-color: var(--neutral-300) !important;
}

[data-theme=dark] .table .dropdown-menu,
[data-theme=dark] table.dataTable .dropdown-menu,
[data-theme=dark] .dt-colvis-wrapper .dropdown-menu,
[data-theme=dark] .dropdown-menu.dt-dropdown-portal {
    background-color: var(--dark-2);
    border-color: var(--neutral-300) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
}

[data-theme=dark] .table .dropdown-menu .dropdown-item:hover,
[data-theme=dark] .table .dropdown-menu .dropdown-item:focus,
[data-theme=dark] table.dataTable .dropdown-menu .dropdown-item:hover,
[data-theme=dark] table.dataTable .dropdown-menu .dropdown-item:focus,
[data-theme=dark] .dt-colvis-wrapper .dropdown-menu .dropdown-item:hover,
[data-theme=dark] .dt-colvis-wrapper .dropdown-menu .dropdown-item:focus,
[data-theme=dark] .dropdown-menu.dt-dropdown-portal .dropdown-item:hover,
[data-theme=dark] .dropdown-menu.dt-dropdown-portal .dropdown-item:focus {
    background-color: var(--dark-3) !important;
}
