/**
 * Yönder Portal — küçük ekran / tablet uyumu (Bootstrap 4 + AdminLTE 3 + DataTables)
 * header.php (ana shell + iframe sekme) üzerinden yüklenir.
 */

/* Flex içinde yatay taşmayı engelle (AdminLTE .content-wrapper zinciri) */
.wrapper > .content-wrapper,
.content-wrapper > .content,
.content-wrapper > .content > .container-fluid {
  min-width: 0;
}

/* Kart gövdesi: geniş tablolar kartı taşırmasın */
.card-body {
  max-width: 100%;
}

/* DataTables: yatay kaydırma, dokunmatik momentum */
.dataTables_wrapper {
  width: 100% !important;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dataTables_scroll,
.dataTables_scrollHead,
.dataTables_scrollBody,
.dataTables_scrollFoot {
  max-width: 100%;
}

.dataTables_scrollBody {
  -webkit-overflow-scrolling: touch;
}

/* YonderGrid: tablo ebeveyni (yonder-grid.js → .yonder-dt-host) */
.yonder-dt-host {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Geniş tablolar (DataTables dışı, örn. kasa hareket) */
.table-responsive,
.ks-table-wrap,
.fd-mhs-grid-wrap,
.fl-dt-responsive,
.cd-wrap .fd-mhs-grid-wrap,
.cari-win .fd-mhs-grid-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* DataTables üst/alt kontroller — mobilde alt alta */
@media (max-width: 767.98px) {
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 0.5rem;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    max-width: 100%;
    margin-left: 0 !important;
  }

  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: center !important;
    margin-top: 0.35rem;
  }

  .dataTables_wrapper .dataTables_paginate ul.pagination {
    justify-content: center;
    flex-wrap: wrap;
  }

  .dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Çok dar ekran: modal taşması */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.4rem auto;
    max-width: calc(100vw - 0.8rem);
  }

  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    max-width: calc(100vw - 0.8rem);
  }

  .modal.show .modal-content {
    max-height: calc(100vh - 1rem);
    display: flex;
    flex-direction: column;
  }

  .modal.show .modal-header,
  .modal.show .modal-footer {
    flex-shrink: 0;
  }

  .modal.show .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* Tablet: modal genişliği */
@media (min-width: 576px) and (max-width: 991.98px) {
  .modal-dialog.modal-xl {
    max-width: min(1140px, calc(100vw - 1.5rem));
  }
}
