/*
 * Orbicular sidebar — "Amber Charcoal" design system (vol-m0y1 / P0).
 *
 * Single source of truth for the navigation sidebar look, loaded in BOTH the
 * Vue/Inertia layout and the legacy Blade layout so the menu is identical on
 * both sides of the strangler-fig boundary. Markup differs per platform; the
 * `.obx-*` class names and tokens here are the shared contract that
 * widgets/main-navigation (Vue) and layouts/partials/nav-item.blade.php (Blade)
 * both emit. Hand-authored (not Tailwind utilities) so it cannot drift.
 *
 * Spec: docs/superpowers/specs/2026-06-22-sidebar-orbicular-redesign-design.md
 */

/* ---- BRAND: single source of truth -------------------------------------
 * The one place the brand accent is defined. Loaded globally (both the Vue
 * and Blade layouts link this file), so it resolves everywhere — unlike the
 * PrimeVue `--p-primary-*` tokens, which only exist once the Vue app mounts
 * and are therefore absent on pure Blade pages. The PrimeVue preset
 * (resources/js/theme/volumi-preset.ts) and the `.obx-*` sidebar tokens below
 * both reference --brand-primary, so changing the brand is a one-line edit.
 * INTERIM value; final owned by the Style Book. // TODO(style-book)
 * ---------------------------------------------------------------------- */
:root {
  --brand-primary: #4f45fc;
  --brand-primary-ink: #ffffff;
}

.obx-sidebar {
  border: 0;

  /* ---- tokens ---- */
  --obx-bg: #2f4050;
  --obx-accent: var(--brand-primary);
  --obx-accent-ink: var(--brand-primary-ink);
  --obx-accent-soft: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  --obx-text: #cbd5e1;
  --obx-text-strong: #f1f5f9;
  --obx-muted: #94a3b8;
  --obx-hover: rgba(255, 255, 255, 0.07);
  --obx-divider: rgba(255, 255, 255, 0.09);

  /* Liquid-glass active capsule — neutral frosted material, brand-independent.
   * On a flat sidebar there is no content behind to refract, so this reads as a
   * frosted translucent pill with a specular top rim + depth shadow (not full
   * Apple refraction). Dark-rail values here; the light Vue rail overrides below. */
  --obx-glass-bg: rgba(255, 255, 255, 0.1);
  --obx-glass-rim: rgba(255, 255, 255, 0.22);
  --obx-glass-ring: rgba(255, 255, 255, 0.14);
  --obx-glass-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);

  --obx-scroll-thumb: rgba(255, 255, 255, 0.16);
  --obx-scroll-thumb-hover: rgba(255, 255, 255, 0.32);

  --obx-radius: 12px;
  --obx-radius-sm: 9px;
  --obx-gap: 11px;

  background: var(--obx-bg);
  color: var(--obx-text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

/* Light theme — Vue sidebar only (the <aside>, never the Blade .navbar-static-side,
 * which stays dark). The brand header keeps its dark photo backdrop in both themes
 * so the white logo stays visible (we have no dark logo asset). The amber accent is
 * brand-fixed, so only the neutral surfaces flip.
 * The collapsed-rail flyout (CollapsedFlyout.vue) teleports to <body>, outside
 * .obx-sidebar, so it is listed here too — otherwise it falls back to the :root
 * dark defaults and renders dark over a light rail. */
html:not(.app-dark) .obx-sidebar:not(.navbar-static-side),
html:not(.app-dark) .obx-flyout-outer {
  --obx-bg: #ffffff;
  --obx-text: #475569;
  --obx-text-strong: #0f172a;
  --obx-muted: #94a3b8;
  --obx-hover: rgba(15, 23, 42, 0.05);
  --obx-divider: rgba(15, 23, 42, 0.1);
  --obx-profile-bg: rgba(15, 23, 42, 0.04);

  /* Frosted glass on the white rail: a faint dark tint + bright rim reads as a
   * raised pill on light (a translucent-white pill would be invisible here). */
  --obx-glass-bg: rgba(15, 23, 42, 0.05);
  --obx-glass-rim: rgba(255, 255, 255, 0.7);
  --obx-glass-ring: rgba(15, 23, 42, 0.08);
  --obx-glass-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);

  --obx-scroll-thumb: rgba(15, 23, 42, 0.18);
  --obx-scroll-thumb-hover: rgba(15, 23, 42, 0.34);
}

