/* Shared mobile layout fixes for all application pages. */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.avam-container,
.bmd-layout-content,
.bmd-layout-content > main,
.container,
.container-fluid,
.row,
.card,
.card-body,
.jumbotron,
.modal-content {
    min-width: 0;
    max-width: 100%;
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

.highcharts-container,
.apexcharts-canvas,
.orgchart,
.orgchart-container {
    max-width: 100% !important;
}

.table-responsive,
.dataTables_wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

pre,
pre code {
    max-width: 100%;
    overflow-x: auto;
}

@media (max-width: 991.98px) {
    .bmd-layout-container {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .bmd-layout-header {
        width: 100% !important;
        max-width: 100%;
    }

    .bmd-layout-content {
        width: 100%;
        max-width: 100%;
        min-height: calc(100vh - 64px);
        padding-inline: 10px !important;
        transform: none !important;
    }

    #dw-s1.bmd-layout-drawer {
        width: min(280px, 86vw);
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .modern-menu-link,
    .modern-dropdown-toggle,
    #dw-s1 .nav-link,
    #dw-s1 .dropdown-item {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .bmd-layout-header .navbar.container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .bmd-layout-header .navbar.container > * {
        min-width: 0;
    }

    .bmd-layout-header .navbar-nav {
        min-width: 0;
    }

    .bmd-layout-header .dropdown-menu {
        max-width: calc(100vw - 16px);
    }

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

    .modal-content {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .modal-body {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 14px;
    }

    .bmd-layout-content {
        padding-inline: 7px !important;
    }

    .container-fluid {
        padding-inline: 7px;
    }

    .row {
        margin-inline: -5px;
    }

    .row > [class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-inline: 5px;
    }

    .jumbotron,
    .jumbotron.shade {
        margin: 4px 0 10px;
        padding: 12px 9px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }
    h4, h5, h6 { font-size: 1rem; }

    .form-row,
    .form-group,
    form,
    .input-group,
    .select2-container,
    .select2,
    .custom-file,
    .custom-file-input {
        max-width: 100%;
    }

    .form-control,
    .custom-select,
    select.form-control:not([size]):not([multiple]),
    textarea.form-control {
        width: 100%;
        max-width: 100%;
        min-height: 42px;
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 88px;
    }

    .select2-container {
        width: 100% !important;
    }

    input[type="file"] {
        width: 100%;
        max-width: 100%;
        font-size: 14px;
    }

    .input-group {
        flex-wrap: nowrap;
        min-width: 0;
    }

    .input-group > .form-control,
    .input-group > .custom-select {
        flex: 1 1 0;
        min-width: 0;
    }

    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .btn-group,
    .btn-toolbar,
    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        max-width: 100%;
    }

    .d-flex:not(.flex-column) {
        flex-wrap: wrap;
    }

    .card-header,
    .card-title,
    .modal-title,
    .breadcrumb,
    .alert {
        overflow-wrap: anywhere;
    }

    .table-responsive,
    .dataTables_wrapper,
    .dataTables_scroll,
    .dataTables_scrollBody {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive > table,
    .dataTables_wrapper table,
    table.dataTable {
        max-width: none;
    }

    table:not(.dataTable) {
        display: block;
        width: 100% !important;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td,
    table.dataTable th,
    table.dataTable td {
        padding: 6px 7px;
        font-size: 12px;
        white-space: nowrap;
    }

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

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        display: block;
        width: 100%;
        margin: 7px 0;
        text-align: center !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: 100%;
        margin: 4px 0 0;
    }

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

    .modal-header,
    .modal-footer {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }

    .modal-footer > * {
        flex: 1 1 auto;
    }

    .modal .table-responsive {
        margin-bottom: 8px;
    }

    .pagination .page-link {
        padding: .35rem .55rem;
    }
}

@media (max-width: 575.98px) {
    .bmd-layout-header .navbar.container {
        padding-inline: 6px;
    }

    .bmd-layout-header .navbar-toggler {
        flex: 0 0 auto;
        padding: 5px;
    }

    .bmd-layout-header .navbar-nav .dropdown-toggle {
        display: block;
        max-width: 32vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-inline: 5px;
    }

    .bmd-layout-header .dropdown.base {
        flex: 0 0 auto;
        margin-inline-start: 0 !important;
    }

    .bmd-layout-header .dropdown.base > .btn {
        padding: 6px 7px;
        font-size: 12px;
    }

    .container-fluid {
        padding-inline: 5px;
    }

    .jumbotron,
    .jumbotron.shade {
        padding: 10px 7px;
    }

    .table th,
    .table td,
    table.dataTable th,
    table.dataTable td {
        padding: 5px 6px;
        font-size: 11px;
    }

    .modal-content {
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
    }

    .modal-body {
        padding: 10px;
    }

    .modal-footer .btn {
        min-width: 100%;
    }
}

@media (max-width: 374.98px) {
    html {
        zoom: 1 !important;
    }

    .bmd-layout-content {
        padding-inline: 4px !important;
    }

    .bmd-layout-header .navbar.container {
        gap: 2px;
    }

    .bmd-layout-header .navbar-nav .dropdown-toggle {
        max-width: 28vw;
        font-size: 12px;
    }

    .bmd-layout-header .dropdown.base > .btn {
        font-size: 11px;
        padding-inline: 4px;
    }
}
