.demo-banner {
  height: var(--demo-banner-height);
  background: var(--color-surface-demo);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.app-header {
  height: var(--header-height);
  background: var(--fiori-shell-bg);
  box-shadow: var(--fiori-shell-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  gap: var(--space-md);
  z-index: 100;
  position: relative;
}

.app-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
  flex: 1;
}

.app-header__logo {
  height: 2rem;
  width: auto;
  flex-shrink: 0;
}

.app-header__title {
  font-size: 1rem;
  font-weight: 400;
  color: var(--bih-teal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
}

.app-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Theme switcher (compare Fiori / n8n / ChatGPT live) */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.theme-switch__btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-switch__btn:hover {
  color: var(--color-text-body);
}

.theme-switch__btn.is-active {
  background: var(--fiori-sap-blue);
  color: #fff;
}

/* dropdown link item (Settings & Preferences) */
.user-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-body);
  border-radius: var(--radius-sm);
}
.user-menu__item:hover {
  background: var(--color-surface-muted);
  color: var(--color-text-body);
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  height: 2.25rem;
}

.user-menu__trigger:hover {
  background: var(--fiori-sidenav-hover);
}

.user-menu__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--fiori-sap-blue-light);
  color: var(--fiori-sap-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.user-menu__name {
  font-size: 0.875rem;
  color: var(--fiori-text);
}

.user-menu__chevron {
  font-size: 0.625rem;
  color: var(--color-text-muted);
}

.user-menu__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 15rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
  z-index: 200;
  padding: var(--space-sm) 0;
}

.user-menu.is-open .user-menu__dropdown {
  display: block;
}

.user-menu__section {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.user-menu__section:last-child {
  border-bottom: none;
}

.user-menu__label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.user-menu__dropdown select,
.user-menu__dropdown button {
  width: 100%;
  margin-top: var(--space-xs);
}

.user-menu__dropdown .btn {
  width: 100%;
  margin-top: var(--space-xs);
}

.scenario-bar {
  background: var(--fiori-sap-blue-light);
  border-bottom: 1px solid #b3d4ef;
  padding: var(--space-sm) var(--space-md);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.scenario-bar.is-active {
  display: flex;
}

.scenario-bar__coach {
  font-size: 0.875rem;
  color: var(--fiori-text);
  flex: 1;
}

.scenario-bar__step {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.app-body {
  display: flex;
  min-height: calc(100vh - var(--header-height) - var(--demo-banner-height));
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--fiori-sidenav-bg);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  padding: 0.5rem 0;
}

.sidebar__group {
  margin-bottom: 0.25rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--fiori-text);
  font-size: 0.875rem;
  border-left: 0.1875rem solid transparent;
  text-decoration: none;
  min-height: 2.75rem;
}

.sidebar__link:hover {
  background: var(--fiori-sidenav-hover);
  color: var(--fiori-text);
}

.sidebar__link.is-active {
  border-left-color: var(--fiori-sap-blue);
  background: var(--fiori-sidenav-selected);
  color: var(--fiori-sap-blue);
  font-weight: 600;
}

.sidebar__icon {
  width: 1rem;
  font-size: 1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.main {
  flex: 1;
  padding: 0 1.5rem 1.5rem;
  overflow-x: auto;
  background-color: var(--color-surface-page);
  background-image: var(--canvas-bg-image);
  background-size: var(--canvas-bg-size);
}

.page-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--fiori-text);
}

.page-header p {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.list-overview {
  display: grid;
  grid-template-columns: 1fr 17.5rem;
  gap: var(--space-md);
  align-items: start;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (max-width: 960px) {
  .list-overview {
    grid-template-columns: 1fr;
  }

  .app-body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding: var(--space-sm);
  }

  .sidebar__group {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .app-header__title {
    display: none;
  }

  .main {
    padding: 0 var(--space-md) var(--space-md);
  }
}

/* ============================================================
   SHELL REBUILD — header / sidebar / breadcrumb
   Appended overrides (later rules win at equal specificity).
   ============================================================ */
.app-header {
  height: auto;
  padding: 6px 16px;
  gap: 18px;
  background: var(--fiori-shell-bg);
  box-shadow: var(--fiori-shell-shadow);
}

.app-header__left {
  flex: 0 0 auto;
  width: calc(var(--sidebar-width) - 20px);
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text-heading);
}
.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--fiori-sap-blue);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand__sub { color: var(--color-text-muted); font-weight: 500; }

/* global search */
.global-search {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.global-search:focus-within {
  border-color: var(--fiori-sap-blue);
  box-shadow: 0 0 0 3px var(--fiori-sap-blue-light);
}
.global-search__icon { font-size: 1rem; line-height: 1; }
.global-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text-body);
}
.global-search__kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--color-text-muted);
}

/* header icon buttons */
.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: 0.16s ease;
}
.icon-btn:hover {
  color: var(--color-text-body);
  border-color: var(--fiori-sap-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.icon-btn__dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fiori-sap-blue);
  border: 2px solid var(--color-surface);
}

/* avatar trigger */
.user-menu__trigger { gap: 8px; height: 38px; border-radius: 10px; }
.user-menu__avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, #2e8fff, #7b5bff);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}
.user-menu__dropdown { border-radius: var(--radius); box-shadow: var(--shadow-card-hover); }

/* sidebar — sectioned with rounded active pill + count badges */
.sidebar { padding: 12px; }
.nav-section { margin-bottom: 6px; }
.nav-section__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 14px 12px 6px;
}
.sidebar__link {
  border-left: none;
  border-radius: 10px;
  margin-bottom: 2px;
  min-height: 0;
  padding: 9px 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
}
.sidebar__link:hover { background: var(--color-surface-muted); color: var(--color-text-body); }
.sidebar__link.is-active {
  background: var(--fiori-sap-blue-light);
  color: var(--fiori-sap-blue);
  font-weight: 600;
}
.sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--fiori-sap-blue);
}
.sidebar__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--fiori-sap-blue);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
}
.sidebar__link:not(.is-active) .sidebar__count {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

/* breadcrumb (prepended to main per route) */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 0;
}
.breadcrumb b { color: var(--color-text-body); font-weight: 600; }

/* ============================================================
   APP-SHELL SCROLLING
   Fixed chrome (banner/header/scenario-bar); only the main
   region scrolls vertically. The page itself never overflows.
   ============================================================ */
html, body { height: 100%; }
body { overflow: hidden; display: flex; flex-direction: column; }

/* Fixed chrome must never shrink — otherwise tall pages squeeze the banner/header */
.demo-banner,
.app-header,
.scenario-bar { flex: 0 0 auto; }

.app-body {
  flex: 1 1 auto;
  min-height: 0;       /* allow children to scroll instead of growing the page */
  overflow: hidden;
}

.sidebar { overflow-y: auto; }

.main {
  min-height: 0;
  overflow-y: auto;    /* the right region scrolls on its own */
}
