.hub-shell-ready,
:root {
  --hub-app-sidebar-width: clamp(200px, calc(200px * var(--hub-ui-scale, 1)), 236px);
}

body.organigramm-shell {
  --organigramm-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.arbeitsanweisung-shell {
  --arbeitsanweisung-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.begehung-shell {
  --begehung-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.gbu-shell {
  --gbu-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.monatsbericht-shell {
  --monatsbericht-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.org-handbuch-shell {
  --org-handbuch-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.projektradar-shell {
  --projektradar-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.prueffristen-shell {
  --prueffristen-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.qualimatrix-shell {
  --qualimatrix-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.routenplaner-shell {
  --routenplaner-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.todo-shell {
  --todo-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.zertifikate-shell {
  --zert-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.audit-shell {
  --audit-shell-sidebar-width: var(--hub-app-sidebar-width);
}

.hub-shell-navigation {
  border-right: 1px solid rgba(148, 163, 184, 0.2) !important;
  background: #090d13 !important;
  font-size: clamp(12px, calc(12.5px * var(--hub-ui-scale, 1)), 14px);
}

.hub-shell-navigation .brand {
  border-bottom-color: rgba(245, 164, 0, 0.42);
}

.hub-shell-navigation .brand-logo {
  border: 1px solid rgba(245, 164, 0, 0.42);
  background: #090806;
}

.hub-nav-item {
  position: relative;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  min-height: clamp(40px, calc(42px * var(--hub-ui-scale, 1)), 48px) !important;
  gap: clamp(8px, calc(9px * var(--hub-ui-scale, 1)), 11px) !important;
  padding: clamp(6px, calc(7px * var(--hub-ui-scale, 1)), 9px)
    clamp(8px, calc(10px * var(--hub-ui-scale, 1)), 12px) !important;
  font-size: clamp(12px, calc(12.5px * var(--hub-ui-scale, 1)), 14px) !important;
  box-shadow: none !important;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.hub-nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.hub-nav-item:hover,
.hub-nav-item.active,
.hub-nav-item[aria-current] {
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: #151c26 !important;
  color: #ffffff;
  box-shadow: none !important;
  transform: none !important;
}

.hub-nav-item:hover::before,
.hub-nav-item.active::before,
.hub-nav-item[aria-current]::before {
  background: var(--hub-shell-gold);
  box-shadow: 0 0 10px rgba(245, 164, 0, 0.32);
}

.hub-shell-navigation .icon {
  width: clamp(28px, calc(29px * var(--hub-ui-scale, 1)), 34px);
  height: clamp(28px, calc(29px * var(--hub-ui-scale, 1)), 34px);
  flex: 0 0 clamp(28px, calc(29px * var(--hub-ui-scale, 1)), 34px);
  display: grid;
  place-items: center;
  border-color: transparent !important;
  border-radius: 6px !important;
  background: rgba(245, 164, 0, 0.08) !important;
  color: var(--hub-shell-gold-bright);
  box-shadow: none !important;
}

@media (min-width: 921px) {
  .hub-shell-ready .hub-shell-navigation .brand-logo {
    width: clamp(56px, calc(60px * var(--hub-ui-scale, 1)), 70px) !important;
    height: clamp(56px, calc(60px * var(--hub-ui-scale, 1)), 70px) !important;
    max-width: 38% !important;
    max-height: none !important;
    object-fit: contain !important;
  }
}

@media (max-width: 920px) {
  .hub-shell-ready .hub-shell-navigation .brand {
    min-height: auto !important;
  }

  .hub-shell-ready .hub-shell-navigation .brand-logo {
    width: clamp(52px, calc(58px * var(--hub-ui-scale, 1)), 68px) !important;
    height: clamp(52px, calc(58px * var(--hub-ui-scale, 1)), 68px) !important;
    max-width: 72px !important;
    max-height: 72px !important;
    object-fit: contain !important;
  }

  .hub-shell-ready .hub-nav-item {
    min-height: clamp(42px, calc(44px * var(--hub-ui-scale, 1)), 54px) !important;
    gap: 8px !important;
    padding-inline: 9px !important;
    font-size: clamp(12px, calc(12px * var(--hub-ui-scale, 1)), 14px) !important;
  }

  .hub-shell-ready .hub-shell-navigation .icon {
    width: clamp(28px, calc(30px * var(--hub-ui-scale, 1)), 34px);
    height: clamp(28px, calc(30px * var(--hub-ui-scale, 1)), 34px);
    flex-basis: clamp(28px, calc(30px * var(--hub-ui-scale, 1)), 34px);
  }
}

.hub-shell-navigation .icon svg {
  width: 82%;
  height: 82%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}

.hub-shell-navigation .sidebar-customer-picker,
.hub-shell-navigation .runtime-status,
.hub-shell-navigation .sidebar-info {
  border-color: rgba(245, 164, 0, 0.34);
  background: rgba(10, 9, 7, 0.72);
}

html[data-hub-resolved-theme="light"] .hub-shell-navigation {
  border-right-color: rgba(180, 111, 0, 0.38);
  background:
    linear-gradient(180deg, rgba(245, 164, 0, 0.11), transparent 36%),
    #fffaf0;
  color: #171410;
}

html[data-hub-resolved-theme="light"] .hub-shell-navigation .brand {
  border-bottom-color: rgba(180, 111, 0, 0.38);
}

html[data-hub-resolved-theme="light"] .hub-shell-navigation .brand-logo {
  border-color: rgba(180, 111, 0, 0.38);
  background: #fffdf8;
}

html[data-hub-resolved-theme="light"] .hub-nav-item {
  background: rgba(255, 252, 246, 0.72);
  color: #171410;
  box-shadow: inset 0 0 0 1px rgba(180, 111, 0, 0.08);
}

html[data-hub-resolved-theme="light"] .hub-nav-item:hover,
html[data-hub-resolved-theme="light"] .hub-nav-item.active,
html[data-hub-resolved-theme="light"] .hub-nav-item[aria-current] {
  border-color: rgba(180, 111, 0, 0.54);
  background: rgba(245, 164, 0, 0.18);
  color: #171410;
  box-shadow: 0 0 24px rgba(180, 111, 0, 0.12);
}

html[data-hub-resolved-theme="light"] .hub-shell-navigation .icon {
  border-color: rgba(180, 111, 0, 0.52);
  background: rgba(245, 164, 0, 0.13);
  color: #9a6100;
  box-shadow: 0 0 14px rgba(180, 111, 0, 0.12);
}

html[data-hub-resolved-theme="light"] .hub-shell-navigation .sidebar-customer-picker,
html[data-hub-resolved-theme="light"] .hub-shell-navigation .runtime-status,
html[data-hub-resolved-theme="light"] .hub-shell-navigation .sidebar-info {
  border-color: rgba(180, 111, 0, 0.32);
  background: rgba(255, 252, 246, 0.82);
  color: #171410;
}

/* Shared desktop navigation collapse for Hub and every integrated app shell. */
:root {
  --hub-navigation-collapsed-width: 56px;
}

.hub-navigation-collapse-root {
  position: relative;
  transition: width 180ms ease, padding 180ms ease, border-color 180ms ease;
}

.hub-navigation-collapse-toggle {
  position: absolute;
  z-index: 120;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: #151c26;
  color: #ffd166;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 180ms ease;
}

.hub-navigation-collapse-toggle:hover {
  border-color: rgba(245, 164, 0, 0.72);
  background: #202936;
  color: #ffffff;
}

.hub-navigation-collapse-toggle:focus-visible {
  outline: 3px solid rgba(255, 191, 47, 0.48);
  outline-offset: 3px;
}

.hub-navigation-collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  transform: translateY(-1px);
  transition: color 160ms ease;
}

html[data-hub-resolved-theme="light"] .hub-navigation-collapse-toggle {
  border-color: rgba(180, 111, 0, 0.64);
  background: #fff8e8;
  color: #8a5700;
  box-shadow: 0 5px 14px rgba(67, 45, 10, 0.18);
}

body.interface-manager-shell {
  --interface-manager-shell-sidebar-width: var(--hub-app-sidebar-width);
}

body.calculation-shell {
  --calculation-sidebar-width: var(--hub-app-sidebar-width);
}

@media (min-width: 921px) {
  body[data-navigation-collapsed="true"] {
    --app-sidebar-width: var(--hub-navigation-collapsed-width);
    --hub-main-sidebar-width: var(--hub-navigation-collapsed-width);
    --hub-app-sidebar-width: var(--hub-navigation-collapsed-width);
    --arbeitsanweisung-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --audit-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --begehung-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --calculation-sidebar-width: var(--hub-navigation-collapsed-width);
    --gbu-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --interface-manager-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --monatsbericht-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --org-handbuch-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --organigramm-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --projektradar-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --prueffristen-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --qualimatrix-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --routenplaner-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --todo-shell-sidebar-width: var(--hub-navigation-collapsed-width);
    --zert-shell-sidebar-width: var(--hub-navigation-collapsed-width);
  }

  body[data-navigation-collapsed="true"] .hub-navigation-collapse-root {
    width: var(--hub-navigation-collapsed-width) !important;
    min-width: var(--hub-navigation-collapsed-width) !important;
    max-width: var(--hub-navigation-collapsed-width) !important;
    padding: 4px !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  body[data-navigation-collapsed="true"] .hub-navigation-collapse-root > :not(.hub-navigation-collapse-toggle) {
    display: none !important;
  }

  body[data-navigation-collapsed="true"] .hub-navigation-collapse-toggle {
    top: 6px;
    right: 6px;
  }
}

@media (max-width: 920px) {
  .hub-navigation-collapse-toggle {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-navigation-collapse-root,
  .hub-navigation-collapse-toggle,
  .hub-navigation-collapse-icon {
    transition: none;
  }
}
