/* ═══════════════════════════════════════════════════
   NanoLunar — Header Widget (créditos + usuário)
   Usado via [nanolunar_header_widget]
   Réplica do header do Lunar Painel (dashboard.css)
═══════════════════════════════════════════════════ */
.nlhw-root {
    --nlhw-border:   #252525;
    --nlhw-purple:   #764ba2;
    --nlhw-blue:     #667eea;
    --nlhw-gradient: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
    --nlhw-text:     #e8e8e8;
    --nlhw-muted:    #bbb;
    --nlhw-danger:   #ef4444;

    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.2;
}
.nlhw-root * { box-sizing: border-box; }

.nlhw-btn-login {
    all: unset;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    background: var(--nlhw-gradient);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none !important;
    transition: opacity 0.18s;
}
.nlhw-btn-login:hover { opacity: 0.85; color: #fff !important; }

/* ── Pílula de créditos (igual ao Painel: .nl-credits-pill) ── */
.nlhw-credits-pill {
    display: flex !important; align-items: center !important; gap: 7px !important;
    background: rgba(118,75,162,0.18); border: 1px solid rgba(118,75,162,0.35);
    border-radius: 20px; padding: 6px 16px;
}
.nlhw-pill-icon  { font-size: 16px; line-height: 1; }
.nlhw-pill-label { font-size: 11px; color: #a78cc0; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; }
.nlhw-pill-value { font-size: 16px; font-weight: 800; color: #e2d0f5; letter-spacing: 0.01em; }

/* ── Menu do usuário (igual ao Painel: .nl-user-menu / .nl-user-btn) ── */
.nlhw-user-menu { position: relative; display: inline-flex !important; }
.nlhw-user-btn {
    all: unset;
    box-sizing: border-box;
    display: flex !important; flex-direction: row !important; align-items: center !important; gap: 9px !important;
    background: rgba(255,255,255,0.05); border: 1px solid var(--nlhw-border);
    border-radius: 8px; padding: 6px 12px 6px 6px; cursor: pointer;
    transition: background 0.18s;
}
.nlhw-user-btn:hover { background: rgba(255,255,255,0.09); }
.nlhw-avatar {
    display: flex !important; align-items: center !important; justify-content: center !important;
    width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
    background: var(--nlhw-gradient); font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.nlhw-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.nlhw-user-name {
    font-size: 15px; font-weight: 500; color: var(--nlhw-text);
    max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nlhw-arrow { font-size: 15px; color: var(--nlhw-muted); transition: transform 0.18s; }
.nlhw-user-btn.open .nlhw-arrow { transform: rotate(180deg); }

/* ── Dropdown (igual ao Painel: .nl-dropdown) ── */
.nlhw-dropdown {
    position: absolute; top: calc(100% + 7px); right: 0;
    background: #1a1a1a; border: 1px solid var(--nlhw-border);
    border-radius: 10px; min-width: 175px; padding: 5px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5); z-index: 9999; display: none;
}
.nlhw-dropdown.open { display: block !important; }
.nlhw-dropdown-item {
    all: unset;
    box-sizing: border-box;
    display: flex !important; align-items: center !important; gap: 9px !important;
    padding: 9px 11px; border-radius: 7px; cursor: pointer;
    font-size: 15px; color: var(--nlhw-text); transition: background 0.14s;
    width: 100%;
}
.nlhw-dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--nlhw-text) !important; }
.nlhw-dropdown-item.nlhw-danger { color: var(--nlhw-danger); }
.nlhw-dropdown-sep { height: 1px; background: var(--nlhw-border); margin: 4px 0; }
