/* Taxipult panel — mobile table/layout fixes */

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

  body.full-screen .all-wrapper,
  body .content-w,
  body .content-i,
  body .content-box,
  body .element-wrapper,
  body .element-box {
    max-width: 100% !important;
    overflow-x: hidden;
  }

  body .content-i {
    padding: 12px !important;
  }

  body .element-box {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* main.css sets overflow:visible — breaks mobile tables */
  body .table-responsive,
  body .element-box > .table-responsive,
  body .element-box .table-responsive.tab-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  body .table-responsive > .table,
  body .element-box > .table-responsive > .table {
    min-width: 880px;
    width: max-content;
    max-width: none !important;
    table-layout: auto !important;
    margin-bottom: 0;
  }

  body .table-responsive > .table thead th,
  body .table-responsive > .table tbody td {
    white-space: nowrap;
    word-break: normal !important;
    overflow-wrap: normal !important;
    vertical-align: middle;
  }

  /* Long addresses may wrap in one column */
  body .table-responsive > .table tbody td:nth-child(3),
  body .table-responsive > .table tbody td:nth-child(4) {
    white-space: normal;
    min-width: 140px;
    max-width: 240px;
    line-height: 1.35;
  }

  body .controls-above-table .form-inline {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 8px;
    width: 100%;
  }

  body .controls-above-table .form-inline .btn,
  body .controls-above-table .form-inline select,
  body .controls-above-table .form-inline input {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
  }

  body .controls-above-table .form-inline .btn {
    width: auto;
    flex: 1 1 auto;
  }

  body .controls-above-table .form-inline select,
  body .controls-above-table .form-inline input[type="text"] {
    flex: 1 1 100%;
  }

  body .os-tabs-w .os-tabs-controls {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body .os-tabs-w .nav-tabs {
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }

  body .os-tabs-w .nav-tabs .nav-link {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }

  body .row-actions {
    white-space: nowrap;
  }

  body .modal-dialog {
    margin: 10px auto !important;
    max-width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 575px) {
  body .content-i {
    padding: 8px !important;
  }

  body .table-responsive > .table,
  body .element-box > .table-responsive > .table {
    min-width: 760px;
  }

  body .top-bar .logo-w,
  body .top-bar .fancy-selector-w {
    max-width: 100%;
  }
}
