:root {
  --topbar-bg: rgba(8, 13, 10, 0.96);
  --topbar-surface: rgba(14, 21, 16, 0.92);
  --topbar-surface-hover: rgba(27, 39, 30, 0.95);
  --topbar-border: rgba(180, 210, 184, 0.16);
  --topbar-border-strong: rgba(91, 214, 87, 0.48);
  --topbar-text: #eef7ef;
  --topbar-muted: #91a794;
  --topbar-dim: #536856;
  --topbar-accent: #39ff14;
  --topbar-accent-muted: #62d85c;
  --topbar-active-bg: rgba(57, 255, 20, 0.11);
  --topbar-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

body.topbar-layout {
  padding-top: 80px;
}

body.topbar-layout .sidebar,
body.topbar-layout .sidebar-overlay,
body.topbar-layout .menu-toggle,
body.topbar-layout #menuToggle {
  display: none !important;
}

body.topbar-layout .main,
body.topbar-layout.sidebar-collapsed .main,
body.topbar-layout.sidebar-hover-collapsed .main {
  margin-left: 0 !important;
}

.topbar-shell {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1200;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
  backdrop-filter: blur(18px);
}

.topbar-shell::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.52), transparent);
  opacity: 0.58;
  pointer-events: none;
}

.topbar-nav {
  width: min(1240px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  column-gap: 22px;
}

.topbar-home {
  width: max-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 0;
  border-radius: 6px;
  color: var(--topbar-text);
  text-decoration: none;
}

.topbar-home:hover,
.topbar-home.active {
  color: var(--topbar-text);
}

.topbar-exit {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(215, 168, 92, 0.24);
  border-radius: 7px;
  background: rgba(215, 168, 92, 0.07);
  color: #f3d49e;
  text-decoration: none;
  font: 820 12px "Inter", sans-serif;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.topbar-exit svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.topbar-exit:hover,
.topbar-exit.active {
  border-color: rgba(215, 168, 92, 0.56);
  background: rgba(215, 168, 92, 0.14);
  color: #fff1d5 !important;
  transform: translateY(-1px);
}

.topbar-logo-img {
  display: block;
  width: auto;
  height: 42px;
  max-width: 150px;
  object-fit: contain;
}

.topbar-divider {
  display: none;
}

.topbar-center {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.topbar-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.topbar-side.left,
.topbar-side.right {
  justify-self: center;
}

.topbar-side.right {
  margin-left: 0;
}

.topbar-link,
.topbar-trigger {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--topbar-muted);
  text-decoration: none;
  font: 760 12px "Inter", sans-serif;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.topbar-trigger:hover,
.topbar-trigger.active,
.topbar-link:hover,
.topbar-link.active {
  border-color: var(--topbar-border);
  background: var(--topbar-surface-hover);
  color: var(--topbar-text) !important;
}

.topbar-trigger.active {
  border-color: var(--topbar-border-strong);
  background: var(--topbar-active-bg);
  box-shadow: inset 0 -2px 0 var(--topbar-accent-muted);
}

.topbar-trigger-title {
  display: grid;
  gap: 3px;
  line-height: 1.05;
  text-align: left;
}

.topbar-trigger-title small {
  max-width: 142px;
  overflow: hidden;
  color: var(--topbar-dim);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-trigger.active .topbar-trigger-title small {
  color: var(--topbar-accent-muted);
}

.topbar-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--topbar-dim);
  transition: transform 0.16s ease, color 0.16s ease;
}

.topbar-dd {
  position: relative;
}

.topbar-dd.open .topbar-chevron {
  color: var(--topbar-accent-muted);
  transform: rotate(180deg);
}

.topbar-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 260px;
  padding: 8px;
  border: 1px solid var(--topbar-border);
  border-radius: 10px;
  background: rgba(9, 15, 11, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transform-origin: top left;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.topbar-dd.open .topbar-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.topbar-menu a {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--topbar-muted);
  text-decoration: none;
  font: 720 12px "Inter", sans-serif;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.topbar-menu-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--topbar-dim);
}

.topbar-menu a:hover,
.topbar-menu a.active {
  border-color: rgba(98, 216, 92, 0.22);
  background: rgba(57, 255, 20, 0.08);
  color: var(--topbar-text) !important;
}

.topbar-menu a:hover .topbar-menu-dot,
.topbar-menu a.active .topbar-menu-dot {
  background: var(--topbar-accent-muted);
}

@media (max-width: 980px) {
  body.topbar-layout {
    padding-top: 76px;
  }

  .topbar-nav {
    width: calc(100% - 24px);
    min-height: 64px;
    grid-template-columns: auto 1fr auto;
    column-gap: 12px;
  }

  .topbar-side.right {
    margin-left: 0;
  }

  .topbar-trigger {
    min-height: 40px;
    padding: 0 11px;
  }

  .topbar-trigger-title small {
    max-width: 104px;
  }
}

@media (max-width: 760px) {
  body.topbar-layout {
    padding-top: 74px;
  }

  .topbar-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .topbar-home,
  .topbar-exit,
  .topbar-center,
  .topbar-side,
  .topbar-side.left,
  .topbar-side.right {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    margin: 0;
  }

  .topbar-home {
    padding: 0;
  }

  .topbar-logo-img {
    height: 38px;
    max-width: 124px;
  }

  .topbar-trigger-title small {
    display: none;
  }

  .topbar-menu {
    position: fixed;
    top: 68px;
    left: 8px;
    right: 8px;
    min-width: 0;
    max-height: calc(100vh - 84px);
    overflow: auto;
    transform-origin: top center;
  }
}

@media (max-width: 420px) {
  body.topbar-layout {
    padding-top: 70px;
  }

  .topbar-nav {
    min-height: 60px;
    width: calc(100% - 16px);
  }

  .topbar-trigger,
  .topbar-link,
  .topbar-exit {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 11px;
  }
}

@media print {
  .topbar-shell {
    display: none !important;
  }

  body.topbar-layout {
    padding-top: 0;
  }
}
