/* === SIDEBAR (desktop) ===
   Flush to the left edge with only the RIGHT side rounded — small
   top/bottom inset so the dark panel doesn't run wall-to-wall. */
.sidebar {
  position: fixed;
  top: 8px;
  left: 0;
  bottom: 8px;
  width: 276px;
  background: var(--sidebar-bg);
  backdrop-filter: var(--sidebar-blur, blur(50px) saturate(220%) brightness(1.05));
  -webkit-backdrop-filter: var(--sidebar-blur, blur(50px) saturate(220%) brightness(1.05));
  border: var(--sidebar-border, 1px solid rgba(255,255,255,0.12));
  border-left: none;
  border-radius: 0 28px 28px 0;
  box-shadow: 0 16px 48px -16px rgba(0,0,0,0.6);
  will-change: transform;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition:
    width 0.25s cubic-bezier(0.4,0,0.2,1),
    top 0.25s cubic-bezier(0.4,0,0.2,1),
    left 0.25s cubic-bezier(0.4,0,0.2,1),
    bottom 0.25s cubic-bezier(0.4,0,0.2,1),
    border-radius 0.25s cubic-bezier(0.4,0,0.2,1),
    transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Mobile + tablet sidebar (≤1023px): slides UP from the bottom
   viobar — reads as a sheet rising out of the Menu tab, glass-dark,
   sized to content with a cap so it never overruns the viewport.

   Perf rationale (May 2026): the open-lag on mid-tier phones came from
   three things — (1) a full-area `backdrop-filter: blur` repainting every
   frame of the slide-up, (2) animating `opacity` alongside `transform`
   (forced full-paint each frame instead of a cheap GPU composite), and
   (3) the dialer widget shipping the Twilio Voice SDK on every page so
   the drawer's open frame raced with main-thread JS. We dropped the
   backdrop-filter (the dark fill carries the contrast already), animate
   only `transform` via translate3d for a guaranteed compositor layer,
   and gate `will-change`/`pointer-events` so the GPU layer is only paid
   for while the drawer is opening or open. */
@media (max-width: 1023px) {
  .sidebar {
    left: 0;
    right: 0;
    top: auto;
    /* `--lq-kb-h` is set by base.html JS from the visualViewport delta when
       the on-screen keyboard opens. With the default
       `interactive-widget=resizes-visual` mode, opening the keyboard does
       NOT shrink the layout viewport that `position: fixed` anchors to,
       so `bottom: 0` parks the drawer (and the cmdbar input it contains)
       BEHIND the keyboard. Setting `bottom: var(--lq-kb-h)` lifts the
       drawer to sit flush on top of the keyboard, keeping the search field
       visible while the user types. Cap max-height to the remaining
       visible area so the drawer never overflows above the layout
       viewport top (which would push the cmdbar input off-screen). */
    bottom: var(--lq-kb-h, 0px);
    width: auto;
    height: auto;
    max-height: min(75vh, calc(100vh - var(--lq-kb-h, 0px) - 16px));
    border: none;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px 18px 0 0;
    transform: translate3d(0, 100%, 0);
    pointer-events: none;
    transition:
      transform .28s cubic-bezier(.4,0,.2,1),
      max-height .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 -24px 48px -16px rgba(0,0,0,0.55);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-y: auto;
    /* No backdrop-filter on mobile: the solid-ish dark surface already
       provides separation, and blur is the #1 mobile compositor cost.
       Saving ≈80–120ms on the open frame on a Pixel 5-class device. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Hint the compositor to keep this on its own GPU layer while open.
       Removed in the closed state below to avoid leaking a permanent
       layer on every page load. */
    will-change: transform;
    contain: layout paint;
  }
  /* Closed state: drop the layer + listener cost so unrelated taps don't
     wake the GPU. Re-applied via .open. */
  .sidebar:not(.open) { will-change: auto; }
  .sidebar.open {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }

  /* When the in-drawer "Full menu" toggle is open, the drawer grows to
     100dvh (height/max-height set in sidebar-menu-v2.css). Drop the
     drawer's outer scroll and let the .sidebar-full-menu wrapper take
     the remaining space and scroll internally — that keeps the
     favourites grid + quick-create + user / notif rows anchored at the
     drawer bottom in normal flex flow, instead of being pushed
     offscreen by long nav lists above. */
  .sidebar.sidebar--full-menu-open {
    overflow: hidden;
  }
  .sidebar.sidebar--full-menu-open .sidebar-full-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Let .sidebar itself scroll, with the nav + user button flowing
     naturally inside it. The Notifications row stays pinned to the
     bottom (sticky) — the user profile button scrolls with the
     rest of the content. */
  .sidebar .sidebar-nav { overflow: visible; flex: 0 0 auto; }
  .sidebar .sidebar-footer {
    display: contents;
    border-top: none;
    padding: 0;
  }
  .sidebar .sidebar-user-wrap {
    order: 50;
    padding: 0.25rem 0.625rem 0.5rem;
  }
  /* Notif row sits at the very bottom of the drawer in normal flow.
     No sticky positioning — sticky was overlapping the user-wrap when
     the drawer content was scrolled to the end. */
  .sidebar .sidebar-notif-row {
    order: 100;
    margin: 0 0.625rem 0.5rem;
    padding: .65rem .75rem;
    background: #000;
    border-radius: 12px;
  }

  /* Menu viobar tab → soft peach X icon when drawer is open. Only the
     icon swaps color/glow; the "Menu" label stays its normal viobar
     color so the tab doesn't scream alarm-state. */
  body.sidebar-open .viobar a[href="#more"] i::before {
    content: "\F659";  /* bi-x-lg */
  }
  body.sidebar-open .viobar a[href="#more"] i {
    color: #ffb380 !important;
    filter: drop-shadow(0 0 6px rgba(255,179,128,0.55));
  }

  /* In-drawer × close button is shown via .sidebar-close-btn in fab.css.
     The bottom-right FAB also doubles as a close button while the drawer
     is open. */

  /* Hide ⌘K / Ctrl K hint on mobile — no keyboard */
  .cmdbar-kbd { display: none !important; }

  /* ── Slide-up drawer quick-create row ─────────────────────────────────
     Three favourite create actions docked to the bottom of the mobile
     drawer. Dark Ink surface + cream text per the linq brand spec; New
     Job uses the orange Signal accent and sits in the right-most slot
     so it's the natural thumb-rest position when the sheet is at rest.
     ───────────────────────────────────────────────────────────────── */
  .sidebar-quick-create {
    order: 95;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 0.625rem 0.5rem;
  }
  .sidebar-quick-create .sb-qc {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 76px;
    padding: 12px 8px;
    border-radius: 14px;
    background: #0F1623;
    color: #F2EBDF;
    text-decoration: none;
    text-align: center;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform .12s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-quick-create .sb-qc i {
    font-size: 1.2rem;
    color: rgba(242,235,223,0.9);
  }
  .sidebar-quick-create .sb-qc:active {
    transform: scale(.97);
    background: #1B2230;
  }
  .sidebar-quick-create .sb-qc--accent {
    background: linear-gradient(135deg, #EA6A2C 0%, #C9551F 100%);
    border-color: rgba(255,255,255,0.14);
    color: #FAF6EE;
    box-shadow: 0 6px 16px -8px rgba(234,106,44,0.55);
  }
  .sidebar-quick-create .sb-qc--accent i { color: #FAF6EE; }
  .sidebar-quick-create .sb-qc--accent:active {
    background: linear-gradient(135deg, #C9551F 0%, #A4441A 100%);
  }
}

/* Desktop: quick-create row is mobile-only — sidebar already has its
   own create chip in the cmdbar. */
@media (min-width: 1024px) {
  .sidebar-quick-create { display: none !important; }
}

.sidebar-logo {
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: 'Public Sans', sans-serif;
  font-weight: 900;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.sidebar-logo-text .field-part { color: #fff; }
.sidebar-logo-text .vio-part   { color: var(--brand-light); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.625rem;
  /* Teal scrollbar on the right edge of the sidebar. Slim rail, fully
     rounded thumb so it matches the sidebar's floating-pill vibe. */
  scrollbar-width: thin;
  scrollbar-color: var(--brand-light, #14b8a6) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--brand-light, #14b8a6);
  border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--brand, #0d7377);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  position: relative;
  margin-bottom: 2px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-nav a:active {
  transform: scale(0.96);
  background: rgba(255,255,255,0.10);
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
}
.sidebar-nav a.active {
  background: var(--brand-tint-bg);
  color: var(--brand-light);
  font-weight: 600;
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--brand-light);
}
@media (min-width: 1024px) {
  .sidebar-nav a.active::before {
    right: auto;
    left: 0;
    border-radius: 0 2px 2px 0;
  }
}
.sidebar-nav a i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-nav a i.bi-diamond-fill {
  color: #a78bfa !important;
}
.sidebar-nav .nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

/* ── Moments live indicator in sidebar + mobile nav ── */
.live-nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 20px;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.live-nav-badge.live {
  color: #f87171;
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.3);
}
.live-nav-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.live-nav-badge.live .live-nav-dot {
  background: #f87171;
  animation: liveNavPulse 1.6s infinite;
}
@keyframes liveNavPulse {
  0%   { box-shadow: 0 0 0 0 rgba(248,113,113,.7); }
  70%  { box-shadow: 0 0 0 5px rgba(248,113,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); }
}
/* Hide badge text in collapsed sidebar — just show dot */
.sidebar.collapsed .live-nav-badge { display: none; }

.sidebar-footer {
  padding: 0.5rem 0.625rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.sidebar-user-wrap { position: relative; }

/* Sticky Notifications row — sits in the footer above the user button so
   it stays pinned as the nav scrolls. */
.sidebar-notif-row {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .55rem .625rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.78);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar-notif-row:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar-notif-row.active {
  background: rgba(20,184,166,0.12);
  color: #fff;
}
.sidebar-notif-row i { font-size: 1rem; opacity: .9; }
.sidebar-notif-badge {
  display: none;
  position: absolute;
  top: .35rem;
  left: 1.35rem;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
  padding: 0 4px;
}
.sidebar.collapsed .sidebar-notif-label { display: none; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.5rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.sidebar-user-avatar {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 8px;
  background: var(--brand-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.4);
}
.sidebar-user-chevron {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  transition: transform 0.25s ease, color 0.15s;
  flex-shrink: 0;
}
.sidebar-user-wrap.open .sidebar-user-chevron {
  transform: rotate(180deg);
  color: rgba(255,255,255,0.6);
}

/* Slide-up dropdown */
.sidebar-dropdown {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0.25rem;
  right: 0.25rem;
  background: rgba(22,24,34,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 0.375rem;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 210;
}
.sidebar-user-wrap.open .sidebar-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sidebar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.sidebar-dropdown-item i {
  font-size: 0.9375rem;
  width: 1.125rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar-dropdown-danger { color: rgba(239,68,68,0.8); }
.sidebar-dropdown-danger:hover {
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
}
.sidebar-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0.25rem 0.5rem;
}
.sidebar-dropdown-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0.35rem 0.75rem 0.25rem;
}

/* ── Masteradmin company switcher ── */
.ma-company-switcher {
  padding: 0.25rem 0;
}
.ma-switcher-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
}
.ma-switcher-search-wrap {
  padding: 0.25rem 0.5rem;
}
.ma-switcher-search {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.375rem;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.15s;
}
.ma-switcher-search::placeholder {
  color: rgba(255,255,255,0.25);
}
.ma-switcher-search:focus {
  border-color: rgba(45,212,191,0.5);
}
.ma-company-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ma-company-list::-webkit-scrollbar {
  width: 4px;
}
.ma-company-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.ma-company-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4375rem 0.75rem;
  border: none;
  background: none;
  color: rgba(255,255,255,0.65);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
}
.ma-company-option:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.ma-company-option.active {
  color: #2dd4bf;
  background: rgba(45,212,191,0.08);
}
.ma-co-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.3125rem;
  background: rgba(255,255,255,0.06);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.ma-company-option.active .ma-co-icon {
  background: rgba(45,212,191,0.15);
}
.ma-co-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.ma-co-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.ma-co-trade {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.2;
}
.ma-company-option.active .ma-co-trade {
  color: rgba(45,212,191,0.5);
}
.ma-co-active-icon {
  font-size: 0.75rem;
  color: #2dd4bf;
  flex-shrink: 0;
}
.ma-company-option.hidden-by-search {
  display: none;
}

/* Sidebar overlay (mobile). Blur removed — `backdrop-filter` over a full
   viewport on a slow mobile GPU is the second worst offender behind the
   sidebar's own filter. The 50%-black scrim already separates the drawer
   from the page beneath. */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* === MAIN CONTENT OFFSET ===
   Sidebar is flush-left (276px wide). Main column starts 276 + 24 =
   300px right, leaving a 24px gap between sidebar's right edge and
   content. */
.main {
  margin-left: 300px;
  min-height: 100vh;
  padding: 2.25rem 1.75rem 2.25rem 0.5rem;
  transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1);
}
@media (max-width: 1023px) {
  /* Tighter horizontal padding on mobile so cards/forms aren't squeezed
     into a narrow column on small viewports. Vertical padding stays at
     1rem to keep separation from the floating pill header below. */
  .main { margin-left: 0; padding: 1rem .5rem; }
}
/* Mobile: the default `.ld-header--global` (rendered by the
   mobile_header block in base.html) is `position: sticky` and lives
   in normal flow, so it takes its own space — no extra padding-top
   reservation needed. The legacy `.fvpill-header` was fixed-position
   and required this 5rem buffer; that's now scoped to pages that
   explicitly include the pill (public event portals via
   pill_header(show_all_viewports=true)) — see pill-header.css. */

/* === FVPILL-HEADER rules moved to `static/css/pill-header.css` so they can
   be reused by non-base-extending public pages. Include that stylesheet
   alongside nav.css wherever the mobile pill should render. === */

/* === VIOBAR (mobile bottom nav) ===
   Footer is transparent glass to match the floating pill header:
   same translucent navy, same blur, same hairline border. */
.viobar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  /* Mirror the pill-header surface — same tinted teal-navy gradient at
     55% alpha for the glass effect, same blur, same soft dark halo,
     rounded TOP corners (vs the header's rounded bottom) so the chrome
     at top + bottom feels like one floating-card frame. */
  background: linear-gradient(135deg,
    rgba(10, 37, 57, 0.55) 0%,
    rgba(14, 58, 79, 0.55) 55%,
    rgba(19, 91, 108, 0.55) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 0;
  border-radius: 22px 22px 0 0;
  box-shadow:
    0 0 0 6px rgba(10, 14, 26, 0.18),
    0 -6px 16px -8px rgba(10, 14, 26, 0.45);
  z-index: 300;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* Viobar removed — replaced by the bottom-right .fab-menu. Hide any
   legacy markup that still emits it from older partials/templates. */
.viobar { display: none !important; }

.viobar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0.375rem 0;
  text-decoration: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.15s, transform 0.1s, opacity 0.1s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.viobar-item:active {
  transform: scale(0.88);
  opacity: 0.6;
}
.viobar-item i { font-size: 1.25rem; line-height: 1; }
.viobar-item.active {
  color: var(--brand-light);
}
.viobar-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2rem;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--brand-light);
}
/* === MOBILE BACK BUTTON ===
   Sits in the bottom-LEFT corner so it doesn't collide with the
   bottom-right FAB-menu. (Was 72px above the old viobar.) */
.mobile-back-btn {
  display: none;
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-size: 1.125rem;
  cursor: pointer;
  z-index: 299;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.mobile-back-btn:active {
  transform: scale(0.88);
  background: rgba(255,255,255,0.15);
  color: #fff;
}
@media (max-width: 640px) {
  .mobile-back-btn { display: flex; }
}

/* FAB slot in viobar centre */
.viobar-fab-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   COMMAND BAR (Search + Create) — sits below logo at top of sidebar
   ============================================================ */
.sidebar-cmdbar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  margin: 0 0 0.25rem;
  flex-shrink: 0;
}

/* Search input wrapper */
.cmdbar-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.cmdbar-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}
.cmdbar-search {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.5rem 0.625rem 0.5rem 2rem;
  color: #fff;
  font-family: 'Public Sans', 'Public Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.cmdbar-search::placeholder {
  color: rgba(255,255,255,0.35);
}
.cmdbar-search:focus {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
}

/* Search results dropdown */
.cmdbar-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(15,18,30,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 0.375rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 310;
  max-height: 320px;
  overflow-y: auto;
}
.cmdbar-results.open { display: block; }

.cmdbar-result-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.1s;
}
.cmdbar-result-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.cmdbar-result-item i {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
}
.cmdbar-result-item .result-title {
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.cmdbar-result-item .result-subtitle {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}
.cmdbar-results-empty {
  padding: 0.75rem;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 0.8125rem;
}
.cmdbar-result-section {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem 0.25rem;
  font-family: 'Archivo Narrow', ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.cmdbar-result-section i {
  font-size: 0.75rem;
  color: var(--linq-orange, #EA6A2C);
  flex: none;
}
.cmdbar-result-section + .cmdbar-result-section { margin-top: 0.25rem; }
.cmdbar-result-item + .cmdbar-result-section { margin-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 0.5rem; }

/* ⌘K / Ctrl K keyboard hint inside search input */
.cmdbar-kbd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Public Sans', 'Public Sans', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}
.cmdbar-search:focus ~ .cmdbar-kbd { opacity: 0; }

/* Utility round-chip buttons (messages, notifications) */
.cmdbar-util-btn {
  position: relative;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cmdbar-util-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.16);
}
.cmdbar-util-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--orange, #f97316);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid rgba(10,14,26,0.95);
  box-shadow: 0 0 8px rgba(249,115,22,0.35);
}

/* Create button */
.cmdbar-create-wrap {
  position: relative;
  flex-shrink: 0;
}
.cmdbar-create-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.cmdbar-create-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.cmdbar-create-btn.open {
  background: rgba(255,255,255,0.14);
  color: #fff;
  transform: rotate(45deg);
}

/* Create dropdown */
.cmdbar-create-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(15,18,30,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 0.375rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 310;
}
.cmdbar-create-menu.open { display: block; }

.cmdbar-create-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.cmdbar-create-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.cmdbar-create-item i {
  font-size: 0.9375rem;
  width: 1.125rem;
  text-align: center;
  flex-shrink: 0;
}

/* Collapsed sidebar: hide command bar */
.sidebar.collapsed .sidebar-cmdbar {
  display: none;
}

/* Tablet: hide command bar (horizontal top-bar layout has no room;
   FAB handles actions). Mobile keeps the cmdbar inside the slide-out
   drawer so users can search from their phone. */
@media (min-width: 641px) and (max-width: 1023px) {
  .sidebar-cmdbar { display: none; }
}


/* ============================================================
   SIDEBAR COLLAPSE (desktop only)
   ============================================================ */

/* Collapse toggle button */
.sidebar-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  position: absolute;
  top: .75rem;
  right: .5rem;
  z-index: 10;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
@media (min-width: 1024px) {
  .sidebar-collapse-btn { display: flex; }
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
}
.sidebar-collapse-btn i {
  font-size: 0.75rem;
  transition: transform 0.3s;
}
.sidebar.collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

/* Nav label — smooth hide on collapse */
.nav-label {
  transition: opacity 0.15s, max-width 0.2s;
  overflow: hidden;
  white-space: nowrap;
}

/* Collapsed logo indicator */
.sidebar-logo-collapsed {
  display: none;
  font-family: 'Public Sans', sans-serif;
  font-weight: 900;
  font-size: 1.125rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Collapsed state — long vertical pill ----
   Stays flush to the left edge (matching expanded state); only the
   right side rounds into a tall capsule. */
.sidebar.collapsed {
  top: 8px;
  left: 0;
  bottom: 8px;
  width: 60px;
  border-left: none;
  border-radius: 0 999px 999px 0;
  box-shadow: 0 16px 48px -16px rgba(0,0,0,0.55);
}
.sidebar.collapsed .sidebar-logo-text {
  display: none;
}
.sidebar.collapsed .sidebar-logo-collapsed {
  display: block;
}
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 1.25rem 0.5rem 0.75rem;
}
.sidebar.collapsed .sidebar-nav {
  padding: 0.5rem 0.5rem;
  overflow: visible;  /* allow tooltips to show outside nav bounds */
}
.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 0.5rem;
  border-radius: 12px;
  background: transparent;
}
.sidebar.collapsed .sidebar-nav a.active {
  background: transparent;
}
.sidebar.collapsed .nav-label {
  display: none;
}
.sidebar.collapsed .sidebar-nav a i {
  font-size: 1.125rem;
  width: 36px;
  height: 36px;
}
.sidebar.collapsed .sidebar-nav a.active::before {
  display: none;
}
.sidebar.collapsed .sidebar-nav .nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  margin-left: 0;
  min-width: 16px;
  height: 16px;
  font-size: 0.55rem;
  padding: 0 2px;
}

/* Tooltip popout on hover (collapsed) */
.sidebar.collapsed .sidebar-nav a {
  position: relative;
}
.sidebar.collapsed .sidebar-nav a::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,17,28,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 300;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-50%) translateX(-4px);
}
.sidebar.collapsed .sidebar-nav a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Notification bell — collapsed */
.sidebar.collapsed #notif-bell-sidebar {
  justify-content: center !important;
  padding: 0.625rem !important;
  margin: 0 0.375rem 0.5rem !important;
}
.sidebar.collapsed #notif-bell-sidebar .nav-label {
  display: none;
}
.sidebar.collapsed #notif-bell-sidebar::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  background: rgba(15,17,28,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 300;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-50%) translateX(-4px);
}
.sidebar.collapsed #notif-bell-sidebar:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Footer — collapsed: avatar only */
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-chevron {
  display: none;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 0.5rem;
}
.sidebar.collapsed .sidebar-footer {
  padding: 0.5rem;
}
.sidebar.collapsed .sidebar-dropdown {
  left: calc(100% + 8px);
  bottom: 0;
  right: auto;
  min-width: 240px;
}

