:root {
    --app-sidebar-width: 280px;
    --app-mobile-header-height: 58px;
}

.sidebar-menu-toggle,
.sidebar-mobile-header,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.sidebar-menu-visible {
        overflow: hidden;
    }

    .sidebar-menu-toggle {
        position: fixed;
        top: 10px;
        left: 12px;
        z-index: 1200;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 42px;
        padding: 8px 13px;
        border: 1px solid #cbd5e1;
        border-radius: 9px;
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 3px 12px rgba(15, 23, 42, .16);
        font: inherit;
        font-weight: 800;
        cursor: pointer;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1250;
        display: block;
        background: rgba(15, 23, 42, .52);
    }

    .sidebar-backdrop[hidden] {
        display: none;
    }

    .app-sidebar.sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        z-index: 1300;
        display: block !important;
        width: min(var(--app-sidebar-width), 86vw) !important;
        max-width: 86vw;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 18px 24px !important;
        overflow-y: auto;
        transform: translateX(-105%);
        visibility: hidden;
        background: #ffffff;
        box-shadow: 10px 0 30px rgba(15, 23, 42, .25);
        transition: transform .22s ease, visibility .22s ease;
    }

    .app-sidebar.sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-mobile-header {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: var(--app-mobile-header-height);
        margin: 0 -18px 12px;
        padding: 0 14px 0 18px;
        border-bottom: 1px solid #e2e8f0;
        background: #ffffff;
    }

    .sidebar-mobile-title {
        font-size: 18px;
        font-weight: 800;
    }

    .sidebar-menu-close {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 8px;
        background: #f1f5f9;
        color: #0f172a;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
    }

    .app-sidebar.sidebar .logo {
        display: block;
        margin: 10px 0 18px;
    }

    .app-sidebar.sidebar nav {
        display: grid;
        gap: 6px;
    }

    .app-sidebar.sidebar nav a {
        min-height: 46px;
        box-sizing: border-box;
    }

    #main-content,
    main#main-content,
    .account-page {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        padding-top: 66px;
        box-sizing: border-box;
    }
}

@media (min-width: 769px) {
    .app-sidebar.sidebar {
        transform: none !important;
        visibility: visible !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar.sidebar {
        transition: none;
    }
}
