/* ============================================================================
   ResponseMate design system: global chrome (top bar + its menus).
   Source of truth: .mdd/design/handoff/design/app-nav.dc.html (values literal).
   Governed by .mdd/docs/00-design-system.md. Loaded globally on every page
   (themesettings assets) from the M2 chrome swap on; the Metronic sidebar is
   gone. Everything is prefixed .rm- to coexist with Metronic until M8.
   ========================================================================== */

.rm-topbar {
  display: flex;
  align-items: center;
  gap: 30px;
  background: var(--rm-nav-black);
  color: #fff;
  padding: 0 32px;
  height: var(--rm-topbar-h);
  flex: none;
  font-family: var(--rm-font-body);
  position: sticky;
  top: 0;
  z-index: 200; /* below the rm modal bands (250+) */
}

.rm-topbar__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; flex: none; }
.rm-topbar__brand:hover { color: #fff; }
.rm-topbar__mark {
  width: 34px; height: 34px; border-radius: 9px;
  /* bare mark (2026-08-21): no plate, border or shadow - just the brand-blue mark */
  display: flex; align-items: center; justify-content: center;
  color: #00A7E5;
}
.rm-topbar__wordmark { font-family: var(--rm-font-heading); font-weight: 800; font-size: 18px; letter-spacing: -.01em; }

.rm-topbar__nav { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; min-width: 0; }

.rm-topbar__item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 10px;
  color: #B7C0D0; text-decoration: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  background: none; border: 1px solid transparent; cursor: pointer;
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
}
.rm-topbar__item:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.rm-topbar__item:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(127, 166, 255, .35); }