/* Main content offset — collapsed (60px pill + 12px left gap + 12px right gap). */
body.sidebar-collapsed .main {
  margin-left: 84px;
}
@media (max-width: 1023px) {
  body.sidebar-collapsed .main { margin-left: 0; }
}
@media (max-width: 640px) {
  .sidebar.collapsed { width: 220px; }  /* Don't collapse on mobile */
}

/* Pre-collapse: applied via <html class="sbc"> before first paint to prevent flash */
html.sbc .sidebar {
  top: 8px !important;
  left: 0 !important;
  bottom: 8px !important;
  width: 60px !important;
  border-radius: 0 999px 999px 0 !important;
  transition: none !important;
}
html.sbc .main { margin-left: 84px !important; transition: none !important; }
html.sbc .nav-label,
html.sbc .sidebar-logo-text,
html.sbc .sidebar-user-info,
html.sbc .sidebar-user-chevron { display: none !important; }
html.sbc .sidebar-logo-collapsed { display: none !important; }
html.sbc .sidebar-logo { display: none !important; }
html.sbc .sidebar-cmdbar { display: none !important; }
html.sbc .sidebar-nav { padding: 0.5rem 0.5rem !important; }
html.sbc .sidebar-nav a { justify-content: center !important; padding: 0.5rem !important; }
html.sbc .sidebar-logo { justify-content: center !important; padding: 1.25rem 0.5rem 0.75rem !important; }
@media (max-width: 640px) {
  html.sbc .sidebar { width: 220px !important; }
  html.sbc .main { margin-left: 0 !important; }
}

