/*
  CCH Shared Top Navigation
  Datei: css/cch-topnav.css
  Version: 0.5.4-flow-clearance
*/

body.cch-theme-tech {
  --cch-topnav-height: 108px;
  --cch-content-top-offset: 150px;
  --cch-mobile-menu-top-gap: 12px;
}

body.cch-theme-tech .wrap {
  padding-top: max(var(--cch-content-top-offset), calc(var(--cch-topnav-height) + 22px));
}

body.cch-theme-tech .cch-page-shell,
body.cch-theme-tech .page-shell,
body.cch-theme-tech .module-shell {
  padding-top: max(var(--cch-content-top-offset), calc(var(--cch-topnav-height) + 22px));
}

body.cch-theme-tech.cch-nav-open {
  overflow: hidden;
  touch-action: none;
}

body.cch-theme-tech .cch-sticky-topnav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 850;
  width: min(1500px, var(--cch-shell-content-width-desktop, calc(100vw - (var(--cch-shell-gutter-desktop, 50px) * 2))));
  border: 1px solid rgba(79, 209, 255, .16);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15, 24, 36, .95), rgba(9, 17, 27, .97));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
}

body.cch-theme-tech .cch-topnav-inner {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px 12px;
}

body.cch-theme-tech .cch-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  min-width: 238px;
}

body.cch-theme-tech .cch-brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(79, 209, 255, .18);
  box-shadow: 0 10px 24px rgba(14, 165, 233, .12);
  overflow: hidden;
}

body.cch-theme-tech .cch-brand-logo-img {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  object-fit: contain;
  display: block;
}

body.cch-theme-tech .cch-brand-copy {
  display: grid;
  gap: 1px;
}

body.cch-theme-tech .cch-brand-copy strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.05;
  letter-spacing: -.02em;
}

body.cch-theme-tech .cch-brand-copy small {
  color: #8fa3b8;
  font-size: 11px;
  font-weight: 800;
}

body.cch-theme-tech .cch-module-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.cch-theme-tech .cch-nav-group {
  position: relative;
}

body.cch-theme-tech .cch-nav-group-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(79, 209, 255, .07);
  border: 1px solid rgba(79, 209, 255, .12);
  color: #d9e7f5;
  font-size: 12px;
  font-weight: 850;
  box-shadow: none;
}

body.cch-theme-tech .cch-nav-group-btn:hover,
body.cch-theme-tech .cch-nav-group.open .cch-nav-group-btn {
  background: rgba(79, 209, 255, .13);
  border-color: rgba(79, 209, 255, .25);
  color: #fff;
  transform: translateY(-1px);
}

body.cch-theme-tech .cch-nav-chevron {
  color: #8fe6ff;
  font-size: 12px;
  transform: translateY(-1px);
  transition: transform .15s ease;
}

body.cch-theme-tech .cch-nav-group.open .cch-nav-chevron {
  transform: rotate(180deg);
}

body.cch-theme-tech .cch-nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(79, 209, 255, .16);
  background: linear-gradient(180deg, rgba(19, 31, 46, .99), rgba(14, 22, 34, .99));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
  z-index: 910;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.cch-theme-tech .cch-nav-group.open .cch-nav-dropdown {
  display: grid;
  gap: 6px;
}

body.cch-theme-tech .cch-nav-dropdown-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 13px;
  color: #d9e7f5;
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid transparent;
}

body.cch-theme-tech .cch-nav-dropdown-link:hover,
body.cch-theme-tech .cch-nav-dropdown-link.active {
  color: #fff;
  background: rgba(79, 209, 255, .10);
  border-color: rgba(79, 209, 255, .18);
}

body.cch-theme-tech .cch-topnav-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 54px;
}

body.cch-theme-tech .cch-module-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, .22);
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 900;
}

body.cch-theme-tech .cch-mobile-menu-btn {
  display: none;
  width: 38px;
  min-height: 34px;
  padding: 0;
  border-radius: 14px;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 1px;
}

body.cch-theme-tech .cch-mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--cch-mobile-menu-top-gap));
  right: 8px;
  width: min(340px, calc(100vw - 28px));
  max-height: calc(100dvh - var(--cch-topnav-height) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(79, 209, 255, .16);
  background: linear-gradient(180deg, rgba(19, 31, 46, .99), rgba(14, 22, 34, .99));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
  z-index: 910;
}

body.cch-theme-tech .cch-mobile-menu.show {
  display: grid;
  gap: 10px;
}

