/* Dedicated admin account-switching UI. Loaded after the main CRM theme. */
html[data-crm-impersonating="true"] .account-toggle__avatar {
  background: #fff1d6 !important;
  background-image: none !important;
  border: 2px solid #e39b27 !important;
  color: #92520b !important;
  box-shadow: 0 0 0 3px #fff1d6;
}
html[data-crm-impersonating="true"] .account-toggle { border-radius: 50%; }
.account-menu .account-impersonation-hint {
  margin: 10px 0; padding: 10px 12px; background: #fff6e7; color: #92400e;
  border: 1px solid #f5c77e; border-radius: 9px; font-size: 12px; line-height: 1.5;
}
.account-menu .account-switch, .account-menu .account-return {
  display: block; width: 100%; margin: 9px 0 0; padding: 11px 12px;
  border: 1px solid #a9bbd7; border-radius: 8px; text-align: left;
  background: #eff5ff; color: #173978; font-weight: 600;
}
.account-menu .account-return { background: #fff5e6; border-color: #efbf71; color: #884b08; }
.account-menu .account-switch:hover, .account-menu .account-return:hover { filter: brightness(.96); }
.account-menu .account-switch-panel {
  box-sizing: border-box; width: min(375px, calc(100vw - 60px));
  padding: 12px 0 8px; max-width: 100%;
}
.account-switch-panel label { margin: 0 0 6px; color: #334155; font-size: 12px; font-weight: 600; }
.account-switch-panel input {
  box-sizing: border-box; width: 100%; min-height: 38px;
  padding: 9px 10px; background: #fff; color: #111827; border: 1px solid #94a3b8; border-radius: 8px;
}
.account-switch-panel #account-switch-status { margin: 7px 0; color: #64748b; font-size: 12px; line-height: 1.4; }
.account-switch-panel #account-switch-status[data-error="true"] { color: #a22020; }
.account-switch-users { display: grid; gap: 5px; overflow-y: auto; max-height: min(330px, 44vh); }
.account-switch-users button {
  display: grid; gap: 3px; padding: 9px 11px; width: 100%; border-radius: 8px;
  border: 1px solid #e2e8f0; background: white; color: #1e293b; text-align: left;
}
.account-switch-users button:hover:not(:disabled), .account-switch-users button:focus-visible {
  background: #eaf2ff; border-color: #719de0;
}
.account-switch-users button:disabled { background: #f7f8fa; color: #8692a3; cursor: not-allowed; }
.account-switch-users strong { font-size: 13px; font-weight: 600; }
.account-switch-users small { font-size: 11px; overflow-wrap: anywhere; line-height: 1.35; }

/* Keep the effective user name visible in the top-right profile control. */
.app-topbar .account-toggle.btn-profile {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  width: auto; max-width: min(330px, 53vw); height: 44px;
  padding: 3px 10px 3px 4px; border-radius: 24px;
}
.app-topbar .account-toggle__avatar { flex: 0 0 38px; }
.app-topbar .account-toggle__name {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: #1d4a94; font-size: 12px; font-weight: 600;
}
html[data-crm-impersonating="true"] .app-topbar .account-toggle__name { color: #975209; }
@media (max-width: 480px) {
  .app-topbar .account-toggle.btn-profile { max-width: 58vw; gap: 5px; padding-right: 5px; }
  .app-topbar .account-toggle__name { font-size: 11px; }
}
