/* KMT basit liste sayfaları — hesap kodu, gelir/gider başlıkları (mobil uyumlu) */
html body .emm-shell .kmt-simple-list-page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

html body .emm-shell .kmt-simple-list-page .card,
html body .emm-shell .kmt-simple-list-page .card-body {
    max-width: 100%;
    box-sizing: border-box;
}

html body .emm-shell .kmt-simple-list-page .kmt-simple-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 0.75rem !important;
}

html body .emm-shell .kmt-simple-list-page .btn-add {
    margin-bottom: 0 !important;
    min-width: min(100%, 12rem);
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

html body .emm-shell .kmt-simple-list-page .btn-add .fa-plus,
html body .emm-shell .kmt-tanitim-cards-page .btn-add .fa-plus,
html body .emm-shell .edefter-list-toolbar .btn-add .fa-plus {
    margin-right: 0 !important;
}

html body .emm-shell .kmt-simple-list-page #datatable-container {
    width: 100%;
    max-width: 100%;
    overflow-x: visible !important;
}

html body .emm-shell .kmt-simple-list-page #datatable-container .dataTables_wrapper,
html body .emm-shell .kmt-simple-list-page #datatable-container .dt-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
}

html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

html body .emm-shell .kmt-simple-list-page div.dt-container div.dt-search input,
html body .emm-shell .kmt-simple-list-page .dataTables_wrapper .dataTables_filter input {
    width: min(300px, 100%);
    max-width: 100%;
    box-sizing: border-box;
}

html body .emm-shell .kmt-simple-list-page table.dataTable td:not(:last-child) {
    max-width: none;
    white-space: normal !important;
}

html body .emm-shell .kmt-simple-list-page table.dataTable td:last-child {
    white-space: nowrap !important;
}

/* Basit liste tabloları — mobilde 860px min-width uygulanmasın, satırlar okunaklı kalsın */
html body .emm-shell .kmt-simple-list-page table.dataTable.kmt-simple-list-dt,
html body .emm-shell .kmt-simple-list-page .kmt-dt-table-scroll table.kmt-simple-list-dt,
html body .emm-shell .kmt-simple-list-page .kmt-dt-table-scroll #fixed-columns-datatable.kmt-simple-list-dt {
    table-layout: fixed;
    width: 100% !important;
}

