:root {
  --app-nav-bg: #f4efe7;
  --app-nav-panel: #ffffff;
  --app-nav-line: rgba(29, 20, 12, 0.12);
  --app-nav-text: #1a120d;
  --app-nav-muted: #87786b;
  --app-nav-active: #1a120d;
  --app-nav-active-text: #ffffff;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(244, 239, 231, 0.96);
  border-bottom: 1px solid var(--app-nav-line);
  backdrop-filter: blur(8px);
}

.app-topbar-inner {
  width: min(1720px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  color: var(--app-nav-text);
  text-decoration: none;
}

.app-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #17100b;
  color: #fff;
  font: 800 1rem "Fraunces", serif;
  flex: 0 0 auto;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-brand-name {
  font: 800 1.05rem "Fraunces", serif;
  letter-spacing: -0.01em;
}

.app-brand-sub {
  margin-top: 2px;
  color: var(--app-nav-muted);
  font: 500 0.82rem "Plus Jakarta Sans", system-ui, sans-serif;
}

.app-switcher-wrap {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-switcher-wrap::-webkit-scrollbar { display: none; }

.app-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  padding: 2px 0;
}

.app-switch-link,
.app-support-link,
.app-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--app-nav-line);
  background: var(--app-nav-panel);
  color: var(--app-nav-text);
  text-decoration: none;
  font: 700 0.98rem "Plus Jakarta Sans", system-ui, sans-serif;
  white-space: nowrap;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.app-switch-link:hover,
.app-support-link:hover,
.app-logout-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 20, 12, 0.22);
}

.app-switch-link.is-active {
  background: var(--app-nav-active);
  color: var(--app-nav-active-text);
  border-color: var(--app-nav-active);
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 96px;
}

.app-support-link {
  color: var(--app-nav-text);
}

.app-logout-btn {
  cursor: pointer;
}

@media (max-width: 1100px) {
  .app-topbar-inner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand action"
      "switcher switcher";
    padding: 10px 0 12px;
    min-height: 0;
  }

  .app-brand { grid-area: brand; min-width: 0; }
  .app-topbar-actions { grid-area: action; }
  .app-switcher-wrap { grid-area: switcher; }
}

@media (max-width: 640px) {
  .app-topbar-inner {
    width: min(100% - 20px, 1720px);
    gap: 12px;
  }

  .app-brand-sub { display: none; }
  .app-switch-link,
  .app-support-link,
  .app-logout-btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.92rem;
  }
}
