/*
 * Organizer / attendee sidebar (components/nb/side-nav.blade.php).
 * PassOut-dashboard-user design: a black ticket (--sn-* below), cream text, a dotted
 * perforation with notches under who's signed in, the current page as a cream pill
 * with a rust icon. Orange TEXT on black uses --acc-ink (contrast-gate).
 *
 *  ≥1024px   260px, or 72px icons-only when collapsed (html.nav-collapsed)
 *  769-1023  always the 72px icon rail (keeps the two-column page layout)
 *  ≤768px    hidden - the bottom tab bar takes over (nb-mobile.css)
 */

/* ------------------------------------------------------------------ frame */
.nb .sidebar.sn {
  /* UI fix C: no inner scroll. The sidebar is as tall as its menu. nb-sidenav.js adds
     .is-sticky when the whole menu fits under the header (then it stays in view); when it
     doesn't, it scrolls with the page instead of inside itself - so no item, and never the
     current one, is cut off. Without JS it simply scrolls with the page. */
  position: static; top: calc(var(--hdr-h, 64px) + 16px); align-self: start;
  height: auto; min-height: 0;
  display: flex; flex-direction: column; overflow: visible;
  padding: 14px; border: 0; border-radius: 22px;
  --sn-bg: #141414; --sn-hover: #1E1E1E; --sn-edge: #2A2A2A; --sn-text: #D8CEC6; --sn-mut: #9C928A; --sn-label: #7D746D;
  background: var(--sn-bg); color: var(--cream); box-shadow: none;
}
.nb .sn-top { flex: none; }
.nb .sn-nav { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nb .sn-scroll { flex: none; margin: 0 -6px; padding: 0 6px 8px; overflow: visible; }
.nb .sidebar.sn.is-sticky { position: sticky; max-height: calc(100vh - var(--hdr-h, 64px) - 24px); }
.nb .sn-bottom { flex: none; border-top: 1px solid var(--sn-edge); margin-top: 4px; padding-top: 4px; }
.nb .sn ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* O-37 is covered by the rule above (UI fix C): the sidebar never scrolls inside itself. */

/* ------------------------------------------------------------------ who's signed in */
.nb .sn-profile { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px; border-radius: 14px; color: var(--cream); text-decoration: none; }
.nb .sn-profile:hover { background: var(--sn-hover); }
.nb .sn-profile:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.nb .sn-avatar { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--acc); color: var(--ink); font-family: var(--fd); font-weight: 900; font-size: 17px; letter-spacing: -.02em; }
.nb .sn-profile__text { min-width: 0; display: grid; gap: 1px; }
.nb .sn-profile__text strong { font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb .sn-profile__text small { font-size: 12.5px; color: var(--sn-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb .sn-chip { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
.nb .sn .sn-chip.tone-ok { background: #16321F; color: #8FD6A6; }
.nb .sn .sn-chip.tone-warn { background: #3A2A12; color: #F2C178; }
.nb .sn-create, .nb .sn-create.b-sec { width: 100%; margin: 10px 0 4px; min-height: 44px; gap: 8px; justify-content: center; border: 0; border-radius: 999px; background: var(--acc); color: var(--ink); font-weight: 700; }
.nb .sn-create:hover { background: var(--cream); color: var(--ink); }

/* ------------------------------------------------------------------ groups + items */
.nb .sn-group { margin-top: 14px; }
.nb .sn-scroll .sn-group:first-child { margin-top: 12px; }
.nb .sn-group--pinned { margin-top: 8px; }
.nb .sn-group__label { padding: 6px 12px 8px; margin: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--sn-label); }
.nb .sn-link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none;
  color: var(--sn-text, var(--ink-2)); font: inherit; font-size: 15px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.nb .sn-link svg { flex: none; }
.nb .sn-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Hover: a neutral wash only - never the active look. */
.nb .sn .sn-link:hover { background: var(--sn-hover); color: #fff; }
.nb .sn .sn-link:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
/* The one current page: brand tint, brand text + icon, 600, 3px accent bar. */
.nb .sn .sn-link.is-active, .nb .sn .sn-link.is-active:hover { background: var(--cream); color: var(--ink); font-weight: 700; }
.nb .sn .sn-link.is-active svg { color: var(--rust); }
.nb .sn .sn-link[data-logout] { color: #F09A84; }

/* Badges: a small count pill; warn = needs attention, err only for a real failure. */
.nb .sn-badge { flex: none; margin-left: auto; padding: 2px 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1.4; }
.nb .sn-badge.tone-info { background: var(--acc-w); color: var(--acc-d); }
.nb .sn-badge.tone-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.nb .sn-badge.tone-err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }

.nb .sn .sn-collapse { color: var(--sn-mut); }
.nb .sn-collapse__open { display: none; }

/* ------------------------------------------------------------------ collapsed / rail */
@media (min-width: 1024px) {
  html.nav-collapsed .nb .page-grid:has(> .sn) { grid-template-columns: 72px minmax(0, 1fr); }
}
@media (min-width: 769px) and (max-width: 1023px) {
  /* Tablets: the icon rail keeps the two-column layout (the full sidebar used to
     stack above the content here). The collapse toggle isn't needed. */
  .nb .page-grid:has(> .sn) { grid-template-columns: 72px minmax(0, 1fr); gap: 20px; }
  .nb .sn-collapse { display: none; }
}
@media (min-width: 1024px) { html.nav-collapsed .nb .sn { --sn-rail: 1; } }
@media (min-width: 769px) and (max-width: 1023px) { .nb .sn { --sn-rail: 1; } }

/* Rail look (applies when either rule above is on) */
@media (min-width: 769px) and (max-width: 1023px) { .nb .sn { padding: 12px 8px; } .nb .sn .sn-label, .nb .sn .sn-profile__text, .nb .sn .sn-group__label { display: none; } .nb .sn .sn-link, .nb .sn .sn-profile, .nb .sn .sn-create { justify-content: center; padding: 0; } .nb .sn .sn-profile { min-height: 48px; } .nb .sn .sn-create { width: 44px; margin-left: auto; margin-right: auto; } .nb .sn .sn-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sn-edge); } .nb .sn .sn-scroll .sn-group:first-child { border-top: 0; } .nb .sn .sn-badge { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; padding: 0; font-size: 0; } .nb .sn .sn-badge .sr-only { font-size: 12px; } .nb .sn .sn-link.is-active::before { top: 10px; bottom: 10px; } }
@media (min-width: 1024px) { html.nav-collapsed .nb .sn { padding: 12px 8px; } html.nav-collapsed .nb .sn .sn-label, html.nav-collapsed .nb .sn .sn-profile__text, html.nav-collapsed .nb .sn .sn-group__label { display: none; } html.nav-collapsed .nb .sn .sn-link, html.nav-collapsed .nb .sn .sn-profile, html.nav-collapsed .nb .sn .sn-create { justify-content: center; padding: 0; } html.nav-collapsed .nb .sn .sn-profile { min-height: 48px; } html.nav-collapsed .nb .sn .sn-create { width: 44px; margin-left: auto; margin-right: auto; } html.nav-collapsed .nb .sn .sn-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sn-edge); } html.nav-collapsed .nb .sn .sn-scroll .sn-group:first-child { border-top: 0; } html.nav-collapsed .nb .sn .sn-badge { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; padding: 0; font-size: 0; } html.nav-collapsed .nb .sn .sn-badge .sr-only { font-size: 12px; } html.nav-collapsed .nb .sn .sn-link.is-active::before { top: 10px; bottom: 10px; }
  html.nav-collapsed .nb .sn-collapse__open { display: block; } html.nav-collapsed .nb .sn-collapse__close { display: none; } }

/* Tooltip for the icon rail (positioned by nb-sidenav.js so the scroll area can't clip it). */
.nb-tip { position: fixed; z-index: var(--z-tip); padding: 6px 10px; border-radius: var(--r-sm); background: var(--ink); color: var(--surface); font: 500 13px/1.3 var(--ff); white-space: nowrap; pointer-events: none; transform: translateY(-50%); }

/* Phone sheet (mobile-nav): group labels and the current item, same states as the sidebar. */
.nb .m-sheet__group { padding: 14px 12px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); }
.nb .m-sheet__link.is-active { background: var(--acc-w); color: var(--acc-d); font-weight: 600; }
.nb .m-sheet__link.is-active svg { color: var(--acc-d); }
.nb .m-sheet__link .sn-badge { margin-left: auto; }
.nb .m-sheet__head .sn-profile { flex: 1; min-width: 0; padding: 4px 0; }
.nb .m-sheet__head .sn-profile:hover { background: none; }
/* C-47: the phone sheet is light - the sidebar's white name / faint number were unreadable */
.nb .m-sheet__head .sn-profile__text strong { color: var(--ink); }
.nb .m-sheet__head .sn-profile__text small { color: var(--ink-2, #5E5650); }

@media (prefers-reduced-motion: reduce) { .nb .sn * { transition: none !important; } }

/* Rail badge dot: solid colour (the pale pill tint is invisible as a dot). */
@media (min-width: 769px) and (max-width: 1023px) {
  .nb .sn .sn-badge.tone-info { background: var(--acc); } .nb .sn .sn-badge.tone-warn { background: var(--warn); } .nb .sn .sn-badge.tone-err { background: var(--err); }
}
@media (min-width: 1024px) {
  html.nav-collapsed .nb .sn .sn-badge.tone-info { background: var(--acc); } html.nav-collapsed .nb .sn .sn-badge.tone-warn { background: var(--warn); } html.nav-collapsed .nb .sn .sn-badge.tone-err { background: var(--err); }
}

/* Attendee <-> organizer switch under who's signed in (same mobile on both sides). */
.nb .sn-switch { margin: 2px 0 0; }
.nb .sn .sn-switch__btn { color: var(--acc-ink); font-weight: 600; }
.nb .m-sheet__head .sn-switch { display: none; } /* phone sheet: shown as a menu row instead */
.nb .m-sheet__switch { margin: 0; }
.nb .m-sheet__switch .m-sheet__link { width: 100%; color: var(--acc-d); font-weight: 600; }

/* ------------------------------------------------------------------ dark ticket extras */
/* Badges on black: a solid orange count pill (warn / err keep their own colour). */
.nb .sn .sn-badge { min-width: 22px; text-align: center; }
.nb .sn .sn-badge.tone-info { background: var(--acc); color: var(--ink); }
.nb .sn .sn-badge.tone-warn { background: #F2C178; color: var(--ink); }
.nb .sn .sn-badge.tone-err { background: #F09A84; color: var(--ink); }
.nb .sn .sn-link.is-active .sn-badge { background: var(--acc); color: var(--ink); }
/* Perforation under who's signed in: dotted line, a notch (page colour) at each edge. */
.nb .sn-perf { position: relative; flex: none; height: 18px; margin: 6px -14px 0; }
.nb .sn-perf::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; border-top: 2px dotted #4A4440; }
.nb .sn-perf::after, .nb .sn-perf i { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); transform: translateY(-50%); }
.nb .sn-perf::after { left: -9px; }
.nb .sn-perf i { right: -9px; }
@media (min-width: 769px) and (max-width: 1023px) { .nb .sn .sn-perf { margin-left: -8px; margin-right: -8px; } .nb .sn .sn-perf::before { left: 14px; right: 14px; } }
@media (min-width: 1024px) { html.nav-collapsed .nb .sn .sn-perf { margin-left: -8px; margin-right: -8px; } html.nav-collapsed .nb .sn .sn-perf::before { left: 14px; right: 14px; } }
.nb-tip { background: var(--cream); color: var(--ink); box-shadow: 0 4px 16px rgba(0,0,0,.18); }

/* Phone section chips (side-nav .sn-chips): one swipeable row above the page content. */
.nb .sn-chips { display: none; }
@media (max-width: 768px) {
  /* position: relative keeps the chips' .sr-only text inside the scroller (it pushed the page to 458px wide) */
  .nb .page-grid > .sn-chips { position: relative; display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--pad, 16px)) 4px; padding: 0 var(--pad, 16px) 4px; scrollbar-width: none; }
  .nb .sn-chips::-webkit-scrollbar { display: none; }
  .nb .sn-chips a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; /* C-48 */ padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
  .nb .sn-chips a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--cream); }
  .nb .sn-chips__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--acc); color: var(--ink); font-size: 12px; line-height: 20px; text-align: center; }
}
/* real profile picture in the sidebar / phone sheet (App\Support\Avatar) */
.nb .sn-avatar.has-photo { overflow: hidden; padding: 0; background: var(--line-2); }
.nb .sn-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Neutral badge: a plain count (followers) - grey, never the orange/amber "needs attention"
   look; in the collapsed sidebar it shows no dot at all. */
