/**
 * Mobile layout — loaded directly (no Tailwind build required).
 * Keep in sync with resources/css/premium-ui.css + sidebar-daisy.css mobile rules.
 */

/* App header — fallback when tw: breakpoints missing from build */
.cv-app-header {
    flex-shrink: 0;
    min-height: 3.75rem;
}

.cv-app-header__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
}

.cv-app-header .cv-show-sm,
.cv-app-header .cv-show-md,
.cv-app-header .cv-show-lg,
.cv-app-header .cv-show-md-text {
    display: none !important;
}

.cv-app-header .small-view-button {
    display: inline-flex;
}

.cv-app-header .side-bar-collapse {
    display: none;
}

@media (min-width: 1024px) {
    .cv-app-header .small-view-button {
        display: none !important;
    }

    .cv-app-header .side-bar-collapse {
        display: inline-flex !important;
    }

    .cv-app-header .cv-show-lg {
        display: inline-flex !important;
    }
}

@media (min-width: 768px) {
    .cv-app-header .cv-show-md {
        display: inline-flex !important;
    }

    .cv-app-header .cv-show-md-text {
        display: inline !important;
    }

    .cv-app-header .cv-hide-md {
        display: none !important;
    }
}

@media (min-width: 640px) {
    .cv-app-header .cv-show-sm {
        display: inline-flex !important;
    }
}

/* Mobile shell — sidebar off-canvas; main full width */
@media (max-width: 1023px) {
    .thetop > aside.side-bar.cv-sidebar-shell:not(.small-view-side-active) {
        display: none !important;
        flex: 0 0 0 !important;
        width: 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .thetop > main {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    body.cv-mobile-sidebar-open {
        overflow: hidden;
    }

    .thetop > aside.side-bar.cv-sidebar-shell.small-view-side-active {
        display: flex !important;
        flex-direction: column;
        flex: none !important;
        z-index: 1000;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: min(17.5rem, 88vw) !important;
        max-width: min(17.5rem, 88vw) !important;
        min-width: 0 !important;
        overflow: hidden;
        pointer-events: auto;
        box-shadow: 8px 0 40px rgb(15 23 42 / 0.15);
    }

    .cv-app-header .tw\:px-5 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .cv-app-header > .tw\:px-5 > .tw\:flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cv-app-header__toolbar {
        flex: 1 1 100%;
        max-width: 100%;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 0.375rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .cv-app-header__toolbar::-webkit-scrollbar {
        display: none;
    }

    section.content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .content-header h1 {
        font-size: 1.25rem;
    }
}

/* Overlay (mobile menu backdrop) */
.overlay {
    z-index: 999;
}

@media (max-width: 1023px) {
    .overlay.tw\:hidden {
        display: none !important;
    }
}
