:root {
  --menu-overlay: rgba(15, 23, 42, 0.38);
  --menu-panel-bg: rgba(255, 255, 255, 0.98);
  --menu-text: #0f172a;
  --menu-muted: rgba(51, 65, 85, 0.8);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease, background 160ms ease;
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: var(--menu-overlay);
  backdrop-filter: blur(6px);
}

.menu-panel {
  background: var(--menu-panel-bg);
  color: var(--menu-text);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--shadow);
  transform: translateY(-6px);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-overlay.is-open .menu-panel {
  transform: translateY(0);
  opacity: 1;
}

.menu-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.menu-title {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--menu-muted);
}

.menu-close {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(30, 41, 59, 0.9);
}

.menu-close:hover {
  background: rgba(15, 23, 42, 0.04);
}

.menu-items {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: rgba(30, 41, 59, 0.9);
}

.menu-item i {
  width: 22px;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  color: rgba(51, 65, 85, 0.8);
}

.menu-item span {
  font-weight: 700;
  font-size: 14px;
}

.menu-item:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.12);
}

@media (min-width: 861px) {
  .menu-panel {
    width: 320px;
    border-radius: 18px;
    position: fixed;
    top: calc(var(--topbar-h) + 14px);
    left: calc(var(--sidebar-w) + 14px);
    max-height: calc(100dvh - var(--topbar-h) - 28px);
  }
}

@media (max-width: 860px) {
  .menu-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .menu-header {
    height: var(--topbar-h);
    padding: 0 14px 0 16px;
  }

  .menu-items {
    padding: 14px;
    gap: 10px;
  }

  .menu-item {
    padding: 14px 14px;
    border-radius: 16px;
  }
}
