/**
 * Mobil tablo / içerik taşma düzeltmeleri
 * print-* sayfaları hariç panel görünümü
 */

@media (max-width: 991.98px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  #wrapper {
    max-width: 100%;
    overflow-x: hidden;
  }

  .content-page {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
  }

  .content-page .content,
  .content-page .container-fluid {
    max-width: 100%;
    width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
  }

  .content-page .row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .content-page .row > [class*="col-"] {
    min-width: 0;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  .content-page .card,
  .content-page .card-body,
  .content-page .card-header,
  .content-page .card-footer {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Tablo kaydırma alanı */
  .table-responsive,
  .mobile-table-scroll,
  .dataTables_wrapper,
  .card-body:has(> table),
  .card-body:has(> .dataTables_wrapper),
  .card-body:has(> .table-responsive),
  .tab-pane:has(> table),
  .modal-body:has(> table),
  .modal-body:has(> .table-responsive) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .mobile-table-scroll > table,
  .table-responsive > table,
  .dataTables_wrapper table.table {
    margin-bottom: 0;
  }

  /* nowrap tablolar ekranı taşırmaz; yatay kaydırılır */
  table.table.nowrap,
  table.table.dt-responsive,
  table.table {
    max-width: none;
  }

  /* DataTables üst/alt kontrolleri */
  .dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: left !important;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    display: block;
    margin-top: 0.35rem;
  }

  .dataTables_wrapper .dataTables_length select {
    display: inline-block;
    width: auto;
    max-width: 100%;
  }

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

  /* Responsive child satırlar */
  table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
  table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    margin-right: 0.35rem;
  }

  /* Filtre / toolbar satırları */
  .content-page .d-flex.flex-wrap,
  .content-page .btn-toolbar,
  .content-page .page-title-box .page-title-right {
    max-width: 100%;
  }

  .content-page .page-title-box .page-title-right {
    float: none !important;
    margin-top: 0.5rem;
  }

  .content-page img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 575.98px) {
  .content-page {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .content-page .card-body {
    padding: 0.85rem;
  }

  .table > :not(caption) > * > * {
    padding: 0.45rem 0.5rem;
  }
}

@media print {
  .table-responsive,
  .mobile-table-scroll,
  .dataTables_wrapper {
    overflow: visible !important;
  }
}