/* ---- brand (header band with the profile backdrop + centered wordmark) ---- */
.obx-brand {
  position: relative; /* containing block for the absolutely-positioned collapse toggle */
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  margin-bottom: 12px;
  background: url('/img/header-profile.png') center / cover no-repeat;
}

.obx-brand img {
  height: 21px;
  width: auto;
}

/* Circular collapse/expand button at the brand bottom-right — mirrors Logo.vue's charcoal pill.
 * Centered on the rail's right edge (50% overhang) in both states, so it sits on the
 * sidebar/content boundary exactly like the expanded state. */
.obx-collapse-toggle {
  position: absolute;
  bottom: 0;
  right: 0;
  transform: translate(50%, 50%);
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  background: var(--obx-bg);
  border: 2px solid var(--obx-bg);
  /* ring-offset-2 (charcoal gap) then ring-2 ring-white/90 */
  box-shadow: 0 0 0 2px var(--obx-bg), 0 0 0 4px rgba(255, 255, 255, 0.9);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.obx-collapse-toggle:hover {
  /* slightly lighter than --obx-bg (#2f4050) for a visible but subtle hover */
  background: #3d5166;
  border-color: #3d5166;
  box-shadow: 0 0 0 2px #3d5166, 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.obx-sidebar .obx-collapse-toggle .pi {
  font-size: 14px;
  line-height: 1;
  color: #ffffff;
}

/* Links keep their colour across :visited — a legacy `a:visited` rule otherwise
 * turns a visited item (e.g. Dashboard) blue. */
.obx-sidebar a {
  text-decoration: none;
}

.obx-nav__item,
.obx-nav__item:visited,
.obx-nav__subitem,
.obx-nav__subitem:visited {
  color: var(--obx-text);
}

/* ---- nav list ---- */
.obx-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Animated accordion wrapper: grid-template-rows 0fr->1fr animates the EXACT
 * content height, independent of length/nesting and symmetric for open/close —
 * no max-height magic numbers, no layout jump. */
.obx-nav__sub-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.obx-nav__sub-wrap--open {
  grid-template-rows: 1fr;
}

.obx-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

/* ---- nav item (row) ---- */
.obx-nav__item {
  display: flex;
  align-items: center;
  gap: var(--obx-gap);
  box-sizing: border-box;
  min-height: 35px;
  padding: 7px 12px;
  margin: 1px 0;
  border-radius: var(--obx-radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--obx-text);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.obx-nav__item:hover {
  color: var(--obx-text-strong);
}

.obx-nav__item--active {
  background: var(--obx-glass-bg);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  color: var(--obx-text-strong);
  font-weight: 700;
  box-shadow:
    var(--obx-glass-shadow),
    inset 0 1px 0 var(--obx-glass-rim),
    inset 0 0 0 1px var(--obx-glass-ring);
}

.obx-nav__item--active:hover {
  background: var(--obx-glass-bg);
  color: var(--obx-text-strong);
}

/* ---- icon / label / trailing ---- */
/*
 * Use .obx-sidebar scope (specificity 0,2,0) to beat PrimeVue's inline-injected
 * `.pi { font-size: var(--p-icon-size) }` which has specificity (0,1,0) but lands
 * later in the cascade via dynamic JS stylesheet insertion.
 */
.obx-sidebar .obx-nav__icon {
  flex: none;
  font-size: 17px;
  line-height: 1;
}

.obx-nav__label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.obx-nav__chevron {
  flex: none;
  margin-left: auto;
  font-size: 13px;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.obx-nav__chevron--open {
  transform: rotate(180deg);
}

/* ---- badge ---- */
.obx-badge {
  flex: none;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--obx-accent);
  color: var(--obx-accent-ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

/* ---- nested sub-items ---- */
.obx-nav__subitem {
  display: flex;
  align-items: center;
  gap: var(--obx-gap);
  padding: 6px 12px 6px 22px;
  margin: 1px 0;
  border-radius: var(--obx-radius-sm);
  font-size: 13px;
  color: var(--obx-text);
  text-decoration: none;
  opacity: 0.85;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}

.obx-nav__subitem:hover {
  color: var(--obx-text-strong);
  opacity: 1;
}

.obx-nav__subitem--active {
  background: var(--obx-glass-bg);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  color: var(--obx-text-strong);
  opacity: 1;
  font-weight: 600;
  box-shadow:
    var(--obx-glass-shadow),
    inset 0 1px 0 var(--obx-glass-rim),
    inset 0 0 0 1px var(--obx-glass-ring);
}

/* ---- search pill ---- */
.obx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--obx-radius-sm);
  background: var(--obx-hover);
  color: var(--obx-muted);
  font-size: 13px;
}

/* Reset the global Inspinia input height (35px) so the pill stays slim — the
 * .obx-search padding controls the row height, matching the reference. */
.obx-sidebar .obx-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 20px;
  line-height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--obx-text);
  font-size: 13px;
  outline: none;
  box-shadow: none;
}

