/*
 * admin-shell-layout.css — structural chrome shared by GolfKit admin workspaces.
 *
 * This file owns the stable application frame: topbar, viewport grid, sidebar,
 * navigation states, content panels and the mobile drawer hand-off. It loads
 * after admin-foundation.css and before each app stylesheet so a shell can theme
 * these primitives without re-declaring their layout.
 */

/* ── Viewport frame ───────────────────────────────────────────── */
.admin-hero {
  /* The rail carries global navigation weight. Keep the workspace header
   * neutral so route context, scope controls and account actions scan clearly
   * across every tenant theme. */
  --admin-header-bg: #ffffff;
  --admin-header-accent: var(--accent);
  --admin-header-text: #1e293b;
  --admin-header-text-rgb: 30, 41, 59;
  --admin-header-control-hover: #f3f4f6;
  --admin-header-brand-font: 'DM Sans', 'Ubuntu', sans-serif;
  position: sticky;
  top: 0;
  box-sizing: border-box;
  width: calc(100% + var(--admin-shell-rail-reserve, 0px));
  margin-inline-start: calc(-1 * var(--admin-shell-rail-reserve, 0px));
  height: var(--admin-header-h);
  background: var(--admin-header-bg) center 60% / cover no-repeat;
  z-index: 50;
  opacity: 1;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.18);
  transition: opacity var(--dur-slow) ease;
}

/* Access prompts have no desktop rail, so their header must not reserve its width. */
body.admin-shell-auth-prompt .admin-hero {
  margin-inline-start: 0;
  width: 100%;
}

.admin-page {
  --admin-nav-reveal-duration: 0.24s;
  --admin-nav-reveal-easing: cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  z-index: 10;
  min-height: 100dvh;
}

.admin-header {
  height: var(--admin-header-h);
  padding: 0;
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  padding-inline-start: calc(var(--admin-shell-rail-reserve, 0px) + var(--space-lg));
}

.admin-header-left,
.admin-header-right {
  display: flex;
  align-items: center;
}

.admin-header-left {
  gap: 0;
  min-width: 0;
}
.admin-header-right {
  gap: var(--space-lg);
  margin-inline-start: auto;
}

.admin-wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--admin-header-text);
  font-family: var(--admin-header-brand-font);
  font-size: var(--fs-section);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.admin-wordmark__accent { color: var(--admin-header-accent); }

.admin-header-wordmark { display: inline-flex; flex: 0 0 auto; }
.admin-header-wordmark { text-decoration: none; }
.admin-header-wordmark:hover { opacity: 0.96; }
.admin-header-wordmark:focus-visible {
  outline: 3px solid rgba(var(--admin-header-text-rgb), 0.72);
  outline-offset: 2px;
}

body.admin-shell-auth-prompt .admin-nav-collapse-toggle,
body.admin-shell-auth-prompt .admin-route-context { display: none; }

@media (min-width: 901px) {
  .admin-header-wordmark { display: none; }
}

@media (min-width: 721px) and (max-width: 900px) {
  /* The intermediate rail owns the brand when it opens over the workspace. */
  .admin-header-wordmark { display: none; }
}

.admin-body {
  display: grid;
  grid-template-columns: var(--admin-nav-w) minmax(0, 1fr);
  --admin-shell-rail-reserve: var(--admin-nav-w);
  min-height: 100dvh;
  align-items: start;
  transition: opacity var(--dur-slow) ease;
}

.admin-workspace {
  grid-column: 2;
  min-width: 0;
  /* Fixed tooltips use viewport coordinates, so expose the rail as a safe-area
   * inset rather than allowing wide bubbles to clamp underneath navigation. */
  --tooltip-viewport-inset-left: var(--admin-shell-rail-reserve, 0px);
}

/* Temporary rail reveal uses a fixed viewport veil rather than filtering the
 * workspace box. Filters expand their painted bounds and previously produced
 * a document-level horizontal scrollbar while the compact rail was open. */
.admin-page::after {
  position: fixed;
  z-index: 55;
  inset: 0 0 0 var(--admin-nav-compact-w);
  background: rgba(var(--black-rgb), 0.035);
  backdrop-filter: blur(1.25px);
  content: '';
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--admin-nav-reveal-duration) var(--admin-nav-reveal-easing),
    visibility 0s linear var(--admin-nav-reveal-duration);
  visibility: hidden;
}

body.admin-shell-auth-prompt .admin-body {
  --admin-shell-rail-reserve: 0px;
  grid-template-columns: 0 minmax(0, 1fr);
}
body.admin-shell-auth-prompt .admin-nav { display: none; }
body.admin-shell-auth-prompt .admin-workspace {
  grid-column: 1 / -1;
  width: 100%;
}
body.admin-shell-auth-prompt .admin-header-wordmark { display: inline-flex; }

/* A standalone console opens resolving its session and draws nothing until it
 * knows whether to show the workspace or the access card; without it a
 * signed-in reload flashes the sign-in layout first. The delayed animation
 * shows the page anyway if the console never settles. */
body.admin-shell-resolving .admin-page {
  opacity: 0;
  animation: admin-shell-resolve-timeout 0s linear 4s forwards;
}
@keyframes admin-shell-resolve-timeout { to { opacity: 1; } }

/* The access card every admin console shows when signed out or without
 * access: the tenant and platform shells (admin-auth.js) and Extras Stock. */