/* Sıra No — masaüstü dar sütun */
@media (min-width: 992px) {
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th.kmt-dt-col-sira,
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt tbody td.kmt-dt-col-sira {
        width: 5rem !important;
        max-width: 5.5rem !important;
        min-width: 4.25rem !important;
        white-space: nowrap !important;
        text-align: center !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
}

@media (max-width: 991.98px) {
    html body .emm-shell .kmt-simple-list-page table.dataTable.kmt-simple-list-dt,
    html body .emm-shell .kmt-simple-list-page .kmt-dt-table-scroll table.kmt-simple-list-dt,
    html body .emm-shell .kmt-simple-list-page .kmt-dt-table-scroll #fixed-columns-datatable.kmt-simple-list-dt {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th,
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt tbody td {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.35 !important;
        padding: 0.5rem 0.45rem !important;
        min-height: 2.75rem;
        height: auto !important;
        vertical-align: middle !important;
    }

    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th {
        white-space: normal !important;
        font-size: 12px !important;
        height: auto !important;
        min-height: 2.25rem;
        padding-top: 0.45rem !important;
        padding-bottom: 0.45rem !important;
    }

    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th:last-child,
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt tbody td.kmt-dt-actions {
        width: 5.75rem !important;
        min-width: 5.75rem !important;
        max-width: 5.75rem !important;
        white-space: nowrap !important;
        word-break: normal;
        text-align: center !important;
    }

    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th:first-child,
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt tbody td:first-child {
        width: auto !important;
    }

    /* 3 sütun (hesap kodu): işlem sütunu sabit, diğerleri esnek */
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th:nth-child(2),
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt tbody td:nth-child(2) {
        width: auto !important;
    }
}

@media (max-width: 575.98px) {
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt thead th,
    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt tbody td {
        font-size: 12px !important;
        padding: 0.45rem 0.35rem !important;
    }

    html body .emm-shell .kmt-simple-list-page table.kmt-simple-list-dt .btn-edit-delete {
        min-width: 2.1rem !important;
        padding: 0.2rem 0.35rem !important;
    }
}

@media (max-width: 991.98px) {
    html body .emm-shell .kmt-simple-list-page .kmt-simple-list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    html body .emm-shell .kmt-simple-list-page .btn-add {
        width: 100%;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-lf-row,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dt-container > .d-flex.justify-content-between,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dataTables_wrapper > .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .dt-length,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dt-search,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dataTables_length,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dataTables_filter {
        width: 100% !important;
        margin-right: 0 !important;
        float: none !important;
        display: flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    html body .emm-shell .kmt-simple-list-page div.dt-container div.dt-search input,
    html body .emm-shell .kmt-simple-list-page .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        flex: 1 1 100%;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-top-toolbar {
        width: 100%;
        justify-content: center !important;
        flex-wrap: wrap;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .dt-info,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dataTables_info {
        text-align: center;
        width: 100%;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .dt-paging,
    html body .emm-shell .kmt-simple-list-page #datatable-container .dataTables_paginate {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .pagination {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }
}

@media (max-width: 575.98px) {
    html body .emm-shell .kmt-simple-list-page .card-body {
        padding: 0.65rem !important;
    }

    html body .emm-shell .kmt-simple-list-page table.dataTable thead th,
    html body .emm-shell .kmt-simple-list-page table.dataTable td {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }

    html body .emm-shell .kmt-simple-list-page .btn-edit-delete {
        min-width: 2.25rem !important;
        padding: 3px 6px !important;
    }
}

@media (max-width: 575.98px) {
    html body .kmt-simple-list-popup.dxbl-popup,
    html body .kmt-simple-list-popup.dx-popup {
        width: calc(100vw - 1.25rem) !important;
        max-width: calc(100vw - 1.25rem) !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
    }
}

/* Geniş tablolar (banka bilgileri vb.) — mobilde yatay scroll */
@media (max-width: 991.98px) {
    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll table.kmt-simple-list-dt-wide,
    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll #fixed-columns-datatable.kmt-simple-list-dt-wide {
        min-width: 42rem !important;
        width: max-content !important;
        max-width: none !important;
        table-layout: auto !important;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll:has(table.kmt-simple-list-dt-wide) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Hizmet türleri — kart grid */
html body .emm-shell .kmt-tanitim-cards-page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

html body .emm-shell .kmt-tanitim-cards-page .service-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
    margin-top: 0.5rem;
    width: 100%;
}

html body .emm-shell .kmt-tanitim-cards-page .service-type-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid #ececef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    min-width: 0;
}

html body .emm-shell .kmt-tanitim-cards-page .service-type-title {
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    html body .emm-shell .kmt-tanitim-cards-page .service-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html body .emm-shell .kmt-tanitim-cards-page .kmt-simple-list-toolbar .btn-add {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    html body .emm-shell .kmt-tanitim-cards-page .service-type-grid {
        grid-template-columns: 1fr;
    }

    html body .emm-shell .kmt-tanitim-cards-page .service-type-card {
        flex-wrap: wrap;
    }

    html body .emm-shell .kmt-tanitim-cards-page .service-type-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* emm-overrides 960px — basit liste tablolarında iptal */
@media (max-width: 991.98px) {
    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll #fixed-columns-datatable.kmt-simple-list-dt,
    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll table.dataTable.kmt-simple-list-dt,
    html body .emm-shell .kmt-simple-list-page .kmt-dt-table-scroll #fixed-columns-datatable.kmt-simple-list-dt,
    html body .emm-shell .kmt-simple-list-page .kmt-dt-table-scroll table.dataTable.kmt-simple-list-dt {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll {
        overflow-x: visible !important;
    }
}

@media (max-width: 575.98px) {
    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll #fixed-columns-datatable.kmt-simple-list-dt,
    html body .emm-shell .kmt-simple-list-page #datatable-container .kmt-dt-table-scroll table.dataTable.kmt-simple-list-dt {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}
