/* ═══════════════════════════════════════════════════════
   NAV.CSS — Sidebar + Mobile Hamburger Navigation
   ═══════════════════════════════════════════════════════ */

/* ─── Mobile Topbar ──────────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bf-black);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
}
.mobile-logo {
  font-size: .9375rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}
.mobile-logo span { color: var(--accent-on-dark); }
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all var(--t-normal);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: translateX(-6px); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Sidebar ─────────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bf-black);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

/* Sidebar Header — Liberty on a white top band, Bonfire reversed on the dark nav below */
.sidebar-header {
  padding: 0;
  background: var(--bf-black);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.cobrand-lt {
  background: #fff;
  padding: 14px 20px;
  display: flex;
}
.cobrand-lt img { height: 22px; width: auto; display: block; }
.cobrand-bf {
  padding: 16px 20px;
  display: flex;
}
.cobrand-bf img { height: 25px; width: auto; display: block; }
.sidebar-logo {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
  margin-bottom: var(--space-1);
}
.sidebar-logo span { color: var(--accent-on-dark); }
.sidebar-client {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  font-weight: 500;
}
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-3);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: .6875rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sidebar-badge .live-dot {
  width: 6px; height: 6px;
  background: var(--bf-green);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0 var(--space-8);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Nav items */
.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  font-size: .8125rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: color var(--t-fast), background var(--t-fast);
  border-left: 2px solid transparent;
  cursor: pointer;
}
.nav-link:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.05);
}
.nav-link.active {
  color: #fff;
  background: rgba(91,141,239,.14);
  border-left-color: var(--accent-on-dark);
  font-weight: 600;
}
.nav-link.parent-active {
  color: rgba(255,255,255,.8);
}

/* Nav section divider */
.nav-section {
  padding: var(--space-5) var(--space-5) var(--space-2);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.2);
}

/* Expand chevron */
.nav-chevron {
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: .4;
  transition: transform var(--t-normal);
}
.nav-item.open > .nav-link .nav-chevron { transform: rotate(90deg); opacity: .8; }

/* Sub-items */
.nav-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
}
.nav-item.open > .nav-children {
  max-height: 500px;
}
.nav-children .nav-link {
  padding-left: calc(var(--space-5) + 14px);
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}
.nav-children .nav-link:hover { color: rgba(255,255,255,.75); }
.nav-children .nav-link.active {
  color: #fff;
  background: rgba(91,141,239,.12);
  border-left-color: var(--accent-on-dark);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: .8rem;
  color: rgba(255,255,255,.35);
  transition: color var(--t-fast);
}
.sidebar-footer a:hover { color: rgba(255,255,255,.7); }
.sidebar-footer-logo {
  font-size: .75rem;
  font-weight: 800;
  color: rgba(255,255,255,.25);
}
.sidebar-footer-logo span { color: rgba(91,141,239,.65); }

/* ─── Mobile overlay ──────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.visible { display: block; }

/* ─── Mobile sidebar ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mobile-topbar { display: flex; }

  #sidebar {
    top: 0;
    transform: translateX(-100%);
    transition: transform var(--t-normal);
    z-index: 200;
    width: min(var(--sidebar-w), calc(100vw - 56px));
    box-shadow: var(--shadow-lg);
  }
  #sidebar.open { transform: translateX(0); }

  .sidebar-placeholder { display: none; }
}