body.cch-theme-tech .cch-mobile-menu::-webkit-scrollbar,
body.cch-theme-tech .cch-nav-dropdown::-webkit-scrollbar {
  width: 8px;
}

body.cch-theme-tech .cch-mobile-menu::-webkit-scrollbar-thumb,
body.cch-theme-tech .cch-nav-dropdown::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .38);
  border-radius: 999px;
}

body.cch-theme-tech .cch-mobile-menu::-webkit-scrollbar-track,
body.cch-theme-tech .cch-nav-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

body.cch-theme-tech .cch-mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-weight: 900;
  padding: 2px 2px 6px;
}

body.cch-theme-tech .cch-mobile-menu-head button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
}

body.cch-theme-tech .cch-mobile-nav-section {
  display: grid;
  gap: 6px;
}

body.cch-theme-tech .cch-mobile-nav-section strong {
  color: #8fa3b8;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 4px;
}

body.cch-theme-tech .cch-mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(79, 209, 255, .08);
  border: 1px solid rgba(79, 209, 255, .12);
  color: #ecf3fb;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}

body.cch-theme-tech .cch-mobile-nav-link.active {
  background: rgba(34, 197, 94, .12);
  border-color: rgba(34, 197, 94, .22);
  color: #bbf7d0;
}

@media(max-width:1080px) {
  body.cch-theme-tech .cch-module-nav {
    display: none;
  }

  body.cch-theme-tech .cch-mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.cch-theme-tech .cch-topnav-inner {
    grid-template-columns: auto 1fr auto;
  }
}