.au-signin-btn      { display: inline-flex; align-items: center; gap: 8px; padding: 12px 32px; border: none; border-radius: var(--radius-btn,6px); background: var(--primary); color: var(--card); font-size: var(--fs-body); font-weight: 500; font-family: inherit; cursor: pointer; transition: background .15s; }
.au-screen          { display: flex; align-items: center; justify-content: center; min-height: 60vh; text-align: center; width: 100%; }
.au-card            { background: var(--card); border-radius: var(--radius-card,8px); box-shadow: var(--shadow-lg); padding: 48px clamp(40px, 5vw, 64px); }
.au-card-icon       { font-size: var(--fs-page-title); margin-bottom: 16px; }
.au-card-title      { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.au-card-text       { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.au-card-text--unavail { margin-bottom: 0; }

body.admin-shell-nav-motion-ready .admin-body {
  transition:
    grid-template-columns var(--admin-nav-reveal-duration) var(--admin-nav-reveal-easing),
    opacity var(--dur-slow) ease;
}

body.admin-shell-nav-compact .admin-body {
  --admin-shell-rail-reserve: var(--admin-nav-compact-w);
  grid-template-columns: var(--admin-nav-compact-w) minmax(0, 1fr);
}

/* A visible compact rail stays visually open while only the workspace reserve
 * moves into its pinned position. The compact class is released after this
 * grid transition, so the rail never replays an opening animation. */
body.admin-shell-nav-compact.admin-shell-nav-pinning .admin-body {
  --admin-shell-rail-reserve: var(--admin-nav-w);
  grid-template-columns: var(--admin-nav-w) minmax(0, 1fr);
}

/* ── Navigation trigger and current route context ─────────────── */
.admin-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-inline-end: var(--space-xl);
  padding: 10px;
  border: 1px solid rgba(var(--admin-header-text-rgb), 0.35);
  border-radius: var(--radius-btn);
  background: rgba(var(--admin-header-text-rgb), 0.12);
  color: var(--admin-header-text);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--dur), border-color var(--dur);
}

.admin-route-context {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: min(360px, 34vw);
  margin-inline-start: var(--space-lg);
  color: var(--admin-header-text);
}

.admin-route-context__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-inline-end: var(--space-sm);
  flex: 0 0 auto;
}
.admin-route-context__icon .nav-ic {
  width: 18px;
  height: 18px;
}
.admin-route-context__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}
.admin-route-context__scope,
.admin-route-context__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-route-context__scope {
  color: rgba(var(--admin-header-text-rgb), 0.68);
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.035em;
}
.admin-route-context__label {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
}

.admin-nav-toggle:hover,
body.admin-shell-mobile-drawer-open .admin-nav-toggle {
  background: rgba(var(--admin-header-text-rgb), 0.2);
}

.admin-nav-toggle:focus-visible {
  outline: 3px solid rgba(var(--admin-header-text-rgb), 0.72);
  outline-offset: 2px;
}

.admin-nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
  transition: transform var(--dur), opacity var(--dur);
}

body.admin-shell-mobile-drawer-open .admin-nav-toggle__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.admin-shell-mobile-drawer-open .admin-nav-toggle__line:nth-child(2) { opacity: 0; }
body.admin-shell-mobile-drawer-open .admin-nav-toggle__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Sidebar navigation ───────────────────────────────────────── */
.admin-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  padding: 0;
  background: var(--admin-nav-bg);
  box-shadow: var(--admin-nav-edge-shadow);
  opacity: 1;
  transition:
    width var(--admin-nav-reveal-duration, var(--dur-slow)) var(--admin-nav-reveal-easing, ease-in-out),
    padding var(--dur-slow) ease,
    opacity var(--dur-slow) var(--ease-emphasized),
    transform var(--dur-slow) var(--ease-emphasized),
    visibility 0s linear;
}

.admin-nav gk-tooltip[block] { display: block; }

.admin-nav-shell-header {
  display: flex;
  align-items: center;
  flex: 0 0 var(--admin-header-h);
  min-height: 0;
  padding: 0 4px;
  border-bottom: 1px solid rgba(var(--admin-nav-text-rgb), 0.12);
  background: var(--admin-nav-bg);
}

.admin-nav-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 var(--space-md);
  scrollbar-color: rgba(var(--admin-nav-text-rgb), 0.36) transparent;
  scrollbar-width: thin;
}
.admin-nav-content::-webkit-scrollbar {
  width: 8px;
}
.admin-nav-content::-webkit-scrollbar-track {
  background: transparent;
}
.admin-nav-content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: rgba(var(--admin-nav-text-rgb), 0.36);
  background-clip: padding-box;
}
.admin-nav-content::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--admin-nav-text-rgb), 0.58);
  background-clip: padding-box;
}

/* Account actions belong with global navigation rather than the route header.
 * Keeping this region outside the scrollable route inventory makes sign-out
 * consistently reachable without consuming workspace-header space. */
