/* ============================================================
   Vandelay Companies — Sidebar layout
   Used by Financial Dashboard, Forecasting, and Labor Efficiency.
   Active only inside .vc-design-context.

   Markup pattern:
     <div class="vc-sidebar-layout">
       <aside class="vc-sidebar">
         <h6 class="vc-sidebar__group">Section</h6>
         <a class="vc-sidebar__link" href="...">...</a>
         <a class="vc-sidebar__link vc-sidebar__link--active" href="...">...</a>
       </aside>
       <main class="vc-sidebar-main">
         ...page content...
       </main>
     </div>

   For Capacitor / mobile, the sidebar collapses behind a Bootstrap
   offcanvas — keep the existing data-bs-toggle markup; CSS only
   hides/shows the desktop sidebar.
   ============================================================ */

.vc-design-context .vc-sidebar-layout {
  display: flex;
  min-height: calc(100vh - var(--_vc-topbar-height));
  align-items: stretch;
  background: var(--vc-paper);
  margin: 0 calc(var(--vc-space-6) * -1);
}

.vc-design-context .vc-sidebar {
  flex: 0 0 220px;
  background: var(--vc-paper-2);
  border-right: 1px solid var(--vc-rule);
  padding: var(--vc-space-5) var(--vc-space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--vc-sans);
}

@media (max-width: 991.98px) {
  .vc-design-context .vc-sidebar { display: none; }
  /* Stack the mobile toggle bar ABOVE main (not beside it). The default
     row-direction caused the toggle to take left-side width and shoved
     <main> into the right ~70% of the viewport — content was offset and
     clipped. flex-direction: column makes the toggle stack on top, so
     <main> can claim full width below. */
  .vc-design-context .vc-sidebar-layout {
    flex-direction: column;
    /* Drop the negative side margins on mobile — the parent .container
       only has 12px padding, so a -24px margin pushed content past the
       viewport edge and clipped on the right. */
    margin-left: 0;
    margin-right: 0;
  }
}

.vc-design-context .vc-sidebar__group {
  font-family: var(--vc-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vc-ink-3);
  margin: var(--vc-space-3) var(--vc-space-3) var(--vc-space-1);
  padding: 0;
}
.vc-design-context .vc-sidebar__group:first-child { margin-top: 0; }

.vc-design-context .vc-sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px var(--vc-space-3);
  color: var(--vc-ink-2);
  font-family: var(--vc-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--vc-r-md);
  border-left: 2px solid transparent;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.vc-design-context .vc-sidebar__link:hover,
.vc-design-context .vc-sidebar__link:focus-visible {
  background: var(--vc-navy-tint);
  color: var(--vc-navy);
  outline: none;
}

.vc-design-context .vc-sidebar__link--active {
  background: var(--vc-surface);
  color: var(--vc-navy);
  border-left-color: var(--vc-navy);
  font-weight: 600;
}

.vc-design-context .vc-sidebar__link i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.vc-design-context .vc-sidebar-main {
  flex: 1;
  min-width: 0;
  padding: var(--vc-space-5) var(--vc-space-6);
  overflow-x: auto;
}

@media (max-width: 991.98px) {
  .vc-design-context .vc-sidebar-main {
    padding: var(--vc-space-4);
  }
}

/* ── Mobile menu toggle for sidebar layouts ─────────────────── */
.vc-design-context .vc-sidebar-mobile-toggle {
  display: none;
}

@media (max-width: 991.98px) {
  .vc-design-context .vc-sidebar-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    /* No negative side margins — the parent .container has only 12px
       padding on phones, so a -24px bleed pushes the toggle bar past
       the viewport edge. Stay within the container. */
    margin: 0 0 var(--vc-space-4);
    background: var(--vc-paper-2);
    border-bottom: 1px solid var(--vc-rule);
    font-family: var(--vc-sans);
    font-size: 13px;
    color: var(--vc-ink-2);
  }
  .vc-design-context .vc-sidebar-mobile-toggle button {
    background: transparent;
    border: 1px solid var(--vc-rule-strong);
    border-radius: var(--vc-r-md);
    padding: 4px 10px;
    font-size: 12px;
    color: var(--vc-ink-2);
    cursor: pointer;
  }
}

/* ── Offcanvas mobile sidebar (Bootstrap-driven) ─────────────── */
.vc-design-context .offcanvas-vc {
  background: var(--vc-paper-2);
  font-family: var(--vc-sans);
}
.vc-design-context .offcanvas-vc .offcanvas-header {
  border-bottom: 1px solid var(--vc-rule);
}
.vc-design-context .offcanvas-vc .offcanvas-title {
  font-family: var(--vc-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vc-ink-3);
}

/* ── Sidebar-page header ─────────────────────────────────────
   Pages inside the sidebar layout get a slimmer header that
   doesn't bleed to the viewport edges (because the sidebar takes
   the left half). Override the global page-header here. */
.vc-design-context .vc-sidebar-main .vc-page-header {
  margin-left: 0;
  margin-right: 0;
  padding: 0 0 var(--vc-space-5);
  border-bottom: 1px solid var(--vc-rule);
  background: transparent;
}
.vc-design-context .vc-sidebar-main .vc-page-header__title { font-size: 36px; }