.obx-search__input::placeholder {
  color: var(--obx-muted);
}

/* Search wrapper — mirrors the nav list horizontal padding so the pill aligns
 * with the nav items. Collapsed state removes the extra padding because the
 * sidebar's own px-3 (Vue) / body.mini-navbar padding (Blade) is sufficient. */
.obx-search-wrap {
  padding: 0 20px 8px;
}

.obx-sidebar--collapsed .obx-search-wrap {
  padding: 0 0 8px;
}

body.mini-navbar .obx-sidebar .obx-search-wrap {
  padding: 0 0 8px;
}

/* Clear button inside the search pill */
.obx-search__clear {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--obx-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.obx-search__clear:hover {
  color: var(--obx-text);
}

.obx-search__clear .pi {
  font-size: 10px;
  line-height: 1;
}

/* Collapsed-rail icon-only search button (Vue uses v-if; Blade uses CSS show/hide) */
.obx-search--icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  padding: 0;
  border-radius: var(--obx-radius);
  background: var(--obx-hover);
  border: 0;
  color: var(--obx-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.obx-search--icon-only:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--obx-text);
}

.obx-search--icon-only .pi {
  font-size: 15px;
  line-height: 1;
}

/* Blade: show full pill by default; swap to icon button when collapsed.
   Scoped to :not(.obx-sidebar--collapsed) so the Vue sidebar (which uses
   that class when collapsed) is not affected — Vue's v-if handles its own
   show/hide without needing CSS. */
body:not(.mini-navbar) .obx-sidebar:not(.obx-sidebar--collapsed) .obx-search--icon-only {
  display: none;
}

body.mini-navbar .obx-sidebar .obx-search--full {
  display: none;
}

/* Highlight span for matched substrings in visible nav labels */
.obx-search__hl {
  background: rgba(224, 177, 94, 0.30);
  color: var(--obx-accent);
  border-radius: 3px;
  padding: 0 1px;
  font-weight: 600;
}

/* ---- CSS tokens at :root -----------------------------------------------
 * Mirrors the .obx-sidebar token block so that elements Teleported to
 * <body> (the collapsed flyout) can resolve custom properties. The sidebar
 * block stays the source of truth; these are a structural necessity.
 * ---------------------------------------------------------------------- */