/* Mobile (≤640px) non-sidebar chrome rules. Do NOT re-declare
   .sidebar positioning/width here — the drop-down panel rule at the
   top of this file (@media max-width: 1023px) owns it. */
@media (max-width: 640px) {
  .main { margin-left: 0; }
  .fvpill-header { display: block; }
  .mobile-back-btn { display: flex; }
  body.sidebar-collapsed .main { margin-left: 0; }
  html.sbc .main { margin-left: 0 !important; }
}

/* ============================================================
   KEYBOARD NAVIGATION
   ============================================================ */
.sidebar-nav a.kb-focus {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR ZONES (Option B restructure)
   Dark + teal primary + orange accent. Used by both the desktop
   sidebar and the mobile/tablet drop-down panel (same .sidebar-nav
   container renders both).
   ══════════════════════════════════════════════════════════════════ */

/* Reset the flat vertical-list spacing from .sidebar-nav a — the new
   children are structured (grid / rows / chips) and handle their own
   padding. */
.sidebar-nav .nav-primary-grid,
.sidebar-nav .nav-favorites,
.sidebar-nav .nav-chips {
  padding: 0 .75rem;
}

/* Section label (subtle SMALL CAPS divider) */
.sidebar-nav .nav-section-label {
  display: flex; align-items: center; gap: .4rem;
  padding: 1rem .75rem .45rem;
  font-size: .65rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}

/* Zone 1 — 2x2 card grid (exactly 4 slots) on all viewports. */
.sidebar-nav .nav-primary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  padding-top: .4rem;
  padding-bottom: .4rem;
}
.sidebar-nav .nav-primary-card {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: .4rem;
  padding: .75rem .7rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: rgba(255,255,255,0.85);
  font-size: .8rem; font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.sidebar-nav .nav-primary-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.sidebar-nav .nav-primary-card:active { transform: scale(.97); }
.sidebar-nav .nav-primary-card.active {
  background: linear-gradient(135deg, rgba(13,115,119,0.85), rgba(20,184,166,0.85));
  border-color: rgba(20,184,166,0.6);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(20,184,166,0.45);
}
.sidebar-nav .nav-primary-ico {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  font-size: .95rem;
  color: var(--brand-light, #14b8a6);
}
.sidebar-nav .nav-primary-card.active .nav-primary-ico {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.sidebar-nav .nav-primary-label { font-size: .78rem; line-height: 1.2; }

/* Zone 2 — Favorites (2-col grid of dot + label rows). Collapsed
   sidebar drops to single column via override below. */
.sidebar-nav .nav-favorites {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 6px;
}
.sidebar-nav .nav-fav-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .55rem;
  border-radius: 9px;
  color: rgba(255,255,255,0.78);
  font-size: .8rem; font-weight: 500;
  text-decoration: none;
  min-width: 0;
  transition: background .15s;
}
.sidebar-nav .nav-fav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-nav .nav-fav-row:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar-nav .nav-fav-row.active {
  background: rgba(249,115,22,0.12);
  color: #fff;
}
.sidebar-nav .nav-fav-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px -1px currentColor;
}

/* Zone 3 — Chips (compact pills, 2-col grid so every chip is equal width) */
.sidebar-nav .nav-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  padding-bottom: 1rem;
}
.sidebar-nav .nav-chip {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .25rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: rgba(255,255,255,0.72);
  font-size: .78rem; font-weight: 500;
  text-decoration: none;
  transition: color .15s;
  min-width: 0;
}
.sidebar-nav .nav-chip i { font-size: .85rem; opacity: .85; }
.sidebar-nav .nav-chip:hover {
  background: transparent;
  color: #fff;
}
.sidebar-nav .nav-chip:hover i { opacity: 1; color: var(--brand-light, #14b8a6); }
.sidebar-nav .nav-chip.active {
  background: transparent;
  border: none;
  color: var(--brand-light, #14b8a6);
  font-weight: 600;
}
.sidebar-nav .nav-chip.active i { color: var(--brand-light, #14b8a6); opacity: 1; }
.sidebar-nav .nav-chip-label { white-space: nowrap; }

/* Collapsed desktop sidebar: hide text labels, show just icons.
   Primary cards (the 2x3 top grid) strip their card chrome in this
   state so they don't tower over the chips below — operator flagged
   the mismatch in padding. */
.sidebar.collapsed .nav-primary-grid {
  grid-template-columns: 1fr;
  gap: .25rem;
  padding-top: .25rem;
  padding-bottom: .25rem;
}
.sidebar.collapsed .nav-favorites { grid-template-columns: 1fr; }
.sidebar.collapsed .nav-primary-label,
.sidebar.collapsed .nav-fav-label,
.sidebar.collapsed .nav-chip-label,
.sidebar.collapsed .nav-section-label { display: none; }
.sidebar.collapsed .nav-primary-card {
  padding: .35rem;
  gap: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
}
.sidebar.collapsed .nav-primary-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.sidebar.collapsed .nav-primary-card.active {
  background: rgba(20,184,166,0.12);
  border-color: rgba(20,184,166,0.35);
  box-shadow: none;
}
.sidebar.collapsed .nav-primary-ico {
  width: 32px; height: 32px;
}
.sidebar.collapsed .nav-chips { grid-template-columns: 1fr; justify-items: center; }
.sidebar.collapsed .nav-chip { padding: .5rem; width: 100%; justify-content: center; }

/* Hide the mini "FV" logo in collapsed state — operator wants the
   rail to be pure nav, no branding mark when narrow. The expand
   arrow still lives on `.sidebar-collapse-btn` separately. */
.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-logo-collapsed {
  display: none !important;
}

/* Tablet/mobile pill header: favorites chips (3 slots before burger).
   Uses the shared --brand colors so it picks up per-tenant theming. */
@media (max-width: 1023px) {
  .fvpill-favs {
    display: inline-flex; align-items: center; gap: .25rem;
    margin-right: .35rem;
  }
  .fvpill-fav {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    transition: background .15s, color .15s;
  }
  .fvpill-fav:hover {
    background: rgba(20,184,166,0.18);
    color: #fff;
  }
  .fvpill-fav.active {
    background: linear-gradient(135deg, rgba(13,115,119,0.85), rgba(20,184,166,0.85));
    color: #fff;
  }
  /* Hide favs on phone — only show on tablet (641-1023px) */
  @media (max-width: 640px) { .fvpill-favs { display: none; } }
}

/* ══════════════════════════════════════════════════════════════════
   NAV "MORE" drawer + drag-state feedback
   ══════════════════════════════════════════════════════════════════ */
.sidebar-nav .nav-more {
  margin: .75rem 0 1rem;
  padding: 0 .75rem;
}
.sidebar-nav .nav-more-summary {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: rgba(255,255,255,0.75);
  font-size: .78rem; font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background .15s, border-color .15s;
}
.sidebar-nav .nav-more-summary::-webkit-details-marker { display: none; }
.sidebar-nav .nav-more-summary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}
.sidebar-nav .nav-more-count {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .5rem;
  height: 18px;
  min-width: 18px;
  border-radius: 999px;
  background: rgba(249,115,22,0.15);
  color: #fb923c;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
}
.sidebar-nav .nav-more-count:empty { display: none; }
.sidebar-nav .nav-more[open] .nav-more-summary {
  background: rgba(20,184,166,0.10);
  border-color: rgba(20,184,166,0.35);
  color: #fff;
}
.sidebar-nav .nav-more-list {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin-top: .5rem;
  padding: .6rem;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 10px;
  min-height: 52px;
}
.sidebar-nav .nav-more-list.empty { justify-content: center; align-items: center; }
.sidebar-nav .nav-more-hint {
  width: 100%;
  text-align: center;
  font-size: .7rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}
.sidebar-nav .nav-more-list:not(.empty) .nav-more-hint { display: none; }

/* Drag state — dragging chip/fav + active drop zone */
.sidebar-nav a.nav-chip.dragging {
  opacity: 0.35;
  transform: scale(0.92);
  cursor: grabbing;
}
.sidebar-nav a.nav-chip,
.sidebar-nav a.nav-primary-card,
.sidebar-nav a.nav-fav-row { cursor: grab; }
.sidebar-nav a.nav-primary-card.dragging {
  opacity: 0.35;
  transform: scale(0.94);
  cursor: grabbing;
}
.sidebar-nav a.nav-fav-row.dragging {
  opacity: 0.35;
  transform: scale(0.94);
  cursor: grabbing;
}
.sidebar-nav [data-dropzone].drop-hover {
  background: rgba(20,184,166,0.12);
  border-color: rgba(20,184,166,0.55);
  outline: 2px dashed rgba(20,184,166,0.45);
  outline-offset: 2px;
  border-radius: 10px;
}
/* Summary row also accepts drops so users can dump a chip onto "More"
   even while the drawer is closed. */
.sidebar-nav .nav-more-summary.drop-hover {
  background: rgba(20,184,166,0.16);
  border-color: rgba(20,184,166,0.55);
  color: #fff;
  outline: 2px dashed rgba(20,184,166,0.45);
  outline-offset: 2px;
}
/* While a drag is in flight, nudge the "More" label so users notice the
   drop target without a tooltip. */
body.nav-dragging .sidebar-nav .nav-more-summary {
  background: rgba(20,184,166,0.08);
  border-color: rgba(20,184,166,0.35);
  color: #fff;
}

/* ════════════════════════════════════════════════════════════════════
   DESKTOP-ONLY (≥1024px) — Light sidebar + flat OPERATIONS / BUSINESS
   list. Mobile slide-up drawer keeps the dark glass + Zone 1/2/3
   layout above; everything in this block is gated to ≥1024px.

   No hex codes here — every color comes from :root in base.html.
   Tokens used: --panel, --panel-soft, --border, --border-strong,
   --text, --text-muted, --text-faint, --on-text, --brand,
   --brand-gradient, --green, --radius-sm, --radius-md, --radius-pill.
   ════════════════════════════════════════════════════════════════════ */

.sidebar-nav-flat { display: none; }   /* hidden by default; desktop turns it on */
.sidebar-edit-chip { display: none; }  /* desktop-only — see ≥1024px block */

@media (min-width: 1024px) {

  /* ── Sidebar palette: white panel, soft border, NO blur/glass.
         Straight right edge to match the design sample (no rounded
         corners on desktop — the floating-pill curve was a holdover
         from the dark-glass variant). ─────────────────────────── */
  .sidebar {
    background: var(--panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    box-shadow: none;
  }

  /* Logo — dark text on light bg */
  .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 1rem 1rem 0.5rem;
  }
  .sidebar-logo-text .field-part { color: var(--text); }
  .sidebar-logo-text .vio-part   { color: var(--brand); }

  /* Edit chip in the sidebar header (top-right of logo row).
     Visual only — links to existing settings.sidebar_prefs. The full
     drag/rename/hide edit-mode UI is a follow-up PR. */
  .sidebar-edit-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;   /* micro-label ≤11px stays uppercase */
    color: var(--text-muted);
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
  }
  .sidebar-edit-chip:hover {
    background: var(--border);
    color: var(--text);
  }

  /* Trade-template chooser (masteradmin-only) — sits inline before the
     EDIT chip and is revealed by sidebar-edit.js while edit mode is
     active. Active template is reflected via [data-active="…"] so
     sidebar-edit.js doesn't need to mutate styles per click. */
  .sidebar-template-chooser {
    flex-shrink: 0;
    display: inline-flex;
    gap: 4px;
    margin-right: 6px;
  }
  .sidebar-template-chooser[hidden] { display: none; }
  .sidebar-template-btn {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--panel-soft);
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
  }
  .sidebar-template-btn:hover {
    background: var(--border);
    color: var(--text);
  }
  .sidebar-template-chooser[data-active="locksmith"] .sidebar-template-btn[data-template="locksmith"],
  .sidebar-template-chooser[data-active="events"]    .sidebar-template-btn[data-template="events"] {
    background: var(--brand, #14b8a6);
    border-color: var(--brand, #14b8a6);
    color: #0f172a;
  }

  /* Search lives in the top bar on desktop; hide the legacy sidebar
     cmdbar so the sidebar matches the screenshot's clean look. */
  .sidebar .sidebar-cmdbar { display: none; }

  /* Hide the mobile-drawer Zone 1/2/3 nav on desktop — the flat nav
     below replaces it. */
  .sidebar > nav.sidebar-nav { display: none; }

  /* ── Flat nav container ────────────────────────────────────────── */
  .sidebar-nav-flat {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.625rem 0.5rem;
    gap: 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
  .sidebar-nav-flat::-webkit-scrollbar { width: 6px; }
  .sidebar-nav-flat::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
  }

  /* Section eyebrow — mono uppercase per brand kit (matches the
     ".eyebrow" treatment on linq-marketing.css). */
  .sidebar-nav-flat .nav-section {
    font-family: var(--font-mono, 'Archivo Narrow', ui-monospace, monospace);
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 18px 12px 8px;
  }
  .sidebar-nav-flat .nav-section:first-child { padding-top: 6px; }

  /* Item — full-width row: bordered icon tile + label + optional
     badge/dot. The tile mirrors the marketing-site feature-card tile
     (1px ink border, bone-soft fill, 8px radius) so the platform and
     the website read as the same brand vocabulary. */
  .sidebar-nav-flat .nav-flat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 6px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.25;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sidebar-nav-flat .nav-flat-item:hover {
    background: var(--panel-soft);
  }
  .sidebar-nav-flat .nav-flat-item:hover .nav-flat-icon {
    background: var(--bg);
    border-color: var(--border-strong);
  }

  /* Active state — Ink-filled tile with bone glyph + the brand-mark
     offset signal square at bottom-right of the tile (mirrors the
     wordmark q's escaping tab). The row itself stays light so the
     active tile pops without painting the whole row. */
  .sidebar-nav-flat .nav-flat-item.active { color: var(--text); }
  .sidebar-nav-flat .nav-flat-item.active .nav-flat-icon {
    background: var(--text);
    color: var(--on-text, #F2EBDF);
    border-color: var(--text);
    position: relative;
    overflow: visible;
  }
  .sidebar-nav-flat .nav-flat-item.active .nav-flat-icon::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 6px;
    height: 6px;
    background: var(--signal, #EA6A2C);
    border-radius: 1.5px;
  }

  /* Bordered icon tile — 28×28 bone-soft surface with ink hairline.
     Bootstrap-icons sit centered inside; the `.bi` selector ensures
     the 14.5px glyph sizing applies even though the parent tile is
     larger now. */
  .sidebar-nav-flat .nav-flat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    font-size: 14.5px;
    line-height: 1;
    color: var(--text);
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .sidebar-nav-flat .nav-flat-label { flex: 1; min-width: 0; }
  .sidebar-nav-flat .nav-flat-badge {
    flex-shrink: 0;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
  }
  .sidebar-nav-flat .nav-flat-item.active .nav-flat-badge {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border-strong);
  }

  /* Live-activity green dot — sits at the row-end, opposite the
     tile-icon. Used by the Call Center item to signal an active call.
     Pulsing ring uses the same animation pattern as the marketing
     hero's status pulse. */
  .sidebar-nav-flat .nav-flat-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--sage, #1F9D55);
    margin-left: auto;
    position: relative;
  }
  .sidebar-nav-flat .nav-flat-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid var(--sage, #1F9D55);
    animation: nav-pulse 2s ease-out infinite;
  }
  @keyframes nav-pulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
  }

  /* ── More drawer — collapsed by default; expands inline. Visually
     a thin separator with a small mono toggle row, then the same
     flat-item rows as the primary nav (no inset / no indentation —
     they ARE primary nav, just one-click further away). */
  .sidebar-nav-flat .nav-more {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .sidebar-nav-flat .nav-more-toggle {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
    user-select: none;
  }
  .sidebar-nav-flat .nav-more-toggle::-webkit-details-marker { display: none; }
  .sidebar-nav-flat .nav-more-toggle:hover {
    background: var(--panel-soft);
    color: var(--text);
  }
  .sidebar-nav-flat .nav-more-toggle-label {
    font-family: var(--font-mono, 'Archivo Narrow', ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    flex: 1;
  }
  .sidebar-nav-flat .nav-more-toggle-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
  }
  .sidebar-nav-flat .nav-more-toggle-icon {
    font-size: 12px;
    color: var(--text-faint);
    transition: transform 0.2s ease;
  }
  .sidebar-nav-flat details[open] .nav-more-toggle-icon {
    transform: rotate(180deg);
  }
  .sidebar-nav-flat .nav-more-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-top: 4px;
  }
  .sidebar-nav-flat .nav-flat-item.nav-coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .sidebar-nav-flat .nav-flat-item.nav-coming-soon .nav-flat-label {
    text-decoration: line-through;
  }

  /* ── Footer (notif row + user button) — light variant ──────────── */
  .sidebar .sidebar-notif-row {
    color: var(--text);
    background: var(--panel-soft);
    border-color: var(--border);
  }
  .sidebar .sidebar-notif-row:hover {
    background: var(--border);
    color: var(--text);
  }
  .sidebar .sidebar-notif-row.active {
    background: var(--text);
    color: white;
  }

  .sidebar .sidebar-user {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
  }
  .sidebar .sidebar-user:hover {
    background: var(--panel-soft);
    border-color: var(--border-strong);
  }
  .sidebar .sidebar-user-avatar {
    background: var(--brand-gradient);
    color: white;
  }
  .sidebar .sidebar-user-name { color: var(--text); }
  .sidebar .sidebar-user-role { color: var(--text-muted); }
  .sidebar .sidebar-user-chevron { color: var(--text-faint); }
  .sidebar .sidebar-footer { border-top-color: var(--border); }

  /* Slide-up dropdown — light card */
  .sidebar .sidebar-dropdown {
    background: var(--panel);
    border: 1px solid var(--border-strong);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.18);
  }
  .sidebar .sidebar-dropdown-item { color: var(--text); }
  .sidebar .sidebar-dropdown-item:hover {
    background: var(--panel-soft);
    color: var(--text);
  }
  .sidebar .sidebar-dropdown-divider { background: var(--border); }
  .sidebar .sidebar-dropdown-label { color: var(--text-faint); }
  .sidebar .sidebar-dropdown-danger { color: var(--red); }
  .sidebar .sidebar-dropdown-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--red);
  }

  /* Collapse button — hidden on desktop. The redesigned sidebar
     stays at full width; the legacy chevron toggle was overlapping
     the EDIT / DONE chip. The collapsed-sidebar `.sbc` mode still
     works programmatically (e.g., a future toggle elsewhere).
     ─────────────────────────────────────────────────────────── */
  .sidebar .sidebar-collapse-btn {
    display: none !important;
  }

  /* MasterAdmin company switcher — light */
  .sidebar .ma-company-switcher,
  .sidebar .ma-switcher-label,
  .sidebar .ma-switcher-search,
  .sidebar .ma-company-option {
    color: var(--text);
  }
  .sidebar .ma-switcher-search {
    background: var(--panel-soft);
    border-color: var(--border-strong);
  }
  .sidebar .ma-company-option:hover { background: var(--panel-soft); }
  .sidebar .ma-company-option.active {
    background: var(--brand-tint-bg);
    color: var(--brand);
  }
  .sidebar .ma-co-name { color: var(--text); }
  .sidebar .ma-co-trade { color: var(--text-muted); }

  /* Drop the top padding on .main — the new sticky topbar provides
     its own breathing room. Side and bottom padding unchanged. */
  .main { padding-top: 0.25rem; }

  /* ── EDIT MODE (toggled by JS via body.sidebar-editing) ───────── */
  .sidebar-editing .sidebar-nav-flat .nav-section {
    background: var(--panel-soft);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin: 6px 0 2px;
    cursor: text;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-editing .sidebar-nav-flat .nav-section:focus {
    background: var(--panel);
    box-shadow: 0 0 0 2px var(--brand-tint-bg);
  }
  .sidebar-nav-flat .nav-section-actions {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
  }
  .sidebar-nav-flat .nav-section-del {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--text-faint);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar-nav-flat .nav-section-del:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
  }

  .sidebar-editing .sidebar-nav-flat .nav-flat-item {
    cursor: grab;
    background: var(--panel-soft);
  }
  .sidebar-editing .sidebar-nav-flat .nav-flat-item.active {
    background: var(--panel-soft);
    color: var(--text);
  }
  .sidebar-editing .sidebar-nav-flat .nav-flat-item.active .nav-flat-icon {
    color: var(--text-muted);
  }
  .nav-flat-eye {
    display: none;
    margin-left: auto;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    font-size: 13px;
  }
  .sidebar-editing .nav-flat-eye {
    display: inline-flex;
  }
  .nav-flat-eye:hover {
    background: var(--border);
    color: var(--text);
  }

  /* Hidden item — only shown in edit mode (greyed + struck-through). */
  .nav-flat-item.nav-item-hidden {
    display: none;
  }
  .sidebar-editing .nav-flat-item.nav-item-hidden {
    display: flex;
    opacity: 0.45;
  }
  .sidebar-editing .nav-flat-item.nav-item-hidden .nav-flat-label {
    text-decoration: line-through;
  }

  /* Bottom edit controls (Add / Reset). */
  .nav-edit-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .nav-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
  }
  .nav-edit-btn:hover {
    background: var(--panel-soft);
    color: var(--text);
    border-style: solid;
  }
  .nav-edit-btn i { font-size: 12px; }

  /* When the chip is in editing mode the visual flips to "DONE". */
  .sidebar-edit-chip[data-mode="editing"] {
    background: var(--text);
    color: white;
    border-color: var(--text);
  }
  .sidebar-edit-chip[data-mode="editing"]:hover {
    filter: brightness(1.18);
  }

  /* ── Drag-and-drop reorder (edit mode only) ──────────────────── */
  .sidebar-editing .sidebar-nav-flat .nav-flat-item {
    cursor: grab;
    position: relative;
  }
  .sidebar-editing .sidebar-nav-flat .nav-flat-item:active { cursor: grabbing; }
  .nav-flat-grip {
    display: none;
    flex: 0 0 auto;
    width: 14px;
    margin-right: 4px;
    color: var(--text-faint);
    font-size: 14px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* let drag fire on the parent .nav-flat-item */
  }
  .sidebar-editing .nav-flat-grip { display: inline-flex; }
  .sidebar-editing .nav-flat-item.is-dragging {
    opacity: 0.45;
  }
  /* Drop indicator: a thin teal line above/below the target. */
  .sidebar-editing .nav-flat-item.is-drop-before::before,
  .sidebar-editing .nav-flat-item.is-drop-after::after,
  .sidebar-editing .nav-section.is-drop-before::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--brand, #0D7377);
    border-radius: 2px;
    pointer-events: none;
  }
  .sidebar-editing .nav-flat-item.is-drop-before::before { top: -1px; }
  .sidebar-editing .nav-flat-item.is-drop-after::after { bottom: -1px; }
  .sidebar-editing .nav-section { position: relative; }
  .sidebar-editing .nav-section.is-drop-before::after { bottom: -2px; }
}

