.sidebar, .sidebar[data-background-color="white"] {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 265px;
  display: block;
  z-index: 1002;
  color: $white-color;
  font-weight: 200;
  background: $white-color;
  -webkit-box-shadow: 4px 4px 10px rgba(69, 65, 78, 0.06);
  -moz-box-shadow: 4px 4px 10px rgba(69, 65, 78, 0.06);
  box-shadow: 4px 4px 10px rgba(69, 65, 78, 0.06);
  transition: all .3s;
  .user {
    padding-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 15px;
    border-top: 1px solid $grey-color;
    border-bottom: 1px solid $grey-color;
    display: block;
    margin-left: 15px;
    margin-right: 15px;
    .info {
      a {
        white-space: nowrap;
        display: block;
        position: relative;
        &:hover, &:focus {
          text-decoration: none;
        }
        > span {
          font-size: 1rem;
          font-weight: $font-weight-normal;
          color: #777;
          display: flex;
          flex-direction: column;
          .user-level {
            color: #555;
            font-weight: $font-weight-bold;
            font-size: 12px;
            margin-top: 5px;
          }
        }
        .link-collapse {
          padding: 7px 0;
        }
      }
      .caret {
        position: absolute;
        top: 17px;
        right: 0px;
        border-top-color: #777;
      }
    }
  }
  .sidebar-wrapper {
    position: relative;
    max-height: calc(100vh - 75px);
    min-height: 100%;
    overflow: auto;
    width: 100%;
    z-index: 4;
    transition: all .3s;
    .sidebar-content{
      padding-top: 0px;
      padding-bottom: 100px;
    }
    .scroll-element.scroll-y{
      top: 5px !important;
    }
  }
  .nav {
    display: block;
    float: none;
    margin-top: 20px;
    .nav-section{
      margin: 15px 0 0 0;
      .sidebar-mini-icon{
        text-align: center;
        font-size: 15px;
        color: rgb(144, 144, 147);
        display: none;
      }
      .text-section{
        padding: 2px 30px;
        font-size: 12px;
        color: #727275;
        font-weight: $font-weight-bold;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 12px;
        margin-top: 20px;
      }
    }
    > .nav-item {
      display: list-item;
      &.active {
        > a {
          background: rgba(0, 0, 0, 0.03);
          color: $body-text-color !important;
          &:before {
            background: #1d7af3;
            @extend %nav-item-hover-before;
          }
          p {
            color: $body-text-color !important;
            font-weight: $font-weight-bold;
          }
        }
        &:hover > a:before {
          background: #1d7af3;
          @extend %nav-item-hover-before;
        }
        a i {
          color: #4d7cfe;
        }
      }
      &.submenu{
        background: rgba(0, 0, 0, 0.03);
        > li {
          > a {
            i {
              color: rgba(23, 125, 255, 0.76);
            }
          }
        }
      }
      > a:hover, a:focus {
        // background: rgba(0, 0, 0, 0.16);
      }
      a {
        display: flex;
        align-items: center;
        color: #575962;
        padding: 6px 25px;
        width: 100%;
        font-size: 1rem;
        font-weight: $font-weight-normal;
        position: relative;
        margin-bottom: 3px;
        text-decoration: none !important;
        &:hover, &:focus {
          text-decoration: none;
          p {
            color: #575962 !important;
            font-weight: $font-weight-bold;
          }
          i {
            color: #4d7cfe !important;
          }
        }
      }
      a {
        .letter-icon{
          color: #a1a2a6;
          margin-right: 15px;
          width: 25px;
          text-align: center;
          vertical-align: middle;
          float: left;
          font-size: 20px;
          font-weight: 200;
        }
        i {
          color: #8d9498;
          margin-right: 15px;
          width: 25px;
          text-align: center;
          vertical-align: middle;
          float: left;
          font-size: 16px;
          line-height: 30px;
          &[class^="flaticon-"]{
            font-size: 20px;
          }
        }
        p {
          font-size: 1rem;
          margin-bottom: 0px;
          margin-right: 5px;
          white-space: nowrap;
          font-weight: $font-weight-bold;
        }
        .caret{
          margin-left: auto;
          margin-right: 6px;
          transition: all .5s;
          color: #8d9498;
        }
      }
      a[data-toggle=collapse][aria-expanded=true]{
        background: transparent;
        p {
          color: #575962;
        }
        i {
          color: #4d7cfe;
        }
        .caret {
          filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
          -webkit-transform: rotate(-180deg);
          transform: rotate(-180deg);
        }
        &:before {
          background: #1d7af3;
          @extend %nav-item-hover-before;
        }
      }
    }
    @mixin nav-sidebar-state($color) {
      > .nav-item {
        a:hover, a:focus, a[data-toggle=collapse][aria-expanded=true]  {
          i {
            color: $color !important;
          }
        }
        a[data-toggle=collapse][aria-expanded=true] {
          &:before {
            background: $color !important;
          }
        }
        &.active {
          a {
            &:before {
              background: $color !important;
            }
            i {
              color: $color !important;
            }
          }
        }
        .nav-collapse li.active > a {
          color: $color !important;
        }
      }
    }
    &.nav-primary {
      @include nav-sidebar-state($primary-color);
    }
    &.nav-secondary {
      @include nav-sidebar-state($secondary-color);
    }
    &.nav-info {
      @include nav-sidebar-state($info-color);
    }
    &.nav-success {
      @include nav-sidebar-state($success-color);
    }
    &.nav-warning {
      @include nav-sidebar-state($warning-color);
    }
    &.nav-danger {
      @include nav-sidebar-state($danger-color);
    }
  }
  %nav-item-hover-before {
    opacity: 1 !important;
    position: absolute;
    z-index: 1;
    width: 2px;
    height: 100%;
    content: '';
    left: 0;
    top: 0;
  }
  .nav-collapse{
    margin-top: 0px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    padding-top: 10px;
    li {
      &.active {
        > a {
          font-weight: 600;
        }
      }
      a:before, a:hover:before{
        opacity: 0 !important;
      }
      a {
        margin-bottom: 3px !important;
        padding: 10px 25px !important;
        .sub-item{
          font-size: 1rem;
          position: relative;
          margin-left: 25px;
          opacity: .85;
          &:before{
            content: '';
            height: 4px;
            width: 4px;
            background: rgba(131, 132, 138, 0.89);
            position: absolute;
            left: -15px;
            top: 50%;
            transform: translateY(-50%);
            border-radius: 100%;
          }
        }
        &:hover {
          .sub-item {
            opacity: 1;
          }
        }
        .sidebar-mini-icon {
          font-size: 16px;
          color: #C3C5CA;
          margin-right: 15px;
          width: 25px;
          text-align: center;
          vertical-align: middle;
          float: left;
          font-weight: $font-weight-light !important;
        }
      }
    }
    &.subnav {
      padding-bottom: 10px;
      margin-bottom: 0px;
      li {
        a {
          padding-left: 40px !important;
        }
      }
    }
  }
  .profile-section {
    .border-right, .border-left, .border-top, .border-bottom {
      border-color: rgba(255,255,255,.3) !important;
    }
  }
  .user-profile {
    .user-name {
      font-size: 16px;
    }
    .user-level {
      font-size: 13px;
    }
  }
  .menubar {
    color: #fff;
    line-height: 80px;
    font-size: 18px;
    opacity: .9;
  }
}

