.profile-wrapper {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-left: 1px solid var(--border-border);
  border-radius: 12px;
  transition: background .12s;
}

.user-trigger:hover {
  background: var(--bg-bg-subtle);
}

.user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-fg);
  white-space: nowrap;
}

.user-role {
  font-size: 12px;
  color: var(--text-fg-muted);
  white-space: nowrap;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .03em;
}

.profile-menu {
  display: none;
  position: fixed;
  top: 64px;
  right: 0;
  width: 282px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-border);
  border-radius: 0 0 14px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  padding: 0;
}

.profile-menu.show {
  display: block;
}

.profile-menu-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 14px;
  background: #f3f6fb;
  border-bottom: 1px solid var(--border-border);
}

.profile-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-accent);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.profile-menu-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-fg);
  line-height: 1.2;
}

.profile-menu-role {
  font-size: 12px;
  color: var(--text-fg-muted);
  margin-top: 2px;
  line-height: 1.2;
}

.profile-menu-email {
  font-size: 11px;
  color: var(--text-accent);
  margin-top: 2px;
  line-height: 1.2;
}

.profile-menu-section,
.profile-menu-divider {
  padding: 8px 10px;
}

.profile-menu-divider {
  border-top: 1px solid var(--border-border);
}

.profile-section-title {
  padding: 10px 14px 4px;
  color: var(--text-fg-subtle);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  color: var(--text-fg);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.profile-menu-item:hover {
  background: var(--bg-bg-subtle);
}

.profile-menu-item.active {
  background: #eaf0ff;
}

.profile-menu-item.danger {
  color: var(--text-danger);
}

.profile-role-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-fg-muted);
  flex-shrink: 0;
}

.profile-role-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.profile-role-copy {
  flex: 1;
  min-width: 0;
}

.profile-role-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-fg);
  line-height: 1.2;
}

.profile-role-sub {
  display: block;
  font-size: 12px;
  color: var(--text-fg-muted);
  line-height: 1.25;
  margin-top: 1px;
}

.profile-role-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-accent);
  flex-shrink: 0;
}
