/* ============================================
   ESTILOS MOBILE COMPARTILHADOS
   Cooperativa Farm — apenas @media (max-width: 1023px)
   Desktop (≥1024px): nenhuma regra aqui altera layout.
   ============================================ */

@media (max-width: 1023px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: max(0.75rem, env(safe-area-inset-top, 0.75rem));
        left: max(0.75rem, env(safe-area-inset-left, 0.75rem));
        z-index: 1002;
        width: 44px;
        height: 44px;
        background: rgba(31, 41, 55, 0.95);
        border: 2px solid #84CC16;
        color: #84CC16;
        padding: 0;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: background 0.2s, color 0.2s;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
    }

    .mobile-menu-btn:active {
        background: #84CC16;
        color: #1F2937;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        z-index: 1000;
    }

    .mobile-overlay.active {
        display: block;
    }

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

    .dashboard-wrapper,
    .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .ml-64 {
        margin-left: 0 !important;
    }

    /* Botões e links tocáveis */
    button,
    a.button,
    .btn,
    .nav-item,
    .nav-item-membro,
    .nav-item-root {
        min-height: 44px;
    }

    /* Inputs — evita zoom no iOS */
    input,
    select,
    textarea {
        font-size: 16px;
    }

    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Modais */
    .modal-panel {
        max-width: 95vw !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Tabelas */
    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Formulários compactos */
    .form-card {
        padding: 1.25rem !important;
    }

    #login-modal-backdrop {
        z-index: 100200 !important;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-btn,
    .mobile-overlay {
        display: none !important;
    }
}

@media (max-width: 374px) {
    .dashboard-wrapper,
    .main-content-wrapper {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}
