/* ──────────────────────────────────────────────────────────────────────────
   Nest IQ — Sticky Navbar layout polish & KPI hierarchy
   Loaded globally via shared/includes/layout/css.html on every protected page.
   Scope: on-screen only (print rules live in print.css).
   ──────────────────────────────────────────────────────────────────────── */

/* ── 2. Sticky-navbar spacing ──────────────────────────────────────────────
   The navbar is position:sticky at the top. Anchored navigation (in-page
   #hash links) would otherwise scroll content under the navbar. scroll-margin
   reserves the navbar's height so anchored targets land below it. We also give
   the first page-header ~24px of breathing room beneath the navbar bar. */
.page-body,
.page-header,
[id] { scroll-margin-top: 5rem; }

.page-wrapper > .page-header:first-child,
.page-header {
  padding-top: 1.5rem;    /* ~24px between the sticky navbar and the page title */
  padding-bottom: 1.25rem; /* ground the header before the filter row begins */
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--tblr-border-color, rgba(0, 0, 0, 0.08));
}

/* Keep the compact workspace switcher from stretching: size to its content
   and never let the branch label wrap inside the pill. */
#workspace-switcher .dropdown-toggle {
  white-space: nowrap;
}
#workspace-switcher .dropdown-toggle > strong {
  font-weight: 600;
}

/* ── 4. Z-index / occlusion ────────────────────────────────────────────────
   Keep the sticky navbar above all page-body chrome (Bootstrap fixed level),
   and ensure utility dropdowns (workspace switcher, identity menu) and the
   mobile collapse menu render above it when open. */
.sticky-top,
.navbar.sticky-top { z-index: 1030; }

#workspace-switcher .dropdown-menu,
.navbar .dropdown-menu { z-index: 1031; }

/* Mobile: when the hamburger menu is expanded, the collapsed navbar panel must
   sit above page content and never be clipped by the page-header below it. */
@media (max-width: 767.98px) {
  .navbar-collapse.show,
  .navbar-collapse.collapsing { z-index: 1032; position: relative; }
}

/* ── 3. KPI card hierarchy ─────────────────────────────────────────────────
   Match the executive Net Profit card to the dashboard's primary cards:
   identical border-radius, elevation depth, and comfortable padding. */
.card-netprofit {
  border-radius: var(--tblr-border-radius, 0.5rem);
  box-shadow: var(--tblr-shadow-card, 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12));
}

.card-netprofit > #kpi-netprofit-body {
  padding: 1.25rem 1.5rem; /* parity with .card-body default rhythm */
}

/* Readability guard: labels/sub-text on the charcoal Net Profit background
   must stay legible regardless of the active Bootstrap colour scheme. */
[data-bs-theme="dark"] .card-netprofit #kpi-netprofit-body,
.card-netprofit #kpi-netprofit-body { color: #f8fafc; }
