/* Shared account controls. Page styles must not override their geometry.
   Right-rail placement owns a 54px row; inline toolbars already own that row. */
:root {
  --account-row-h: 54px;
  --account-inset-x: 10px;
  --account-column-gap: 10px;
  --account-group-gap: 7px;
  --account-icon-control: 24px;
  --account-icon-size: 15px;
  --account-avatar-size: 20px;
  --account-panel-width: 278px;
  --account-profile-max: 100px;
}

.account-panel {
  display: grid;
  grid-template-columns: auto minmax(82px, 1fr) minmax(0, auto);
  align-items: center;
  column-gap: var(--account-column-gap);
  height: var(--toolbar-control-h);
  min-height: var(--toolbar-control-h);
  min-width: 0;
  width: var(--account-panel-width);
  max-width: 100%;
  margin: calc((var(--account-row-h) - var(--toolbar-control-h)) / 2) 0;
  padding: 0 var(--account-inset-x);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.team-desktop-account .account-panel,
.client-operations-toolbar .account-panel {
  margin: 0;
}

.account-actions,
.account-profile {
  display: flex;
  align-items: center;
  gap: var(--account-group-gap);
  min-width: 0;
}

.account-profile-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.account-panel .account-profile-wrap { max-width: var(--account-profile-max); }

.account-profile-button {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.account-profile-button:hover .topbar-avatar {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.76), 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.account-actions .icon-btn {
  width: var(--account-icon-control);
  height: var(--account-icon-control);
  flex: 0 0 var(--account-icon-control);
  align-items: center;
  justify-items: center;
}

.account-actions .icon-btn:hover,
.account-profile-button:hover {
  background: transparent;
  box-shadow: none;
}

.account-actions .icon-btn svg {
  width: var(--account-icon-size);
  height: var(--account-icon-size);
}

.account-actions .messages-icon-btn svg { transform: translateY(-1px); }
.account-actions .notify-dot { top: -1px; right: -1px; min-width: 14px; height: 14px; font-size: 11px; border-width: 0; }
.account-actions .notification-unread-dot { top: 0; right: 0; width: 6px; height: 6px; }

.account-panel .topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--account-avatar-size);
  width: var(--account-avatar-size);
  min-width: var(--account-avatar-size);
  height: var(--account-avatar-size);
  padding-top: 0;
  font-size: 9px;
  line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.76);
}

.topbar-avatar .avatar-letter { display: block; line-height: 1; transform: translateY(0.5px); }
.account-panel .profile-copy { min-width: 0; overflow: hidden; }
.account-panel .profile-copy strong,
.account-panel .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-panel .profile-copy strong { display: block; font-size: 11.5px; line-height: 1; }

.branch-switcher,
.organization-switcher { min-width: 0; }
.organization-switcher-label {
  display: block;
  min-width: 0;
  max-width: 142px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  line-height: 26px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.organization-switcher select,
.branch-switcher select {
  width: 100%;
  max-width: 124px;
  min-height: 26px;
  padding: 0 24px 0 9px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  line-height: 1;
  text-overflow: ellipsis;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  border: 0;
  border-radius: 8px;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
}
.organization-switcher select { max-width: 142px; }
.organization-switcher select:hover,
.organization-switcher select:focus-visible,
.branch-switcher select:hover,
.branch-switcher select:focus-visible { background-color: var(--primary-soft); color: var(--text-primary); }
.organization-switcher select:disabled,
.branch-switcher select:disabled { opacity: 1; }
