/* Admin responsive layout adjustments. Desktop rules remain unchanged. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
canvas {
    max-width: 100%;
}

.content-wrapper {
    min-width: 0;
}

.card,
.card-body,
.container-fluid,
.row {
    min-width: 0;
}

.dataTables_wrapper,
.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper > .row {
    min-width: 0;
}

.table {
    width: 100%;
}

@media (max-width: 767.98px) {
    .content-wrapper,
    .content-wrapper > .content,
    .content-wrapper .container-fluid,
    .card,
    .card-body {
        max-width: 100%;
    }

    .main-header .navbar-nav {
        min-width: 0;
    }

    .main-header .navbar-nav.ml-auto,
    .main-header .navbar-nav.ml-auto > .nav-item,
    .main-header .btn-group {
        min-width: 0;
    }

    .main-header .btn-group > .btn {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-header .btn-group > .btn .ml-3 {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .main-header .user-img {
        position: static;
        width: 27px;
        height: 27px;
        flex: 0 0 27px;
        margin: 0 6px 0 0;
    }

    .main-header {
        min-height: 50px;
    }

    .main-header .navbar-nav .nav-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
    }

    .main-header .navbar-nav.ml-auto .nav-link {
        padding: 4px;
    }

    .main-header .btn-group {
        max-width: calc(100vw - 64px);
    }

    .main-header .btn-group > .btn {
        max-width: 100%;
        min-height: 40px;
        display: flex;
        align-items: center;
        white-space: normal;
        text-align: left;
    }

    .content-wrapper {
        padding: 0.75rem !important;
    }

    .content-header {
        padding: 10px 0.25rem;
    }

    .content-header h1 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 0.75rem;
    }

    .card-title {
        float: none;
        display: block;
        line-height: 1.35;
    }

    .card-tools {
        float: none;
        margin-top: 0.5rem;
    }

    .card-tools .btn,
    .card-header > .btn {
        min-height: 40px;
    }

    .dataTables_wrapper {
        padding-bottom: 0.25rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: min(100%, 220px);
        max-width: 100%;
    }

    .dataTables_wrapper > .row:last-child {
        display: block;
    }

    .table {
        min-width: 700px;
        white-space: nowrap;
        margin-bottom: 0;
    }

    .table td,
    .table th {
        vertical-align: middle;
    }

    .table .dropdown-menu {
        position: absolute;
        z-index: 1030;
    }

    .table .btn,
    .btn-group .btn {
        min-height: 40px;
    }

    .form-control,
    .custom-select,
    .select2-container {
        width: 100% !important;
        max-width: 100%;
    }

    .form-group,
    .input-group,
    .custom-control,
    .custom-file {
        max-width: 100%;
    }

    .input-group {
        max-width: 100%;
        flex-wrap: nowrap;
    }

    .input-group .form-control {
        min-width: 0;
    }

    .row > [class*="col-"] {
        min-width: 0;
    }

    .info-box,
    .small-box {
        min-height: 84px;
        margin-bottom: 0.75rem;
    }

    .info-box-content {
        min-width: 0;
    }

    .chart,
    .chart-container {
        max-width: 100%;
        overflow-x: auto;
    }

    .modal-dialog {
        width: auto;
        max-width: none;
        margin: 0.5rem;
    }

    .main-footer > .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .login-box {
        width: calc(100% - 1rem) !important;
        max-width: 400px;
        margin-top: 1rem;
    }

    #logo-img {
        width: 8rem !important;
        height: 8rem !important;
    }

    .content-wrapper {
        padding: 0.5rem !important;
    }

    .main-header .navbar-nav.ml-auto .btn-group > .btn {
        max-width: calc(100vw - 118px);
    }

    .main-header .navbar-nav.ml-auto .btn-group > .btn .ml-3 {
        max-width: calc(100vw - 190px);
    }

    .table {
        min-width: 640px;
    }

    .modal-dialog {
        margin: 0.25rem;
    }
}