/* Shared mobile usability rules for the FastAdmin backend. */
@media (max-width: 767px) {
    html,
    body,
    #main,
    #content,
    .content-wrapper {
        min-width: 0;
    }

    .wrapper .main-header .logo {
        left: 50%;
        width: auto;
        max-width: calc(100% - 132px);
        margin-left: 0;
        padding: 0 8px;
        transform: translateX(-50%);
        overflow: hidden;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: 0;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wrapper .main-header .logo .logo-lg {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.inside-header #main,
    body.is-dialog #main {
        overflow-x: hidden;
    }

    .content {
        padding: 10px;
    }

    #content > .row,
    .content > .row {
        margin-right: -5px;
        margin-left: -5px;
    }

    #content > .row > [class*="col-"],
    .content > .row > [class*="col-"] {
        padding-right: 5px;
        padding-left: 5px;
    }

    #ribbon {
        min-height: 38px;
        padding: 0 10px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    #ribbon .breadcrumb {
        float: none !important;
        display: inline-block;
        margin: 0;
        white-space: nowrap;
    }

    .panel-intro > .panel-heading,
    .panel-default > .panel-heading,
    .panel-body {
        padding-right: 12px;
        padding-left: 12px;
    }

    .panel-intro > .panel-heading .nav-tabs {
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .panel-intro > .panel-heading .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    form.form-horizontal .form-group {
        margin-right: 0;
        margin-bottom: 16px;
        margin-left: 0;
    }

    form.form-horizontal .control-label {
        padding-top: 0;
        margin-bottom: 7px;
        text-align: left;
    }

    form.form-horizontal [class*="col-xs-"],
    form.form-horizontal [class*="col-sm-"] {
        padding-right: 0;
        padding-left: 0;
    }

    .form-control,
    .bootstrap-select > .dropdown-toggle,
    .input-group-btn > .btn,
    .sp_container .sp_input,
    .selectpage .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 110px;
    }

    .radio,
    .checkbox {
        min-height: 32px;
    }

    .radio > label,
    .checkbox > label,
    label.radio-inline,
    label.checkbox-inline {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    button.btn,
    a.btn {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    form .btn,
    .form-horizontal .btn {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .fixed-table-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .fixed-table-toolbar::before,
    .fixed-table-toolbar::after {
        display: none;
    }

    .fixed-table-toolbar > .bs-bars,
    .fixed-table-toolbar .toolbar {
        width: 100%;
        margin: 0;
    }

    .fixed-table-toolbar .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .fixed-table-toolbar .toolbar .btn,
    .fixed-table-toolbar .columns .btn,
    .fixed-table-toolbar .search .form-control {
        min-width: 40px;
        min-height: 44px;
    }

    .fixed-table-toolbar .search {
        float: none !important;
        flex: 1 1 170px;
        width: auto;
        max-width: none;
        margin: 0;
    }

    .fixed-table-toolbar .search .form-control {
        width: 100%;
        font-size: 16px;
    }

    .fixed-table-toolbar .columns {
        float: none !important;
        margin: 0;
    }

    .fixed-table-container,
    .fixed-table-body,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bootstrap-table .card-view {
        display: flex;
        align-items: flex-start;
        padding: 7px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .bootstrap-table .card-view:last-child {
        border-bottom: 0;
    }

    .bootstrap-table .card-view .title {
        flex: 0 0 34%;
        padding-right: 10px;
        color: #667085;
        white-space: normal;
    }

    .bootstrap-table .card-view .value {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere;
        text-align: left;
    }

    .bootstrap-table .card-view .value .btn-group,
    .bootstrap-table .card-view .value .btn-group-vertical {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .bootstrap-table .card-view .value .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 12px;
    }

    .fixed-table-pagination {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .fixed-table-pagination > .pull-left,
    .fixed-table-pagination > .pull-right {
        float: none !important;
        width: 100%;
        margin: 0 !important;
        text-align: center;
    }

    .fixed-table-pagination .pagination {
        display: inline-flex;
        flex-wrap: wrap;
        margin: 0;
    }

    .fixed-table-pagination .pagination > li > a,
    .fixed-table-pagination .pagination > li > span {
        min-width: 38px;
        min-height: 44px;
        padding: 11px 10px;
    }

    .layer-footer {
        display: flex;
        gap: 10px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .layer-footer .btn {
        flex: 1;
        min-height: 44px;
        font-size: 15px;
    }

    .layui-layer-fast {
        max-width: calc(100vw - 20px) !important;
    }

    .layui-layer-fast .layui-layer-title {
        padding-left: 14px;
        padding-right: 70px;
    }

    .layui-layer-fast .layui-layer-setwin a {
        width: 28px;
        height: 28px;
    }

    .dropdown-menu {
        max-width: calc(100vw - 24px);
    }

    .sj-dash .sj-card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sj-dash .sj-table {
        width: max-content;
        min-width: 100%;
    }

    #sj-msg-center {
        right: 10px !important;
        bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    }

    #sj-msg-panel {
        width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 90px) !important;
    }

    #sj-msg-list {
        max-height: calc(100vh - 140px) !important;
    }
}

@media (max-width: 480px) {
    .fixed-table-toolbar .toolbar .btn {
        font-size: 14px;
    }
}