:root {
  --obx-bg: #2f4050;
  --obx-accent: var(--brand-primary);
  --obx-accent-ink: var(--brand-primary-ink);
  --obx-accent-soft: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  --obx-text: #cbd5e1;
  --obx-text-strong: #f1f5f9;
  --obx-muted: #94a3b8;
  --obx-hover: rgba(255, 255, 255, 0.07);
  --obx-divider: rgba(255, 255, 255, 0.09);
  --obx-glass-bg: rgba(255, 255, 255, 0.1);
  --obx-glass-rim: rgba(255, 255, 255, 0.22);
  --obx-glass-ring: rgba(255, 255, 255, 0.14);
  --obx-glass-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  --obx-radius: 12px;
  --obx-radius-sm: 9px;
  --obx-gap: 11px;
}

/* ---- collapsed flyout popover ---- */
.obx-flyout {
  border-radius: var(--obx-radius);
  background: var(--obx-bg);
  padding: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
}

/* Stacked layout: chip on top, children card below.
 * position: relative anchors the sliding hover pill (.obx-nav__hover-pill) that
 * flows between the flyout rows, mirroring the main rail. */
.obx-flyout--children {
  position: relative;
  margin-top: 4px;
  min-width: 150px;
}

/* ---- collapsed flyout: outer wrapper (Teleported to <body>) ---- */
.obx-flyout-outer {
  pointer-events: auto;
  min-width: 150px;
  max-width: 240px;
}

/* Links inside the flyout must not show browser underline (the
 * .obx-sidebar a rule only covers the sidebar DOM tree, not Teleported nodes). */
.obx-flyout-outer a {
  text-decoration: none;
}

/* ---- collapsed flyout: label chip ---- */
.obx-flyout__chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--obx-accent);
  color: var(--obx-accent-ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(224, 177, 94, 0.3);
}

/* Sub-item rows inside the flyout card use shallower left padding than the
 * inline accordion (which has 22px to visually indent under the parent icon).
 * The exact left padding is overridden per-row via inline style to convey
 * nesting depth; 6px top/bottom from this rule is preserved. */
.obx-flyout .obx-nav__subitem {
  padding: 6px 10px;
}

/* Group / section header rows inside the flyout card.
 * These are non-navigable containers (the child links below them are the
 * actual nav targets).  Rendered as a <div> with a dimmed, uppercase label
 * so the user can identify the sub-section boundary at a glance. */
.obx-flyout__group-label {
  cursor: default;
  pointer-events: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.5;
  padding-top: 10px;
}

/* Icon inside the teleported flyout: matches .obx-sidebar .obx-nav__icon
 * which is scoped and does not reach outside the sidebar DOM. */
.obx-flyout-outer .obx-nav__icon {
  flex: none;
  font-size: 17px;
  line-height: 1;
}

/* ---- collapsed flyout: Vue Transition (slide-right + fade) ---- */
.obx-flyout-enter-active,
.obx-flyout-leave-active {
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}

.obx-flyout-enter-from,
.obx-flyout-leave-to {
  opacity: 0;
  transform: translateX(-6px);
}

/* ---- collapsed flyout: Blade fade-in (mirrors the Vue Transition above) ----
 * JS creates the flyout with --blade so it starts invisible, then adds
 * --blade-visible on the next rAF to trigger the transition. */
.obx-flyout-outer--blade {
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}

.obx-flyout-outer--blade.obx-flyout-outer--blade-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ---- divider ---- */
.obx-divider {
  border: 0;
  border-top: 1px solid var(--obx-divider);
  margin: 13px 2px;
}

/* ---- footer profile card ---- */
.obx-profile {
  display: flex;
  align-items: center;
  gap: var(--obx-gap);
  /* horizontal inset aligns the name with the nav labels; vertical breathing
   * room matches the reference card. */
  /* full-width band filling the footer to the bottom edge (reference); content
   * keeps breathing room via the larger bottom padding. */
  padding: 10px 12px 16px;
  background: var(--obx-profile-bg, rgba(255, 255, 255, 0.05));
  border-top: 1px solid var(--obx-divider);
  border-radius: var(--obx-radius) var(--obx-radius) 0 0;
}

