/* ============================================================
   MONETIX RESPONSIVE - Arquivo único que controla visibilidade
   Desktop vs Mobile sem conflito
   ============================================================ */

/* ============================================================
   REGRA #1: O QUE ESCONDER NO MOBILE (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    .desktop-dashboard-content  { display: none !important; }
    .topbar-glass               { display: none !important; }
    .sidebar                    { transform: translateX(-100%) !important; }
    .sidebar-nav                { display: none !important; }
    .sidebar-footer             { display: none !important; }
    .login-page .mobile-header         { display: none !important; }
    .login-page .mobile-sidebar        { display: none !important; }
    .login-page .mobile-sidebar-overlay{ display: none !important; }
    .mobile-header              { display: block !important; }
    body:not(.login-page) .main-content {
        margin-left: 0 !important;
        padding-top: 86px !important;
        padding-bottom: 24px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ============================================================
   REGRA #2: O QUE ESCONDER NO DESKTOP (>= 769px)
   ============================================================ */
@media (min-width: 769px) {
    .mobile-dashboard-container { display: none !important; }
    .mobile-header              { display: none !important; }
    .mobile-sidebar             { display: none !important; }
    .mobile-sidebar-overlay     { display: none !important; }

    /* Topbar cobre 100% da largura */
    .topbar-glass {
        left: 0 !important;
        right: 0 !important;
        z-index: 1001 !important;
    }

    /* Sidebar começa ABAIXO da topbar */
    .sidebar {
        top: 80px !important;
        height: calc(100vh - 80px) !important;
        z-index: 999 !important;
    }

    /* Conteúdo principal: margem da sidebar + padding da topbar */
    body:not(.login-page) .main-content {
        margin-left: var(--sidebar-width) !important;
        padding-top: 108px !important;
    }
}

/* ============================================================
   MOBILE HEADER - Branco Premium
   ============================================================ */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid transparent;
    box-shadow: none;
    z-index: 999;
    padding: 0 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-header.scrolled {
    height: 56px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    border-bottom-color: #E5E7EB;
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Logo mobile - texto com M azul */
.mobile-logo-text {
    font-size: 22px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.5px;
    color: #1F2937;
}

/* Span M em azul */
.mobile-logo-text .logo-m {
    background: linear-gradient(135deg, #0066CC, #4A90E2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 3px rgba(0,102,204,0.25));
    font-size: 1.15em;
}

/* Botão hambúrguer */
.mobile-menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    padding: 10px 9px;
    z-index: 10001 !important;
    position: relative;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
}

.mobile-menu-toggle:hover  { background: #E5E7EB; }
.mobile-menu-toggle:active { background: #0066CC; transform: scale(0.95); }
.mobile-menu-toggle:active span { background: #ffffff !important; }

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: background 0.2s ease;
    pointer-events: none !important;
}

.mobile-menu-toggle:hover span { background: #0066CC; }
.mobile-header.scrolled .mobile-menu-toggle { width: 36px; height: 36px; }

/* ============================================================
   TOPBAR DESKTOP - Glass Effect
   ============================================================ */
.topbar-glass {
    position: fixed;
    top: 0;
    left: 280px; /* var(--sidebar-width) */
    right: 0;
    height: 80px;
    background: rgba(8, 20, 40, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    z-index: 900;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-glass.scrolled {
    height: 62px;
    background: rgba(8, 20, 40, 0.97);
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.topbar-content {
    height: 100%;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo: M dourado + resto branco */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-logo-wrap {
    display: flex;
    align-items: baseline;
}

.topbar-logo-m {
    font-size: 28px;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(255,165,0,0.45));
    line-height: 1;
    transition: font-size 0.3s ease;
}

.topbar-logo-rest {
    font-size: 24px;
    font-weight: 900;
    font-style: italic;
    color: rgba(255,255,255,0.93);
    letter-spacing: -0.5px;
    line-height: 1;
    transition: font-size 0.3s ease;
}

.topbar-glass.scrolled .topbar-logo-m   { font-size: 22px; }
.topbar-glass.scrolled .topbar-logo-rest { font-size: 19px; }

.topbar-divider {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255,255,255,0.18),
        transparent
    );
}

/* Direita */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-icon {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(255,255,255,0.88);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.topbar-glass.scrolled .topbar-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
}

.topbar-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.topbar-title {
    font-size: 22px;
    font-weight: 600;
    color: rgba(255,255,255,0.96);
    line-height: 1.1;
    transition: font-size 0.3s ease;
}

.topbar-glass.scrolled .topbar-title { font-size: 17px; }

.topbar-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    transition: all 0.3s ease;
}

.topbar-glass.scrolled .topbar-subtitle { font-size: 12px; }

/* Esconde page-header dentro do dashboard desktop */
.desktop-dashboard-content .page-header {
    display: none !important;
}