@import url("./motion-system-v1.css");

/* Sidebar navigation parity: every entry uses the same clean visual language. */
.app-drawer {
  z-index: 500 !important;
  gap: 6px;
  padding-top: 10px;
  padding-bottom: 12px;
  transition:
    transform 120ms cubic-bezier(.2, 0, 0, 1),
    opacity 90ms ease-out !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.app-drawer-backdrop {
  z-index: 490 !important;
  transition: none !important;
  animation: none !important;
}

.portal-sidebar__header {
  min-height: 44px;
  margin-bottom: 0;
}

.app-navigation {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-navigation > li {
  margin: 0;
  padding: 0;
  border: 0 !important;
  list-style: none;
}

.app-navigation > a,
.app-navigation > button,
.app-navigation > li > a,
.app-navigation > li > button {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 0;
  margin: 0 !important;
  padding: 7px 12px !important;
  border: 0 !important;
  border-top: 0 !important;
  border-radius: 8px;
  background: transparent;
  color: #1f3c88 !important;
  font: 600 17px/1.3 Poppins, sans-serif;
  letter-spacing: .01em;
  text-align: left;
  text-decoration: none !important;
  text-transform: none;
  box-shadow: none !important;
  transition: background .16s ease, color .16s ease;
}

/* No bullets, dots or admin separators in the navigation. */
.app-navigation > a::before,
.app-navigation > button::before,
.app-navigation > li > a::before,
.app-navigation > li > button::before,
#activity-statistics-menu::before {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  flex: 0 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  content: none !important;
  box-shadow: none !important;
}

.app-navigation .app-navigation__admin-only,
.app-navigation [data-admin-only="true"] {
  margin-top: 0 !important;
  padding-top: 7px !important;
  border-top: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.app-navigation .app-navigation__admin-only::after,
.app-navigation [data-admin-only="true"]::after {
  display: none !important;
  content: none !important;
}

/* Fallback visivo: la voce viene anche rimossa dal DOM dallo script dedicato. */
#legacy-crm-menu {
  display: none !important;
}

.admin-restricted-key {
  position: relative;
  display: inline-grid;
  width: 20px;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: auto;
  color: #d92d20;
}

.admin-restricted-key svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-restricted-key::after {
  position: absolute;
  z-index: 40;
  right: -4px;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 230px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #1f2937;
  color: #fff;
  content: attr(data-tooltip);
  font: 600 11px/1.35 "Open Sans", sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}

.admin-restricted-key:hover::after,
.admin-restricted-key:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.strategies-tabs .admin-restricted-key {
  margin-left: 7px;
}

.app-navigation > a:hover,
.app-navigation > a:focus-visible,
.app-navigation > a[aria-current="page"],
.app-navigation > button:hover,
.app-navigation > button:focus-visible,
.app-navigation > button[aria-current="page"],
.app-navigation > li > a:hover,
.app-navigation > li > a:focus-visible,
.app-navigation > li > a[aria-current="page"],
.app-navigation > li > button:hover,
.app-navigation > li > button:focus-visible,
.app-navigation > li > button[aria-current="page"] {
  background: #eaf2ff !important;
  color: #1f3c88 !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .app-drawer {
    transition: none !important;
  }
}

@media (max-width: 680px) {
  .app-drawer {
    gap: 6px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .app-navigation > a,
  .app-navigation > button,
  .app-navigation > li > a,
  .app-navigation > li > button {
    min-height: 38px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
}
