/* Sidebar */

.sidebar {
  min-height: calc(100vh - #{$navbar-height});
  background: $sidebar-light-bg;
  font-family: $type-2;
  padding: 0;
  width: $sidebar-width-lg;
  z-index: 11;
  -webkit-transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
  -moz-transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
  -ms-transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
  transition: width $action-transition-duration $action-transition-timing-function, background $action-transition-duration $action-transition-timing-function;
  .nav {
    overflow: hidden;
    flex-wrap: nowrap;
    flex-direction: column;
    .nav-item {
      .collapse {
        z-index: 999;
      }
      .collapse.show,
      .collapsing {
        background: $sidebar-light-menu-active-bg;
      }
      .nav-link {
        align-items: center;
        display: flex;
        padding: $sidebar-menu-padding;
        white-space: nowrap;
        height: $nav-link-height;
        color: $sidebar-light-menu-color;
        i {
          &.menu-arrow {
            margin-left: auto;
            margin-right: 0;
            @include transition-duration(0.2s);
            @include transition-property(transform);
            @include transition-timing-function(ease-in);
            &:before {
              content: "\F142";
              font-family: "Material Design Icons";
              font-size: 18px;
              line-height: 1;
              font-style: normal;
              vertical-align: middle;
              color: rgba($sidebar-light-menu-color, 0.5);
            }
          }
        }
        &[aria-expanded="true"] {
          background: $sidebar-light-menu-active-bg;
          i {
            &.menu-arrow {
              @include transform(rotate(90deg));
            }
          }
        }
        .menu-icon {
          margin-right: 1.25rem;
          width: $sidebar-icon-size;
          line-height: 1;
          font-size: 18px;
          color: lighten($sidebar-light-menu-icon-color, 30%);
          .rtl & {
            margin-right: 0;
            margin-left: 1.25rem;
          }
        }
        .menu-title {
          color: inherit;
          display: inline-block;
          font-size: $sidebar-menu-font-size;
          line-height: 1;
          vertical-align: middle;
        }
        .badge {
          margin-left: auto;
        }
        &:hover {
          color: darken($sidebar-light-menu-color, 5%);
        }
      }
      &.active {
        >.nav-link {
          color: $sidebar-light-menu-active-color;
          .menu-title,
          i {
            color: inherit;
          }
        }
      }
      &.nav-profile {
        .nav-link {
          @include display-flex;
          @include flex-direction(column);
          height: auto;
          .user-wrapper {
            @include display-flex;
            margin-bottom: 30px;
            .profile-image {
              width: 40px;
              height: 40px;
              img {
                @include border-radius(100%);
                max-width: 100%;
              }
            }
            .text-wrapper {
              margin-left: 15px;
              .rtl & {
                margin-left: 0;
                margin-right: 15px;
              }
              .profile-name {
                font-weight: 500;
                margin-bottom: 8px;
              }
              .designation {
                margin-right: 3px;
              }
            }
          }
        }
      }
    }
    &:not(.sub-menu) {
      >.nav-item {
        &:hover {
          &:not(.nav-profile) {
            >.nav-link {
              background: $sidebar-light-menu-hover-bg;
              color: $sidebar-light-menu-hover-color;
            }
          }
        }
      }
    }
    &.sub-menu {
      margin-bottom: 0;
      padding: $sidebar-submenu-padding;
      .nav-item {
        .nav-link {
          color: $sidebar-light-submenu-color;
          padding: $sidebar-submenu-item-padding;
          font-size: $sidebar-submenu-font-size;
          line-height: 1;
          height: auto;
          &.active {
            color: $sidebar-light-menu-active-color;
            background: transparent;
            &:before {
              background: $sidebar-light-menu-active-color;
            }
          }
        }
        &:hover {
          >.nav-link {
            background: $sidebar-light-submenu-hover-bg;
            color: $sidebar-light-submenu-hover-color;
            &:before {
              background: $sidebar-light-submenu-hover-color;
            }
          }
        }
      }
    }
  }
}

//sidebar color variation
.sidebar-dark {
  .sidebar {
    background: $sidebar-dark-bg;
    .nav {
      .nav-item {
        .collapse.show,
        .collapsing {
          background: $sidebar-dark-menu-active-bg;
        }
        .nav-link {
          color: $sidebar-dark-menu-color;
          &[aria-expanded="true"] {
            background: $sidebar-dark-menu-active-bg;
          }
          i {
            color: $sidebar-dark-menu-icon-color;
            &.menu-arrow {
              &:before {
                color: rgba($sidebar-dark-menu-color, 0.5);
              }
            }
          }
          &:hover {
            color: darken($sidebar-dark-menu-color, 5%);
          }
        }
        &.nav-profile {
          .profile-name {
            .name {
              color: $sidebar-dark-profile-name-color;
            }
            .designation {
              color: $sidebar-dark-profile-title-color;
            }
          }
          .notification-panel {
            &:before {
              background: $sidebar-dark-profile-name-color;
            }
            >span {
              background: $sidebar-dark-menu-active-bg;
              i {
                color: $sidebar-dark-menu-active-color;
              }
            }
          }
        }
        &.active {
          >.nav-link {
            color: $sidebar-dark-menu-active-color;
          }
        }
        .sidebar-sticker {
          background: $sidebar-dark-menu-active-bg;
        }
      }
      &:not(.sub-menu) {
        >.nav-item {
          &:hover {
            &:not(.nav-profile) {
              >.nav-link {
                background: $sidebar-dark-menu-hover-bg;
                color: $sidebar-dark-menu-hover-color;
              }
            }
          }
        }
      }
      &.sub-menu {
        .nav-item {
          .nav-link {
            color: $sidebar-dark-submenu-color;
            &.active {
              color: $sidebar-dark-menu-active-color;
              &:before {
                background: $sidebar-dark-menu-active-color;
              }
            }
          }
          &:hover {
            >.nav-link {
              background: $sidebar-dark-submenu-hover-bg;
              color: $sidebar-dark-submenu-hover-color;
              &:before {
                background: $sidebar-dark-submenu-hover-color;
              }
            }
          }
        }
      }
    }
  }
}

/* style for off-canvas menu*/

@media screen and (min-width: 992px) {
  .sidebar-offcanvas {
    position: fixed;
    left: 0;
    top: $navbar-height;
    bottom: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 1020;
  }

  .sidebar.sidebar-modern.sidebar-offcanvas + .main-panel {
    margin-left: 272px;
    width: calc(100% - 272px);
  }
}

@media screen and (max-width: 991px) {
  .sidebar-offcanvas {
    position: fixed;
    max-height: calc(100vh - #{$navbar-height});
    top: $navbar-height;
    bottom: 0;
    overflow: auto;
    right: -$sidebar-width-lg;
    -webkit-transition: all 0.25s ease-out;
    -o-transition: all 0.25s ease-out;
    transition: all 0.25s ease-out;
    &.active {
      right: 0;
    }
  }
}

/* Modern sidebar theme for main application layout */
.sidebar.sidebar-modern {
  border-right: 1px solid #dcdde3;
  background: #dcdde3;
  width: 272px;

  .nav {
    padding: 16px 12px 24px;

    .nav-item {
      margin-bottom: 6px;

      &.nav-profile {
        margin-bottom: 16px;

        .nav-link {
          padding: 12px 10px 14px;
          border-radius: 14px;

          .user-wrapper {
            margin-bottom: 12px;

            .text-wrapper {
              margin-left: 0;

              .profile-name {
                color: #080B12;
                font-size: 21px;
                font-weight: 700;
                letter-spacing: -0.02em;
                margin-bottom: 0;
              }
            }
          }

        }

        .btn.btn-success {
          width: 100%;
          border-radius: 12px;
          border: 1px solid #93406CE3;
          background: #93406CE3;
          color: #ffffff;
          font-weight: 600;
          padding: 10px 14px;
          min-height: 42px;

          &:hover,
          &:focus {
            border-color: #B9C2D0;
            box-shadow: none;
          }
        }
      }

      .nav-link {
        min-height: 44px;
        height: auto;
        border: 1px solid transparent;
        border-radius: 12px;
        padding: 9px 12px;
        color: #737791;
        gap: 12px;
        justify-content: flex-start;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        position: relative;
        z-index: 1;

        .menu-title {
          color: #737791;
          font-weight: 500;
          font-size: 0.75rem;
          line-height: 1.25;
          order: 2;
          flex: 1;
          margin: 0;
        }

        .svg-inline--fa,
        .menu-icon {
          order: 1;
          width: 16px;
          min-width: 16px;
          height: 16px;
          color: #737791;
          margin: 0;
        }

        i.menu-arrow {
          margin-left: auto;
          order: 3;
          font-size: 14px;

          &:before {
            color: #737791;
            font-size: 18px;
          }
        }

        &:hover,
        &:focus {
          border-color: transparent;
          color: #080B12;
          background: #ffffff;

          .menu-title,
          .svg-inline--fa,
          .menu-icon,
          i.menu-arrow:before {
            color: #080B12;
          }
        }
      }

      &.active > .nav-link,
      > .nav-link.active,
      > .nav-link[aria-expanded="true"] {
        background: #93406CE3;
        border-color: #93406CE3;
        color: #ffffff;

        .menu-title,
        .svg-inline--fa,
        .menu-icon,
        i.menu-arrow:before {
          color: #ffffff;
        }
      }

      .collapse.show,
      .collapsing {
        background: transparent;
      }

      > .collapse {
        position: relative;
        z-index: 2;
        pointer-events: auto;
      }
    }

    &:not(.sub-menu) > .nav-item:hover:not(.nav-profile) > .nav-link {
      border-color: transparent;
      color: #080B12;
      background: #ffffff;

      .menu-title,
      .svg-inline--fa,
      .menu-icon,
      i.menu-arrow:before {
        color: #080B12;
      }
    }

    &:not(.sub-menu) > .nav-item.active:hover:not(.nav-profile) > .nav-link,
    &:not(.sub-menu) > .nav-item:hover:not(.nav-profile) > .nav-link.active,
    &:not(.sub-menu) > .nav-item:hover:not(.nav-profile) > .nav-link[aria-expanded="true"] {
      background: #93406CE3;
      border-color: #93406CE3;
      color: #ffffff;

      .menu-title,
      .svg-inline--fa,
      .menu-icon,
      i.menu-arrow:before {
        color: #ffffff;
      }
    }

    &.sub-menu {
      padding: 6px 0 6px 18px;
      position: relative;
      z-index: 3;
      pointer-events: auto;

      .nav-item {
        margin-bottom: 4px;

        .nav-link {
          min-height: 34px;
          padding: 7px 10px;
          border-radius: 10px;
          font-size: 13px;
          line-height: 1.2;
          color: #737791;
          border: 1px solid transparent;

          &:hover,
          &:focus {
            border-color: transparent;
            color: #080B12;
            background: #ffffff;
          }

          &.active {
            background: #93406CE3;
            border-color: #93406CE3;
            color: #ffffff;
          }
        }
      }
    }
  }
}

@media screen and (max-width: 991px) {
  .sidebar.sidebar-modern {
    width: $sidebar-width-lg;
  }
}