.sidebar {
  &[data-background-color="dark"], &[data-background-color="dark2"] {
    .nav {
      .nav-item {
        > a:hover, > a:focus, &.submenu  {
          background: rgba(0, 0, 0, 0.16);
        }
        &.submenu {
          > a {
            background: transparent !important;
          }
        }
        &.active {
          > a {
            background: rgba(0, 0, 0, 0.16);
          }
        }
      }
    }
  }
}

.logo-header {
  float: left;
  width: 265px;
  height: 70px;
  line-height: 60px;
  color: #333333;
  z-index: 1001;
  font-size: 17px;
  font-weight: $font-weight-normal;
  padding-left: 25px;
  padding-right: 25px;
  z-index: 1001;
  display: flex;
  align-items: center;
  position: relative;
  transition: all .3s;
  .big-logo {
    margin-right: 8px;
    &:hover {
      text-decoration: none;
    }
    .logo-img{
      width: 35px;
      height: 35px;
    }
  }
  .logo {
    color: $body-text-color;
    opacity: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    &:hover {
      text-decoration: none;
    }
    .navbar-brand{
      padding-top: 0px;
      padding-bottom: 0px;
      margin-right: 0px;
    }
  }
  .nav-toggle{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: absolute;
    top: 0;
    right: 18px;
    z-index: 5;
  }
  .navbar-toggler {
    padding-left: 0px;
    padding-right: 0px;
    opacity: 0;
    display: none;
    .navbar-toggler-icon {
      height: unset;
      width: unset;
      display: block;
      color: #545454;
      font-size: 22px;
    }
  }
  .more {
    background: $transparent-bg;
    border: 0;
    font-size: 22px;
    padding: 0;
    opacity: 0;
    width: 0;
    display: none;
  }
}