.obx-profile__avatar {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--obx-accent);
  color: var(--obx-accent-ink);
}

.obx-profile__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--obx-bg);
}

.obx-profile__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
}

.obx-profile__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--obx-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.obx-profile__email {
  font-size: 11.5px;
  color: var(--obx-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  margin-top: 4px;
}

.obx-profile__logout {
  flex: none;
  margin-left: auto;
  color: var(--obx-text);
  opacity: 0.6;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.obx-profile__logout:hover {
  opacity: 1;
}

/* ---- dark-mode toggle row (Vue pages only) ---- */
.obx-toggle {
  display: flex;
  align-items: center;
  gap: var(--obx-gap);
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--obx-text);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.obx-toggle__icon {
  flex: none;
  font-size: 15px;
}

/* Sun (light state) takes the brand accent like the active nav item; the moon
 * (dark state) is the reference blue. */
.obx-toggle__icon.pi-sun {
  color: var(--obx-accent);
}

.obx-toggle__icon.pi-moon {
  color: #4f8ef7;
}

.obx-toggle__label {
  flex: 1 1 auto;
}

/* The switch is a visual indicator only — the whole row is the button. */
.obx-toggle__switch {
  pointer-events: none;
}

/* Collapsed rail: the toggle becomes a centred icon-button (still toggles). */
.obx-sidebar--collapsed .obx-toggle__label,
.obx-sidebar--collapsed .obx-toggle__switch {
  display: none;
}

.obx-sidebar--collapsed .obx-toggle {
  justify-content: center;
  padding: 6px 0;
}

/* ---- nav list default padding (replaced from nav-item.blade.php inline style) ---- */
.obx-sidebar .obx-nav {
  padding: 0 20px 12px;
}

/* ====================================================================
 * Liquid-glass hover pill — a single floating capsule that slides between
 * items as the cursor moves (one shared highlight, not per-item backgrounds),
 * so the glass appears to "flow". Position/size are driven by JS (Vue:
 * use-hover-pill.ts; Blade: navigation.blade.php) via the hovered item's
 * offset box; the springy easing sells the liquid motion. Sits behind the
 * item label/icon (z-index) and behind the active capsule.
 * ==================================================================== */
.obx-nav {
  position: relative;
}

.obx-nav__item,
.obx-nav__subitem {
  position: relative;
  z-index: 1;
}

.obx-nav__hover-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 0;
  border-radius: var(--obx-radius);
  background: var(--obx-glass-bg);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    var(--obx-glass-shadow),
    inset 0 1px 0 var(--obx-glass-rim),
    inset 0 0 0 1px var(--obx-glass-ring);
  opacity: 0;
  pointer-events: none;
  will-change: transform, width, height;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.45, 0.5, 1),
    width 0.38s cubic-bezier(0.34, 1.45, 0.5, 1),
    height 0.38s cubic-bezier(0.34, 1.45, 0.5, 1),
    opacity 0.18s ease;
}

.obx-nav__hover-pill--visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .obx-nav__hover-pill {
    transition:
      opacity 0.18s ease;
  }
}

/* ====================================================================
 * body.mini-navbar — icon rail (Blade legacy burger toggle)
 *
 * Mirrors layoutState.menuCollapsed=true in the Vue sidebar:
 *   w-16 (64 px) rail, labels/chevrons/badges/sub-wraps hidden,
 *   icons centred, active amber pill intact.
 *
 * Cascade note: orbicular-sidebar.css loads after app.css in
 * app.blade.php (line 24 vs 12), so these same-specificity (0,2,1)
 * rules override the legacy Inspinia 70 px rule without !important.
 * ==================================================================== */

