/* Navegação e ajustes exclusivos do Conecta Admin em telas pequenas. */
.mobile-menu-toggle,
.mobile-menu-backdrop {
    display: none;
}

@media (max-width: 800px) {
    body {
        padding: 0;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    #dashboard-view,
    #dashboard-view.active {
        position: relative;
        width: 100%;
        height: 100vh !important;
        height: 100dvh !important;
    }

    #sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1002;
        width: min(82vw, 300px);
        height: 100vh;
        height: 100dvh;
        padding-top: calc(24px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
        overflow-y: auto;
        box-shadow: 18px 0 45px rgba(0, 0, 0, 0.42);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
    }

    body.mobile-menu-open #sidebar {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        position: fixed;
        top: calc(12px + env(safe-area-inset-top));
        left: 12px;
        z-index: 1001;
        display: inline-flex;
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: rgba(15, 23, 42, 0.96);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
        color: var(--text-main);
        font-size: 1.5rem;
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(2, 6, 23, 0.72);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    body.mobile-menu-open .mobile-menu-backdrop {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        padding: calc(68px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
    }

    .global-header {
        position: static;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .global-header > div,
    .global-header > div:first-child {
        width: 100% !important;
        min-width: 0;
        margin-left: 0 !important;
    }

    .global-header > div:first-child {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    #global-client-select {
        width: 100% !important;
        min-width: 0 !important;
    }

    .content-card {
        width: 100%;
        min-width: 0;
        padding: 18px;
        overflow-x: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        width: 100%;
        min-width: 0;
    }

    .view-section > div[style*="justify-content: space-between"],
    .content-card > div[style*="justify-content: space-between"] {
        align-items: stretch !important;
        flex-wrap: wrap;
    }

    .data-table {
        min-width: 640px;
    }

    .modal-overlay {
        padding-right: 12px;
        padding-left: 12px;
    }

    #login-view {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 16px;
    }

    #login-view .container {
        padding: 28px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #sidebar,
    .mobile-menu-backdrop {
        transition: none;
    }
}