.nb .sn-badge.tone-neutral { background: var(--line-2); color: var(--ink-2); }
.nb .sn .sn-badge.tone-neutral, .nb .sn .sn-link.is-active .sn-badge.tone-neutral { background: #2E2E2E; color: var(--sn-mut); }
.nb .sn .sn-link.is-active .sn-badge.tone-neutral { background: #EADFD6; color: var(--ink-2); }
@media (min-width: 769px) and (max-width: 1023px) { .nb .sn .sn-badge.tone-neutral { display: none; } }
@media (min-width: 1024px) { html.nav-collapsed .nb .sn .sn-badge.tone-neutral { display: none; } }

/* Labels keep their full width ("My Passes" next to "1 unpaid"); a badge gives way first
   and a label only shortens with an ellipsis on very narrow widths. */
.nb .sn-label { flex: 1 0 auto; max-width: 100%; }
.nb .sn-link .sn-badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 360px) { .nb .sn-label { flex: 1 1 auto; } }

/* A badge that's its own link (sidebar + phone sheet): sits over the item's right end. */
.nb .sn-item, .nb .m-sheet__item { position: relative; }
.nb .sn-item .sn-link { padding-right: 96px; }
.nb .sn-badge--link { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); z-index: 1; text-decoration: none; }
.nb .sn-badge--link:hover { filter: brightness(1.08); text-decoration: underline; text-underline-offset: 2px; }
.nb .sn-badge--link:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.nb .m-sheet__item .m-sheet__link { padding-right: 104px; }
@media (min-width: 769px) and (max-width: 1023px) { .nb .sn-item .sn-link { padding-right: 0; } .nb .sn .sn-badge--link { transform: none; top: 8px; } }
@media (min-width: 1024px) { html.nav-collapsed .nb .sn-item .sn-link { padding-right: 0; } html.nav-collapsed .nb .sn .sn-badge--link { transform: none; top: 8px; } }