/* 1. Collapse to 64 px — matches Vue's w-16 so Blade/Vue rail is identical */
body.mini-navbar .obx-sidebar {
  width: 64px;
}

/* Content margin must match the 64px rail. Inspinia's default (app.css) is 70px,
 * which left a 6px dark strip so the sidebar/content boundary fell to the right of
 * the collapse button instead of through its centre. */
body.mini-navbar #page-wrapper {
  margin-left: 64px;
}

/* 2. Tighten nav list horizontal padding — leaves room for centred icons */
body.mini-navbar .obx-sidebar .obx-nav {
  padding: 0 4px 12px;
}

/* 3. Brand — default: small logo hidden; collapsed: swap to small logo */
.obx-brand__small-logo {
  display: none;
}

body.mini-navbar .obx-brand__logo {
  display: none;
}

body.mini-navbar .obx-brand__small-logo {
  display: block;
  /* natural size on the rail (matches the Vue logo, which renders small-logo.png at 44x35) */
  height: 35px;
}

/* 4. Hide text elements — no truncated labels, chevrons, or badges.
 * Scoped to .obx-sidebar so the rules do not leak into the collapsed flyout,
 * which is appended to <body> (outside the rail) and must keep its labels. */
body.mini-navbar .obx-sidebar .obx-nav__label,
body.mini-navbar .obx-sidebar .obx-nav__chevron,
body.mini-navbar .obx-sidebar .obx-badge {
  display: none;
}

/* 5. Hide sub-wraps — the collapsed flyout hover replaces them */
body.mini-navbar .obx-sidebar .obx-nav__sub-wrap {
  display: none;
}

/* 6. Centre icon; remove gap that separated icon from the now-hidden label */
body.mini-navbar .obx-sidebar .obx-nav__item,
body.mini-navbar .obx-sidebar .obx-nav__subitem {
  justify-content: center;
  padding: 7px;
  gap: 0;
}

/* ====================================================================
 * .obx-sidebar--collapsed — Vue/Inertia equivalent of body.mini-navbar
 *
 * The Blade sidebar uses body.mini-navbar (class toggled by the Inspinia
 * burger button). The Vue sidebar uses layoutState.menuCollapsed which
 * binds obx-sidebar--collapsed on the <aside>. These rules mirror the
 * six Blade rules above so both rails collapse identically.
 *
 * Note: specificity for .obx-sidebar--collapsed rules must beat the
 * general .obx-sidebar .obx-nav rule (0,2,0) for padding overrides.
 * ==================================================================== */

/* 1. Vue rail width is set via w-[64px] Tailwind class on <aside> */

/* 2. Tighten nav list horizontal padding (beats .obx-sidebar .obx-nav at 0,2,0 via position) */
.obx-sidebar--collapsed .obx-nav {
  padding: 0 4px 12px;
}

/* 3. Logo swap is handled in Logo.vue via v-if on layoutState.menuCollapsed */

/* 4. Labels/chevrons/badges hidden via v-show / v-if in MenuItem.vue */

/* 5. Sub-wraps hidden via v-if in MenuItem.vue */

/* 6. Centre icon; remove gap; tighten padding (beats .obx-nav__item at 0,1,0) */
.obx-sidebar--collapsed .obx-nav__item,
.obx-sidebar--collapsed .obx-nav__subitem {
  justify-content: center;
  padding: 7px;
  gap: 0;
}

/* 7. Active-branch hint on the collapsed rail.
 * When collapsed, the active child leaf is hidden, so the top-level group that
 * owns the current page would otherwise show no active state. Surface it on the
 * group icon (soft accent pill + accent icon). Only applies while collapsed —
 * expanded rails already show the open accordion + active leaf pill. */