.btn-toggle{
  font-size: 20px !important;
  line-height: 20px;
  padding: 0px !important;
  background: transparent !important;
  color: $body-text-color !important;
  &:hover, &:focus {
    opacity: 1;
  }
}

/* Sidebar style 2 */
.sidebar {
  &.sidebar-style-2 {
    .nav {
      .nav-item {
        padding: 0 15px;
        a {
          padding: 8px 10px;
          border-radius: 10px;
        }
        a:hover, a:focus, a[data-toggle=collapse][aria-expanded=true]  {
          background: hsla(0,0%,78%,.2);
          p, i {
            color: #575962 !important;
          }
        }
        &.active {
          a:before {
            background: transparent;
          }
        }
        .active {
          a {
            background: hsla(0,0%,78%,.2);
            p, i {
              color: #575962 !important;
            }
          }
        }
        &.submenu {
          background: transparent !important;
        }
        a[data-toggle=collapse][aria-expanded=true] {
          &:before {
            background: transparent !important;
          }
        }
      }
      @mixin nav-sidebar-state2($color) {
        > .nav-item {
          &.active {
            > a {
              background: $color !important;
              box-shadow: 4px 4px 10px 0 rgba(0, 0, 0, 0.1), 4px 4px 15px -5px  rgba($color, .4);
              &:before {
                background: transparent !important;
              }
              p, i, .caret, span {
                color: $white-color !important;
              }
              &[data-toggle=collapse][aria-expanded=true] { 
                i {
                  color: $white-color !important;
                }
              }
            }
          }
        }
      }
      &.nav-primary {
        @include nav-sidebar-state2($primary-color);
      }
      &.nav-secondary {
        @include nav-sidebar-state2($secondary-color);
      }
      &.nav-info {
        @include nav-sidebar-state2($info-color);
      }
      &.nav-success {
        @include nav-sidebar-state2($success-color);
      }
      &.nav-warning {
        @include nav-sidebar-state2($warning-color);
      }
      &.nav-danger {
        @include nav-sidebar-state2($danger-color);
      }
    }
    &[data-background-color="dark"], &[data-background-color="dark2"] {
      .nav {
        .nav-item {
          a:hover, a:focus, a[data-toggle=collapse][aria-expanded=true]  {
            p, i {
              color: #b9babf !important;
            }
          }
          &.active {
            a {
              color: $white-color ;
              p, i, .caret, span {
                color: $white-color;
              }
              &[data-toggle=collapse][aria-expanded=true] { 
                p, i, .caret, span {
                  color: $white-color;
                }
              }
            }
          }
        }
      }
    }
  }
}

