/* Shared responsive layer for the application shell and legacy views. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

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

iframe {
    max-width: 100%;
}

.main-panel,
.main-panel > .content,
.main-panel .container,
.main-panel .container-fluid,
.main-panel .row,
.main-panel [class*="col-"] {
    min-width: 0;
}

.main-panel .content {
    overflow-wrap: anywhere;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > table {
    min-width: 640px;
}

.table,
.table td,
.table th {
    overflow-wrap: anywhere;
}

.modal-dialog {
    width: auto;
    max-width: calc(100% - 2rem);
}

.modal-content,
.dropdown-menu,
.card {
    max-width: 100%;
}

.form-control,
.form-select,
.input-group,
.input-group > .form-control,
.input-group > .form-select {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .sidebar,
    body > .navbar-collapse {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 300ms ease;
        z-index: 1040;
    }

    .sidebar.mobile-open,
    body > .navbar-collapse.mobile-open {
        transform: translateX(0);
    }

    .main-panel,
    body.sidebar-collapsed .main-panel {
        float: none;
        width: 100%;
    }

    .main-panel > .content {
        padding: 0px 8px;
    }

    .main-panel .navbar {
        min-height: 54px;
    }

    .navbar .container-fluid {
        flex-wrap: wrap;
    }

    .navbar .navbar-nav {
        max-width: 100%;
    }

    .sidebar-mobile-toggle {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1041;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
    }

    .sidebar-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1039;
        display: none;
        background: rgba(21, 36, 71, .38);
    }

    body.sidebar-mobile-open .sidebar-mobile-backdrop {
        display: block;
    }
}

@media (min-width: 992px) {
    .sidebar-mobile-toggle,
    .sidebar-mobile-backdrop {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: 12px;
    }

    .btn-group,
    .btn-toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-group > .btn {
        border-radius: .25rem !important;
    }

    .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: .5rem auto;
    }

    .modal-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs .nav-link {
        padding: .5rem .65rem;
    }

    .footer .row,
    footer.row {
        display: block;
    }

    .footer [class*="col-"] {
        width: 100%;
        max-width: 100%;
    }
}

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

    .main-panel > .content {
        padding: 8px 4px;
    }

    .display-1,
    .display-2,
    .display-3,
    .display-4 {
        font-size: 2.25rem;
    }

    h1,
    .h1 {
        font-size: 1.7rem;
    }

    h2,
    .h2 {
        font-size: 1.45rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    .form-row,
    .input-group,
    .d-flex.flex-row,
    .d-flex.flex-row-reverse {
        flex-wrap: wrap;
    }

    .form-row > *,
    .input-group > *,
    .d-flex.flex-row > *,
    .d-flex.flex-row-reverse > * {
        max-width: 100%;
    }

    .dropdown-menu {
        max-width: calc(100vw - 1rem);
        overflow-wrap: anywhere;
    }

    .table-responsive > table {
        min-width: 560px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    body > .navbar-collapse {
        transition: none;
    }
}