html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    overflow-x: hidden;
}

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

button,
.button,
input,
select,
textarea,
a {
    touch-action: manipulation;
}

button,
.button,
input,
select,
textarea {
    min-height: 44px;
}

input,
select,
textarea {
    max-width: 100%;
}

table {
    min-width: 760px;
}

main {
    max-width: 100%;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid #d8e0df;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2933;
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    main {
        padding: 24px 18px !important;
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 850px) {
    body.sidebar-open {
        overflow: hidden;
    }

    header {
        position: sticky;
        top: 0;
        z-index: 30;
        align-items: center !important;
        flex-direction: row !important;
        flex-wrap: wrap;
    }

    header strong {
        flex: 1 1 auto;
        min-width: 0;
    }

    .toplinks {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px !important;
    }

    .toplinks a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .layout {
        display: block !important;
        min-height: auto !important;
    }

    aside {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        width: min(84vw, 320px);
        height: 100vh;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        border-right: 1px solid #d8e0df !important;
        border-bottom: 0 !important;
        box-shadow: 16px 0 40px rgba(31, 41, 51, 0.18);
    }

    body.sidebar-open aside {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: none;
        border: 0;
        background: transparent;
        pointer-events: none;
    }

    body.sidebar-open .sidebar-backdrop {
        display: none;
    }

    aside .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 44px;
        margin: 0 0 12px;
        border: 1px solid #d8e0df;
        border-radius: 8px;
        background: #e8efed;
        color: #1f2933;
        font-weight: 700;
    }

    main {
        width: 100% !important;
        padding: 20px 14px !important;
    }

    h1 {
        font-size: 24px !important;
        line-height: 1.2;
    }

    h2 {
        font-size: 20px;
    }

    .toolbar,
    .actions,
    .pagination {
        align-items: stretch !important;
        flex-direction: column;
    }

    .actions > *,
    .toolbar .button,
    .pagination a,
    .pagination span {
        width: 100%;
    }

    .button,
    button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        white-space: normal;
        text-align: center;
    }

    form.inline {
        display: block !important;
        width: 100%;
    }

    .filters,
    .grid {
        grid-template-columns: 1fr !important;
    }

    .panel,
    .card,
    .module {
        padding: 16px !important;
    }

    .profile-head {
        align-items: center !important;
        text-align: center;
    }

    .avatar {
        width: 92px !important;
        height: 92px !important;
    }

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

@media (min-width: 851px) {
    aside .sidebar-close {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    header {
        padding: 12px 14px !important;
    }

    main {
        padding: 16px 10px !important;
    }

    .login-shell,
    .shell {
        width: 100% !important;
    }

    .card {
        padding: 20px !important;
    }

    table {
        min-width: 680px;
    }
}