/*    sidebar minimized   */
@media screen and (min-width: 992px) {
  .sidebar_minimize{
    .main-panel, .main-header {
      width: calc(100% - 75px);
      transition: all .3s;
    }
    .logo-header {
      width: 75px;
      transition: all .3s;
      padding: 0px;
      text-align: center;
      .big-logo {
        margin-right: 0px;
      }
      .logo {
        position: absolute;
        transform: translate3d(25px,0,0);
        opacity: 0;
        img {
          display: none;
        }
      }
    }
    .logo-header {
      .nav-toggle {
        position: absolute;
        left: 50% !important;
        transform: translateX(-50%);
        height: 100%;
        right: 0 !important;
      }
    }
    .sidebar{
      width: 75px;
      transition: all .3s;
      .sidebar-wrapper{
        width: 75px;
        transition: all .3s;
        .user {
          padding-left: 0px;
          padding-right: 0px;
          [class^="avatar-"] {
            float: none !important;
          }
          .info{
            display: none;
            span {
              display: none;
            }
          }
        }
        .nav-item {
          position : relative;
          a {
            .letter-icon {
              display: block !important;
            }
            i {
              margin-right: unset;
            }
            .badge, span, .caret, p {
              display: none;
              transition: all .3s;
            }
            .sidebar-mini-icon{
              display: block !important;
              margin-right: 0px;
            }
          }
          &.submenu, &.active{
            .nav-collapse {
              display: none;
            }
          }
        }
        .nav-section{
          .text-section{
            display: none;
          }
          .sidebar-mini-icon{
            display: block;
          }
        }
      }
      .user-profile {
        .user-name, .user-level {
          display: none
        }
        .avatar {
          display: none;
          &.avatar-minimize {
            display: block !important;
          }
        }
      }
      .menubars {
        display: none;
      }
    }
    &.sidebar_minimize_hover {
      // .logo-header{
      //   width: 250px;
      //   padding-left: 25px;
      //   padding-right: 25px;
      //   text-align: left;
      //   .logo {
      //     opacity: 1 !important;
      //     transform: translate3d(0, 0, 0) !important;
      //     position: relative !important;
      //     img {
      //       display: inline-block !important;
      //     }
      //   }
      // }
      .main-panel, .main-header {
        // width: 100% !important;
      }
      .sidebar{
        width: 265px;
        position: fixed;
        height: 100vh;
        top: 0;
        .logo-header{
          width: 265px;
          padding-left: 25px;
          padding-right: 25px;
          text-align: left;
          .logo {
            opacity: 1 !important;
            transform: translate3d(0, 0, 0) !important;
            position: relative !important;
            img {
              display: inline-block !important;
            }
          }
          .nav-toggle {
            right: 18px !important;
            transform: translateX(0%) !important;
            left: unset !important;
          }
        }
        .sidebar-wrapper{
          width: 265px;
          .user {
            padding-left: 15px;
            padding-right: 15px;
            [class^="avatar-"] {
              float: left !important;
            }
            .info{
              display: block;
              span {
                display: flex;
              }
            }
          }
          .nav-item {
            a {
              i {
                margin-right: 15px;
              }
              .badge, span, .caret, p {
                display: block;
              }
              .sidebar-mini-icon{
                display: block !important;
                margin-right: 15px;
              }
            }
            &.submenu, &.active{
              .nav-collapse {
                display: block;
              }
            }
          }
          .nav-section{
            .sidebar-mini-icon {
              display: none;
            }
            .text-section{
              display: block;
            }
          }
        }
        .user-profile {
          .user-name, .user-level {
            display: block
          }
          .avatar {
            display: block;
            &.avatar-minimize {
              display: none !important;
            }
          }
        }
        .menubars {
          display: flex;
        }
      }
    }
  }
  .sidebar_minimize_hover {
    // .logo-header {
    //   .nav-toggle {
    //     right: 18px !important;
    //     transform: translateX(0%) !important;
    //     left: unset !important;
    //   }
    // }
  }
}