@layer base {
  body.use-new-ui header.topbar {
    z-index: var(--z-sticky);
    pointer-events: auto;
  }

  body.use-new-ui .topbar-actions {
    position: relative;
    z-index: var(--z-sticky);
    pointer-events: auto;
  }

  .topbar-dropdown,
  body.use-new-ui .user-menu-dropdown.topbar-dropdown,
  body.use-new-ui .notification-dropdown.topbar-dropdown,
  body.use-new-ui #notificationDropdown.topbar-dropdown,
  body.use-new-ui .quick-add-dropdown.topbar-dropdown,
  body.use-new-ui .owner-quick-dropdown.topbar-dropdown {
    z-index: var(--z-dropdown);
    pointer-events: auto;
  }

  .topbar-dropdown.hidden,
  body.use-new-ui .topbar-dropdown.hidden {
    pointer-events: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    width: 100%;
    flex: 0 0 auto;
    z-index: var(--z-sticky);
    height: 72px;
    min-height: 72px;
    border-bottom: 1px solid rgba(205, 214, 228, 0.65);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }

  body.use-new-ui .topbar-inner {
    height: 100%;
    max-width: var(--admin-content-max, 1680px);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
  }

  .topbar-inner {
    height: 100%;
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .topbar-actions,
  .topbar-extras {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .page-title-text {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    flex: 0 1 auto;
    min-width: 0;
  }

  .topbar-actions {
    gap: var(--space-2);
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }

  .topbar-extras {
    display: inline-flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    min-width: 0;
  }

  body.use-new-ui .top-search-wrap .topbar-search,
  body.use-new-ui .topbar-search.input-md {
    flex: 1 1 200px;
    max-width: min(420px, 100%);
    min-width: 160px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(205, 214, 228, 0.85);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  body.use-new-ui .top-search-wrap .topbar-search:focus {
    border-color: rgba(148, 163, 184, 0.95);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  }

  .topbar-search.input-md {
    flex: 1 1 200px;
    max-width: min(420px, 100%);
    min-width: 160px;
  }

  .topbar-search.input,
  .topbar-actions input.topbar-search {
    min-width: 160px;
  }

  @media (max-width: 640px) {
    .topbar-search.input-md {
      flex-basis: 100%;
      max-width: none;
    }
  }
}

/* Owner quick menu + spotlight trigger — unlayered so shell stays crisp */
body.use-new-ui .owner-quick-menu-wrap {
  position: relative;
  z-index: var(--z-dropdown);
}

body.use-new-ui .owner-quick-dropdown {
  min-width: 260px;
  max-width: min(280px, 92vw);
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

body.use-new-ui .owner-quick-dropdown.is-open {
  animation: owner-quick-in 180ms ease-out;
}

@keyframes owner-quick-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.use-new-ui .owner-quick-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: #0f172a;
}

body.use-new-ui .owner-quick-item:hover,
body.use-new-ui .owner-quick-item:focus-visible {
  background: rgba(241, 245, 249, 0.95);
  outline: none;
}

body.use-new-ui .owner-quick-item.is-active {
  background: rgba(219, 234, 254, 0.95);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
  outline: none;
}

body.use-new-ui .owner-quick-ico {
  font-size: 15px;
  text-align: center;
}

body.use-new-ui .owner-quick-text strong {
  font-size: var(--fs-sm);
  font-weight: 650;
  display: block;
  line-height: 1.25;
}

body.use-new-ui .owner-quick-sc {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.14);
}

body.use-new-ui .topbar-spotlight-btn {
  flex: 0 0 auto;
  height: 34px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}

body.use-new-ui .topbar-spotlight-btn:hover {
  border-color: rgba(59, 130, 246, 0.45);
  color: #1d4ed8;
}

@media (max-width: 720px) {
  body.use-new-ui .topbar-spotlight-btn {
    display: none;
  }
}

body.dark.use-new-ui .owner-quick-dropdown {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.28);
}

body.dark.use-new-ui .owner-quick-item {
  color: #e2e8f0;
}

body.dark.use-new-ui .owner-quick-item:hover,
body.dark.use-new-ui .owner-quick-item:focus-visible {
  background: rgba(30, 41, 59, 0.75);
}

body.dark.use-new-ui .owner-quick-item.is-active {
  background: rgba(30, 58, 138, 0.55);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}

body.dark.use-new-ui .owner-quick-sc {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

body.dark.use-new-ui .topbar-spotlight-btn {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}
