/* Linked portal identities dropdown (Client marketing header + Partner/Admin dashboards).
   All row/menu styles are self-contained (no Tailwind) so Partner/Admin match Client. */

/* Positioning context: shrink-wrap to trigger so the panel aligns under the avatar */
.partner-portal-profile-root {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
	width: max-content;
	max-width: 100%;
	flex: 0 0 auto;
	overflow: visible;
}

.header-profile-panel {
	position: absolute;
	top: calc(100% + 0.25rem);
	inset-inline-end: 0;
	min-width: max(100%, 14rem);
	max-width: min(22rem, 92vw);
	background: #fff;
	border-radius: 0.75rem;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
	border: 1px solid rgb(229, 231, 235);
	z-index: 100000;
	overflow: hidden;
	box-sizing: border-box;
}

.header-profile-panel__body {
	max-height: 16rem;
	overflow-y: auto;
	box-sizing: border-box;
	background: #fff;
}

/* Partner mobile drawer: panel is fixed under “Linked accounts”; column layout for scroll + footer */
.header-profile-panel.header-profile-panel--drawer-mode {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.header-profile-panel.header-profile-panel--drawer-mode .header-profile-panel__body {
	flex: 1 1 auto;
	min-height: 0;
}

/* Client marketing header: fixed panel matches full drawer action width — long labels wrap; calmer focus than default ring */
.header-profile-panel.header-profile-panel--marketing-mobile {
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba(24, 28, 45, 0.18);
	background-color: #ffffff !important;
	background-image: none !important;
	opacity: 1 !important;
	isolation: isolate;
	mix-blend-mode: normal;
}

.header-profile-panel.header-profile-panel--marketing-mobile .header-profile-panel__body {
	background-color: #ffffff !important;
	background-image: none !important;
	mix-blend-mode: normal;
}

.header-profile-panel.header-profile-panel--marketing-mobile button.header-profile-panel__row,
.header-profile-panel.header-profile-panel--marketing-mobile button.header-profile-panel__footer-btn {
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	hyphens: auto;
	text-align: start;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
	background-color: #ffffff !important;
	background-image: none !important;
}

.header-profile-panel.header-profile-panel--marketing-mobile button.header-profile-panel__row:focus {
	outline: none;
}

.header-profile-panel.header-profile-panel--marketing-mobile button.header-profile-panel__row:focus-visible {
	outline: 2px solid #6b5b95;
	outline-offset: 2px;
}

/* Menu rows: explicit reset — overrides global typography `button { … !important }` + theme */
.header-profile-panel button.header-profile-panel__row {
	display: block;
	width: 100%;
	text-align: start;
	box-sizing: border-box;
	margin: 0;
	padding: 0.625rem 0.875rem;
	font-family: inherit !important;
	font-size: 0.9375rem !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	letter-spacing: normal !important;
	color: #111111 !important;
	background-color: #ffffff !important;
	border: none;
	border-radius: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.header-profile-panel__body .header-profile-panel__row + .header-profile-panel__row {
	border-top: 1px solid rgb(229, 231, 235);
}

.header-profile-panel button.header-profile-panel__row:hover,
.header-profile-panel button.header-profile-panel__footer-btn:hover {
	background-color: rgb(245, 243, 255) !important;
}

.header-profile-panel__loading,
.header-profile-panel__error {
	margin: 0;
	padding: 0.75rem 0.875rem;
	font-size: 0.875rem;
	line-height: 1.4;
	font-family: inherit;
	box-sizing: border-box;
}

.header-profile-panel__loading {
	color: #6b7280;
	background: #fff;
}

.header-profile-panel__error {
	color: #b91c1c;
	background: #fff;
}

/* “New partner” action — no Tailwind */
.header-profile-panel button.header-profile-panel__footer-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.625rem 0.875rem;
	text-align: start;
	font-family: inherit !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	letter-spacing: normal !important;
	color: #6a5d8b !important;
	background-color: #ffffff !important;
	border: none;
	border-top: 1px solid rgb(229, 231, 235);
	border-radius: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.header-profile-panel__footer-logout {
	background: #fff;
	border-top: 1px solid rgb(229, 231, 235);
}

/* Avoid double rule when “New partner” row already has a top border */
.header-profile-panel__footer-btn + .header-profile-panel__footer-logout {
	border-top: none;
}

/* Logout row: override admin/partner layout CSS (.profile-dropdown-logout-btn uses row-reverse + flex-end in LTR, which clips text). */
.header-profile-panel__footer-logout > a,
.header-profile-panel__footer-logout a.profile-dropdown-logout-btn {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 0.5rem;
	padding: 0.75rem 0.875rem !important;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	text-decoration: none !important;
	color: inherit;
	min-width: 0;
}

.header-profile-panel__footer-logout .profile-dropdown-type {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	gap: 0.5rem;
	width: 100%;
	min-width: 0;
	flex: 1 1 auto;
}

/* Icon before label (DOM is text then icon) */
.header-profile-panel__footer-logout .profile-dropdown-logout-icon {
	float: none !important;
	flex-shrink: 0;
	order: -1;
}

.header-profile-panel__footer-logout .profile-dropdown-logout-text {
	flex: 1 1 auto !important;
	min-width: 0;
	text-align: start !important;
	text-overflow: clip;
	overflow: visible;
	white-space: nowrap;
	color: #db3a34;
	font-size: 0.875rem;
	font-weight: 500;
}

[dir="rtl"] .header-profile-panel__footer-logout > a,
[dir="rtl"] .header-profile-panel__footer-logout a.profile-dropdown-logout-btn {
	flex-direction: row-reverse !important;
	justify-content: flex-end !important;
}

[dir="rtl"] .header-profile-panel__footer-logout .profile-dropdown-type {
	flex-direction: row-reverse !important;
}

[dir="rtl"] .header-profile-panel__footer-logout .profile-dropdown-logout-icon {
	order: 1;
}

[dir="rtl"] .header-profile-panel__footer-logout .profile-dropdown-logout-text {
	text-align: start !important;
}

.header-profile-panel__footer-logout > a:hover {
	background-color: rgb(245, 243, 255);
}

/* Partner header: allow dropdown to paint outside toolbar row */
.DashboardHeader-toolbar .partner-portal-profile-root {
	overflow: visible;
}

/* Admin dashboard: same portal menu host */
#adminPortalProfileDropdownRoot.profile {
	position: relative;
	overflow: visible;
	flex: 0 0 auto;
}
