body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #ffffff;
  padding-top: 92px; /* always reserve space for fixed header (16px + 60px pill + 16px) */
}

/* ============================= */
/* KPI.zone Header               */
/* ============================= */

.kpi-header__toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.kpi-header {
  position: fixed; /* fixed on BOTH desktop and mobile */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  padding: 16px 1rem; /* breathing room above/below pill */
  margin: 0;
}

/* MkDocs overrides */
.md-header {
  top: 92px;
  z-index: 500;
}
.md-container,
.md-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ============================= */
/* DESKTOP pill                  */
/* ============================= */

.kpi-header__pill {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  height: 60px;
  padding: 0 1.2rem;
  border-radius: 999px;
  background: #e7e8eb;
}

.kpi-header__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  height: 100%;
}

.logo-image {
  max-height: 1.4rem;
  display: block;
}

.kpi-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  flex: 1;
}

.kpi-header__link {
  font-weight: 700 !important;
  text-decoration: none !important;
  color: #1f3f46 !important;
  font-size: 0.8rem !important;
}

.kpi-header__link:hover {
  color: #163035 !important;
}

.kpi-iconbtn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e7e8eb;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #111;
  cursor: pointer;
  flex-shrink: 0;
}
.kpi-iconbtn:hover {
  background: #dedfe3;
}

/* ============================= */
/* MOBILE bar                    */
/* ============================= */

.kpi-header__mobile-bar {
  display: none; /* hidden on desktop */
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1.2rem; /* padding inside bar, no extra margin needed */
  border-radius: 999px;
  background: #e7e8eb;
}

/* ============================= */
/* MOBILE overlay                */
/* ============================= */

.kpi-header__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #f0f0f2;
  z-index: 1001;
  flex-direction: column;
}

#kpi-nav-toggle:checked ~ .kpi-header__overlay {
  display: flex;
}

.kpi-overlay__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 8px 1rem 0;
  flex-shrink: 0;
}

.kpi-overlay__bar .kpi-iconbtn {
  background: #e7e8eb;
}

.kpi-overlay__nav {
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 0;
}

.kpi-header__m-link {
  font-size: 1.3rem !important;
  font-weight: 400 !important;
  color: #1a1a2e !important;
  text-decoration: none !important;
  padding: 0.75rem 0 !important;
  border: none !important;
}
.kpi-header__m-link:hover {
  opacity: 0.6 !important;
}

/* ============================= */
/* Responsive switch             */
/* ============================= */

@media (max-width: 900px) {
  .kpi-header__pill {
    display: none;
  }
  .kpi-header__mobile-bar {
    display: flex;
  }

  /* No change needed on .kpi-header — fixed/padding already correct */
}

@media (min-width: 901px) {
  .kpi-header__overlay {
    display: none !important;
  }
}
