.page-with-sidebar {
  .sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
  }
}

.sidebar-wrapper {
  z-index: 99;
  background: $background-color;
}

.content-wrapper {
  width: 100%;
  padding: 15px;
  background: #FFF;
}

.nav-sidebar {
  margin: 0;
  list-style: none;

  &.navbar-collapse {
    padding: 0px !important;
  }
}

.nav-sidebar li a .count {
  float: right;
  background: #eee;
  padding: 0px 8px;
  @include border-radius(6px);
}

.nav-sidebar li {
}

.nav-sidebar li {
  &.separate-item {
    padding-top: 10px;
    margin-top: 10px;
  }

  a {
    color: $gray;
    display: block;
    text-decoration: none;
    padding: 8px 15px;
    font-size: 13px;
    line-height: 20px;
    padding-left: 16px;

    &:hover {
      text-decoration: none;
    }

    &:active, &:focus {
      text-decoration: none;
    }

    i {
      width: 20px;
      color: $gray-light;
      margin-right: 23px;
    }
  }
}

.sidebar-subnav {
  margin-left: 0px;
  padding-left: 0px;

  li {
    list-style: none;
  }
}

@mixin expanded-sidebar {
  padding-left: $sidebar_width;

  .sidebar-wrapper {
    width: $sidebar_width;

    .nav-sidebar {
      margin-top: 29px;
      position: fixed;
      top: $header-height;
      width: $sidebar_width;
    }
  }

  .content-wrapper {
    padding: 20px;
  }
}

@mixin folded-sidebar {
  padding-left: 50px;

  .sidebar-wrapper {
    width: $sidebar_collapsed_width;

    .nav-sidebar {
      margin-top: 29px;
      position: fixed;
      top: $header-height;
      width: $sidebar_collapsed_width;

      li a {
        padding-left: 18px;
        font-size: 14px;
        padding: 8px 15px;
        text-align: center;


        & > span {
          display: none;
        }
      }
    }

    .collapse-nav a {
      left: 0px;
      width: $sidebar_collapsed_width;
    }

    .sidebar-user {
      .username {
        display: none;
      }
    }
  }
}

.collapse-nav a {
  position: fixed;
  top: $header-height;
  left: 198px;
  font-size: 13px;
  background: transparent;
  width: 32px;
  height: 28px;
  text-align: center;
  line-height: 28px;
}

.collapse-nav a:hover {
  text-decoration: none;
  background: #f2f6f7;
}

@media (max-width: $screen-md-max) {
  .page-sidebar-collapsed {
    @include folded-sidebar;
  }

  .page-sidebar-expanded {
    @include folded-sidebar;
  }

  .collapse-nav {
    display: none;
  }
}

@media(min-width: $screen-md-max) {
  .page-sidebar-collapsed {
    @include folded-sidebar;
  }

  .page-sidebar-expanded {
    @include expanded-sidebar;
  }
}

.sidebar-user {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 10px;

  .username {
    margin-top: 5px;
  }
}
