/* ────────────────────────────────────────────────────────────────
   Admin nav — grouped dropdown ("Growth")
   Added 2026-07-31. Scoped entirely to .menu-group so it cannot
   collide with the per-page inline `nav.tabs a` rules; those still
   style the links inside the panel, keeping every page consistent.
   Opens on hover AND on keyboard focus (focus-within), no JS.
   ──────────────────────────────────────────────────────────────── */

.menu-group {
  position: relative;
  display: inline-flex;
}

/* The parent item — matches the look of a normal nav tab. */
.menu-group > .menu-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text-2, #9a9ab0);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: inherit;
}
.menu-group > .menu-trigger:hover {
  background: var(--card, #1a1a26);
  color: var(--text, #f0f0f5);
}
/* Parent shows as active when the current page lives inside the group. */
.menu-group > .menu-trigger.active {
  background: var(--accent, #6366f1);
  color: #fff;
}
.menu-group > .menu-trigger .caret {
  font-size: 0.6em;
  opacity: 0.75;
  transition: transform 0.16s;
}
.menu-group:hover > .menu-trigger .caret,
.menu-group:focus-within > .menu-trigger .caret {
  transform: rotate(180deg);
}

/* The dropdown panel. */
.menu-group > .menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  border-radius: 10px;
  background: var(--panel, #12121a);
  border: 1px solid var(--border, rgba(99, 102, 241, 0.16));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
}
.menu-group:hover > .menu-panel,
.menu-group:focus-within > .menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover bridge — stops the panel closing while crossing the 6px gap. */
.menu-group > .menu-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

/* Panel links: inherit each page's tab colours, but stack vertically. */
.menu-group > .menu-panel a {
  display: block;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

/* ── Let the dropdown escape the tab bar ─────────────────────────
   header.unified-admin nav.tabs sets `overflow-x: auto` (added when the
   bar had 15 flat items and needed horizontal scrolling). An overflow
   value other than `visible` creates a clipping context, which hid the
   absolutely-positioned panel entirely. Grouping six items under
   "Growth" shortened the bar to 10, so scrolling is no longer needed —
   wrap to a second line on narrow screens instead.
   This file is linked AFTER _admin_nav.css, so same-specificity wins. */
header.unified-admin nav.tabs {
  overflow-x: visible;
  overflow: visible;
  flex-wrap: wrap;
  row-gap: 6px;
}