@media(max-width:760px) {
  body.cch-theme-tech {
    --cch-topnav-height: 104px;
  }

  body.cch-theme-tech .wrap {
    padding-top: calc(var(--cch-topnav-height) + 12px);
  }

  body.cch-theme-tech .cch-sticky-topnav {
    top: 8px;
    width: var(--cch-shell-content-width-mobile, calc(100vw - (var(--cch-shell-gutter-mobile, 10px) * 2)));
    border-radius: 22px;
  }

  body.cch-theme-tech .cch-topnav-inner {
    min-height: 52px;
    padding: 7px 8px;
    gap: 8px;
  }

  body.cch-theme-tech .cch-brand {
    min-width: 0;
  }

  body.cch-theme-tech .cch-brand-logo-wrap {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  body.cch-theme-tech .cch-brand-logo-img {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
  }

  body.cch-theme-tech .cch-brand-copy strong {
    font-size: 13px;
  }

  body.cch-theme-tech .cch-brand-copy small {
    font-size: 10px;
  }

  body.cch-theme-tech .cch-module-pill {
    display: none;
  }

  body.cch-theme-tech .cch-topnav-meta {
    min-width: 0;
  }
}

@media(max-width:420px) {
  body.cch-theme-tech .cch-brand-copy small {
    display: none;
  }
}

/* CCH Topnav v0.1.2 Version Pill + Changelog Link */
body.cch-theme-tech .cch-module-pill {
  text-decoration: none;
  max-width: 190px;
}

body.cch-theme-tech .cch-module-pill:hover {
  background: rgba(34, 197, 94, .18);
  border-color: rgba(34, 197, 94, .34);
  color: #dcfce7;
}


/* CCH Topnav v0.5.0: Top-Bar + separate Context-Info-Bar */
body.cch-theme-tech .cch-sticky-topnav {
  overflow: visible;
}

body.cch-theme-tech .cch-topnav-meta {
  gap: 8px;
}

body.cch-theme-tech .cch-topnav-meta .cch-module-pill,
body.cch-theme-tech .cch-topnav-context {
  display: none !important;
}

body.cch-theme-tech .cch-topnav-infobar {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(140px, .8fr) minmax(220px, 1fr) minmax(140px, .75fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px 10px;
}

body.cch-theme-tech .cch-infobar-item {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid rgba(79, 209, 255, .12);
  background: rgba(2, 6, 23, .26);
  color: #d9e7f5;
  box-sizing: border-box;
  text-decoration: none;
}

body.cch-theme-tech .cch-infobar-item span {
  color: #8fa3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.cch-theme-tech .cch-infobar-item strong,
body.cch-theme-tech .cch-infobar-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  color: #f8fafc;
  font-style: normal;
}

body.cch-theme-tech .cch-infobar-module {
  border-color: rgba(34, 197, 94, .20);
  background: rgba(34, 197, 94, .10);
}

body.cch-theme-tech .cch-infobar-module em {
  flex: 0 0 auto;
  color: #bbf7d0;
}

body.cch-theme-tech .cch-infobar-status {
  border-color: rgba(34, 211, 238, .20);
  background: rgba(34, 211, 238, .08);
}

body.cch-theme-tech .cch-infobar-status strong {
  color: #a5f3fc;
}

body.cch-theme-tech .cch-infobar-employee select,
body.cch-theme-tech .cch-infobar-object select {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  border: 0;
  border-radius: 11px;
  background: rgba(15, 23, 42, .72);
  color: #f8fafc;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
  outline: none;
}

body.cch-theme-tech .cch-infobar-employee select:focus,
body.cch-theme-tech .cch-infobar-object select:focus {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .16);
}

body.cch-theme-tech .cch-infobar-object select[hidden],
body.cch-theme-tech .cch-infobar-object strong[hidden] {
  display: none !important;
}

@media(max-width:1180px) {
  body.cch-theme-tech .cch-topnav-infobar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.cch-theme-tech .cch-infobar-status {
    display: none;
  }
}

@media(max-width:760px) {
  body.cch-theme-tech .cch-topnav-infobar {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0 8px 8px;
  }

  body.cch-theme-tech .cch-infobar-item {
    min-height: 32px;
    border-radius: 14px;
  }

  body.cch-theme-tech .cch-infobar-module,
  body.cch-theme-tech .cch-infobar-object {
    display: none;
  }
}

@media(max-width:420px) {
  body.cch-theme-tech .cch-infobar-user {
    display: none;
  }
}

/* ===== CCH 2026-09-16: zentraler Layout-/Navigations-Fix =====
   Desktop: 5 % Abstand links/rechts (= 90 vw Nutzbreite).
   Mobile/Tablet bleibt bewusst fast vollbreit, damit Bedienelemente nicht gequetscht werden. */
body.cch-theme-tech {
  --cch-shell-gutter-desktop: 5vw;
  --cch-shell-content-width-desktop: 90vw;
  --cch-shell-gutter-mobile: 10px;
  --cch-shell-content-width-mobile: calc(100vw - 20px);
}

@media (min-width: 1081px) {
  body.cch-theme-tech .cch-sticky-topnav {
    width: var(--cch-shell-content-width-desktop) !important;
    max-width: var(--cch-shell-content-width-desktop) !important;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  body.cch-theme-tech .cch-topnav-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  body.cch-theme-tech .cch-module-nav {
    width: 100%;
    justify-self: end;
    justify-content: flex-end !important;
    margin-left: auto;
  }

  body.cch-theme-tech .cch-topnav-meta {
    justify-self: end;
    margin-left: 0;
  }
}

body.cch-theme-tech .cch-mobile-menu-btn .cch-menu-dots {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: .55;
  transform: translateY(-2px);
}

@media (max-width: 1080px) {
  body.cch-theme-tech .cch-sticky-topnav {
    width: var(--cch-shell-content-width-mobile) !important;
    max-width: var(--cch-shell-content-width-mobile) !important;
  }

  body.cch-theme-tech .cch-topnav-meta {
    margin-left: auto;
  }
}



/* CCH 0.7.8: fixed navigation owns its document-flow clearance via #cchTopnavMount.
   Content keeps only its local spacing; the navigation itself is unchanged. */
body.cch-theme-tech:not(.cch-dashboard-page) #cchTopnavMount ~ * {
  --cch-topnav-height: 0px;
  --cch-content-top-offset: 0px;
}

/* Compact, consistent V3 context bar: six controls must not form a five-column grid. */
@media (min-width: 1081px) {
  body.cch-theme-tech .cch-sticky-topnav {
    width: min(1500px, 90vw) !important;
    max-width: min(1500px, 90vw) !important;
  }
}

body.cch-theme-tech .cch-topnav-infobar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

body.cch-theme-tech .cch-infobar-module { flex: 0 1 240px; max-width: 240px; }
body.cch-theme-tech .cch-infobar-user { flex: 0 1 150px; max-width: 150px; }
body.cch-theme-tech .cch-infobar-employee,
body.cch-theme-tech .cch-infobar-object { flex: 1 1 210px; max-width: 300px; }
body.cch-theme-tech .cch-infobar-status,
body.cch-theme-tech .cch-infobar-logout { flex: 0 0 auto; }
body.cch-theme-tech .cch-infobar-module strong { flex: 0 1 auto; }
body.cch-theme-tech .cch-infobar-logout { width: auto; }

@media (max-width: 760px) {
  body.cch-theme-tech .cch-topnav-infobar { padding: 0 8px 8px; }
  body.cch-theme-tech .cch-infobar-employee { flex: 1 1 180px; max-width: none; }
}
