/* Shared Top-Right Profile Account Menu & View As Role Preview Switcher
   Used across Workspace, Admin, Workspaces Hub, and Landing pages. */

[hidden],
.profile-menu-wrap[hidden],
.profile-dropdown[hidden] {
  display: none !important;
}

.profile-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-trigger:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-trigger-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-caret {
  font-size: 10px;
  color: var(--muted, var(--ink-soft));
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 245px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  padding: 6px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-dropdown-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.profile-dropdown-email {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

.profile-menu-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.profile-menu-item:hover {
  background: var(--surface-soft);
  color: var(--accent);
}

.profile-menu-danger {
  color: var(--lost, #b91c1c);
}

.profile-menu-danger:hover {
  background: var(--lost-bg, #fef2f2);
  color: var(--lost, #b91c1c);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* View As Role Preview Switcher & Persistent Top Banner */
.view-as-banner {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: #fef3c7;
  border-bottom: 1px solid #f59e0b;
  color: #78350f;
  padding: 8px 16px;
  font-size: 12.5px;
}

.view-as-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.view-as-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.view-as-banner-sub {
  opacity: 0.85;
  font-size: 12px;
}

.view-as-banner-link {
  color: #92400e;
  font-weight: 700;
  text-decoration: underline;
}

.view-as-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.view-as-banner-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.view-as-banner-pill {
  border: none;
  background: transparent;
  color: #78350f;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.view-as-banner-pill.active {
  background: #b45309;
  color: #ffffff;
}

.view-as-exit-btn {
  border: 1px solid #b45309;
  background: #ffffff;
  color: #78350f;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.view-as-exit-btn:hover {
  background: #fffbeb;
}

.view-as-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px 4px 3px 9px;
  box-shadow: var(--shadow);
}

.profile-viewas-block {
  padding: 7px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-prefs-block {
  padding: 7px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-lang-toggle {
  box-shadow: none;
}

.profile-theme-picker {
  box-shadow: none;
  padding: 2px 4px;
}

.view-as-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, var(--ink-soft));
  white-space: nowrap;
}

.view-as-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.view-as-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.view-as-btn:hover {
  color: var(--ink);
}

.view-as-btn.active {
  background: var(--accent);
  color: #ffffff;
}