body.mini-navbar .obx-sidebar .obx-nav__item--branch-active,
.obx-sidebar--collapsed .obx-nav__item--branch-active {
  background: var(--obx-glass-bg);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  color: var(--obx-text-strong);
  box-shadow:
    var(--obx-glass-shadow),
    inset 0 1px 0 var(--obx-glass-rim),
    inset 0 0 0 1px var(--obx-glass-ring);
}

/* ====================================================================
 * Profile footer: sidebar bottom-pin
 *
 * Make the sidebar a flex column so the profile card stays at the
 * bottom. The nav region (.sidebar-collapse for Blade; the flex-1
 * Tailwind wrapper in Vue) grows to fill the remaining space and
 * scrolls internally when the menu is taller than the viewport.
 * ==================================================================== */
.obx-sidebar {
  display: flex;
  flex-direction: column;
}

/* Blade: fix the rail to the viewport so the footer stays pinned to the bottom
 * of the SCREEN on content scroll (Inspinia's .navbar-static-side is otherwise
 * absolute and scrolls away). #page-wrapper already reserves the rail width via
 * margin-left, so fixing the sidebar does not shift the content. Vue's <aside>
 * uses `sticky top-0 h-screen` Tailwind classes for the same effect. */
.obx-sidebar.navbar-static-side {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

/* Blade: the .sidebar-collapse div fills the space between the search
 * bar and the profile footer and scrolls internally when the menu is tall.
 * Vue uses a flex-1 Tailwind wrapper instead. */
.obx-sidebar .sidebar-collapse {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

/* ====================================================================
 * Nav scroll region — OverlayScrollbars (overlay, cross-browser).
 *
 * The nav region scrolls when the menu + footer exceed the viewport (common on
 * 13" laptops). A native scrollbar RESERVES width, which shifts the menu icons
 * left of the rail centre (out of line with the toggle/avatar) and squeezes the
 * hover pill. OverlayScrollbars renders the bar as an OVERLAY (zero reserved
 * width) identically in Safari/Chrome/Firefox, so icons stay centred and the
 * pill keeps full width. Initialised in overlayscrollbars-vue (Vue) and
 * blade-sidebar.ts (Blade); themed here via its CSS custom properties so the
 * thumb follows --obx-scroll-thumb (which flips with the light/dark sidebar).
 * ==================================================================== */
.obx-os-scroll {
  --os-size: 9px;
  --os-padding-perpendicular: 2px;
  --os-padding-axis: 4px;
  --os-handle-border-radius: 999px;
}

/* Handle colour set on .os-scrollbar so it beats OverlayScrollbars' built-in
 * os-theme-* class (which defines --os-handle-bg at the same level). The token
 * flips with the light/dark sidebar. */
.obx-os-scroll .os-scrollbar {
  --os-handle-bg: var(--obx-scroll-thumb);
  --os-handle-bg-hover: var(--obx-scroll-thumb-hover);
  --os-handle-bg-active: var(--obx-scroll-thumb-hover);
}

/* Slimmer thumb on the collapsed rail so it never crowds the 64px icons. */
.obx-sidebar--collapsed .obx-os-scroll,
body.mini-navbar .obx-sidebar .obx-os-scroll {
  --os-size: 7px;
}

/* ====================================================================
 * Profile footer: collapsed-rail variant
 *
 * When collapsed, show only the avatar (centred). Info text and the
 * logout button are removed from the DOM in Vue (v-if) and hidden via
 * CSS for the Blade sidebar (body.mini-navbar).
 * ==================================================================== */
.obx-sidebar--collapsed .obx-profile__info,
.obx-sidebar--collapsed .obx-profile form,
body.mini-navbar .obx-sidebar .obx-profile__info,
body.mini-navbar .obx-sidebar .obx-profile form {
  display: none;
}

.obx-sidebar--collapsed .obx-profile,
body.mini-navbar .obx-sidebar .obx-profile {
  justify-content: center;
  padding: 6px 0 8px;
  background: transparent;
  border-top: 0;
}