/* Phone chips: "My Passes" + its "1 unpaid" link, joined into one pill. */
.nb .sn-chips__pair { flex: none; display: inline-flex; align-items: center; }
.nb .sn-chips .sn-chips__pair > a:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; padding-right: 10px; }
.nb .sn-chips .sn-chips__more { display: inline-flex; align-items: center; height: 44px; padding: 0 10px 0 2px; border: 1.5px solid var(--line); border-left: 0; border-radius: 0 999px 999px 0; background: var(--surface); text-decoration: none; }
.nb .sn-chips .sn-chips__pair > a:first-child[aria-current="page"] + .sn-chips__more { border-color: var(--ink); background: var(--ink); }
.nb .sn-chips .sn-chips__more:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.nb .sn-chips__n.tone-neutral { background: var(--line-2); color: var(--ink-2); }
.nb .sn-chips a[aria-current="page"] .sn-chips__n.tone-neutral { background: #3A3A3A; color: var(--cream); }

/* UI fix C: on shorter desktop windows (mouse, not touch) a tighter menu so it still fits
   and stays sticky on a 1440x900 laptop; touch screens keep 44px rows. */
@media (min-width: 1024px) and (max-height: 960px) and (pointer: fine) {
  .nb .sidebar.sn { padding: 10px 12px; }
  .nb .sn-profile { min-height: 48px; padding: 6px 8px; }
  .nb .sn-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
  .nb .sn-create, .nb .sn-create.b-sec { min-height: 40px; margin: 8px 0 2px; }
  .nb .sn-link { height: 34px; }
  .nb .sn-group { margin-top: 8px; }
  .nb .sn-scroll .sn-group:first-child { margin-top: 8px; }
  .nb .sn-group__label { padding: 3px 12px; }
}