.admin-nav-footer {
  display: grid;
  flex: 0 0 auto;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid rgba(var(--admin-nav-text-rgb), 0.12);
  background: var(--admin-nav-bg);
}
.admin-nav-footer[hidden] { display: none; }
.admin-nav-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-sm);
}
.admin-nav-account .admin-identity {
  align-items: flex-start;
  flex: 1 1 auto;
}
/* Keep the signed-in identity and compact global actions on one efficient row. */
.admin-nav-footer #oauthUserWrap {
  align-items: center;
  flex-direction: row;
}
.admin-nav-account-tooltip {
  min-width: 36px;
  flex: 0 0 36px;
}
.admin-nav-account-tooltip:has(> .u-hidden) {
  display: none !important;
}
.admin-nav-account-action__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.admin-nav-account .admin-nav-account-action--icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 8px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  font-size: 0;
}
.admin-nav-account .oauth-user-email {
  display: block;
  overflow: hidden;
  max-width: 100%;
  color: var(--admin-nav-label-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-nav-account .btn-signout {
  flex: 0 0 auto;
  border-color: rgba(var(--admin-nav-text-rgb), 0.24);
  color: var(--admin-nav-text);
}
.admin-nav-account .btn-signout:hover {
  background: var(--admin-nav-hover-bg);
  color: var(--admin-nav-hover-text);
}
.admin-nav-account .btn-super-admin {
  border-color: var(--admin-nav-text);
  background: var(--admin-nav-text);
  color: var(--admin-nav-bg);
}
.admin-nav-account .btn-super-admin:hover {
  border-color: var(--admin-nav-hover-bg);
  background: var(--admin-nav-hover-bg);
  color: var(--admin-nav-hover-text);
}
.admin-nav-account :is(.btn-signout, .btn-super-admin):focus-visible {
  outline: 3px solid var(--admin-nav-text);
  outline-offset: 2px;
}
.admin-nav-account .btn-google-signin {
  width: 100%;
  justify-content: center;
  border-color: var(--admin-nav-text);
  background: var(--admin-nav-text);
  color: var(--admin-nav-bg);
}
.admin-nav-account .btn-google-signin:hover {
  border-color: var(--admin-nav-hover-bg);
  background: var(--admin-nav-hover-bg);
  color: var(--admin-nav-hover-text);
}

.admin-nav-wordmark {
  color: var(--admin-nav-text);
  text-decoration: none;
}
.admin-nav-wordmark .admin-wordmark__accent { color: var(--admin-nav-brand-accent); }
.admin-nav-wordmark--product {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  line-height: 1.1;
}
.admin-nav-wordmark__brand {
  color: var(--admin-nav-text);
  font-size: var(--fs-panel);
  font-weight: 700;
}
.admin-nav-wordmark__product {
  max-width: 100%;
  overflow: hidden;
  color: var(--admin-nav-text);
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-nav-wordmark:hover { opacity: 0.96; }
.admin-nav-wordmark:focus-visible {
  outline: 3px solid var(--admin-nav-text);
  outline-offset: 2px;
}

body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-shell-header {
  justify-content: flex-start;
  padding-inline: 4px;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-shell-header .admin-nav-collapse-toggle { margin-inline-end: 0; }
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-wordmark { display: none; }

.admin-nav-collapse-toggle {
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 8px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--admin-nav-text);
  cursor: pointer;
  flex: 0 0 auto;
  margin-inline-end: var(--space-lg);
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    opacity var(--dur-fast) var(--ease);
}

.admin-nav-collapse-toggle:hover {
  background: var(--admin-nav-hover-bg);
  color: var(--admin-nav-text);
}

.admin-nav-collapse-toggle:focus-visible {
  outline: 3px solid var(--admin-nav-text);
  outline-offset: 2px;
}

.admin-nav-collapse-toggle gk-icon {
  width: 18px;
  height: 18px;
}

.admin-nav-item__label {
  display: inline-block;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  opacity: 1;
  text-overflow: ellipsis;
  transform: translateX(0);
  transition:
    max-width var(--dur-slow) var(--ease-emphasized),
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  white-space: normal;
}

body.admin-shell-nav-open .admin-nav-item__label {
  transition-delay: 0s, var(--dur-fast), var(--dur-fast);
}

#adminNavDrawer .admin-nav {
  position: static;
  display: block;
  height: auto;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
#adminNavDrawer .admin-nav-shell-header { display: none; }
#adminNavDrawer .admin-nav-content {
  overflow: visible;
  padding: 0 0 var(--space-md);
}

.admin-nav-brand {
  margin: 0 var(--space-sm) var(--space-lg);
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
  border-bottom: 1px solid rgba(var(--admin-nav-text-rgb), 0.12);
}

.admin-nav-brand__label {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--admin-nav-label-text);
  font-size: var(--fs-meta);
  font-weight: 700;
}

.admin-nav-brand__name {
  display: block;
  overflow-wrap: anywhere;
  color: var(--admin-nav-text);
  font-size: var(--fs-panel);
  line-height: 1.35;
}

.admin-nav-label {
  overflow: hidden;
  max-height: 44px;
  padding: var(--space-3xl) var(--space-lg) var(--space-xs);
  color: var(--admin-nav-label-text);
  font-size: var(--fs-meta);
  font-weight: 400;
  letter-spacing: normal;
  opacity: 1;
  text-transform: none;
  transform: translateX(0);
  transition:
    max-height var(--dur-slow) var(--ease-emphasized),
    padding-block var(--dur-slow) var(--ease-emphasized),
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

body.admin-shell-nav-open .admin-nav-label {
  transition-delay: 0s, 0s, var(--dur-fast), var(--dur-fast);
}

.admin-nav-item.nav-hidden { display: none !important; }
.admin-nav-item {
  position: relative;
  display: flex;
  text-decoration: none;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--admin-nav-item-text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition:
    width var(--dur-slow) var(--ease-emphasized),
    padding var(--dur-slow) var(--ease-emphasized),
    gap var(--dur-slow) var(--ease-emphasized),
    background var(--dur),
    color var(--dur);
}

.admin-nav-item .nav-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--admin-nav-icon-text);
}
.admin-nav-item:hover .nav-ic,
.admin-nav-item.active .nav-ic { color: currentColor; }
.admin-nav-item:hover {
  background: var(--admin-nav-hover-bg);
  color: var(--admin-nav-hover-text);
}
.admin-nav-item.active {
  background: var(--admin-nav-active-bg);
  color: var(--admin-nav-active-text);
  box-shadow: inset 2px 0 0 var(--admin-nav-active-marker);
  font-weight: 600;
}
.admin-nav-item:focus-visible,
.admin-nav-child-link:focus-visible {
  outline: 3px solid var(--admin-nav-text);
  outline-offset: 2px;
}
.admin-nav-item.active::before { display: none; }
.admin-nav-item[aria-controls$="Children"]::after {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: '';
  opacity: 0.78;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur) var(--ease);
}
.admin-nav-item[aria-controls$="Children"] { padding-inline-end: 16px; }
.admin-nav-item[aria-controls$="Children"][aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-2px, -1px);
}
/* An entry with fewer than two pages under it is the page itself (admin-nav-hierarchy.js retires its branch and drops
 * aria-expanded): no chevron, and no room kept for one. */