.rm-topbar__item--active {
  color: #fff;
  background: linear-gradient(100deg, rgba(47, 107, 255, .32), rgba(18, 181, 214, .16));
  border-color: rgba(91, 140, 255, .35);
}
.rm-topbar__item--active:hover { color: #fff; background: linear-gradient(100deg, rgba(47, 107, 255, .32), rgba(18, 181, 214, .16)); }
.rm-topbar__item--active [data-lucide], .rm-topbar__item--active .lucide { color: #7FA6FF; }

/* Active item on a sub-page: label row + breadcrumb sub-label row */
.rm-topbar__item--sub { flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 13px; line-height: 1.15; }
.rm-topbar__item-main { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.rm-topbar__crumb { display: inline-flex; align-items: center; gap: 3px; padding-left: 26px; max-width: 230px; }
.rm-topbar__crumb svg { flex: none; }
.rm-topbar__crumb-label {
  font-size: 10.5px; font-weight: 600; color: #9DBBFF;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rm-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }
/* Import questionnaire (2026-08-19): the questionnaires hero's action moved
   up here as a compact cobalt pill; the global search field is gone. */
.rm-topbar__import {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 12px;
  border-radius: 10px; color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: linear-gradient(120deg, #2F6BFF, #1E4FD1); box-shadow: 0 6px 16px -8px rgba(47, 107, 255, .8);
  transition: filter .15s ease, transform .15s ease;
}
.rm-topbar__import:hover { filter: brightness(1.08); }
.rm-page .rm-topbar__import { color: #fff; }
@media (max-width: 1100px) { .rm-topbar__import-label { display: none; } .rm-topbar__import { padding: 0 10px; } }

/* ---- Global search ---------------------------------------------------------- */

.rm-topbar__search { position: relative; margin-left: auto; flex: 0 1 300px; min-width: 150px; }
.rm-topbar__search + .rm-topbar__right { margin-left: 0; }
.rm-topbar__search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 38px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  color: #8A94A6;
  transition: background .15s ease, border-color .15s ease;
}
.rm-topbar__search-box:focus-within { background: rgba(255, 255, 255, .09); border-color: rgba(127, 166, 255, .45); color: #B7C0D0; }
.rm-topbar__search-input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  font-family: inherit; font-size: 13.5px; font-weight: 500; color: #fff;
}
.rm-topbar__search-input::placeholder { color: #8A94A6; }
.rm-topbar__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.rm-search-panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 121;
  width: 400px; max-width: 82vw;
  background: #fff; border: 1px solid var(--rm-border); border-radius: 14px;
  box-shadow: var(--rm-shadow-overlay);
  padding: 10px;
  font-family: var(--rm-font-body);
}

.rm-search-panel__scopes { display: flex; gap: 6px; padding-bottom: 9px; border-bottom: 1px solid #EEF1F7; }
.rm-search-scope {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--rm-muted); background: #fff;
  border: 1px solid var(--rm-border); border-radius: 9px;
  padding: 6px 11px; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.rm-search-scope:hover { background: var(--rm-ghost-fill); }
.rm-search-scope--on { background: var(--rm-tone-cobalt-bg); color: var(--rm-tone-cobalt-fg); border-color: #B9D0FF; }
.rm-search-scope:disabled { color: var(--rm-faint); cursor: not-allowed; opacity: .55; }
.rm-search-scope:disabled:hover { background: #fff; }

.rm-search-panel__results { max-height: 420px; overflow-y: auto; padding-top: 6px; }
.rm-search-panel__label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--rm-label); padding: 8px 8px 4px;
}
.rm-search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 9px;
  color: var(--rm-ink); text-decoration: none; cursor: pointer;
}
.rm-search-item:hover, .rm-search-item--hl { background: var(--rm-page); color: var(--rm-ink); }
.rm-search-item__tile {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.rm-search-item__tile--questionnaires, .rm-search-item__tile--questions { background: var(--rm-src-past-bg); color: var(--rm-src-past-fg); }
.rm-search-item__tile--library { background: var(--rm-src-qna-bg); color: var(--rm-src-qna-fg); }
.rm-search-item__tile--sources { background: var(--rm-src-file-bg); color: var(--rm-src-file-fg); }
.rm-search-item__tile--clients { background: var(--rm-fill); color: var(--rm-muted); }
.rm-search-item__tile--vendors { background: var(--rm-tone-cobalt-bg); color: var(--rm-tone-cobalt-fg); }
.rm-search-item__text { min-width: 0; }
.rm-search-item__title { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-search-item__subtitle { display: block; font-size: 11.5px; color: var(--rm-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rm-search-panel__state {
  padding: 18px 10px; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--rm-soft);
}
.rm-search-panel__state b { color: var(--rm-slate); font-weight: 700; }

.rm-topbar__chevron { color: #8A94A6; transition: transform .2s ease; }
.rm-topbar__trigger[aria-expanded="true"] .rm-topbar__chevron { transform: rotate(180deg); }

/* ONE profile box (2026-08-21): bell and user chip live inside it, so the
   bell is no longer a framed square of its own beside the profile. They stay
   two menu wraps - two triggers, two trays - and only the chrome moved out to
   the wrapper.

   The bell sits FIRST because it only exists while there are unread
   notifications. The topbar's right group is right-aligned, so a bell
   appearing grows this box leftwards and the avatar never shifts under the
   cursor. */
.rm-topbar__profile {
  display: flex; align-items: center; gap: 2px;
  padding: 3px 4px 3px 3px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--rm-radius-pill);
}
.rm-topbar__profile:has(.rm-topbar__trigger[aria-expanded="true"]) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); }

.rm-topbar__userchip {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 8px 3px 4px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--rm-radius-pill);
  color: #fff; cursor: pointer; font-family: inherit;
  transition: background .15s ease, border-color .15s ease;
}
/* Hover lifts the background only (2026-08-25): the chip sits inside the
   already-bordered .rm-topbar__profile box, so a hover border on it drew a
   second ring inside the first whenever the bell was showing. */
.rm-topbar__userchip:hover { background: rgba(255, 255, 255, .1); }
.rm-topbar__userchip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(127, 166, 255, .35); }
.rm-topbar__avatar {
  width: 34px; height: 34px; border-radius: 50%; position: relative; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rm-font-heading); font-weight: 700; font-size: 14px; color: #fff;
}
/* Shares the site's one presence-dot treatment (components.css) and sets only
   what is its own: the size for a 34px avatar, and the nav bar as the surface
   it rings against. */
.rm-topbar__avatar-dot { right: -1px; bottom: -1px; width: 10px; height: 10px; --rm-dot-ring: var(--rm-nav-black); }
.rm-topbar__username { font-weight: 700; font-size: 13.5px; }
/* User chip on the account screen: first name row + breadcrumb row for the
   active account tab (rmChrome.setUserCrumb, 2026-08-19); same crumb
   classes as the nav items, so the sub-label reads the same everywhere. */
.rm-topbar__usercol { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.15; min-width: 0; }
.rm-topbar__usercol .rm-topbar__crumb { padding-left: 0; max-width: 170px; }
.rm-topbar__userchip--sub { padding-top: 4px; padding-bottom: 4px; }

/* ---- Notifications bell + tray ---------------------------------------------- */

.rm-topbar__bell {
  position: relative;
  width: 32px; height: 32px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #B7C0D0; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.rm-topbar__bell:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rm-topbar__bell:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(127, 166, 255, .35); }
.rm-topbar__bell-badge {
  position: absolute; top: -1px; right: -1px;
  min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: var(--rm-green); color: #fff;
  border: 2px solid var(--rm-nav-black);
  /* Sits inside the profile box now, so it rings against the box's own
     surface (nav black under a 5% white wash) rather than the bare bar. */
  border-radius: var(--rm-radius-pill);
  font-size: 10px; font-weight: 700; line-height: 1;
}

.rm-menu--notifications { width: 360px; }
.rm-menu__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 7px; }
.rm-menu__head-action {
  font-family: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--rm-tone-cobalt-fg); background: none; border: none;
  padding: 4px 6px; border-radius: 7px; cursor: pointer;
}
.rm-menu__head-action:hover { background: var(--rm-tone-cobalt-bg); }

.rm-notifications__list { max-height: 420px; overflow-y: auto; }
.rm-notification {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 11px; border-radius: 9px;
  color: var(--rm-ink); text-decoration: none; cursor: pointer;
}
.rm-notification:hover { background: var(--rm-page); color: var(--rm-ink); }
.rm-notification__tile {
  width: 32px; height: 32px; flex: none; border-radius: 8px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--rm-fill); color: var(--rm-muted);
}
.rm-notification--unread .rm-notification__tile { background: var(--rm-tone-green-bg); color: var(--rm-tone-green-fg); }
.rm-notification__text { min-width: 0; flex: 1; }
.rm-notification__title { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.rm-notification--unread .rm-notification__title { font-weight: 700; }
.rm-notification__body { display: block; font-size: 11.5px; color: var(--rm-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.rm-notification__time { display: block; font-size: 10.5px; font-weight: 600; color: var(--rm-label); margin-top: 3px; }
.rm-notification__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--rm-green); margin-top: 7px; }

.rm-notifications__state {
  padding: 22px 10px; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--rm-soft);
}

/* ---- Dropdown menus (add-ons, user) ---------------------------------------- */

.rm-topbar__menu-wrap { position: relative; }

.rm-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 121;
  width: 280px;
  background: #fff; border: 1px solid var(--rm-border); border-radius: 14px;
  box-shadow: var(--rm-shadow-overlay);
  padding: 7px;
  font-family: var(--rm-font-body);
}
.rm-menu--user { width: 266px; }

