/* Sidebar (smsapp/templates/sidebar.html). Loaded by base.html after each page's own CSS, so
   the menu looks the same on every page whether or not the page loads common-css.css.

   Highlight rules:
   - only the link of the current page (an active item without a submenu) gets the filled highlight;
   - groups that contain the current page are open and show their title in the accent colour;
   - every other link gets a light background on hover, including links inside an open group. */

.layout-menu.bg-menu-theme {
  --sb-accent: var(--primary-color, #696cff);
  --sb-active-bg: rgba(105, 108, 255, 0.16);
  --sb-hover-bg: #eef1f8;
  --sb-text: #566a7f;
  background-color: #fff !important;
}

.layout-menu .menu-link {
  margin: 0 10px !important;
  border-radius: 6px;
  color: var(--sb-text);
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.layout-menu .menu-item > .menu-link > div {
  font-size: var(--mini-header-font-size, 14px) !important;
}

/* Hover: any link that is not the current page. */
.layout-menu .menu-item:not(.active) > .menu-link:hover,
.layout-menu .menu-item.active > .menu-link.menu-toggle:hover {
  background-color: var(--sb-hover-bg) !important;
  color: var(--sb-accent);
}

/* Groups (WhatsApp, RCS, Reports, …) that contain the current page: no fill, accent title. */
.layout-menu .menu-item.active > .menu-link.menu-toggle,
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link.menu-toggle,
.bg-menu-theme .menu-inner .menu-sub > .menu-item.active > .menu-link.menu-toggle {
  background-color: transparent !important;
  color: var(--sb-accent);
  font-weight: var(--font-weight-medium, 500);
}

/* The current page. */
.layout-menu .menu-item.active > .menu-link:not(.menu-toggle),
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link:not(.menu-toggle) {
  background-color: var(--sb-active-bg) !important;
  color: var(--sb-accent) !important;
  font-weight: var(--font-weight-medium, 500);
}

.layout-menu .menu-item.active > .menu-link .menu-icon {
  color: var(--sb-accent);
}

/* Accent bar on the right edge only next to the top-level group of the current page. */
.layout-wrapper:not(.layout-horizontal) .bg-menu-theme .menu-inner > .menu-item.active:before {
  background: var(--sb-accent);
}

/* Submenu bullets are not used. */
.bg-menu-theme .menu-sub > .menu-item > .menu-link:before,
.bg-menu-theme .menu-sub > .menu-item.active > .menu-link:not(.menu-toggle):before {
  display: none !important;
}

.layout-menu .menu-header {
  margin: 0 !important;
}