.admin-nav-item[aria-controls$="Children"]:not([aria-expanded])::after { display: none; }
.admin-nav-item[aria-controls$="Children"]:not([aria-expanded]) { padding-inline-end: 12px; }

body.admin-shell-nav-compact .admin-nav {
  padding: 0;
}
/* Session and scope-switching controls need their labels and identity context.
 * Keep them out of the icon-only rail; they return with the shared open state
 * used by hover, keyboard reveal and pinning. */
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-footer {
  display: none;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-children:not(.admin-nav-children--animated),
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-setup-widget {
  display: none;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-children--animated {
  grid-template-rows: 0fr;
  margin-block: 0;
  border-left-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition-delay: 0s, 0s, 0s, 0s, 0s, var(--dur-slow);
  visibility: hidden;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-label {
  max-height: 0;
  padding-block: 0;
  opacity: 0;
  transform: translateX(-6px);
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item {
  gap: 0;
  width: var(--admin-nav-compact-w);
  min-height: 44px;
  padding: 10px 14px;
  justify-content: center;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item__label {
  flex: 0 0 0;
  white-space: nowrap;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) :is(.admin-nav-item, .admin-nav-collapse-toggle):focus-visible {
  outline-offset: -3px;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item__label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item .count-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item .dirty-dot {
  position: absolute;
  right: 5px;
  bottom: 4px;
  margin: 0;
  box-shadow: 0 0 0 2px var(--admin-nav-bg);
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item[aria-controls$="Children"]::after {
  display: none;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-item.admin-nav-item--locked::after {
  position: absolute;
  top: 2px;
  right: 2px;
  width: auto;
  margin: 0;
  content: '\1f512';
  font-size: var(--fs-meta);
  letter-spacing: normal;
}

/* The compact rail is icon only, so every top-level route needs an icon. An item with no icon of its own gets its initial in
 * the icon slot (admin-shell.js adds an empty .nav-ic--initial span carrying data-initial, so the link's text stays its label).
 * Pages under an item are never drawn in the rail: the collapsed rail shows parent icons only, and the item opens its pages in a
 * flyout beside it (admin-shell.js, .admin-nav-children--flyout below). */
.nav-ic--initial {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.25rem;
  height: 1.25rem;
  border: var(--hairline, 1px) solid currentColor;
  border-radius: var(--radius-control, 6px);
  color: var(--admin-nav-icon-text);
  font-size: var(--fs-meta);
  font-style: normal;
  font-weight: 600;
  line-height: 1;
}
.nav-ic--initial::before { content: attr(data-initial); }
.admin-nav-item:hover .nav-ic--initial,
.admin-nav-item.active .nav-ic--initial { color: currentColor; }
.admin-nav-children .nav-ic--initial { display: none; }

/* The flyout is the item's own list of pages, lifted into the top layer beside the item (a popover, so no clipped or scrolled
 * rail can cut it off). admin-shell.js sets the position; the rest is the same list as in the open rail. */
body.admin-shell-nav-compact:not(.admin-shell-nav-open) #adminNav .admin-nav-children--flyout {
  display: block;
  position: fixed;
  z-index: 70;
  inset: auto;
  box-sizing: border-box;
  min-width: 200px;
  max-width: min(280px, calc(100vw - var(--admin-nav-compact-w) - var(--space-xl)));
  margin: 0;
  padding: var(--space-xs);
  overflow-y: auto;
  border: 1px solid rgba(var(--admin-nav-text-rgb), 0.22);
  border-radius: var(--radius-card);
  background: var(--admin-nav-bg);
  box-shadow: var(--shadow-lg);
  color: var(--admin-nav-text);
  grid-template-rows: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
  visibility: visible;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) #adminNav .admin-nav-children--flyout .admin-nav-children__inner { overflow: visible; }
body.admin-shell-nav-compact:not(.admin-shell-nav-open) #adminNav .admin-nav-children--flyout .admin-nav-item {
  gap: 0;
  width: 100%;
  min-height: 32px;
  padding: 7px var(--space-sm);
  justify-content: flex-start;
}
body.admin-shell-nav-compact:not(.admin-shell-nav-open) #adminNav .admin-nav-children--flyout .admin-nav-item__label {
  flex: 1 1 auto;
  max-width: 100%;
  opacity: 1;
  transform: none;
}

/* Desktop rails own their controls above the full-bleed fixed header. */
@media (min-width: 721px) {
  /* A definite open width at every desktop size. Collapsing at the 900px
   * breakpoint also drops the wide-screen open rule below, and a rail left at
   * its automatic width snaps to the icon rail instead of animating to it. */
  .admin-nav { z-index: 60; width: var(--admin-nav-w); }

  body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav {
    width: var(--admin-nav-compact-w);
  }

  /* Keep the compact rail's narrow chrome quiet without turning its route
   * inventory into a clipped region. Wheel, touchpad and focus scrolling keep
   * the full route list reachable on constrained-height desktops. */
  body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-content::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  /* Pinning an already revealed rail keeps its existing geometry while the
   * workspace reserve catches up. */
  body.admin-shell-nav-pinning .admin-nav { transition: none; }
}

/* Hover, keyboard reveal and the pinned state share one visual-open contract.
 * Compact preference only controls workspace reservation and the toggle
 * direction; it cannot give the rail a second, subtly different open layout. */
/* From the tablet rail up, opening the rail is an overlay with a veil; the workspace never moves. */
@media (min-width: 721px) {
  body.admin-shell-nav-open .admin-nav {
    width: var(--admin-nav-w);
  }

  /* A temporary hover/keyboard reveal gently recedes the workspace without
   * changing its layout or painted bounds. Pinning restores it immediately. */
  body.admin-shell-nav-compact.admin-shell-nav-open:not(.admin-shell-nav-pinning) .admin-page::after {
    opacity: 1;
    transition-delay: 0s, 0s;
    visibility: visible;
  }
}

.admin-nav-item.admin-nav-item--locked {
  color: var(--admin-nav-locked-text);
  cursor: not-allowed;
}
.admin-nav-item.admin-nav-item--locked:hover,
.admin-nav-item.admin-nav-item--locked.active {
  background: transparent;
  box-shadow: none;
  color: var(--admin-nav-locked-text);
}
.admin-nav-item.admin-nav-item--locked::after {
  content: 'Locked';
  margin-left: auto;
  color: var(--admin-nav-locked-label-text);
  font-size: var(--fs-meta);
  font-weight: 700;
}

.admin-nav-item .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--card);
  font-size: var(--fs-meta);
  font-weight: 700;
}

.admin-nav-item .dirty-dot {
  display: none;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--highlight);
}
.admin-nav-item.is-dirty .dirty-dot { display: inline-block; }

.admin-nav-children[hidden] { display: none; }
.admin-nav-children {
  margin: var(--space-3xs) var(--space-sm) var(--space-xs) var(--space-2xl);
  padding-left: var(--space-2xs);
  border-left: 1px solid rgba(var(--admin-nav-text-rgb), 0.22);
}
.admin-nav-children--animated {
  display: grid;
  overflow: hidden;
  /* Siblings (two __inner blocks) share the fold: every row collapses, so none leaves a blank band under the item. */
  grid-template-rows: 0fr;
  grid-auto-rows: 0fr;
  margin-block: 0;
  border-left-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transform-origin: top;
  transition:
    grid-template-rows var(--dur-slow) var(--ease-emphasized),
    margin-block var(--dur-slow) var(--ease-emphasized),
    border-color var(--dur) var(--ease),
    opacity var(--dur) var(--ease),
    transform var(--dur-slow) var(--ease-emphasized),
    visibility 0s linear var(--dur-slow);
  visibility: hidden;
}
.admin-nav-children--animated.is-expanded {
  grid-template-rows: 1fr;
  grid-auto-rows: 1fr;
  margin-block: var(--space-3xs) var(--space-xs);
  border-left-color: rgba(var(--admin-nav-text-rgb), 0.22);
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
  visibility: visible;
}
.admin-nav-children__inner {
  overflow: hidden;
  min-height: 0;
}
.admin-nav-child-group + .admin-nav-child-group { margin-top: 2px; }
.admin-nav-child-link {
  display: block;
  min-height: 32px;
  padding: 7px var(--space-sm);
  border-radius: 4px;
  color: var(--admin-nav-child-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: none;
}
.admin-nav-child-link--with-icon {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.admin-nav-child-icon {
  color: var(--admin-nav-child-text);
  --icon-size: 15px;
}
.admin-nav-child-link--with-icon:hover .admin-nav-child-icon,
.admin-nav-child-link--with-icon.active .admin-nav-child-icon,
.admin-nav-child-link--with-icon.is-ancestor .admin-nav-child-icon { color: currentColor; }
.admin-nav-child-link:hover {
  background: var(--admin-nav-hover-bg);
  color: var(--admin-nav-hover-text);
}
.admin-nav-child-link.active {
  background: var(--admin-nav-active-bg);
  color: var(--admin-nav-child-active-text);
  font-weight: 600;
}
.admin-nav-child-link.is-ancestor {
  color: var(--admin-nav-ancestor-text);
}
/* A routed tab button (it keeps .admin-nav-item for tab switching) that sits in
   a child list reads as a child link: same size, padding and active treatment
   as the plain links beside it, not as a second top-level entry. */
.admin-nav-children .admin-nav-item.admin-nav-child-link {
  display: block;
  gap: 0;
  min-height: 32px;
  padding: 7px var(--space-sm);
  border-radius: 4px;
  color: var(--admin-nav-child-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: none;
}
.admin-nav-children .admin-nav-item.admin-nav-child-link:hover {
  color: var(--admin-nav-hover-text);
}
.admin-nav-children .admin-nav-item.admin-nav-child-link.active {
  color: var(--admin-nav-child-active-text);
  font-weight: 600;
}
.admin-nav-children .admin-nav-item--nested {
  min-height: 34px;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: 4px;
  color: var(--admin-nav-child-text);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: none;
}
.admin-nav-children .admin-nav-item--nested .nav-ic {
  width: 15px;
  height: 15px;
  color: currentColor;
}
.admin-nav-children .admin-nav-item--nested.active {
  color: var(--admin-nav-child-active-text);
  box-shadow: none;
}

/* ── Content canvas ───────────────────────────────────────────── */
/* A docked panel (GkAdminShellPieces.bindDock, gk-sheet dock) sets --admin-dock-bottom or --admin-dock-right to the room it takes. */
.admin-main {
  min-width: 0;
  width: 100%;
  padding: var(--admin-page-gutter);
  padding-block-end: calc(var(--admin-page-gutter) + var(--admin-dock-bottom, 0px));
  padding-inline-end: calc(var(--admin-page-gutter) + var(--admin-dock-right, 0px));
  transition: padding var(--dur-slow) var(--ease-emphasized), opacity var(--dur) ease;
}
.admin-main .panel {
  display: none;
  padding: var(--admin-panel-padding, 0);
  background: transparent;
  box-shadow: none;
  animation: fadeIn var(--dur) ease;
}
.admin-main .panel.active { display: block; }
/* Content width (principle 14, the wide canvas): a page is at most --admin-content-max and sits at the left edge, so a
 * 1920px screen is not one stretched row. A wide data table or the Tee Sheet opts out with .admin-page--full (or
 * data-admin-width="full") on its panel; forms and settings take the narrower --admin-form-max in their own recipes. */
.admin-main .panel { max-width: var(--admin-content-max); }
.admin-main .panel:is(.admin-page--full, [data-admin-width="full"]) { max-width: none; }

/* ── Shared topbar account controls ───────────────────────────── */
.btn-google-signin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-2xl);
  border: 1px solid var(--admin-header-text);
  border-radius: var(--radius-btn,6px);
  background: var(--admin-header-text);
  color: var(--admin-header-bg);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur);
}
.btn-google-signin:hover {
  background: var(--admin-header-control-hover);
  border-color: var(--admin-header-control-hover);
}
.oauth-user-email {
  color: rgba(var(--admin-header-text-rgb), 0.7);
  font-size: 13px;
}
.btn-signout {
  padding: var(--space-xs) var(--space-lg);
  border: 1px solid rgba(var(--admin-header-text-rgb), 0.2);
  border-radius: var(--radius-btn,6px);
  background: transparent;
  color: rgba(var(--admin-header-text-rgb), 0.7);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.btn-signout:hover {
  background: rgba(var(--admin-header-text-rgb), 0.1);
  color: var(--admin-header-text);
}
.btn-super-admin {
  padding: var(--space-xs) var(--space-lg);
  border: 1px solid var(--admin-header-text);
  border-radius: var(--radius-btn,6px);
  background: var(--admin-header-text);
  color: var(--admin-header-bg);
  font-size: 12px;
  font-weight: 600;
  line-height: normal;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-super-admin:hover {
  background: var(--admin-header-control-hover);
  border-color: var(--admin-header-control-hover);
  color: var(--admin-header-bg);
}
.btn-super-admin:focus-visible {
  outline: 3px solid rgba(var(--admin-header-text-rgb), 0.72);
  outline-offset: 2px;
}
#oauthLoginWrap,
#oauthUserWrap {
  display: flex;
  align-items: center;
}
#oauthUserWrap { gap: var(--space-sm); }

.admin-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.admin-identity .oauth-user-email { line-height: 1.2; }
/* The initial hand-off is deliberately brisk; normal navigation motion keeps
 * the shared duration tokens once this short-lived class is removed. */
body.admin-shell-revealing .admin-hero,
body.admin-shell-revealing .admin-body {
  transition-duration: min(100ms, var(--dur));
}

.admin-site-switcher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(var(--admin-header-text-rgb), 0.72);
  font-size: 12px;
  white-space: nowrap;
}
.admin-site-switcher__label { font-weight: 600; }
.admin-site-switcher select {
  max-width: min(300px, 28vw);
  min-width: 170px;
  padding: var(--space-xs) var(--space-2xl) var(--space-xs) var(--space-sm);
  border: 1px solid rgba(var(--admin-header-text-rgb), 0.32);
  border-radius: var(--radius-btn,6px);
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-header-text);
  font: inherit;
}
.admin-site-switcher select:focus-visible {
  outline: 2px solid var(--admin-header-accent);
  outline-offset: 2px;
}
.admin-site-switcher option { color: var(--golfkit-primary, #0f172a); }
/* A closed venue is listed but cannot be chosen: show it muted, not like an open one. */
.admin-site-switcher option:disabled { color: var(--text-muted); }

/* ── Responsive shell hand-off ───────────────────────────────── */
@media (max-width: 720px) {
  .admin-header-inner {
    padding-inline: var(--space-2xl);
    padding-inline-start: var(--space-2xl);
  }

  /* Phones use the drawer. Constrained desktops keep the compact rail, which
   * remains discoverable through hover and keyboard focus. */
  body.admin-shell-auth-prompt .admin-nav-toggle { display: none; }
  .admin-nav-toggle {
    display: inline-flex;
    margin-inline-start: 0;
  }
  .admin-nav-collapse-toggle,
  .admin-nav-shell-header { display: none; }
  /* The drawer carries the GolfKit wordmark at this breakpoint, leaving the
   * fixed header focused on the menu trigger and current route. */
  .admin-header-wordmark { display: none; }
  .admin-header-sub,
  .admin-header-divider { display: none; }
  .admin-route-context {
    max-width: min(260px, 30vw);
    margin-inline-start: var(--space-lg);
  }
  .admin-site-switcher__label { display: none; }
  .admin-site-switcher select { min-width: 0; max-width: 42vw; }

  .admin-body,
  body.admin-shell-nav-compact .admin-body {
    --admin-shell-rail-reserve: 0px;
    grid-template-columns: 0 minmax(0, 1fr);
  }

  @media (max-width: 720px) {
  .admin-body,
  body.admin-shell-nav-compact .admin-body { grid-template-columns: 0 minmax(0, 1fr); }
  .admin-main { padding: var(--space-lg); }
  }

  .admin-nav-drawer {
    --gk-drawer-w: min(288px, calc(100vw - 40px));
    --gk-drawer-radius: 0px;
  }
  #adminNavDrawer {
    /* The drawer is the same navigation destination as the desktop rail. */
    --gk-drawer-surface: var(--admin-nav-bg);
    --gk-drawer-bg: var(--admin-nav-bg);
    --gk-drawer-text: var(--admin-nav-text);
    --gk-drawer-muted-text: var(--admin-nav-label-text);
    --gk-drawer-border: rgba(var(--admin-nav-text-rgb), 0.16);
    --gk-drawer-hover: var(--admin-nav-hover-bg);
    --admin-drawer-active-bg: var(--admin-nav-active-bg);
    --admin-drawer-active-text: var(--admin-nav-active-text);
    --admin-drawer-child-active-bg: var(--admin-nav-active-bg);
    --admin-drawer-child-active-text: var(--admin-nav-child-active-text);
  }
  #adminBody > .admin-nav {
    width: var(--admin-nav-compact-w);
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    transition:
      padding var(--dur-slow) ease,
      opacity var(--dur-slow) var(--ease-emphasized),
      transform var(--dur-slow) var(--ease-emphasized),
      visibility 0s linear var(--dur-slow);
    visibility: hidden;
  }
  #adminNavDrawer .admin-nav-footer {
    margin-top: var(--space-md);
    padding: var(--space-lg) var(--space-lg) var(--space-2xs);
    border-top-color: var(--gk-drawer-border);
    background: transparent;
  }
  #adminNavDrawer .admin-nav-account {
    flex-direction: column;
    align-items: stretch;
  }
  #adminNavDrawer .admin-nav-account-tooltip {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }
  #adminNavDrawer .admin-nav-account .admin-nav-account-action--icon {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    height: auto;
    padding: var(--space-sm) var(--space-lg);
    justify-content: center;
    gap: var(--space-sm);
    font-size: inherit;
  }
  #adminNavDrawer .oauth-user-email {
    display: block;
    overflow: hidden;
    max-width: 100%;
    margin-right: 0;
    color: var(--gk-drawer-muted-text);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #adminNavDrawer .admin-identity { align-items: flex-start; }
  #adminNavDrawer .btn-signout {
    border-color: var(--gk-drawer-border);
    color: var(--gk-drawer-text);
    text-align: center;
  }
  #adminNavDrawer .btn-signout:hover {
    background: var(--gk-drawer-hover);
    color: var(--gk-drawer-text);
  }
  #adminNavDrawer .btn-super-admin {
    border-color: var(--gk-drawer-text);
    background: var(--gk-drawer-text);
    color: var(--gk-drawer-surface);
    text-align: center;
  }
  #adminNavDrawer .btn-super-admin:hover {
    background: var(--gk-drawer-hover);
    border-color: var(--gk-drawer-hover);
    color: var(--gk-drawer-text);
  }
  #adminNavDrawer .admin-nav {
    display: flex;
    min-height: 100%;
    padding: 0;
  }
  #adminNavDrawer .admin-nav-brand { border-bottom-color: var(--gk-drawer-border); }
  #adminNavDrawer .admin-nav-brand__label { color: var(--gk-drawer-muted-text); }
  #adminNavDrawer .admin-nav-brand__name { color: var(--gk-drawer-text); }
  #adminNavDrawer .admin-nav-label { color: var(--gk-drawer-muted-text); }
  #adminNavDrawer .admin-nav-item,
  #adminNavDrawer .admin-nav-child-link { color: var(--gk-drawer-text); }
  #adminNavDrawer .admin-nav-item .nav-ic { color: var(--gk-drawer-muted-text); }
  #adminNavDrawer .admin-nav-item.active .nav-ic { color: currentColor; }
  #adminNavDrawer .admin-nav-item.admin-nav-item--locked::after {
    color: var(--gk-drawer-muted-text);
  }
  #adminNavDrawer .admin-nav-item:hover,
  #adminNavDrawer .admin-nav-child-link:hover {
    background: var(--gk-drawer-hover);
    color: var(--gk-drawer-text);
  }
  /* The same sidebar is relocated here on narrow viewports, so preserve its
   * selection hierarchy instead of promoting the current route to a solid
   * brand-colour button. */
  #adminNavDrawer .admin-nav-item.active {
    background: var(--admin-drawer-active-bg);
    color: var(--admin-drawer-active-text);
  }
  #adminNavDrawer .admin-nav-child-link.active {
    background: var(--admin-drawer-child-active-bg);
    color: var(--admin-drawer-child-active-text);
  }
  #adminNavDrawer .admin-nav-children .admin-nav-item--nested.active {
    background: var(--admin-drawer-child-active-bg);
    color: var(--admin-drawer-child-active-text);
  }
  @media (max-width: 720px) {
    .admin-main .panel { padding: var(--space-4xl) var(--space-3xl); }
  }
}

