/* ==========================================================================
   SISTEMA DE NAVEGACIÓN CONTEXTUAL PREMIUM (MOBILE FIRST)
   ========================================================================== */

/* 1. Botón Disparador en la AppBar */
.actions-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.app-bar-menu-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.burger-bar {
    background-color: #ffffff;
    border-radius: 2px;
    display: block;
    height: 3px;
    width: 24px;
}

/* 2. Capa de Fondo (Overlay) */
.menu-overlay {
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-end; /* Mobile First: Posiciona la tarjeta abajo */
}

.menu-backdrop {
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

/* 3. Tarjeta del Menú (Flutter Bottom-Sheet Style) */
.menu-sheet-card {
    background-color: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sheet-drag-handle {
    background-color: #e2e8f0;
    border-radius: 3px;
    height: 5px;
    margin: 12px auto 0 auto;
    width: 40px;
}

.menu-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.menu-sheet-title {
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.menu-close-button {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.menu-sheet-body {
    overflow-y: auto;
    padding: 8px 24px 32px 24px;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item-link {
    color: #334155;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 16px;
    text-decoration: none;
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.menu-item-link:hover {
    background-color: #f8fafc;
    color: #084e88;
}

.menu-divider {
    background-color: #f1f5f9;
    height: 1px;
    margin: 16px 0;
}

.menu-link-primary {
    background-color: #f0f7ff;
    color: #084e88;
}

.menu-link-danger {
    color: #dc2626;
}

/* Animación Mobile */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ==========================================================================
   ADAPTACIÓN PROFESIONAL PARA ESCRITORIO (WEB MMonitor/PC)
   ========================================================================== */
@media (min-width: 768px) {
    .menu-overlay {
        align-items: flex-start;
        justify-content: flex-end; /* Lo alinea a la derecha superior */
        padding: 70px 24px 0 0;   /* Cae justo debajo de la AppBar */
    }

    .menu-sheet-card {
        border-radius: 16px;       /* Pasa de ser Sheet a tarjeta flotante */
        width: 320px;
        max-height: auto;
        animation: fadeInScale 0.2s ease-out forwards;
    }

    .sheet-drag-handle {
        display: none;             /* Oculta la barra de arrastre en PC */
    }
    
    .menu-sheet-body {
        padding: 8px 16px 16px 16px;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================================================
   ESTILOS MAESTROS PREMIUM - BLOQUE DE USUARIO EN MENU CONTEXTUAL
   ============================================================================ */
.menu-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 80%; /* Evita colisión con el botón de cierre en pantallas angostas */
}

.menu-avatar-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #f1f5f9; /* Fondo gris pizarra muy suave */
    border-radius: 50%;
    font-size: 18px;
    flex-shrink: 0; /* Impide que el círculo se deforme en móviles */
}

.menu-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Truco CSS vital para que text-overflow funcione en Flexbox */
}

.menu-user-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8; /* Gris corporativo secundario */
    font-weight: 600;
}

.menu-user-email {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b; /* Gris premium de alta legibilidad */
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Si el correo es muy largo, añade '...' elegantemente */
}