/* ============================================================================
   Lancalot — header actions (notifications bell + profile menu)
   ----------------------------------------------------------------------------
   ADDITIVE ONLY. Replaces the old .sign-out-btn with the "+" / bell / avatar
   cluster, the last two each opening a popover. Built from
   the same tokens + popover vocabulary as the booking type-switch menu
   (--card, --head-border, --shadow-pop) so it reads as native chrome.
   ========================================================================== */

/* Cluster pinned to the far right of the header (was .sign-out-btn's slot). */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
}

/* Round icon button (bell). Mirrors .toolbar-btn's interaction language. */
.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--head-border);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.header-icon-btn:hover {
  color: var(--text);
  border-color: var(--accent-ring);
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
}
.header-icon-btn:active { transform: translateY(1px); }
.header-icon-btn.is-open {
  color: var(--text);
  border-color: var(--accent-ring);
  background: var(--accent-bg);
}
.header-icon-btn svg { width: 19px; height: 19px; }
.header-icon-btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

/* "+" Add colleague — same neutral treatment as the bell; only the icon is a
   touch smaller so the plus reads cleanly. */
.header-icon-btn--add svg { width: 18px; height: 18px; }

/* Unread badge — small accent-red pip with a count. */
.header-icon-btn__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #cf4034;
  border: 2px solid var(--bg, var(--card));
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.header-icon-btn__badge[hidden] { display: none; }

/* Profile button wraps the avatar; the avatar carries the visual weight. */
.profile-btn {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.profile-btn:active { transform: translateY(1px); }
.profile-btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  transition: box-shadow 0.15s ease;
}
.profile-btn:hover .header-avatar,
.profile-btn.is-open .header-avatar {
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* ── Popover shell (shared by both menus) ─────────────────── */
.header-pop {
  position: absolute;
  top: calc(100% + 11px);
  z-index: 1200;
  background: var(--card);
  border: 1px solid var(--head-border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  transform-origin: top right;
  animation: header-pop-in 0.13s ease;
}
.header-pop[hidden] { display: none; }
@keyframes header-pop-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* ── Notifications panel ──────────────────────────────────── */
.notif-pop {
  right: 49px;          /* right edge aligns under the bell */
  width: 332px;
  padding: 6px;
}
.notif-pop__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px 9px;
}
.notif-pop__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.notif-pop__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.notif-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
}
.notif-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
}
.notif-item + .notif-item { border-top: 1px solid var(--col-line); border-radius: 0; }
.notif-item__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.notif-item__body { min-width: 0; }
.notif-item__text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text);
}
.notif-item__text strong { font-weight: 700; }
.notif-item__meta {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
}
.notif-item__actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}
.notif-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.notif-btn--accept {
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid transparent;
}
.notif-btn--accept:hover { filter: brightness(0.94); }
.notif-btn--decline {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--head-border);
}
.notif-btn--decline:hover { color: var(--text); border-color: var(--accent-ring); }
.notif-btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

/* Resolved (accepted/declined) row collapses to a quiet confirmation line. */
.notif-item--resolved {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 13px 12px;
}
.notif-item--resolved span { color: var(--text); font-weight: 600; }

.notif-empty {
  padding: 30px 18px 34px;
  text-align: center;
  color: var(--muted);
}
.notif-empty svg { width: 26px; height: 26px; margin-bottom: 9px; opacity: 0.6; }
.notif-empty p { margin: 0; font-size: 0.86rem; }

/* ── Profile menu ─────────────────────────────────────────── */
.profile-pop {
  right: 0;             /* under the avatar */
  width: 256px;
  padding: 6px;
}
.profile-pop__id {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 12px 13px;
}
.profile-pop__avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.profile-pop__meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-pop__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-pop__role {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-pop__role[hidden] { display: none; }
.profile-pop__email {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-pop__sep { height: 1px; background: var(--col-line); margin: 2px 6px; }
.profile-pop__action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.profile-pop__action:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.profile-pop__action:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: -1px; }
.profile-pop__action svg { width: 17px; height: 17px; color: var(--muted); }