.rm-menu__label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--rm-label); padding: 8px 11px 6px;
}

.rm-menu__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--rm-ink); text-decoration: none;
}
.rm-menu__item:hover { background: var(--rm-page); color: var(--rm-ink); }
.rm-menu__tile {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  background: #EBF1FF; color: var(--rm-ai-cobalt);
  display: flex; align-items: center; justify-content: center;
}
.rm-menu__text { min-width: 0; display: block; }
.rm-menu__title { display: block; font-size: 13.5px; font-weight: 700; }
.rm-menu__item--plain .rm-menu__title, .rm-menu__item--danger .rm-menu__title { font-weight: 600; }
.rm-menu__desc { display: block; font-size: 11.5px; color: var(--rm-soft); }
.rm-menu__icon { width: 30px; height: 30px; flex: none; color: var(--rm-muted); display: flex; align-items: center; justify-content: center; }

.rm-menu__sep { height: 1px; background: #EEF1F7; margin: 5px 4px; }

.rm-menu__user { display: flex; align-items: center; gap: 11px; padding: 11px 12px 12px; }
.rm-menu__user-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--rm-font-heading); font-weight: 700; font-size: 15px; color: #fff;
}
.rm-menu__user-meta { min-width: 0; display: block; }
.rm-menu__user-name { display: block; font-size: 14px; font-weight: 700; color: var(--rm-ink); }
.rm-menu__user-email { display: block; font-size: 12px; color: var(--rm-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rm-menu__item--danger { color: #D81E46; }
.rm-menu__item--danger:hover { background: #FEECEF; color: #D81E46; }
.rm-menu__item--danger .rm-menu__icon { color: #D81E46; }

/* ---- Responsive fallback ----------------------------------------------------
   The design is desktop-first (1440px container). Below that, shed chrome
   weight instead of scrolling the bar (menus must not be clipped). */

@media (max-width: 1100px) {
  .rm-topbar { gap: 18px; padding: 0 18px; }
  .rm-topbar__crumb { max-width: 140px; }
}
@media (max-width: 920px) {
  .rm-topbar__wordmark { display: none; }
  .rm-topbar__username, .rm-topbar__usercol { display: none; }
  .rm-topbar__item { padding: 9px 10px; }
}
@media (max-width: 720px) {
  .rm-topbar { gap: 10px; padding: 0 12px; }
  .rm-topbar__item { font-size: 13px; gap: 6px; }
  .rm-topbar__crumb { display: none; }
  .rm-topbar__item--sub { flex-direction: row; align-items: center; gap: 6px; padding: 9px 10px; }
}
