/* App switcher. Lives inside each app's own header, so the colours are inherited rather
   than set -- the job board's header is green and the register's is steel blue, and this
   has to look right on both. */

/* The two switchers sit side by side on one line in the top-left: which app, then which
   organisation. On a narrow phone they wrap rather than squashing the names to nothing. */
.switcher-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}

.app-switcher, .org-switcher { position: relative; }

/* The organisation is the quieter of the two -- you change it rarely, and it shouldn't
   compete with the app name for attention. */
.org-btn {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border-style: dashed;
}

.switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  max-width: 72vw;
}

.switcher-btn:hover { background: rgba(255, 255, 255, 0.2); }

.switcher-icon { font-size: 1.15rem; line-height: 1; }

.switcher-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switcher-caret { font-size: 0.7rem; opacity: 0.85; }

.switcher-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 100;
  min-width: 17rem;
  max-width: calc(100vw - 1.5rem);
  background: white;
  color: #1f2530;
  border: 1px solid #d8dce3;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 20, 30, 0.22);
  overflow: hidden;
}

.switcher-item {
  width: 100%;
  text-align: left;
  background: none;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #eceef2;
}

.switcher-item:last-child { border-bottom: none; }
.switcher-item:hover { background: #f4f5f7; }
.switcher-item.current { background: #f4f5f7; }

.switcher-item-icon { font-size: 1.4rem; line-height: 1; }
.switcher-item-text { display: flex; flex-direction: column; min-width: 0; }
.switcher-item-text strong { font-size: 0.95rem; }
.switcher-item-text small { color: #6b7280; font-size: 0.8rem; }
.switcher-tick { margin-left: auto; color: #3f7a4a; font-weight: 700; }

.switcher-new { border-top: 1px solid #e3e6eb; }
.switcher-new strong { color: #3a4a63; }

@media (max-width: 400px) {
  /* Two dropdowns plus a name is a lot for a phone header -- let the app name shrink
     first, since its icon still identifies it. */
  .app-switcher .switcher-name { max-width: 7.5rem; }
  .org-switcher .switcher-name { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