/* ============================================================
   MOBILE DRAWER VISUAL POLISH (≤1023px)
   Tightens spacing, shrinks the logo and primary cards, and trims
   section-label padding so the drop-down drawer fits more content
   without scrolling. Only sets size/padding/font-size — never colors
   — so it layers cleanly over whatever theme is in place (dark glass
   or the locksmith light-glass override). Desktop sidebar styling is
   fully preserved — every rule is gated by `@media (max-width: 1023px)`.
   ============================================================ */
@media (max-width: 1023px) {
  /* Logo: smaller, less top padding so the drawer doesn't waste a
     full row on chrome before the search input. */
  .sidebar-logo { padding: 0.65rem 0.875rem 0.4rem; }
  .sidebar-logo-text { font-size: 1.05rem; letter-spacing: -0.025em; }
  .sidebar-logo img { height: 22px; }

  /* Command bar: tighter padding and a slightly shorter search pill. */
  .sidebar-cmdbar { padding: 0.25rem 0.5rem; margin: 0 0 0.15rem; gap: 0.25rem; }
  .cmdbar-search { padding: 0.4rem 0.5rem 0.4rem 1.85rem; font-size: 0.78rem; }
  .cmdbar-search-icon { left: 0.55rem; font-size: 0.78rem; }

  /* Section labels: less top air so the section feels grouped to its
     own header rather than separated by a paragraph break. */
  .sidebar-nav .nav-section-label {
    padding: 0.55rem 0.75rem 0.3rem;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }

  /* Primary 2-col cards: shorter rows, slimmer icon chip, smaller
     label so all 6 routes fit in roughly half the vertical space.
     (No-op on builds where PR #277 hides the primary grid on mobile,
     but harmless — the rules just don't have anything to apply to.) */
  .sidebar-nav .nav-primary-grid {
    gap: 0.4rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
  }
  .sidebar-nav .nav-primary-card {
    padding: 0.5rem 0.55rem;
    gap: 0.3rem;
    font-size: 0.74rem;
    border-radius: 10px;
  }
  .sidebar-nav .nav-primary-ico {
    width: 26px; height: 26px;
    border-radius: 7px;
    font-size: 0.82rem;
  }
  .sidebar-nav .nav-primary-label { font-size: 0.74rem; }

  /* Favorites: tighter padding, smaller text. */
  .sidebar-nav .nav-fav-row {
    padding: 0.32rem 0.45rem;
    font-size: 0.74rem;
    border-radius: 7px;
  }
  .sidebar-nav .nav-fav-dot { width: 7px; height: 7px; }

  /* Chips: smaller pill, lighter padding. */
  .sidebar-nav .nav-chips { gap: 0.3rem; padding-bottom: 0.6rem; }
  .sidebar-nav .nav-chip {
    padding: 0.32rem 0.55rem;
    font-size: 0.68rem;
    border-radius: 999px;
    gap: 0.3rem;
  }
  .sidebar-nav .nav-chip i { font-size: 0.7rem; }

  /* Slim the "More" tucked-away drawer summary too. */
  .sidebar-nav .nav-more-summary {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
  }

  /* Drawer body padding: a bit less so we get more vertical real
     estate for the actual nav. */
  .sidebar-nav { padding: 0.3rem 0.5rem; }

  /* Footer (notif row + user button): tighter rows. */
  .sidebar-footer { padding: 0.35rem 0.5rem 0.5rem; gap: 0.15rem; }
  .sidebar-notif-row { padding: 0.42rem 0.55rem; font-size: 0.78rem; border-radius: 8px; }
  .sidebar-user { padding: 0.4rem 0.55rem; }
  .sidebar-user-avatar { width: 28px; height: 28px; font-size: 0.7rem; }
  .sidebar-user-name { font-size: 0.8rem; }
  .sidebar-user-role { font-size: 0.66rem; }
}

