*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.site-sidebar {
    position: relative;
}

.sidebar-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-weight: 600;
}

.site-sidebar .sidebar-content {
    display: block;
}

.submenu {
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: inherit;
    background: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

@media (max-width: 1024px) {
    body > div.flex.h-screen,
    body > div.flex {
        flex-direction: column;
    }

    body > div.flex.h-screen {
        height: auto;
        min-height: 100vh;
    }

    body > div.flex.h-screen > aside,
    body > div.flex > aside {
        width: 100% !important;
        min-height: auto;
    }

    body > div.flex.h-screen > div,
    body > div.flex > main {
        width: 100%;
    }

    aside nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.5rem;
    }

    aside nav ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.5rem;
        padding-left: 0;
    }

    aside nav ul ul {
        display: block;
        margin-top: 0.5rem;
    }

    aside nav a {
        white-space: nowrap;
    }

    .sidebar-toggle {
        display: flex;
    }

    .site-sidebar .sidebar-content {
        display: none;
        margin-top: 0.75rem;
    }

    .site-sidebar.is-open .sidebar-content {
        display: block;
    }

    .submenu {
        display: none;
        margin-top: 0.5rem;
    }

    .submenu.is-open {
        display: block;
    }
}

@media (max-width: 768px) {
    header .flex {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    header .text-right {
        text-align: left;
    }

    header .space-x-4 {
        column-gap: 0.75rem;
        row-gap: 0.5rem;
        flex-wrap: wrap;
    }

    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .p-8 {
        padding: 1rem !important;
    }

    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .site-nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
        padding: 0.75rem 0;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav-mobile.is-open {
        display: block;
    }
}

@media (max-width: 640px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    form button,
    form input[type="submit"],
    form input[type="button"] {
        width: 100%;
    }
}
