:root {
  --sidebar-flyout-bg: #f2f2f2;
  --sidebar-flyout-seam: rgba(0, 0, 0, 0.12);
  --sidebar-flyout-width: 250px;
  --sidebar-flyout-width-sm: 210px;
  --sidebar-flyout-title-size: 15px;
  --sidebar-flyout-item-size: 12px;
  --sidebar-flyout-section-size: 11px;
  --main-sidebar-z: 1060;
  --sidebar-flyout-backdrop-z: 1025;
  --sidebar-flyout-z: 1030;
}

.main-sidebar {
  z-index: var(--main-sidebar-z);
}

.sidebar-mini.sidebar-collapse .main-sidebar {
  z-index: var(--main-sidebar-z) !important;
}

.sidebar-flyout-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-flyout-left, var(--main-sidebar-width, 230px));
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: var(--sidebar-flyout-backdrop-z);
}

.sidebar-flyout-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-flyout {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--sidebar-flyout-left, var(--main-sidebar-width, 230px));
  width: var(--sidebar-flyout-width);
  max-width: calc(100vw - var(--sidebar-flyout-left, var(--main-sidebar-width, 230px)));
  box-sizing: border-box;
  background: var(--sidebar-flyout-bg);
  border-left: 1px solid var(--sidebar-flyout-seam);
  box-shadow: 10px 0 22px rgba(0, 0, 0, 0.28);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  transform-origin: left center;
  transform: translateX(-12px) scaleX(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.25, 0.8, 0.25, 1), opacity 220ms ease, visibility 220ms ease;
  z-index: var(--sidebar-flyout-z);
  display: flex;
  flex-direction: column;
}

.sidebar-flyout.is-open {
  transform: translateX(0) scaleX(1);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.sidebar-flyout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #dedede;
}

.sidebar-flyout__title {
  font-size: var(--sidebar-flyout-title-size);
  font-weight: 600;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-flyout__close {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-size: 22px;
  line-height: 1;
  color: #777;
  cursor: pointer;
}

.sidebar-flyout__close:hover,
.sidebar-flyout__close:focus {
  color: #333;
}

.sidebar-flyout__content {
  overflow: auto;
  padding: 6px 0;
  transition: opacity 200ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(95, 100, 132, 0.42) transparent;
}
.sidebar-flyout__content.is-hidden {
  opacity: 0;
}

.sidebar-flyout__content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar-flyout__content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-flyout__content::-webkit-scrollbar-thumb {
  background: rgba(95, 100, 132, 0.34);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.sidebar-flyout__content::-webkit-scrollbar-thumb:hover {
  background: rgba(95, 100, 132, 0.56);
  background-clip: content-box;
}

.sidebar-flyout__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block !important;
}

.sidebar-flyout__menu li {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}
.sidebar-flyout.is-open .sidebar-flyout__menu li {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-flyout__menu > li > a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  color: #5b2c83;
  transition:
    background 220ms ease,
    color 220ms ease,
    padding 220ms ease;
}

.sidebar-flyout__menu > li > a:hover,
.sidebar-flyout__menu > li.active > a {
  background: rgba(91, 44, 131, 0.08);
  padding-left: 24px;
  color: #3a1e60;
}

.sidebar-flyout__menu > li > a > i {
  margin-right: 0;
  margin-top: 2px;
  color: #777;
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  opacity: 1 !important;
  transform: none !important;
  transition: color 220ms ease;
  font-size: 14px;
  display: inline-block !important;
  visibility: visible !important;
}
.sidebar-flyout.is-open .sidebar-flyout__menu > li > a > i {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-flyout__menu > li > a > i.sidebar-flyout-icon {
  opacity: 1 !important;
  visibility: visible !important;
}

.sidebar-flyout__menu > li > a:hover > i {
  color: #4a2e70;
  transform: translateX(-2px);
}

.sidebar-flyout__menu > li > a > span {
  font-size: var(--sidebar-flyout-item-size);
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.3;
  word-break: break-word;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}
.sidebar-flyout.is-open .sidebar-flyout__menu > li > a > span {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-flyout__menu > li.header {
  padding: 18px 18px 8px;
  color: #5f6484;
  font-weight: 800;
  font-size: var(--sidebar-flyout-section-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-flyout__menu > li.header:first-child {
  padding-top: 12px;
}

.sidebar-flyout__menu > li.divider {
  height: 1px;
  margin: 8px 18px 0;
  background: rgba(91, 44, 131, 0.12);
}

.main-sidebar .treeview-menu > li.header {
  padding: 14px 15px 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-sidebar .treeview-menu > li.divider {
  height: 1px;
  margin: 8px 15px 0;
  background: rgba(255, 255, 255, 0.12);
}

.main-sidebar .sidebar-menu > li.is-flyout-open > a {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
}

.main-sidebar .sidebar-menu > li.is-flyout-open > a::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  background: var(--sidebar-flyout-bg);
}

@media (max-width: 768px) {
  .sidebar-flyout {
    width: var(--sidebar-flyout-width-sm);
  }
}

.fixed .main-sidebar {
  top: 0;
  bottom: 0;
  min-height: 0;
}

.main-sidebar .sidebar-nav-scroll,
.fixed .main-sidebar .sidebar-nav-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) rgba(255, 255, 255, 0.04);
}

.main-sidebar .sidebar-nav-scroll::-webkit-scrollbar,
.fixed .main-sidebar .sidebar-nav-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-track,
.fixed .main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  transition: background 180ms ease;
}

.main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-thumb,
.fixed .main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: content-box;
  min-height: 18px;
  transition: background 180ms ease, opacity 180ms ease;
}

.main-sidebar .sidebar-nav-scroll:hover,
.fixed .main-sidebar .sidebar-nav-scroll:hover {
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.08);
}

.main-sidebar .sidebar-nav-scroll:hover::-webkit-scrollbar-track,
.fixed .main-sidebar .sidebar-nav-scroll:hover::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

.main-sidebar .sidebar-nav-scroll:hover::-webkit-scrollbar-thumb,
.fixed .main-sidebar .sidebar-nav-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  background-clip: content-box;
}

.main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-thumb:hover,
.fixed .main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
  background-clip: content-box;
}

.main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-thumb:active,
.fixed .main-sidebar .sidebar-nav-scroll::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.46);
  background-clip: content-box;
}

.main-sidebar .slimScrollDiv {
  height: calc(100vh - 48px) !important;
}

.main-sidebar .slimScrollDiv > .sidebar {
  height: calc(100vh - 48px) !important;
}

.main-sidebar .slimScrollRail {
  width: 7px !important;
  right: 1px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  opacity: 1 !important;
  transition: background 180ms ease !important;
}

.main-sidebar .slimScrollBar {
  width: 7px !important;
  right: 1px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid transparent !important;
  background-clip: padding-box !important;
  opacity: 0.72 !important;
  box-shadow: none !important;
  transition: background 180ms ease, opacity 180ms ease !important;
}

.main-sidebar:hover .slimScrollRail,
.main-sidebar .slimScrollDiv:hover .slimScrollRail {
  background: rgba(255, 255, 255, 0.12) !important;
}

.main-sidebar:hover .slimScrollBar {
  background: rgba(255, 255, 255, 0.32) !important;
  opacity: 1 !important;
}

@media (max-width: 767px) {
  .sidebar-flyout-backdrop {
    top: 0;
  }

  .sidebar-flyout {
    top: 0;
  }

  .fixed .main-sidebar .sidebar-nav-scroll {
    height: 100%;
  }
}
