/* Navbar profile controls and dropdown. The profile page has separate styles. */
.nav-role-badge {
  --role-gradient: var(--nav-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 2px solid transparent;
  border-radius: 100px;
  background: linear-gradient(var(--nav-surface), var(--nav-surface)) padding-box,
              var(--role-gradient) border-box;
  color: var(--bsc-blue);
  font-size: 14px;
  font-weight: 600;
  line-height: 21.8px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.nav-role-badge--trainee { --role-gradient: linear-gradient(90deg, #0153cc, var(--caribbean-dark)); }
.nav-role-badge--admin { --role-gradient: linear-gradient(90deg, #000, #012965); }
.nav-role-badge img { display: block; flex-shrink: 0; }

/* Native details keeps the account menu usable without JavaScript. */
.app-nav-profile {
  position: relative;
  flex-shrink: 0;
}
.app-nav-profile summary { list-style: none; cursor: pointer; }
.app-nav-profile summary::-webkit-details-marker { display: none; }
.app-nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 2px;
  border-radius: 100px;
  transition: background 0.15s;
}
.app-nav-profile-btn:hover { background: var(--nav-surface); }
.app-nav-profile-caret { display: block; flex-shrink: 0; transition: transform 0.15s; }
.app-nav-profile[open] .app-nav-profile-caret { transform: rotate(180deg); }

.app-nav-profile-dropdown {
  position: absolute;
  right: 0;
  top: -6px;
  z-index: 220;
  width: 202px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 80px);
  overflow: hidden;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}
.app-nav-profile-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid #ccc;
  background: var(--panel);
}
.app-nav-profile-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 73px;
  background: var(--nav-gradient);
}
.app-nav-profile-header > * { position: relative; }
.app-nav-profile-toolbar {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  width: 100%;
  min-height: 24px;
}
.app-nav-profile-title {
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 14px;
}
.app-nav-profile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
}
.app-nav-profile-close:hover { background: rgba(255, 255, 255, 0.2); }
.app-nav .app-nav-profile-close:focus-visible { outline-color: #fff; }

.app-nav-avatar,
.app-nav-profile-avatar-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--plum-dark);
  border-radius: 100px;
  background: var(--nav-surface);
  color: var(--nav-active);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.app-nav-avatar > span,
.app-nav-profile-avatar-lg > span {
  background: linear-gradient(254.53deg, var(--plum), #3485fe);
  background-clip: text;
  color: transparent;
}
.app-nav-profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  font-size: 12px;
  line-height: 14px;
  text-align: center;
}
.app-nav-profile-name { color: #000; font-weight: 700; }
.app-nav-profile-email { color: #999; font-weight: 400; }
.app-nav-profile-name,
.app-nav-profile-email { max-width: 100%; overflow-wrap: anywhere; }
.app-nav-profile-roles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.app-nav-profile-role-pill {
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--bsc-blue-light);
  color: var(--bsc-blue);
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.app-nav-profile-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border: none;
  border-bottom: 1px solid #ccc;
  background: var(--panel);
  color: #000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.app-nav-profile-item img,
.app-nav-profile-close img { display: block; flex-shrink: 0; }
.app-nav-profile-item:hover { background: var(--nav-surface); color: #000; }
.app-nav-profile-item--danger { border-bottom: none; background: #fce9ea; }
.app-nav-profile-item--danger:hover { background: #f8d7da; }
.app-nav .app-nav-profile-item:focus-visible { outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
  .app-nav-profile-btn,
  .app-nav-profile-caret,
  .app-nav-profile-close,
  .app-nav-profile-item { transition: none; }
}
