/* ==========================================================================
   CNQ Business Suite — sidebar selection-state corrections

   Loaded from layout/header.php, immediately after bs-mobile-fixes.css, which
   every one of the suite's ~140 pages includes. That partial is required from
   inside <body>, so this sheet is in-body: valid, and the same pattern
   layout/sidebar.php (ai-pet.css) and layout/footer.php (bs-assistant.css)
   already use. It lands before #kt_app_header and before all page content, and
   first paint is already gated on the 1.5MB style.bundle.css in <head>, so the
   practical cost is nil.

   Being later in the cascade than style.bundle.css is deliberate: plain
   declarations already win at equal specificity, so nothing here needs
   !important.

   Why this file exists: style.bundle.css styles the selected sidebar entry
   with .menu-active-bg .menu-item .menu-link.active { background-color; color }
   and nothing else — it declares NO font-weight for either the .active (leaf)
   or the .here (open section) state. Every sidebar title is a flat 600 from
   `.app-sidebar .menu > .menu-item > .menu-link .menu-title`, so the selected
   item reads exactly like its neighbours. Editing the 1.5MB vendored theme
   bundle to add one declaration is not worth the merge cost, hence this sheet.
   ========================================================================== */


/* ==========================================================================
   1. SELECTED NAVIGATION ITEM IS BOLD

   700 is the theme's own bold step (.fw-bolder), one notch above the 600 that
   .app-sidebar menu titles already carry — so the selected row is visibly
   heavier without introducing a weight the Inter face is not loaded for
   (header.php requests 300,400,500,600,700).

   Both halves of the selection are covered:
     .menu-link.active   — the leaf link for the current page.
     .menu-item.here     — the accordion section that contains it, which
                           sidebar.php marks with `here show`. Bolding the
                           section title too keeps the trail readable when the
                           leaf is scrolled out of view.

   Everything is scoped under .app-sidebar so the header dropdowns, the
   user menu and the theme-mode menu — which reuse the same .menu-link/.active
   classes — are untouched.
   ========================================================================== */

.app-sidebar .menu .menu-item .menu-link.active .menu-title,
.app-sidebar .menu .menu-item.here > .menu-link .menu-title {
  font-weight: 700;
}


/* ==========================================================================
   2. MUTED TEXT MEETS WCAG AA IN BOTH THEMES

   style.bundle.css ships --bs-text-muted as #A1A5B7 in light and #565674 in
   dark. Against the surfaces they actually sit on that is 2.45:1 on the white
   content background and 1.96-2.57:1 on the dark card/body/aside backgrounds
   (#2B2B40 / #1e1e2d / #1b1b29 / #151521) — far under the 4.5:1 AA needs for
   body text, and the reason Business Suite Home reads as "very faint" once the
   theme is switched to dark. Every secondary line on that page (the toolbar
   subtitle, the module captions, the shortcut descriptions) is .text-muted.

   Replacements, measured against the same four dark surfaces and white:
     light  #6B7280 -> 4.83:1 on #ffffff
     dark   #9A9AB0 -> 5.01:1 (worst case, #2B2B40) up to 6.57:1

   Both stay visibly secondary to --bs-body-color, so the visual hierarchy the
   theme intends is unchanged; only the legibility floor moves. Overriding the
   token rather than the utility class keeps .text-muted, .menu-heading and
   everything else that resolves it in step.

   Still below AA and deliberately left alone (they are not text-carrying on
   the pages in this report, and flattening them would collapse the theme's
   grey ramp): --bs-gray-600 in dark, #6D6D80, 2.73-3.57:1.
   ========================================================================== */

[data-bs-theme="light"] {
  --bs-text-muted: #6B7280;
}

[data-bs-theme="dark"] {
  --bs-text-muted: #9A9AB0;
}


/* ==========================================================================
   3. DISABLED MENU ROWS LOOK DISABLED

   The user menu now renders the controls that have nothing behind them
   ("My Projects", the four untranslated languages) as .menu-link.disabled
   spans carrying a title= explanation, instead of <a href="#"> rows that
   swallowed the click silently. style.bundle.css has no .disabled state for
   .menu-link, so without this they would still take the menu-state-bg hover
   highlight and read as clickable.

   pointer-events is deliberately NOT disabled: the native title tooltip is the
   whole point of the row, and it only fires while the element receives hover.
   ========================================================================== */

.menu .menu-link.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.menu.menu-state-bg .menu-item .menu-link.disabled:hover,
.menu .menu-item .menu-link.disabled:hover {
  background-color: transparent;
  transition: none;
}

/* ==========================================================================
   4. INLINE FILTER BARS STAY INLINE

   select2 replaces the <select> with its own container and stamps
   `style="width: 100%"` on it inline. That beats the `w-auto` class the
   markup put on the select, so every select2 in a filter row claimed the
   full width of the row and pushed the controls after it onto new lines —
   the invoice, quotation and consumer-bill lists and the attendance-marking
   page all rendered their filters as a vertical stack instead of one bar.

   Scoped to selects that asked for `w-auto`, so this only asserts what the
   markup already said and leaves the full-width selects in forms alone.
   `!important` is required: the competing declaration is an inline style.
   ========================================================================== */

select.w-auto + .select2-container {
  width: auto !important;
  min-width: 8.5rem;
}

/* The rendered control is what carries the visible width, and select2's own
   sheet gives it no minimum, so a short option ("10") collapses to a sliver. */
select.w-auto + .select2-container .select2-selection--single {
  min-width: 8.5rem;
}

/* A filter bar is a wrapping flex row of small controls; without a floor the
   date inputs and the search box shrink past the point of being usable when
   several filters share one line. */
#perForm .form-control[type="date"] {
  min-width: 9.5rem;
}