@media (max-width: 720px) {
  .admin-main { padding: 0; }
  /* The phone panel fills the screen under the header and keeps the desktop's warm grey canvas, so a card keeps its edges. */
  .admin-main .panel {
    min-height: calc(100dvh - var(--admin-header-h));
    padding: var(--space-2xl) var(--space-xl);
    --admin-save-bar-bleed: var(--space-xl);
  }
}

@media (max-width: 720px) {
  .admin-header-inner {
    padding-inline: var(--space-2xl);
    gap: var(--space-xs);
  }
  .admin-wordmark { font-size: var(--fs-panel); }
  .admin-nav-toggle {
    width: 44px;
    height: 44px;
    margin-inline-end: var(--space-sm);
  }
  .admin-route-context {
    max-width: none;
    margin-inline-start: var(--space-lg);
    padding-inline-start: var(--space-sm);
    flex: 1 1 auto;
  }
  .admin-route-context__icon { display: none; }
  .admin-route-context__label { font-size: 12px; }
  .admin-site-switcher select { max-width: 34vw; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-hero,
  .admin-body,
  .admin-workspace,
  .admin-page::after,
  .admin-main,
  .admin-nav,
  .admin-nav-children--animated,
  .admin-nav-label,
  .admin-nav-item__label,
  .admin-nav-item[aria-controls$="Children"]::after,
  .admin-nav-collapse-toggle,
  .admin-nav-toggle__line { transition: none !important; }
  .admin-main .panel { animation: none !important; }
}

@media (pointer: coarse), (max-width: 720px) {
  .admin-nav-item,
  .admin-nav-child-link,
  .admin-nav-children .admin-nav-item.admin-nav-child-link,
  .admin-nav-children .admin-nav-item--nested {
    min-height: 44px;
  }
}

@media (pointer: coarse) {
  .admin-nav-shell-header,
  body.admin-shell-nav-compact:not(.admin-shell-nav-open) .admin-nav-shell-header {
    padding-inline: 0;
  }
  .admin-nav-collapse-toggle,
  .admin-nav-account .admin-nav-account-action--icon {
    width: 44px;
    height: 44px;
  }
  .admin-nav-account-tooltip {
    min-width: 44px;
    flex-basis: 44px;
  }
  .admin-site-switcher select { min-height: 44px; }
}

/* The top bar names where you are, on one line: "<Venue> / <Page>" (a sub-page reads "<Venue> · <Section> / <Page>"). The page's own
 * title is still the H1 in the content; this is the breadcrumb, so a single-venue club always sees which venue it is in. The icon is
 * not drawn. admin-shell.js keeps the text up to date. */
.admin-route-context {
  display: flex;
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  margin-inline-start: var(--space-lg);
  padding-inline-start: 0;
  color: var(--text);
}
.admin-route-context__icon { display: none; }
.admin-route-context__copy { flex-direction: row; align-items: baseline; min-width: 0; line-height: 1.3; }
.admin-route-context__scope,
.admin-route-context__label { margin: 0; font-size: var(--fs-body, 14px); letter-spacing: 0; }
.admin-route-context__scope { flex: 0 1 auto; color: var(--text-muted); font-weight: 400; }
.admin-route-context__scope[hidden] { display: none; }
.admin-route-context__scope::after { content: "/"; margin-inline: var(--space-sm); }
.admin-route-context__sep { margin-inline: var(--space-sm); }
.admin-route-context__link { color: inherit; text-decoration: none; }
.admin-route-context__link:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .admin-route-context__scope [data-crumb-root],
  .admin-route-context__scope [data-crumb-root] + .admin-route-context__sep { display: none; }
}
.admin-route-context__link:focus-visible { outline: var(--focus-outline-width) solid var(--focus-ring-color); outline-offset: var(--focus-outline-offset); }
.admin-route-context__label { flex: 0 1 auto; color: var(--text); font-weight: var(--fw-ui, 600); }
/* One breadcrumb rule in both consoles (admin-shell.js sets data-crumbs): the venue (venue console only), the parent page, then the current
 * page, which is the label. On a phone the first line is a link back to the parent (the venue on a page with no parent) and the
 * current page is drawn in full, wrapping rather than being cut. */
