/* ============================================================
   PROFILE — avatar, user switcher, user chips
   ============================================================ */

.profile-trigger { overflow: hidden; }

.profile-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.profile-trigger-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-preview {
  width: 104px;
  height: 104px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-soft-color);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  flex-shrink: 0;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.profile-actions {
  display: flex;
  gap: 12px;
}

.profile-user-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* User switcher chips */
.user-switcher {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.user-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background-color: var(--surface-color);
  color: var(--text-color);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.user-chip:only-child {
  flex: 0 0 auto;
  min-width: 100px;
  max-width: 50%;
}

.user-chip.active {
  background-color: var(--primary-color);
  color: var(--on-primary-color);
  border-color: var(--primary-color);
}

.user-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.user-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.5;
}

.role-badge--admin {
  background-color: var(--accent-soft-color);
  color: var(--primary-color);
  border: 1px solid var(--accent-strong-color);
}

.role-badge--user {
  background-color: var(--input-bg-color);
  color: var(--secondary-color);
  border: 1px solid var(--soft-border-color);
}

.role-badge--super_admin,
.role-badge--caregiver {
  background-color: var(--input-bg-color);
  color: var(--secondary-color);
  border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 420px) {
  .profile-avatar-preview { width: 88px; height: 88px; }
  .profile-actions         { flex-direction: column; }
  .user-chip               { font-size: 0.7rem; padding: 8px 5px; }
}
