/**
 * KMT liste tablolari (#fixed-columns-datatable)
 * scrollX kapali: tek tablo + yatay kaydirma; baslik/govde kaymasi onlenir.
 */

#datatable-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#fixed-columns-datatable_wrapper,
.dt-container:has(#fixed-columns-datatable) {
    width: 100%;
    max-width: 100%;
}

#fixed-columns-datatable {
    width: 100% !important;
    margin: 0 !important;
    table-layout: auto !important;
}

/* Kirmizi baslik — dataTable class'ina bagimli olmasin */
#fixed-columns-datatable thead th,
#fixed-columns-datatable_wrapper table.dataTable thead th,
.dt-container #fixed-columns-datatable thead th,
table.dataTable#fixed-columns-datatable thead th {
    background-color: rgb(183, 28, 28) !important;
    color: #fff !important;
    font-weight: bold !important;
    border-right: 2px solid #fff !important;
    white-space: nowrap;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    text-align: center;
    vertical-align: middle;
    font-size: 14px !important;
    font-family: arial, sans-serif !important;
    height: 45px !important;
}

#fixed-columns-datatable tbody td,
#fixed-columns-datatable_wrapper table.dataTable tbody td,
.dt-container #fixed-columns-datatable tbody td {
    font-size: 12px !important;
    font-family: arial, sans-serif !important;
    font-weight: bold;
    padding: 3px 5px !important;
    line-height: 1.8 !important;
    vertical-align: middle;
    max-width: none !important;
    box-sizing: border-box;
}

/* KMTLayout / sayfa stillerindeki max-width td kirpmasini iptal et */
#fixed-columns-datatable_wrapper table.dataTable thead th,
#fixed-columns-datatable_wrapper table.dataTable tbody td {
    max-width: none !important;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Uzun unvan / tooltip hucreleri */
#fixed-columns-datatable td.emm-fulltext-tooltip-host {
    max-width: min(42vw, 480px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Islem butonlari ve son sutun */
#fixed-columns-datatable thead th:last-child,
#fixed-columns-datatable tbody td:last-child {
    min-width: 100px;
    width: 1%;
    white-space: nowrap !important;
    overflow: visible !important;
    text-align: center !important;
}

#fixed-columns-datatable tbody td:has(.btn-edit-delete),
#fixed-columns-datatable tbody td:has(.btn) {
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

#fixed-columns-datatable .btn-edit-delete {
    min-width: auto !important;
    width: auto !important;
    padding: 3px 6px !important;
    margin: 0 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    background-color: transparent !important;
    border: 1px solid #000 !important;
    color: #495057 !important;
    border-radius: 4px;
}

#fixed-columns-datatable .btn-edit-delete:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

#fixed-columns-datatable .kmt-rep-badge {
    flex-shrink: 0;
}

#fixed-columns-datatable td.kmt-dt-actions {
    min-width: 108px;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-align: center !important;
}

/* DT2 arama kutusu */
.dt-container div.dt-search input,
.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5em;
    display: inline-block;
    width: 300px;
    border: 1px solid #b71c1c;
    border-radius: 4px;
    padding: 6px 10px;
    color: #333;
}

/* Eski scrollX kalintisi: ayri scroll katmanlarini gizle / hizala */
#fixed-columns-datatable_wrapper .dataTables_scroll {
    overflow: visible !important;
}

#fixed-columns-datatable_wrapper .dataTables_scrollHead,
#fixed-columns-datatable_wrapper .dataTables_scrollBody,
#fixed-columns-datatable_wrapper .dt-scroll-head,
#fixed-columns-datatable_wrapper .dt-scroll-body {
    overflow: visible !important;
    width: 100% !important;
}

#fixed-columns-datatable_wrapper .dataTables_scrollHeadInner,
#fixed-columns-datatable_wrapper .dataTables_scrollHeadInner table {
    width: 100% !important;
}