@media (max-width: 720px) {
  .admin-route-context[data-crumbs] .admin-route-context__copy { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.25; }
  .admin-route-context[data-crumbs] .admin-route-context__scope { max-width: 100%; font-size: var(--fs-meta); }
  .admin-route-context[data-crumbs] .admin-route-context__scope::after { content: none; }
  .admin-route-context[data-crumbs] .admin-route-context__scope[data-has-parent] > :not([data-crumb-back]) { display: none; }
  .admin-route-context[data-crumbs] [data-crumb-back] { position: relative; }
  .admin-route-context[data-crumbs] [data-crumb-back]::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: var(--space-xs);
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    content: "";
    transform: rotate(45deg);
  }
  /* The link is as tall as the header's two lines, so it is a full touch target. */
  .admin-route-context[data-crumbs] [data-crumb-back]::after { position: absolute; inset: -14px -8px; content: ""; }
  .admin-route-context[data-crumbs] .admin-route-context__label { overflow: visible; font-size: var(--fs-body, 14px); text-overflow: clip; white-space: normal; }
}

/* Settings sits apart from daily work, at the foot of the rail. gk-admin-nav moves a section marked
 * admin-nav-section--pinned out of the scrolling list into .admin-nav-pinned, so when a long section is open the list scrolls and
 * Settings stays where it is. Both shells use it. */
