/* ==============================================
   MENU DO USUÁRIO — CABEÇALHO
   ============================================== */

.header-user-menu {
    position: relative;
}

.header-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border-2) !important;
    border-radius: var(--r-pill);
    background: transparent !important;
    color: var(--text-2) !important;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: none !important;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.header-user-trigger::after {
    display: none;
}

.header-user-trigger:hover,
.header-user-trigger:focus,
.header-user-trigger.show {
    color: var(--text-1) !important;
    background: var(--surface-2) !important;
    border-color: var(--border-3) !important;
    box-shadow: none !important;
}

.header-user-trigger-photo {
    width: 32px;
    height: 32px;
    border-radius: var(--r-pill);
    object-fit: cover;
    flex-shrink: 0;
}

.header-user-trigger-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-panel.dropdown-menu {
    min-width: 300px;
    max-width: 360px;
    max-height: min(80vh, 640px);
    padding: 0 !important;
    margin-top: 10px !important;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--border-2) !important;
    border-radius: var(--r-lg) !important;
    background: var(--surface-1) !important;
    box-shadow: var(--shadow-lg) !important;
}

.header-user-panel .dropdown-item {
    padding: 0;
    margin: 0;
    background: transparent !important;
    color: inherit !important;
}

.header-user-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-2);
}

.header-user-head-photo {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    object-fit: cover;
    flex-shrink: 0;
}

.header-user-head-text {
    min-width: 0;
    flex: 1;
}

.header-user-head-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-head-email {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-section {
    padding: 12px 0 4px;
    border-bottom: 1px solid var(--border-2);
}

.header-user-section:last-of-type {
    border-bottom: none;
}

.header-user-section-label {
    display: block;
    padding: 0 16px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.header-user-parent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 16px 10px;
    color: var(--text-1);
    text-decoration: none;
    transition: background 0.15s ease;
}

.header-user-parent:hover {
    background: var(--surface-2);
    color: var(--text-1);
    text-decoration: none;
}

.header-user-parent-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: var(--r-pill);
    background: var(--text-1);
    flex-shrink: 0;
}

.header-user-parent-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.header-user-parent-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-1);
}

.header-user-parent-desc {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-3);
}

.header-user-subnav {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0 16px 10px 28px;
    padding-left: 14px;
    border-left: 1px solid var(--border-2);
}

.header-user-subnav--flush {
    margin-top: 0;
}

.header-user-sublink {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 8px 8px 0;
    color: var(--text-1);
    text-decoration: none;
    border-radius: var(--r-md);
    transition: background 0.15s ease;
}

.header-user-sublink:hover {
    background: var(--surface-2);
    color: var(--text-1);
    text-decoration: none;
}

.header-user-sublink-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    margin-top: 2px;
    color: var(--text-3);
    flex-shrink: 0;
    font-size: 0.8125rem;
}

.header-user-sublink:hover .header-user-sublink-icon {
    color: var(--text-2);
}

.header-user-sublink-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.header-user-sublink-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-1);
}

.header-user-sublink-desc {
    font-size: 0.6875rem;
    line-height: 1.35;
    color: var(--text-3);
}

.header-user-links {
    display: flex;
    flex-direction: column;
}

.header-user-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-1);
    text-decoration: none;
    transition: background 0.15s ease;
}

.header-user-link:hover {
    background: var(--surface-2);
    color: var(--text-1);
    text-decoration: none;
}

.header-user-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    margin-top: 2px;
    color: var(--text-3);
    flex-shrink: 0;
    font-size: 0.875rem;
}

.header-user-link:hover .header-user-link-icon {
    color: var(--text-2);
}

.header-user-link-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.header-user-link-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-1);
}

.header-user-link-desc {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-3);
}

.header-user-link-badge {
    align-self: center;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    color: var(--text-2);
    border: 1px solid var(--border-2);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
}

.header-user-footer {
    padding: 8px 0;
    border-top: 1px solid var(--border-2);
}

.header-user-logout-form {
    margin: 0;
}

.header-user-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none !important;
    border-radius: 0;
    background: transparent !important;
    color: var(--text-1) !important;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.header-user-logout i {
    width: 18px;
    color: var(--text-2);
    text-align: center;
}

.header-user-logout:hover {
    background: var(--red-dim) !important;
    color: var(--red) !important;
}

.header-user-logout:hover i {
    color: var(--red);
}

@media (max-width: 768px) {
    .header-user-panel {
        min-width: 280px;
        max-width: calc(100vw - 24px);
    }

    .header-user-trigger-name {
        max-width: 90px;
    }
}