#adminNav .admin-nav-content { display: flex; flex-direction: column; }
#adminNav .admin-nav-content > * { flex: none; }
.admin-nav-section--pinned {
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(var(--admin-nav-text-rgb), 0.12);
}
.admin-nav-pinned {
  flex: 0 0 auto;
  max-height: 45%;
  overflow-y: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(var(--admin-nav-text-rgb), 0.12);
  background: var(--admin-nav-bg);
}
.admin-nav-pinned > .admin-nav-section--pinned { margin-top: 0; padding-top: 0; border-top: 0; }
#adminNavDrawer .admin-nav-section--pinned,
#adminNavDrawer .admin-nav-pinned { border-top-color: var(--gk-drawer-border); }
#adminNavDrawer .admin-nav-pinned { max-height: none; overflow: visible; background: transparent; }

/* A list that is longer than the rail shows it: a soft edge at the top or foot while there is more to scroll to (the edge is
 * painted on the list's own scroll positions, so it appears only when the list overflows, and never in the drawer). */
.admin-nav-content {
  background:
    linear-gradient(var(--admin-nav-bg) 30%, transparent) center top / 100% 24px no-repeat local,
    linear-gradient(transparent, var(--admin-nav-bg) 70%) center bottom / 100% 24px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(var(--admin-nav-text-rgb), 0.2), transparent) center top / 100% 10px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(var(--admin-nav-text-rgb), 0.2), transparent) center bottom / 100% 10px no-repeat scroll;
  background-color: var(--admin-nav-bg);
}
#adminNavDrawer .admin-nav-content { background: none; }
